]> git.saurik.com Git - bison.git/blame - ChangeLog
tests: calc: simplify location management.
[bison.git] / ChangeLog
CommitLineData
4f756f88
AD
12010-04-13 Akim Demaille <demaille@gostai.com>
2
3 tests: calc: simplify location management.
4 * tests/local.at (AT_LOC_PUSHDEF, AT_LOC_POPDEF): New.
5 (_AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Use them to
6 define the appropriate AT_LOC accessors.
7 * tests/calc.at: Use AT_LOC accessors.
8
24bb8c8c
AD
92010-04-13 Akim Demaille <demaille@gostai.com>
10
11 test location_type.
12 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS):
13 Define AT_LOCATION_TYPE_IF.
14 (_AT_BISON_OPTION_POPDEFS): Undefine AT_LOCATION_TYPE_IF.
15 * tests/calc.at (_AT_DATA_CALC_Y): When %define location_type is
16 used, provide a user location type and use it.
17 (Simple LALR1 C++ Calculator): Add a test case for location_type.
18
af129079
AD
192010-04-13 Akim Demaille <demaille@gostai.com>
20
21 tests: check fclose's return value.
22 * tests/calc.at (_AT_DATA_CALC_Y): Check fclose's return status.
23
36dc3637
AD
242010-04-13 Akim Demaille <demaille@gostai.com>
25
26 tests: don't depend on the actual location type.
27 * tests/calc.at: Use yy::parser::location_type rather than
28 yy::location, since the former is always right, and might point to
29 another type than the latter.
30
c499231d
AD
312010-04-13 Akim Demaille <demaille@gostai.com>
32
33 formatting changes.
34 * tests/calc.at: Formatting changes.
35
7799ef15
AD
362010-04-13 Akim Demaille <demaille@gostai.com>
37
38 lalr1.cc: remove useless forward declaration.
39 * data/lalr1.cc: Include location.hh before stack.hh.
40 Remove the useless forward declarations of position and location.
41 Reported by Chris Morley.
42 * data/glr.cc: Likewise.
43
06cb07d5
JD
442010-04-11 Joel E. Denny <joeldenny@joeldenny.org>
45
46 * NEWS (2.4.3): Mention fix for Sun Studio C++.
47
4586c8cd
JD
482010-04-10 Joel E. Denny <joeldenny@joeldenny.org>
49
50 tests: fix for newer Sun Studio C++.
51 Reported by Dagobert Michelsen at
52 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00023.html>.
53 * THANKS (Dagobert Michelsen): Add.
54 * configure.ac (AC_PREREQ): Set to 2.64 so we get the latest
55 Autoconf macro for handling the restrict keyword.
56 * gnulib: Update to latest, which no longer overrides that macro
57 from Autoconf.
58
44c2b42d
JD
592010-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
60
61 portability: fix pointer arithmetic to conform to C standard.
62 Reported by Tys Lefering at
63 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00035.html>.
64 This fix is already implemented in glr.c and does not apply to
65 lalr1.java.
66 * data/lalr1.cc (yy::parser::parse): Increase size of
67 yyerror_range and adjust subscripting so you don't have to
68 subtract one from the beginning of the array.
69 * data/yacc.c (b4_declare_parser_state_variables,
70 yyparse, yypush_parse): Likewise.
71
218287f5
AD
722010-04-05 Akim Demaille <demaille@gostai.com>
73
74 remove useless include.
75 * src/graphviz.h: Don't include stdbool.h.
76
8176ab33
AD
772010-04-05 Akim Demaille <demaille@gostai.com>
78
79 graph: sign the output file.
80 * src/graphviz.c (start_graph): Issue comments about Bison.
81 Suggested by Tys Lefering.
82
4ad3921d
JD
832010-03-31 Joel E. Denny <jdenny@ces.clemson.edu>
84
85 portability: fix test suite for GCC 4.5's new #error message.
86 Reported by Tys Lefering at
87 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00030.html>.
88 * NEWS (2.4.3): Mention.
89 * tests/synclines.at (AT_TEST_SYNCLINE): Implement.
90
10a697de
AD
912010-03-30 Akim Demaille <demaille@gostai.com>
92
93 fix comments.
94 * src/graphviz.h: Add missing license notice.
95 Document.
96
d6b347e4
AD
972010-03-25 Akim Demaille <demaille@gostai.com>
98
99 tests: fix 250: parse.error=verbose overflow.
100 * tests/regression.at (parse.error=verbose overflow): Avoid the
101 double inclusion of stdlib.h as it triggers hard errors.
102
b8675840
JD
1032010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
104
105 portability: fix for BSD make.
106 Reported by Johan van Selst at
107 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00016.html>.
108 * tests/local.mk ($(TESTSUITE)): Qualify package.m4 in
109 this dependency list as in package.m4's target rule.
110
8b9e021f
JD
1112010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
112
113 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
114 Reported by Johan van Selst at
115 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
116 * NEWS (2.4.3): New.
117 * THANKS (Johan van Selst): Add.
118 * etc/prefix-gnulib-mk (prefix): Adjust regex for makefile
119 targets so that gnulib's new c++defs.h is matched.
120 * gnulib: Update to latest.
121
96a381c5
JD
1222010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
123
124 maint: update for changes to gnulib's announce-gen.
125 * HACKING (Announce): RELEASE_TYPE=major must now be written
126 RELEASE_TYPE=stable.
127
e19a049c
JD
1282010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
129
130 Version 2.4.2.
131 * NEWS (2.4.2): Set version and date. For the recent test suite
132 portability fixes, don't be so optimistic about their success
133 given the lack of feedback on the affected platforms.
134
890aeb28
JD
1352010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
136
137 tests: fix maintainer-xml-check for recent changes.
138 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use
139 AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an
140 output file whose name conflicts with a previous output file
141 is now never generated.
142
f39ab286
JD
1432010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
144
145 portability: fix several issues with M4 subprocess.
146
147 M4's output pipe was not being drained upon fatal errors during
148 scan_skel. As a result, broken-pipe messages from M4 were seen
149 on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
150 failure in the test suite. The problem was that, on platforms
151 where the default disposition for SIGPIPE is ignore instead of
152 terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
153 then reported it. However, there's some sort of race condition,
154 because the new test group occasionally succeeded.
155 Reported by Albert Chin at
156 <http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.
157
158 There were also problems with the test suite livelocking on
159 Tru64 5.1b. Reported by Didier Godefroy at
160 <http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
161 Switching to create_pipe_bidi suggested by Akim Demaille.
162
163 To attempt to solve both of these problems, switch to gnulib's
164 create_pipe_bidi and register M4 process as a slave. Along the
165 way, clean up file name conflict handling, which was affected by
166 the broken-pipe problem before the switch.
167 * NEWS (2.4.2): Document.
168 * THANKS (Didier Godefroy): Add.
169 * bootstrap.conf (gnulib_modules): Add pipe.
170 * gnulib: Update to latest to make sure we have all the latest
171 fixes.
172 * lib/local.mk (lib_libbison_a_SOURCES): Remove subpipe.h and
173 subpipe.c.
174 * po/POTFILES.in (lib/subpipe.c): Remove.
175 * src/files.c (compute_output_file_names): Update invocations
176 of output_file_name_check.
177 (output_file_name_check): In the case that the grammar file
178 would be overwritten, use complain instead of fatal, but replace
179 the output file name with /dev/null. Use the /dev/null solution
180 for the case of two conflicting output files as well because it
181 seems safer in case Bison one day tries to open both files at
182 the same time.
183 * src/files.h (output_file_name_check): Update prototype.
184 * src/output.c (output_skeleton): Use create_pipe_bidi and
185 wait_subprocess. Assert that scan_skel completely drains the
186 pipe.
187 * src/scan-skel.l (at_directive_perform): Update
188 output_file_name_check invocation.
189 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
190 grammar file actually isn't overwritten.
191 (Conflicting output files: -o foo.y): Update expected output.
192 * tests/skeletons.at (Fatal errors but M4 continues producing
193 output): New test group.
194
e32050b0
JD
1952010-02-04 Joel E. Denny <jdenny@ces.clemson.edu>
196
197 Update POTFILES.
198 * HACKING (Release Procedure): Add reminder about keeping
199 POTFILES files up-to-date.
200 * po/POTFILES.in (src/muscle-tab.c, src/scan-skel.l): Add.
201
efc4ed4a
JD
2022010-02-01 Joel E. Denny <jdenny@clemson.edu>
203
204 Code cleanup.
205 * tests/atlocal.in (abs_top_srcdir): Remove shell variable,
206 which is already defined in atconfig.
207
95611b56
JD
2082010-01-22 Joel E. Denny <jdenny@clemson.edu>
209
210 tests: fix missing include caught by g++ 4.4.1.
211 Reported by Tys Lefering.
212 * HACKING (Release checks): Add note about trying a recent GCC.
213 * tests/regression.at (_AT_DATA_DANCER_Y): For C++, include
214 cstdlib for abort.
215 (_AT_DATA_EXPECT2_Y): Likewise.
216
d6e40cba
JD
2172010-01-21 Joel E. Denny <jdenny@clemson.edu>
218
219 * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory.
220
80b70223
JD
2212010-01-21 Joel E. Denny <jdenny@clemson.edu>
222
223 maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
224 * HACKING (Release Procedure): Update notes on copyright years.
225 * Makefile.am (update-package-copyright-year): New target rule.
226 * build-aux/update-package-copyright-year: New file.
227 * cfg.mk (update-copyright): Add update-package-copyright-year
228 as a dependency.
229
3320a276
JD
2302010-01-19 Joel E. Denny <jdenny@clemson.edu>
231
232 * bootstrap: Import improvements from latest gnulib.
233
e30c0477
JD
2342010-01-19 Joel E. Denny <jdenny@clemson.edu>
235
236 build: require Automake 1.11.1 to avoid a security flaw.
237 * HACKING (Release Procedure): Don't document Automake security
238 flaw here.
239 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
240 why here.
241
a538eeb1
JD
2422010-01-19 Joel E. Denny <jdenny@clemson.edu>
243
244 gnulib: update to latest.
245
d6bdb90a
JD
2462010-01-19 Joel E. Denny <jdenny@clemson.edu>
247
248 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
249
326e5cf8
JD
2502010-01-15 Joel E. Denny <jdenny@clemson.edu>
251
252 Thank the developer of the initial push parser implementation.
253 This unfortunate oversight is several years old.
254 * THANKS (Odd Arild Olsen): Add.
255
fca9c5ef
JD
2562010-01-04 Joel E. Denny <jdenny@clemson.edu>
257
258 Fix some comments concerning LR(0) versus LALR(1).
259
260 Stop equating LR(0) with nondeterminism and LALR(1) with
261 determinism. That is, if all states are consistent, then LR(0)
262 tables are deterministic. On the other hand, LALR(1) tables
263 might be nondeterministic before conflict resolution, and GLR
264 permits LALR(1) tables to remain nondeterministic.
265 * src/LR0.c, src/LR0.h: Here.
266 * src/lalr.c, src/lalr.h: Here.
267 * src/main.c (main): Here.
268 * src/state.c, src/state.h: Here.
269
270 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
271 parser tables.
272
e141f4d4
JD
2732010-01-04 Joel E. Denny <jdenny@clemson.edu>
274
275 maint: run "make update-copyright"
276
882be728
JD
2772009-12-30 Joel E. Denny <jdenny@clemson.edu>
278
279 POSIX: complain if %prec's token was not defined.
280 * NEWS (2.5): Document.
281 * src/reader.c (grammar_rule_check): Convert warning to
282 complaint.
283 * tests/input.at (%prec's token must be defined): Update.
284
8bb3a2e7
JD
2852009-12-30 Joel E. Denny <jdenny@clemson.edu>
286
287 POSIX: warn if %prec's token was not defined.
288 Reported by Florian Krohm at
289 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
290 * NEWS (2.4.2): Document.
291 * src/reader.c (grammar_rule_check): Implement.
292 (grammar_current_rule_prec_set): Add comments explaining that we
293 here assume a %prec identifier is a token, but we still manage
294 to support POSIX.
295 * tests/input.at (%prec's token must be defined): New test
296 group.
297
505e1551
JD
2982009-12-31 Joel E. Denny <jdenny@clemson.edu>
299
300 * HACKING (Release Procedure): Recommend a secure automake.
301
b8d19cf8
JD
3022009-12-29 Joel E. Denny <jdenny@clemson.edu>
303
304 portability: `<' and `>' are not always defined on addresses.
305 Specifically, don't sort objects by their memory addresses when
306 they're not allocated in the same array or other object. Though
307 I haven't found a test case where that fails on my platform, C
308 says the behavior is undefined.
309 * src/AnnotationList.c (AnnotationList__insertInto): Remove
310 FIXME. Use new id field of InadequacyList nodes rather than
311 their memory addresses when sorting.
312 (AnnotationList__compute_from_inadequacies): Add
313 inadequacy_list_node_count argument to pass to
314 InadequacyList__new_conflict.
315 * src/AnnotationList.h
316 (AnnotationList__compute_from_inadequacies): Update prototype
317 and documentation for new argument.
318 * src/InadequacyList.c (InadequacyList__new_conflict): Add
319 node_count argument and use it to assign a unique ID.
320 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
321 (InadequacyList): Add id field.
322 (InadequacyList__new_conflict): Update prototype and
323 documentation for new argument.
324 * src/ielr.c (ielr_compute_annotation_lists): Update
325 AnnotationList__compute_from_inadequacies invocation.
326
df222dfa
JD
3272009-12-20 Joel E. Denny <jdenny@clemson.edu>
328
329 Fix handling of yychar manipulation in user semantic actions.
330 The problem was that yacc.c didn't always update the yychar
331 translation afterwards. However, other skeletons appear to be
332 fine. glr.c appears to already translate yychar before every
333 use. lalr1.cc does not define yychar and does not document its
334 replacement, yyla, for users. It does provide yyclearin, but
335 that does not manipulate yyla and thus requires no translation
336 update. In lalr1.java, yychar is out of scope during semantic
337 actions.
338 * NEWS (2.5): Document.
339 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
340 yytoken here.
341 (yyparse, yypush_parse): Instead, translate before every use of
342 yytoken, and add comments explaining this approach.
343 * tests/actions.at (Destroying lookahead assigned by semantic
344 action): New test group checking that translation happens before
345 lookahead destructor calls at parser return. Previously,
346 incorrect destructors were called.
347 * tests/conflicts.at (parse.error=verbose and consistent
348 errors): New test group checking that translation happens at
349 syntax error detection before the associated verbose error
350 message and the associated lookahead destructor calls. While
351 the destructor call is fixed by this patch, the verbose error
352 message is currently incorrect due to another bug (see
353 comments in test group), so this is an expected failure for now.
354
4395a9ff
JD
3552009-12-21 Joel E. Denny <jdenny@clemson.edu>
356
357 YYFAIL: warn about uses and remove from lalr1.java.
358 * NEWS (2.5): Document.
359 * data/lalr1.java (parser::YYStack::YYFAIL): Rename to YYERRLAB,
360 and make it private. Update all uses.
361 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
362
1625df5b
JD
3632009-12-21 Joel E. Denny <jdenny@clemson.edu>
364
365 YYFAIL: deprecate.
366 * NEWS (2.4.2): Document deprecation and the phase-out plan.
367 * data/lalr1.java (parser::YYStack::YYFAIL): Add comment about
368 deprecation.
369 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
370 YYFAIL from GCC cpp's -Wunused-macros.
371 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
372 documentation.
373 (LocalWords): Remove YYFAIL.
374
5335b65a
JD
3752009-12-20 Joel E. Denny <jdenny@clemson.edu>
376
377 tests: cleanup.
378 * tests/c++.at (Syntax error discarding no lookahead): Don't
379 ignore stderr. Instead, eliminate remaining warnings.
380
d59beda0
JD
3812009-12-18 Joel E. Denny <jdenny@clemson.edu>
382
383 lalr1.cc: don't discard non-existent lookahead on syntax error.
384 * data/lalr1.cc (parser::parse): Check yyempty first.
385 * tests/c++.at (Syntax error discarding no lookahead): New test
386 group.
387
387b4d50
JD
3882009-12-17 Joel E. Denny <jdenny@clemson.edu>
389
390 Code cleanup.
391 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
392 function, which is no longer used.
393
a603c6e0
JD
3942009-12-16 Joel E. Denny <jdenny@clemson.edu>
395
396 Add gcc's -Wundef to test suite and fix another warning from it.
397 * NEWS (2.4.2): Update description of -Wundef fix.
398 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
399 (WARN_CFLAGS_TEST): New substitution.
400 * data/glr.c: Avoid warning about __STRICT_ANSI__.
401 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
402 WARN_CFLAGS.
403 (NO_WERROR_CFLAGS): Likewise.
404 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
405
19750d31
JD
4062009-12-16 Joel E. Denny <jdenny@clemson.edu>
407
408 * data/yacc.c: Reformat m4 a little.
409
c938d650
JD
4102009-12-16 Joel E. Denny <jdenny@clemson.edu>
411
412 Document gcc -Wundef fix.
413 * NEWS (2.4.2): Here.
414 * THANKS (Jonathan Nieder): Add.
415
fcd32abd
JN
4162009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
417
418 Simplify y.tab.c when location tracking is disabled.
419 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
420 tracking is not enabled. Instead, unconditionally define
421 YY_LOCATION_PRINT as a no-op for backward compatibility.
422
ae93128c
JN
4232009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
424
425 Avoid warnings from gcc -Wundef y.tab.c.
426 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
427 defined before using them.
428 * data/lalr1.cc: Likewise.
429 * data/yacc.c: Likewise.
430
c843aaab
JD
4312009-12-15 Joel E. Denny <jdenny@clemson.edu>
432
433 autoconf: update to latest for fix of M4 detection.
434 Reported by Eric Blake.
435 * submodules/autoconf: Update.
436
5c99151a
JD
4372009-12-15 Joel E. Denny <jdenny@clemson.edu>
438
439 portability: use -DGNULIB_POSIXCHECK.
440 Reported by Eric Blake. See discussions at
441 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
442 and
443 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
444 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
445 * bootstrap.conf (gnulib_modules): Add all the printf modules
446 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
447 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
448 (excluded_files): Remove m4/printf-posix.m4.
449 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
450 lib/libbison.a so gnulib libraries can be linked.
451
75f94c6d
JD
4522009-12-15 Joel E. Denny <jdenny@clemson.edu>
453
454 gnulib: update for fix of fprintf-posix, which we'll use soon.
455 * etc/prefix-gnulib-mk (prefix): Adjust regex for make file
456 targets so that gnulib's new arg-nonnull.h and link-warning.h
457 are matched.
458 * gnulib: Update.
459
ca01f454
JD
4602009-12-14 Joel E. Denny <jdenny@clemson.edu>
461
462 Enable assertion output and --disable-assert for configure.
463 * bootstrap.conf (gnulib_modules): Add assert module.
464 * src/system.h (aver): Define as assert, and summarize the
465 discussion on this issue.
466
9dc3ee6d
JD
4672009-12-14 Joel E. Denny <jdenny@clemson.edu>
468
469 Expand GLR acronym in summary of Bison.
470 Based on discussion with Akim Demaille starting at
471 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
472 * doc/bison.texinfo (Introduction): Here.
473 * src/getargs.c (usage): Here.
474
d013372c
AR
4752009-10-03 Alex Rozenman <rozenman@gmail.com>
476
477 Document named references.
478 * doc/bison.texinfo (Actions): Add new example and xref to
479 Using Named References node.
480 (Using Named References): New node.
481
5297ebb3
JD
4822009-10-16 Joel E. Denny <jdenny@clemson.edu>
483
484 cleanup.
485 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
486 of char*.
487 (Sbitset__isEmpty): Use Sbitset instead of char*.
488 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
489 instead of char. This helps to avoid casting errors.
490 (Sbitset__or): Use Sbitset instead of char*.
491
175620d3
JD
4922009-10-16 Joel E. Denny <jdenny@clemson.edu>
493
494 portability: don't assume 8-bit bytes.
495 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
496 * src/Sbitset.h (Sbitset__nbytes): Here.
497 (Sbitset__byteAddress): Here.
498 (Sbitset__bit_mask): Here.
499 (Sbitset__last_byte_mask): Here.
500 (Sbitset__ones): Here.
501 (SBITSET__FOR_EACH): Here.
502
786578e3
JD
5032009-10-11 Joel E. Denny <jdenny@clemson.edu>
504
505 portability: use va_start and va_end in the same function.
506 * src/complain.c (error_message): Move va_end from here...
507 (ERROR_MESSAGE): ... to here.
508
416a9da6
JD
5092009-10-08 Joel E. Denny <jdenny@clemson.edu>
510
511 * data/bison.m4: Update comments for rename to muscle-tab.h.
512
10659d0e
JD
5132009-10-07 Joel E. Denny <jdenny@clemson.edu>
514
515 Minor code cleanup.
516 * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
517 replace all uses with UNIQSTR_CONCAT.
518 * src/uniqstr.c (uniqstr_vsprintf): New function.
519 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
520 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
521 macros.
522
3c5362b8
JD
5232009-10-06 Joel E. Denny <jdenny@clemson.edu>
524
525 * TODO (Complaint submessage indentation): New.
526
b143f404
JD
5272009-10-04 Joel E. Denny <jdenny@clemson.edu>
528
529 Minor code cleanup.
530 * src/parse-gram.y: Clean up sorting of declarations.
531 Use types to simplify %printer declarations where possible.
532 Provide %printer for BRACKETED_ID and symbol.prec.
533 * src/symtab.c: Whitespace change.
534
7439c5c0
JD
5352009-10-04 Joel E. Denny <jdenny@clemson.edu>
536
537 tests: skip tests of file names that platform does not support.
538 Reported by Michael Raskin at
539 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
540 * THANKS (Michael Raskin): Add.
541 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
542 to fail at least for file names containing ":" or "\".
543
45319f13
JD
5442009-09-23 Joel E. Denny <jdenny@clemson.edu>
545
546 yysyntax_error: avoid duplicate lookahead collection.
547 Except when memory reallocation is required, this change
548 eliminates the need to invoke yysyntax_error twice and thus to
549 repeat the collection of lookaheads. It also prepares for
550 future extensions that will make those repetitions more
551 expensive and that will require additional memory management in
552 yysyntax_error. Finally, it fixes an obscure bug already
553 exercised in the test suite.
554 * data/yacc.c (yysyntax_error): Add arguments for message
555 buffer variables stored in the parser. Instead of size, return
556 status similar to yyparse status but indicating success of
557 message creation. Other than the actual reallocation of the
558 message buffer, import and clean up memory management code
559 from...
560 (yyparse, yypush_parse): ... here.
561 * tests/regression.at (parse.error=verbose overflow): No longer
562 an expected failure.
563
52cea04a
JD
5642009-09-23 Joel E. Denny <jdenny@clemson.edu>
565
566 yysyntax_error: test memory management more.
567 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
568 * tests/regression.at (parse.error=verbose and
569 YYSTACK_USE_ALLOCA): New test group.
570 (parse.error=verbose overflow): New test group that reveals an
571 obscure bug. Expected fail for now.
572
37318e2f
JD
5732009-10-04 Joel E. Denny <jdenny@clemson.edu>
574
575 benchmarks: use %debug consistently among grammars.
576 * etc/bench.pl.in (generate_grammar_triangular): Do not activate
577 %debug by default. It can affect the timings even if yydebug=0.
578 (generate_grammar_calc): For consistency with other grammars,
579 use YYDEBUG environment variable to set yydebug.
580
f74d6d25
JD
5812009-10-03 Joel E. Denny <jdenny@clemson.edu>
582
583 Remove dead code.
584 * src/symtab.c (symbol_pack): Here because every symbol's number
585 is always defined by this time.
586
5b1ff423
AR
5872009-10-03 Alex Rozenman <rozenman@gmail.com>
588
589 Add additional space after periods in NEWS.
590 * NEWS (2.5): here.
591
47eced30
JD
5922009-09-29 Joel E. Denny <jdenny@clemson.edu>
593
594 Use the correct conversion specifier for size_t.
595 Reported by Jim Meyering.
596 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
597 because Sbitset__Index is size_t.
598 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
599
d8f68fc2
JD
6002009-09-27 Joel E. Denny <jdenny@clemson.edu>
601
602 tests: don't abuse AT_BISON_CHECK.
603 * tests/regression.at (parse-gram.y: LALR = IELR): Move
604 additional shell commands outside of AT_BISON_CHECK.
605
43aabb70
JD
6062009-09-26 Joel E. Denny <jdenny@clemson.edu>
607
608 tests: check that parse-gram.y's IELR and LALR are identical.
609 * tests/atlocal.in (abs_top_srcdir): New shell variable.
610 * tests/regression.at (parse-gram.y: LALR = IELR): New test
611 group.
612
66381412
AR
6132009-09-19 Alex Rozenman <rozenman@gmail.com>
614
615 Keep sub-messages aligned. Fix strings for translation.
5b1ff423
AR
616 * src/location.h (location_print): Add return value.
617 * src/location.c (location_print): Return number of printed
66381412 618 characters.
5b1ff423
AR
619 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
620 new functions.
621 * src/complain.cpp (indent_ptr): New static variable.
622 (error_message, complain_at_indent, warn_at_indent): Implement
623 the alignment mechanism.
624 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
625 for translations. Use new alignment mechanism.
626 * tests/named-ref.at: Adjust test-cases.
66381412
AR
627 * NEWS (2.5): Add an announcement about named references.
628
a6ca4ce2
AD
6292009-09-17 Akim Demaille <demaille@gostai.com>
630
631 doc: fixes.
632 * doc/bison.texinfo: here.
633 Reported by Alex Rozenman.
634
3cdc21cf
AD
6352009-09-16 Akim Demaille <demaille@gostai.com>
636
637 doc: lalr1.cc and variants.
638 * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and
639 "variant" %define variables.
640 (C++ Semantic Values): Split into...
641 (C++ Unions, C++ Variants): these.
642 The latter is new.
643 (C++ Parser Interface): Fix type names.
644 Document parser::syntax_error.
645 Document the fact that locations are not mandatory.
646 (C++ Scanner Interface): Split into...
647 (Split Symbols, Complete Symbols): these.
648 The later is new.
649 (Calc++ Parsing Driver): Use variants.
650 Add more comments.
651 Adjust style.
652 (Calc++ Parser): Declare all the tokens, no
653 longer accept raw characters.
654 Remove %union.
655 Adjust types and printers.
656 Remove destructors.
657 (Calc++ Scanner): Use make_<SYMBOL> functions.
658 Use strerror in error message.
659
f50bfcd6
AD
6602009-09-16 Akim Demaille <demaille@gostai.com>
661
662 doc: spell checking.
663 * doc/bison.texinfo: here.
664
6b5a0de9
AD
6652009-09-16 Akim Demaille <demaille@gostai.com>
666
667 doc: comment changes.
668 * doc/bison.texinfo: Comment changes.
669
2b08bceb
AD
6702009-09-16 Akim Demaille <demaille@gostai.com>
671
672 lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS.
673 * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the
674 constructor to take a token_type instead of the (internal) symbol
675 number.
676 Call yytranslate_.
677 * data/variant.hh (b4_symbol_constructor_define_): Therefore,
678 don't call yytranslate_ here.
679
c981ce9b
AD
6802009-09-16 Akim Demaille <demaille@gostai.com>
681
682 TODO: statistics.
683 * TODO (Figures): New.
684
00d80a9c
JD
6852009-09-13 Joel E. Denny <jdenny@clemson.edu>
686
687 tests: clean up push.at test group titles.
688 * tests/push.at: Remove "Push Parsing: " from test group titles
689 because these are already under the banner "Push Parsing Tests".
690
f64e406b
AR
6912009-09-12 Alex Rozenman <rozenman@gmail.com>
692
693 Provide an additional sub-message for clarity.
694 Add "symbol not found in production" error message when
695 an "invalid reference" is detected in named references
696 resolution.
697 * src/scan-code.l: Update "invalid reference" case.
698 * tests/named-ref.at: Adjust test-cases.
699
bb31eb56
JD
7002009-09-10 Joel E. Denny <jdenny@clemson.edu>
701
702 Clean up yacc.c a little.
703 * data/yacc.c: Clean up M4 for readability, and make output
704 whitespace more consistent. For the main parse function
705 comment, instead of saying "yyparse or yypush_parse", say either
706 "yyparse" or "yypush_parse" depending on which it actually is.
707
2d399888
JD
7082009-09-10 Joel E. Denny <jdenny@clemson.edu>
709
710 Fix --enable-gcc-warnings.
711 * src/parse-gram.y (%printer <param>): Handle param_none.
712
ff601366
AD
7132009-09-09 Akim Demaille <demaille@gostai.com>
714
715 lalr1.cc: syntax_error as exceptions.
716 It is common to use sort of factories in the user actions. These
717 factories may check some "syntactic" constraints that are not
718 enforced by the grammar itself. This is possible using YYERROR
719 within the action itself. Provide the user with a means to throw
720 a syntax_error exception.
721
722 * data/c++.m4 (b4_public_types_declare, b4_public_types_define):
723 Declare and define yy::parser::syntax_error.
724 * data/lalr1.cc: Include stdexcept.
725 (yy::parser::parse): Wrap the user action within a try/catch.
726 * data/glr.cc: Include stdexcept.
727
29660062
AD
7282009-09-09 Akim Demaille <demaille@gostai.com>
729
730 lalr1.cc: add missing "inline".
731 * data/c++.m4 (b4_public_types_define): Add missing inline to
732 implementations provided in headers.
733
2055a44e
AD
7342009-09-09 Akim Demaille <demaille@gostai.com>
735
736 %param: documentation.
737 * NEWS (2.6): Document %param, %lex-param, and %parse-param
738 changes.
739 * doc/bison.texinfo: Document that %lex-param and %parse-param
740 are n-ary.
741 Changes some examples to demonstrate it.
742 (Calc++ Parser): Use %param.
743
dd875058
AD
7442009-09-09 Akim Demaille <demaille@gostai.com>
745
746 Regen.
747
f71db70b
AD
7482009-09-09 Akim Demaille <demaille@gostai.com>
749
750 style changes.
751 * src/parse-gram.y (add_param): Scope changes.
752
eaca4c11
AD
7532009-09-09 Akim Demaille <demaille@gostai.com>
754
755 %parse: support several arguments.
756 * src/parse-gram.y (current_param): New.
757 (param_type): Add param_none.
758 (params): New nonterminal.
759 Use it.
760
b18cdd91
AD
7612009-09-09 Akim Demaille <demaille@gostai.com>
762
763 Regen.
764
a7706735
AD
7652009-09-09 Akim Demaille <demaille@gostai.com>
766
767 %param.
768 Provide a means to factor lex-param and parse-param common
769 declarations.
770
771 * src/parse-gram.y (param_type): New.
772 Define a %printer for it.
773 (add_param): Use it.
774 (%parse-param, %lex-param): Merge into...
775 (%parse): this new token.
776 Adjust the grammar to use it.
777 * src/scan-gram.l (RETURN_VALUE): New.
778 (RETURN_PERCENT_FLAG): Use it.
779 (RETURN_PERCENT_PARAM): New.
780 Use it to support %parse-param, %lex-param and %param.
781
9789acf0
JD
7822009-09-03 Joel E. Denny <jdenny@clemson.edu>
783
784 Use aver not assert.
785 * src/output.c: Don't include assert.h.
786 (output_skeleton): Use aver not assert.
787 * src/system.h (aver): In documentation of why, add links to
788 Paul Eggert's explanations in the mailing lists.
789
61bc57e5
AR
7902009-09-05 Alex Rozenman <rozenman@gmail.com>
791
792 Use "Unresolved reference" error message when no symbols were found
793 in a symbolic reference resolution. Remove .expr and -expr from
794 the shown reference when the reference is unresolved.
795 * src/scan-code.l: Change the error message, adjust location columns,
796 rename variable "exact_mode" to "explicit_bracketing".
797 * tests/named-ref.at: Adjust existing tests and add a new one.
798
f4c75eaf
AD
7992009-09-04 Akim Demaille <demaille@gostai.com>
800
801 Adjust synclines in src/parse-gram.[ch].
802 * tests/bison.in: Do some magic (including working around issues
803 with ylwrap) when this wrapper is used to compile
804 src/parse-gram.y.
805
c6abeab1
JD
8062009-09-03 Joel E. Denny <jdenny@clemson.edu>
807
808 Complain about unused %define variables and %code qualifiers.
809 * NEWS (2.5): Document.
810 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
811 * doc/bison.texinfo (Decl Summary): Document complaint, and
812 improve %define documentation a little otherwise.
813 * tests/input.at (Reject unused %code qualifiers): Update.
814 (%define errors): Update.
815 (%define, --define, --force-define): Update.
816 (%define backward compatibility): Update.
817 (Unused %define api.pure): Update.
818 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
819
82db7cdb
JD
8202009-09-03 Joel E. Denny <jdenny@clemson.edu>
821
822 Don't suppress warnings about unused parse.error.
823 * data/bison.m4 (b4_error_verbose_flag): Don't examine value of
824 %define variable parse.error unless b4_error_verbose_flag is
825 actually expanded in a skeleton.
826
2755de8f
AD
8272009-09-03 Akim Demaille <demaille@gostai.com>
828
829 * NEWS (2.4.2): Add "Internationalization" item.
830
1deef26d
AD
8312009-09-03 Akim Demaille <demaille@gostai.com>
832
833 bootstrap: fix/improve find_tool.
834 * bootstrap (find_tool): Improve error messages.
835 Fix typo about find_tool_names.
836
2646cd54
JD
8372009-08-29 Joel E. Denny <jdenny@clemson.edu>
838
839 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
840 See
841 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
842 * src/scan-code.h (code_props_rule_action_init): Rename
843 named_ref arg to name so it doesn't shadow named_ref type. This
844 makes it consistent with the function definition in scan-code.l
845 anyway.
846
cf499cff
JD
8472009-08-28 Joel E. Denny <jdenny@clemson.edu>
848
849 %define: accept unquoted values.
850 * NEWS (2.5): Group all %define changes together, and document
851 this one. Remove quotes in IELR and canonical LR entry.
852 * doc/bison.texinfo: Remove quotes in most examples throughout.
853 (Decl Summary): Update %define documentation.
854 (Table of Symbols): Likewise.
855 * src/ielr.c (LrType): Update documentation.
856 * src/parse-gram.y (content.opt): Add production for ID.
857 * tests/actions.at: Remove quotes in most tests.
858 * tests/calc.at: Likewise.
859 * tests/existing.at: Likewise.
860 * tests/input.at: Likewise.
861 * tests/local.at: Likewise.
862 * tests/push.at: Likewise.
863 * tests/reduce.at: Likewise.
864 * tests/torture.at: Likewise.
865
6ba96404
JD
8662009-08-28 Joel E. Denny <jdenny@clemson.edu>
867
868 %define lr.type: make values lowercase IDs.
869 That is, "LALR" => "lalr", "IELR" => "ielr", and
870 "canonical LR" => "canonical-lr".
871 * NEWS (2.5): Update documentation.
872 * doc/bison.texinfo (Decl Summary): Likewise.
873 * src/ielr.c (ielr): Use new values.
874 * src/ielr.h (ielr): Update documentation.
875 * src/reader.c (prepare_percent_define_front_end_variables): Use
876 and validate new values.
877 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
878 grammars.
879 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
880
4413bbd3
EB
8812009-08-27 Eric Blake <ebb9@byu.net>
882
883 scan-gram: avoid portability trap with ctype usage.
884 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
885 Avoid compiler warning.
886
b70c7fb4
JD
8872009-08-27 Joel E. Denny <jdenny@clemson.edu>
888
889 tests: use perl for printing special sequences to files.
890 And skip tests if perl is not available. This is better than
891 playing tricks with shell portability. Suggested by Akim
892 Demaille.
893 * tests/input.at (Bad character literals): Use it here for
894 omitting final newlines.
895 (Bad escapes in literals): Use it here for special characters.
896
d1cc31c5
JD
8972009-08-26 Joel E. Denny <jdenny@clemson.edu>
898
899 tests: show a use of %define lr.default-reductions "consistent"
900 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
901 prevents the omission of expected tokens for %error-verbose.
902
3bed3a75
AD
9032009-08-26 Akim Demaille <demaille@gostai.com>
904
905 tests: portability fix.
906 * tests/input.at (Bad escapes in literals): Don't expect "echo
907 '\0'" to output \ then 0.
908
aa0cb40d
JD
9092009-08-26 Joel E. Denny <jdenny@clemson.edu>
910
911 Actually handle the yytable zero value correctly this time.
912 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
913 zero values in the YYTABLE comments.
914 * data/glr.c (yytable_value_is_error): Don't check for zero
915 value.
916 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
917 * data/yacc.c (yytable_value_is_error): Likewise.
918 * data/lalr1.java (yy_table_value_is_error_): Likewise.
919 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
920 * src/tables.h: In header comments, explain why it's useless to
921 check for a zero value in yytable.
922
f2b30bdf
JD
9232009-08-25 Joel E. Denny <jdenny@clemson.edu>
924
925 More fixes related to last two patches.
926 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
927 comments: zero indicates syntax error not default action.
928 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
929 defined.
930 * data/glr.c (yyis_pact_ninf): Rename to...
931 (yypact_value_is_default): ... this.
932 (yyisDefaultedState): Update for rename.
933 (yyis_table_ninf): Rename to...
934 (yytable_value_is_error): ... this, and check for value zero
935 besides just YYTABLE_NINF.
936 (yygetLRActions): Check for default value from yypact. It
937 appears that this check is always performed before this function
938 is invoked, and so adding the check here is probably redundant.
939 However, the code may evolve after this subtlety is forgotten.
940 Also, update for rename to yytable_value_is_error. Because that
941 macro now checks for zero, a different but equivalent branch of
942 the if-then-else here is evaluated.
943 (yyreportSyntaxError): Update for rename to
944 yytable_value_is_error. The zero condition was mishandled
945 before.
946 (yyrecoverSyntaxError): Update for renames. No behavioral
947 changes.
948 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
949 New function.
950 (yy_table_value_is_error_): New function.
951 (parse): Use new functions where possible. No behavioral
952 changes.
953 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
954 The zero condition was mishandled before.
955 * data/yacc.c (yyis_pact_ninf): Rename to...
956 (yypact_value_is_default): ... this.
957 (yyis_table_ninf): Rename to...
958 (yytable_value_is_error): ... this, and check for value zero
959 besides just YYTABLE_NINF.
960 (yysyntax_error): Update for rename to yytable_value_is_error.
961 The zero condition was mishandled before.
962 (yyparse): Update for renames. No behavioral changes.
963 * src/tables.h: Improve comments about yypact, yytable, etc.
964 more. Most importantly, say yytable value of zero means syntax
965 error not default action.
966
53f036ce
JD
9672009-08-25 Joel E. Denny <jdenny@clemson.edu>
968
969 Fix %error-verbose for conflicts resolved by %nonassoc.
970 * NEWS (2.5): Document.
971 * data/glr.c (yyreportSyntaxError): Fix this by checking
972 yyis_table_ninf.
973 * data/yacc.c (yysyntax_error): Likewise.
974 * data/lalr1.cc (yysyntax_error_): Fix this by checking
975 yytable_ninf_.
976 * data/lalr1.java (yysyntax_error): Likewise.
977 * tests/conflicts.at (%nonassoc and eof): Update expected output
978 and remove FIXME.
979
87412882
JD
9802009-08-25 Joel E. Denny <jdenny@clemson.edu>
981
982 Some code and documentation improvements.
983 * data/c.m4 (b4_table_value_equals): New macro to capture
984 some repeated code.
985 * data/glr.c (yyis_pact_ninf): Use it here.
986 (yyis_table_ninf): Likewise.
987 (yyreportSyntaxError): Improve internal comments.
988 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
989 Use it everywhere possible.
990 (yyis_table_ninf): Likewise.
991 (yysyntax_error): Improve internal comments.
992 * data/lalr1.cc (yysyntax_error_): Likewise.
993 * data/lalr1.java (yysyntax_error): Likewise.
994 * src/tables.h: Improve comments about yypact, yytable, etc.
995
e6c849d8
JD
9962009-08-21 Joel E. Denny <jdenny@clemson.edu>
997
998 Use locale when quoting.
999 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
1000 quote rather than implementing quoting here.
1001
d8911864
EB
10022009-08-20 Eric Blake <ebb9@byu.net>
1003
b0778bdd
EB
1004 Make previous patch more robust.
1005 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
1006 argmatch.h.
1007 (output_skeleton): Use it.
1008 Suggested by Akim Demaille.
1009
d8911864
EB
1010 Import latest m4/m4.m4.
1011 * submodules/autoconf: Update to autoconf 2.64.
1012 * configure.ac (M4_GNU_OPTION): New define.
1013 * src/output.c (output_skeleton): Use it to resolve FIXME.
1014 * NEWS: Mention this.
1015
c2724603
JD
10162009-08-19 Joel E. Denny <jdenny@clemson.edu>
1017
1018 Fix complaints about escape sequences.
1019 Discussed starting at
1020 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
1021 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
1022 For a \0 and similar escape sequences meaning the null
1023 character, report an invalid escape sequence instead of an
1024 invalid null character because the latter does not actually
1025 appear in the user's input.
1026 In all escape sequence complaints, don't escape the initial
1027 backslash, and don't quote when the sequence appears at the end
1028 of the complaint line unless there's whitespace that quotearg
1029 won't escape.
1030 Consistently say "invalid" not "unrecognized".
1031 Consistently prefer "empty character literal" over "extra
1032 characters in character literal" warning for invalid escape
1033 sequences; that is, consistently discard those sequences.
1034 * tests/input.at (Bad escapes in literals): New.
1035
17aed602
AD
10362009-08-19 Akim Demaille <demaille@gostai.com>
1037
1038 doc: fixes.
1039 * doc/bison.texinfo: Fix minor Texinfo errors.
1040
9142239a
AD
10412009-08-19 Akim Demaille <demaille@gostai.com>
1042
1043 tests: distcc compliance.
1044 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
1045 error messages from the output.
1046
171ad99d
AD
10472009-08-19 Akim Demaille <demaille@gostai.com>
1048
1049 variables: simplify the upgrade of namespace into api.namespace.
1050
1051 This patch simplifies "variables: rename namespace as
1052 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
1053 Suggested by Joel E. Denny in
1054 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
1055
1056 * src/muscle-tab.c (muscle_percent_variable_update): New.
1057 (muscle_percent_define_insert): Use it in replacement of the
1058 previous tr invocation.
1059 Remove variable_tr, no longer needed.
1060 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1061 Remove.
1062 * data/c++.m4: No longer handle namespace -> api.namespace.
1063 * tests/input.at (%define backward compatibility): Check that
1064 namespace is treated as api.namespace.
1065
d59e456d
AD
10662009-08-19 Akim Demaille <demaille@gostai.com>
1067
1068 doc: %initial-action to initialize yylloc.
1069 Reported by Bill Allombert.
1070 * doc/bison.texinfo: Set fill-column to 76.
1071 (Location Type): Document the use of %initial-action to initialize
1072 yylloc.
1073
ceb8b8e6
AD
10742009-08-19 Akim Demaille <demaille@gostai.com>
1075
1076 lalr1.cc: use state_type.
1077 * data/lalr1.cc (yysyntax_error_): Use state_type.
1078 Move argument names into yy*.
1079
7580c379
AD
10802009-08-19 Akim Demaille <demaille@gostai.com>
1081
1082 lalr1.cc: get rid of yyparse's yystate.
1083 yystate and yystack_[0].state are equal, keep only the latter.
1084 The former was also used as a temporary variable to compute the
1085 post-reduction state. Move this computation into an auxiliary
1086 function.
1087
1088 * data/glr.c (yyLRgotoState): Fuse variable definition and first
1089 assignment.
1090 * data/lalr1.cc (yy_lr_goto_state_): New.
1091 (yyparse): Use it.
1092 Replace remaining uses of yystate by yystate_[0].state.
1093 Remove the former.
1094
c4dc4c46
AD
10952009-08-19 Akim Demaille <demaille@gostai.com>
1096
1097 lalr1.cc: destroy $$ when YYERROR is called.
1098 * data/lalr1.cc (yyreduce): Compute the resulting state before
1099 running the user action so that yylhs is a valid symbol.
1100 (yyerrorlab): Since yylhs is complete (it knows its type), we can
1101 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
1102 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
1103
c67e466f
JD
11042009-08-18 Joel E. Denny <jdenny@clemson.edu>
1105
1106 maint: update for gnulib's recent update-copyright changes
1107 * gnulib: Update.
1108 * .x-update-copyright (COPYING): Add as it's no longer implied
1109 when .x-update-copyright is present.
1110 * cfg.mk (update-copyright-local): Remove, now ignored.
1111 (update-copyright): Declare update-b4-copyright as a dependency.
1112
af6d2358
AD
11132009-08-17 Akim Demaille <demaille@gostai.com>
1114
1115 build: require gettext 0.17.
1116
1117 Suggested by Bruno Haible.
1118 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
1119 * configure.ac: require gettext 0.17 to ensure compatibility with
1120 gnulib.
1121
91a2b9b1
AD
11222009-08-17 Akim Demaille <demaille@gostai.com>
1123
1124 build: lower gettext requirements.
1125
1126 Bison was uselessly requiring the formatstring macros from
1127 gettext, which resulted in mo files not being installed on systems
1128 that perfectly supported Bison mo files. Lower the requirement.
1129 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
1130
b0778bdd
EB
1131 * configure.ac: Require need-ngettext instead of
1132 need-formatstring-macros.
1133 Reported by Martin Jabocs.
1134 Suggested by Bruno Haible.
1135 * INSTALL: Restructure.
1136 (Internationalization): New.
91a2b9b1 1137
585935e8
JD
11382009-08-14 Joel E. Denny <jdenny@clemson.edu>
1139
1140 maint: fix use of copyright year intervals.
1141 * gnulib: Update.
1142 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
1143 as now recommended in gnulib/NEWS.
1144 * build-aux/update-b4-copyright: Fix.
1145 * cfg.mk (update-copyright-env): Configure update-copyright.
1146
83b60c97
JD
11472009-08-13 Joel E. Denny <jdenny@clemson.edu>
1148
1149 Make it easier to write deterministic tests.
1150 Continues Akim's work from his 2009-06-10 commits.
1151 * src/reader.c (check_and_convert_grammar): Don't add any
1152 symbols after the first symbols_do invocation.
1153 * src/symtab.c (symbols_sorted): New static global.
1154 (user_token_number_redeclaration): Update comments.
1155 (symbol_from_uniqstr): If a new symbol is being created, assert
1156 that symbols_sorted hasn't been allocated yet.
1157 (symbols_free): Free symbols_sorted.
1158 (symbols_cmp, symbols_cmp_qsort): New functions.
1159 (symbols_do): Sort symbol_table into symbols_sorted on first
1160 invocation.
1161 * tests/input.at (Numbered tokens): Recombine tests now that the
1162 output should be deterministic across multiple numbers.
1163
28169bab
AD
11642009-08-12 Akim Demaille <demaille@gostai.com>
1165
1166 tests: GCC 4.5 compliance.
1167 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
1168 messages about #error.
1169
9f14e187
AD
11702009-08-12 Akim Demaille <demaille@gostai.com>
1171
1172 build: fix the generation of the documentation.
1173 Some of our targets use "bison --help", but they can't depend on
1174 "bison" itself (to avoid additional requirements on the user), so
1175 they used to call "make src/bison" in the commands. Then
1176 concurrent builds may fail: one make might be aiming one of its
1177 jobs at compiling src/bison, and another job at generating the man
1178 page. If the latter is faster than the former, then we have two
1179 makes that concurrently try to compile src/bison.
1180
1181 This might also be a more convincing explanation for the failure
1182 described in the patch "build: fix paths".
1183
1184 * Makefile.am (SUFFIXES): Initialize.
1185 * build-aux/move-if-change: New, symlink to gnulib's.
1186 * build-aux/local.mk: Ship it.
1187 * doc/common.x: Remove, merged into...
1188 * doc/bison.x: here.
1189 * doc/local.mk (doc/bison.help): New.
1190 ($(CROSS_OPTIONS_TEXI)): Depend on it.
1191 Use src/bison.
1192 (.x.1): Replace with...
1193 (doc/bison.1): this explicit, simpler, target.
1194 (common_dep): Remove, inlined where appropriate.
1195 (SUFFIXES, PREPATH): Remove, unused.
1196
d1b55e81
AD
11972009-08-12 Akim Demaille <demaille@gostai.com>
1198
1199 gnulib: improve prefixing.
1200 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
1201 change the value of...
1202 (gl_LIBOBJS): this.
1203 Adjust more variables.
1204 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
1205 gl_LIBOBJS.
1206 (prefix): Also transform rules whose targets have slashes.
1207 Use $prefix liberally.
1208 Map @MKDIR_P@ to $(MKDIR_P).
1209 Prefix directories that are mkdir'd.
1210
838205d5
AD
12112009-08-12 Akim Demaille <demaille@gostai.com>
1212
1213 build: fix paths.
1214 When using $(top_builddir) inconsistently, Make (including GNU
1215 Make) is sometimes confused. As a result it may want to build
1216 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
1217 file, different names) concurrently, which, amusingly enough,
1218 might end with:
1219
1220 ranlib lib/libbison.a
1221 ranlib lib/libbison.a
1222 make[2]: *** [lib/libbison.a] Segmentation fault
1223
1224 on OS X.
1225
1226 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
1227 needed.
1228
67af7198
AD
12292009-08-12 Akim Demaille <demaille@gostai.com>
1230
1231 distcheck: fix.
1232
b0778bdd 1233 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
67af7198 1234
c467dc42
JD
12352009-08-10 Joel E. Denny <jdenny@clemson.edu>
1236
1237 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
1238
dfaa4860
JD
12392009-08-10 Joel E. Denny <jdenny@clemson.edu>
1240
1241 Miscellaneous code readability improvements.
1242
1243 * src/reader.c (reader): Move %define front-end variable
1244 defaults and checking into...
1245 (prepare_percent_define_front_end_variables): ... this new
1246 function.
1247
1248 * src/scan-gram.l (INITIAL): For consistency with string
1249 literals, don't store open quote on character literal. It's
1250 discarded before returning anyway.
1251 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
1252 Make length test more readable, and make the character stored
1253 for an empty literal more obvious while consistent with the
1254 previous behavior.
1255
1256 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
1257 USER_NUMBER_HAS_STRING_ALIAS throughout.
1258 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
1259 that is repeated in symtab.h. Improve argument names to make it
1260 clear which side of the symbol-string alias pair is which.
1261 (symbol_check_alias_consistency): Improve local variable names
1262 for the same purpose.
1263 * src/symtab.h (struct symbol): Make comments about aliases
1264 clearer.
1265 (symbol_make_alias): Improve comments and argument name.
1266 * src/output.c (token_definitions_output): Update for rename to
1267 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
1268
ce268795
AR
12692009-08-08 Alex Rozenman <rozenman@gmail.com>
1270
1271 Convert "misleading reference" messages to warnings.
1272 * src/scan-code.l: New function 'show_sub_messages', more
1273 factoring.
1274 * tests/named-ref.at: Adjust tests.
1275
401b73af
JD
12762009-08-06 Joel E. Denny <jdenny@clemson.edu>
1277
1278 maint: run "make update-copyright"
1279
a1a9422d
JD
12802009-08-06 Joel E. Denny <jdenny@clemson.edu>
1281
1282 maint: make update-b4-copyright easier to use
1283 * build-aux/update-b4-copyright: In warnings, report line
1284 numbers rather than character positions.
1285 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
1286 that update-copyright runs it.
1287 * gnulib: Update.
1288
0b61a8ec
JD
12892009-08-05 Joel E. Denny <jdenny@clemson.edu>
1290
1291 maint: clean up update-b4-copyright code
1292 * build-aux/update-b4-copyright: Do not accept 2-digit
1293 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
1294 Don't accept a `[' in a b4_copyright argument.
1295 Format code more consistently.
1296 Don't assume b4*copyright never occurs.
1297
269e222e
JD
12982009-08-04 Joel E. Denny <jdenny@clemson.edu>
1299
1300 maint: automate b4_copyright updates.
1301 * Makefile.am (update-b4-copyright): New target rule.
1302 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
1303 * build-aux/update-b4-copyright: New.
1304 * data/yacc.c: Remove stray characters around b4_copyright
1305 invocations.
1306
35905f2b
JD
13072009-08-04 Joel E. Denny <jdenny@clemson.edu>
1308
1309 maint: automate annual package-wide copyright-year update.
1310 * .x-update-copyright: New.
1311 * Makefile.am (EXTRA_DIST): Remove maint.mk.
1312 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
1313 update-copyright. Remove gnumakefile, which is implied by
1314 maintainer-makefile.
1315 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
1316 * gnulib: Update.
1317 * maint.mk: Remove, now copied from gnulib.
1318 * examples/extexi: Add missing "(C)" in copyright statement so
1319 update-copyright can recognize it.
1320 * src/LR0.h: Likewise.
1321 * src/print.h: Likewise.
1322 * src/print_graph.h: Likewise.
1323 * src/gram.c: Add missing comma in copyright statement.
1324 * src/gram.h: Likewise.
1325
b30e18dc
JD
13262009-08-04 Joel E. Denny <jdenny@clemson.edu>
1327
1328 Fix "make distcheck".
1329 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
1330 of just calc.stamp.
1331
8d90395d
JD
13322009-08-01 Joel E. Denny <jdenny@clemson.edu>
1333
1334 Pacify "gcc -Wunused" for the input function from Flex.
1335 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
1336 and later.
1337 * src/scan-code.l: Add "%option noinput", which I cannot find in
1338 the Flex manual, but which Flex has supported since at least as
1339 far back as 2.5.4. However, if any of our developers still use
1340 Flex 2.5.4, they'll need to stop configuring with
1341 --enable-gcc-warnings because "%option noinput" didn't work
1342 correctly until Flex 2.5.6.
1343 * src/scan-gram.l: Likewise.
1344 * src/scan-skel.l: Likewise.
1345
ba4184ec
AR
13462009-07-31 Alex Rozenman <rozenman@gmail.com>
1347
1348 Fix --enable-gcc-warnings problems.
1349 * src/reader.c: Adjust variable names.
1350 * src/scan-code.l: Fix prototypes and adjust names.
1351 * src/named-ref.c: Remove redundant "if".
1352
91a2af97
JD
13532009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1354
1355 Fix a --enable-gcc-warnings problem.
1356 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
1357 variable.
1358
3208e3f4
JD
13592009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1360
1361 Warn about character literals not of length one.
1362 * NEWS (2.5): Document.
1363 * src/scan-gram.l (INITIAL): Remove comment that we don't check
1364 the length.
1365 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
1366 * tests/input.at (Bad character literals): New test group.
1367
5add20ab 13682009-07-24 Alex Rozenman <rozenman@gmail.com>
13cdf208
AR
1369
1370 Fix some memory leaks.
1371 * src/named-ref.c: Add a pointer check (named_ref_free).
1372 * src/scan-code.l: New function (variant_table_free). Called in
1373 code_scanner_free.
1374 * src/symlist.c: Call to named_ref_free (symbol_list_free).
1375
e459fb0e
JD
13762009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1377
1378 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
1379
c4be5517
JD
13802009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
1381
1382 Some M4 cleanup in the testsuite.
1383 Suggested by Eric Blake at
1384 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
1385 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
1386 complicate the code by distinguishing between a missing value
1387 and an empty string value for an optional argument. This fix is
1388 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
1389 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
1390 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
1391 arguments are not needed because of the following changes.
1392 Fix stale comments.
1393 Bison developers should use GNU M4 and should not use
1394 POSIXLY_CORRECT when building the test suite, so do not
1395 complicate the code by avoiding $10 and above.
1396 Do not quote an empty string value for an optional argument, and
1397 do not distinguish between a missing value and an empty string
1398 value.
1399
feeb56cd
JD
14002009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1401
1402 Revert unnecessary column realignment in --help output.
1403 Reported by Akim Demaille at
1404 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
1405 * src/getargs.c (usage): Here.
1406
5add20ab 14072009-07-04 Alex Rozenman <rozenman@gmail.com>
629e4def
AR
1408
1409 Alphabetical order in src/local.mk.
1410 * src/local.mk: Adjust.
1411
5add20ab 14122009-07-04 Alex Rozenman <rozenman@gmail.com>
872b52bc
AR
1413
1414 Style changes and factoring.
1415 * src/named-ref.h: Add comments.
1416 * src/parse-gram.y: Readability and style changes.
1417 * src/reader.c: Factoring: assign_named_ref function.
1418 * src/scan-code.l: Factoring and style changes. Rename
1419 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
1420 Use "unsigned" type for variant index. Improve readablity.
1421 * src/scan-gram.l: Change error messages and add comments.
1422 * src/symlist.h: symbol_list_null: New function decl.
1423 * src/symlist.c: symbol_list_null: Implement here.
1424 * tests/named-refs.at: Adjust for new error messages.
1425
83ea2423
EB
14262009-06-29 Eric Blake <ebb9@byu.net>
1427
1428 scan-code: avoid compiler warnings
1429 * src/scan-code.l (parse_named_ref): Use correct specifiers.
1430
5ece73ea
AD
14312009-06-29 Akim Demaille <demaille@gostai.com>
1432
1433 build: avoid concurrent extraction of calc++.
1434 * examples/calc++/Makefile.am (calc.stamp): New.
1435 Depend on it to create the sources of calc++ so that concurrent
1436 builds don't launch several "extexi" in parallel.
1437 Not only this is inefficient, this also builds incorrect sources
1438 with several extractions mixed together.
1439
ad597a78
AD
14402009-06-29 Akim Demaille <demaille@gostai.com>
1441
1442 parse.error: fix.
1443 * data/bison.m4: Move code related to specific variables after the
1444 definition of the variable-maintaining macros so that we don't
1445 "invoke" b4_percent_define_check_values before it is defined.
1446
31b850d2
AD
14472009-06-29 Akim Demaille <demaille@gostai.com>
1448
1449 variables: parse.error
1450
1451 Implement, document, and test the replacement of %error-verbose
1452 by %define parse.error "verbose".
1453 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
1454 values of the parse.error variable.
1455 Make "simple" its default value.
1456 Check the valid values.
1457 * src/parse-gram.y: Use %define parse.error.
1458 (PERCENT_ERROR_VERBOSE): New token.
1459 Support it.
1460 * src/scan-gram.l: Support %error-verbose.
1461
1462 * doc/bison.texinfo (Decl Summary): Replace the documentation of
1463 %define error-verbose by that of %define parse.error.
1464 * NEWS: Document it.
1465
1466 * tests/actions.at, tests/calc.at: Use parse.error instead of
1467 %error-verbose.
1468
b9f1d9a4
AR
14692009-06-27 Alex Rozenman <rozenman@gmail.com>
1470
1471 Implement support for named symbol references.
1472 * src/parse-gram.y: Add new syntax (named_ref.opt).
1473 * src/reader.c: Store named refs in symbol lists.
1474 * src/reader.h: New argument for symbol_append and
1475 action_append functions.
1476 * src/scan-code.h: Add new field (named_ref) into
1477 code_props data structure. Keeps named ref of midrule
1478 actions.
1479 * src/scan-code.l: Support for named refs in semantic
1480 action code. New function 'parse_named_ref'.
1481 * src/scan-gram.l: Support bracketed id.
1482 * src/symlist.c: Store named refs in symbol lists.
1483 * src/symlist.h: New field in symbol list: named_ref.
1484 * src/named-ref.h: New file, a struct for named_ref.
1485 * src/named-ref.cp: New file, named_ref_new function.
1486 * src/local.mk: Add two new files.
1487 * tests/testsuite.at: Include new test group:
1488 * tests/named-refs.at: this new file.
1489
b5c212b6
AD
14902009-06-25 Akim Demaille <demaille@gostai.com>
1491
1492 hash: check insertion for memory exhaustion.
1493 * src/uniqstr.c (uniqstr_new): New.
1494
67501061
AD
14952009-06-24 Akim Demaille <demaille@gostai.com>
1496
1497 variables: rename namespace as api.namespace.
1498 Discussed in
1499 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
1500
1501 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1502 New.
1503 (b4_percent_define_use): New.
1504 Use it where applicable.
1505 * data/c++.m4: Replace uses of the variable "namespace" by
1506 "api.namespace".
1507 Default the latter to the former.
1508 * doc/bison.texinfo (Decl Summary): Document "namespace" as
1509 obsolete.
1510 Document api.namespace.
1511 Use @samp to document %define uses, keep @code for identifiers.
1512 * NEWS: Likewise.
1513 * tests/c++.at, tests/input.at: Test api.namespace instead of
1514 namespace. (The tests passed with namespace.)
1515
41976786
AD
15162009-06-11 Akim Demaille <demaille@gostai.com>
1517
1518 style changes.
1519 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
1520 * src/print-xml.c: Style changes.
1521 * tests/conflicts.at: Comment changes.
1522
44bb9084
AD
15232009-06-11 Akim Demaille <demaille@gostai.com>
1524
1525 xml: beware of user strings used to give a %prec to rules.
1526 * tests/conflicts.at (%prec with user strings): New.
1527 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
1528 XML output.
1529
04d1e39d
AD
15302009-06-11 Akim Demaille <demaille@gostai.com>
1531
1532 hash: check insertion for memory exhaustion.
1533 * src/muscle-tab.c (muscle_insert, muscle_grow)
1534 * src/state.c (state_hash_insert): Check the return value of
1535 hash_insert.
1536
a8873669
AD
15372009-06-11 Akim Demaille <demaille@gostai.com>
1538
1539 tests: honor TESTSUITEFLAGS in every check target.
1540 * tests/local.mk (RUN_TESTSUITE): New.
1541 (check-local, installcheck-local, maintainer-check-g++)
1542 (maintainer-check-posix, maintainer-check-valgrind): Use it.
1543
8893145a
AD
15442009-06-10 Akim Demaille <demaille@gostai.com>
1545
1546 deterministic test suite.
1547 Some consistency checks on symbols are performed after all the
1548 symbols were read, by an iteration over the symbol table. This
1549 traversal is nondeterministic, which can be a problem for test
1550 cases.
1551 Avoid this.
1552 Addresses another form of nondeterminism reported by Joel E. Denny.
1553 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1554
1555 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
1556 test in two.
1557 Use different file names for the three tests to make the
1558 maintenance easier.
1559
92d7a23a
AD
15602009-06-10 Akim Demaille <demaille@gostai.com>
1561
1562 gnulib: update.
b0778bdd
EB
1563 * gnulib: Update to latest.
1564 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
1565 * m4/.gitignore: Regen.
1566 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
1567 Call xalloc_die on hash_insert failures.
1568 Requested by the new __warn_unused_result__ attribute of
1569 hash_insert.
92d7a23a 1570
12cf133f
AD
15712009-06-10 Akim Demaille <demaille@gostai.com>
1572
1573 deterministic user-token-number redeclaration errors.
1574 Address nondeterminism reported by Joel E. Denny.
1575 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1576
1577 * src/uniqstr.h: Comment changes.
1578 * src/location.h (boundary_cmp, location_cmp): New.
1579 * src/symtab.c (user_token_number_redeclaration): New.
1580 (symbol_translation): Use it.
1581 * tests/input.at (Numbered tokens): Adjust the expected output.
1582
796a2b0a
AD
15832009-05-25 Akim Demaille <demaille@gostai.com>
1584
1585 build: avoid ignored errors.
1586 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
1587 errors, they pollute the output.
1588
0b6d43c5
JD
15892009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1590
1591 Convert multiple variable definition warnings to complaints.
1592 * NEWS (2.5): Add a new entry for that change.
1593 * doc/bison.texinfo (Decl Summary): Update %define entry.
1594 (Bison Options): Update -D/--define/-F/--force-define entry.
1595 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
1596 * src/muscle-tab.h (muscle_percent_define_insert): Update
1597 comments.
1598 * tests/input.at (`%define errors'): Update.
1599 (`%define, --define, --force-define'): Update.
1600
de5ab940
JD
16012009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1602
1603 -F/--force-define and relative %define/-D/--define priorities.
1604 * NEWS (2.5): Add documentation to -D/--define entry.
1605 * build-aux/cross-options.pl: Hard-code association of
1606 --force-define with %define.
1607 * doc/bison.texinfo (Decl Summary): In %define entry,
1608 cross-reference command-line options.
1609 (Bison Options): Add documentation to -D/--define entry.
1610 (Option Cross Key): Widen column for --force-define row.
1611 * src/getargs.c (usage): Document -F/--force-define. Realign
1612 options in output.
1613 (short_options, long_options, getargs): Parse -F/--force-define,
1614 and update muscle_percent_define_insert invocations.
1615 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
1616 (muscle_percent_define_insert): Add argument with that type.
1617 * src/muscle-tab.c (muscle_percent_define_insert): Implement
1618 -F/--force-define behavior and priorities.
1619 (muscle_percent_define_ensure): Update
1620 muscle_percent_define_insert invocation.
1621 * src/parse-gram.y (prologue_declaration): Update
1622 muscle_percent_define_insert invocations.
1623 * tests/input.at (`%define, --define'): Rename to...
1624 (`%define, --define, --force-define'): ... this and extend.
1625
f8e7258f
JD
16262009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1627
1628 Update some comments to make sense for -D.
1629 * data/bison.m4 (b4_check_user_names): In header comments, say
1630 "user occurrence" instead of "grammar occurrence".
1631 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
1632 (muscle_percent_code_grow): Likewise just for consistency.
1633
b987342b
JD
16342009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1635
1636 * data/c++.m4 (b4_namespace_close): Simplify slightly.
1637
4977e0a7
JD
16382009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
1639
1640 Handle a trailing `:' in a user-supplied C++ namespace better.
1641 * data/c++.m4 (b4_namespace_close): Don't let it be printed
1642 among the closing braces here. This fix might make the
1643 generated code easier to debug, but otherwise it should be
1644 insignificant because a trailing `:' is a C++ error already.
1645
9b04dad7
AD
16462009-05-19 Akim Demaille <demaille@gostai.com>
1647
1648 remove useless variable.
1649 * src/getargs.c (skeleton_arg): Remove now useless variable.
1650 Should help the compiler see that this printf-like call is sane.
1651
4c6622c2
AD
16522009-05-15 Akim Demaille <demaille@gostai.com>
1653
1654 Rename token.prefix as api.tokens.prefix.
1655 Discussed here.
1656 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
1657
1658 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
1659 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
1660 (token.prefix): Rename as...
1661 (api.tokens.prefix): this.
1662
3c248d70
AD
16632009-05-11 Akim Demaille <demaille@gostai.com>
1664
1665 doc: use C++ headers.
1666 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
1667 headers.
1668
99c08fb6
AD
16692009-05-11 Akim Demaille <demaille@gostai.com>
1670
1671 doc: token.prefix
1672 * doc/bison.simple (Decl Summary): Document token.prefix.
1673 (Calc++ Parser): Various fixes.
1674 Formatting changes.
1675 Use token.prefix.
1676 Introduce a macro TOKEN to shorten the code and make it more
1677 readable.
1678 (Calc++ Scanner): Adjust.
1679 * NEWS (Variable token.prefix): New.
1680
84a1cb5a
AD
16812009-05-04 Akim Demaille <demaille@gostai.com>
1682
1683 bison: catch bad symbol names.
1684 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
1685 * tests/input.at: Adjust.
1686
cdf3f113
AD
16872009-05-04 Akim Demaille <demaille@gostai.com>
1688
1689 identifiers: dashes are letters.
1690 Dashes can now start identifiers (symbols and directives).
84a1cb5a 1691
cdf3f113
AD
1692 * src/scan-gram.l ({letter}): Add dash.
1693 ({id}): Remove it.
1694 * tests/input.at (Symbols): Adjust.
1695 Remove stray comment.
1696 * tests/regression.at (Invalid inputs): Adjust error message.
1697 * doc/bison.texinfo (Symbols): Update.
1698
98a345a2
JD
16992009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
1700
1701 Declare %code to be a permanent feature.
1702 * NEWS (2.4.2): Here.
1703 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
1704 experimental.
1705 (Decl Summary): Likewise.
1706
67212941
JD
17072009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1708
1709 Convert underscores to dashes in some %define variable names.
1710 For now, just api.push-pull and lr.keep-unreachable-states.
1711 Maintain old names for backward compatibility.
1712 * NEWS (2.5): Document.
1713 * data/c.m4 (b4_identification): Update comment.
1714 * data/yacc.c: Update access.
1715 * doc/bison.texinfo: Update.
1716 * etc/bench.pl.in (bench_push_parser): Update use.
1717 * src/files.c (tr): Move to...
1718 * src/getargs.c, src/getargs.h (tr): ... here because I can't
1719 think of a better place to expose it. My logic is that, for all
1720 uses of tr so far, command-line arguments can be involved, and
1721 getargs.h is already included.
1722 * src/main.c (main): Update access.
1723 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
1724 variable names to new variable names before assigning value.
1725 * src/reader.c (reader): Update setting default.
1726 * tests/calc.at: Update uses.
1727 * tests/conflicts.at (Unreachable States After Conflict
1728 Resolution): Update use.
1729 * tests/input.at (%define enum variables): Update use.
1730 (%define backward compatibility): New test group.
1731 * tests/push.at: Update uses.
1732 * tests/reduce.at: Update uses.
1733 * tests/torture.at: Update uses.
1734
ba5c6d94
JD
17352009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1736
1737 Set all front-end %define defaults in one place.
1738 * src/main.c (main): Move lr.keep_unreachable_states default...
1739 * src/reader.c (reader): ... to here.
1740
5bab9d08
JD
17412009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1742
1743 Rename lr.default_reductions to lr.default-reductions.
1744 * NEWS (2.5): Here.
1745 * doc/bison.texinfo: Here.
1746 * src/lalr.c (initialize_LA): Here.
1747 * src/print.c (print_reductions): Here.
1748 * src/reader.c (reader): Here.
1749 * src/tables.c (action_row): Here.
1750 * tests/input.at (%define enum variables): Here.
1751 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
1752
d521ee19
JD
17532009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1754
1755 Pacify ./configure --enable-gcc-warnings.
1756 * tests/input.at (Symbols): Prototype yyerror and yylex.
1757
17582009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
c9aded4b
JD
1759
1760 Document how `%define "var" "value"' is not M4-friendly.
1761 * src/parse-gram.y (variable): In comments here.
1762
8f0d265e
JD
17632009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1764
1765 Clean up recent patches a little.
1766 Reported by Akim Demaille.
1767 * doc/bison.texinfo (Understanding): Fix typos.
1768 * src/print.c (print_reductions): Don't use negated variable.
1769
f4909773
JD
17702009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1771
1772 List accepted values for a %define enum variable with an invalid value.
1773 Suggested by Akim Demaille at
1774 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
1775 * data/bison.m4 (_b4_percent_define_check_values): Implement.
1776 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
1777 * tests/input.at (%define lr.default_reductions invalid values): Merge
1778 into...
1779 (%define enum variables): ... here, and update output.
1780
110ef36a
JD
17812009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
1782
1783 Rename "default rule" to "default reduction".
1784 This includes changing variable names in code, changing
1785 comments, and renaming %define lr.default_rules to %define
1786 lr.default_reductions.
1787 * NEWS (2.5): Update IELR documentation.
1788 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
1789 documentation.
1790 * data/glr.c, data/lalr1.java: Sync copyright dates.
1791 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
1792 and lr.type documentation. Make some other wording
1793 improvements.
1794 (Glossary): Adjust cross-references and Default Reduction
1795 definition.
1796 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
1797 Remove a confusing comment pointed out by Akim Demaille.
1798 (initialize_LA): Adjust code.
1799 * src/print-xml.c (print_reductions): Adjust code.
1800 * src/print.c (print_reductions): Adjust code.
1801 * src/reader.c (reader): Adjust code.
1802 * src/tables.c (action_row): Adjust code.
1803 (token_actions): Adjust code.
1804 * src/tables.h: Adjust YYDEFACT documentation.
1805 * tests/input.at (%define lr.default_rules invalid values):
1806 Rename test group to...
1807 (%define lr.default_reductions invalid values): ... this, and
1808 update grammar file and expected output.
1809 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
1810 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
1811
746ee38c
AD
18122009-04-21 Akim Demaille <demaille@gostai.com>
1813
1814 tests: check the use of dashes and periods in symbols.
1815 * tests/input.at (Symbol): New test group.
1816
eb45ef3b
JD
18172009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1818
1819 Document %define lr.type and lr.default_rules.
1820 * NEWS (2.5): Add an entry.
1821 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
1822 besides just LALR(1) and GLR(1).
1823 * doc/bison.texinfo (Introduction): Likewise.
1824 (Language and Grammar): Bison is no longer limited to LALR(1)
1825 restrictions.
1826 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
1827 when trying to distinguish from GLR. Talk about LR(1) grammars
1828 rather than LALR(1) grammars.
1829 (Decl Summary): In %define api.push_pull entry, say it applies
1830 to deterministic parsers in C rather than LALR(1) parsers in C.
1831 Add lr.default_rules entry.
1832 Add lr.type entry.
1833 (Mystery Conflicts): Bison is no longer limited to LALR(1)
1834 restrictions.
1835 (Generalized LR Parsing): Same changes as for the previous GLR
1836 section.
1837 (Memory Management): Say deterministic rather than LALR(1).
1838 (Understanding): Correct some bison output.
1839 Index discussion of "accepting state".
1840 Say deterministic rather than LALR(1).
1841 (Bison Options): In --yacc entry, say deterministic rather than
1842 LALR(1).
1843 In --report, --graph, and --xml entries, just don't mention
1844 LALR(1).
1845 (C++ Parsers): Say deterministic rather than LALR(1).
1846 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
1847 (Glossary): Add Accepting State, Consistent State, Default Rule,
1848 and IELR(1) definitions.
1849 In Generalized LR (GLR) definition, make same changes as in
1850 previous GLR sections.
1851 In LALR(1) definition, say Bison uses LALR(1) by default rather
1852 than implying Bison is limited to LALR(1).
1853 (LocalWords): Add IELR.
1854
db34f798
JD
18552009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1856
1857 Finish implementing %define lr.type.
1858 Its value can be "LALR", "IELR", or "canonical LR".
1859 * lib/timevar.def (TV_IELR_PHASE1): New var.
1860 (TV_IELR_PHASE2): New var.
1861 (TV_IELR_PHASE3): New var.
1862 (TV_IELR_PHASE4): New var.
1863 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
1864 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
1865 Sbitset.h, ielr.h, and ielr.c.
1866 * src/getargs.h, src/getargs.c (enum trace, trace_args,
1867 trace_types): Add trace_ielr.
1868 * src/lalr.h, src/lalr.c (ngotos): Export it.
1869 (F): Rename to...
1870 (goto_follows): ... this, update all uses, and export it.
1871 (set_goto_map): Export it.
1872 (map_goto): Export it.
1873 (compute_lookahead_tokens): Don't free goto_follows yet. Now
1874 handled in ielr.
1875 (initialize_LA): Export it. Move lookback allocation to...
1876 (lalr): ... here because, for canonical LR, initialize_LA must
1877 be invoked but lookback and much of the rest of LALR isn't
1878 needed.
1879 * main.c (main): Instead of lalr, invoke ielr, which invokes
1880 lalr.
1881 * src/reader.c (reader): Default lr.type to "LALR".
1882 Default lr.default_rules to "accepting" if lr.type is "canonical
1883 LR". Leave the default as "all" otherwise.
1884 Check for a valid lr.type value.
1885 * src/state.h, src/state.c (struct state_list): Add state_list
1886 member.
1887 (state_new): Initialize state_list member to NULL.
1888 (state_new_isocore): New function, exported.
1889 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
1890 exercises all values of lr.type.
1891 (GNU AWK Grammar): Rename test group to...
1892 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
1893 AT_TEST_EXISTING_GRAMMAR.
1894 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
1895 (GNU pic Grammar): Rename test group to...
1896 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
1897 AT_TEST_EXISTING_GRAMMAR.
1898 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
1899 all values of lr.type.
1900 (Single State Split): New test groups using AT_TEST_LR_TYPE.
1901 (Lane Split): Likewise.
1902 (Complex Lane Split): Likewise.
1903 (Split During Added Lookahead Propagation): Likewise.
1904
7fe11bb5
JD
19052009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1906
1907 Add new files for IELR and canonical LR implementation.
1908 * src/AnnotationList.c: New.
1909 * src/AnnotationList.h: New.
1910 * src/InadequacyList.c: New.
1911 * src/InadequacyList.h: New.
1912 * src/Sbitset.c: New.
1913 * src/Sbitset.h: New.
1914 * src/ielr.c: New.
1915 * src/ielr.h: New.
1916
7254f6a8
JD
19172009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1918
1919 Implement %define lr.default_rules.
1920 Its value describes the states that are permitted to contain
1921 default rules: "all", "consistent", or "accepting".
1922 * src/reader.c (reader): Default lr.default_rules to "all".
1923 Check for a valid lr.default_rules value.
1924 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
1925 is "accepting", then only mark the accepting state as
1926 consistent.
1927 (initialize_LA): Tell state_lookahead_tokens_count whether
1928 lr.default_rules is "accepting".
1929 * src/tables.c (action_row): If lr.default_rules is not "all",
1930 then disable default rules in inconsistent states.
1931 * src/print.c (print_reductions): Use this opportunity to
1932 perform some assertions about whether lr.default_rules was
1933 obeyed correctly.
1934 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
1935 helps with checking the parser tables for a grammar.
1936 * tests/input.at (%define lr.default_rules invalid values): New
1937 test group.
1938 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
1939 AT_TEST_TABLES_AND_PARSE.
1940 (`no %define lr.default_rules'): New test group generated by
1941 AT_TEST_LR_DEFAULT_RULES.
1942 (`%define lr.default_rules "all"'): Likewise.
1943 (`%define lr.default_rules "consistent"'): Likewise.
1944 (`%define lr.default_rules "accepting"'): Likewise.
1945
72e727f2
AD
19462009-04-20 Akim Demaille <demaille@gostai.com>
1947
1948 Formatting change.
1949
90462b8d
AD
19502009-04-20 Akim Demaille <demaille@gostai.com>
1951
1952 bison: factoring.
1953 * src/output.c (token_definitions_output): Use symbol_id_get
1954 instead of duplicating its logic.
1955 * TODO (YYERRCODE): Extend.
1956
4f646c37
AD
19572009-04-20 Akim Demaille <demaille@gostai.com>
1958
71b00ed8
AD
1959 variables: prefer error-verbose to error_verbose.
1960 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
1961 instead of error_verbose.
1962 * src/scan-gram.l (%error-verbose): Map to the error-verbose
1963 variable.
1964 * doc/bison.texinfo: Promote %define error-verbose instead of
1965 %error-verbose.
1966 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
1967
19682009-04-15 Akim Demaille <demaille@gostai.com>
1969
4f646c37
AD
1970 variables: accept dashes.
1971 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
1972 underscores.
1973 * src/scan-gram.l ({id}): Also accept dashes after the initial
1974 letter.
1975 ({directive}): Use {id}.
1976 * src/parse-gram.y: Comment and formatting changes.
1977 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
1978 symbols.
1979 * src/complain.h, src/complain.c (yacc_at): New.
1980 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
1981 symbol names.
1982 * src/output.c (token_definitions_output): Do not #define token
1983 names with dashes.
1984
184e3179
AD
19852009-04-20 Akim Demaille <demaille@gostai.com>
1986
1987 Consistently refer to Yacc, not YACC.
1988 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
1989
41253c3a
JD
19902009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
1991
1992 Pacify make maintainer-check-posix.
1993 * tests/input.at (%define, --define): Move bison command-line
1994 options before grammar file name.
1995
197b82ba
JD
19962009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1997
1998 Document semicolon warnings.
1999 * NEWS (2.5): Here.
2000
0c90a1f5
AD
20012009-04-14 Akim Demaille <demaille@gostai.com>
2002
2003 variables: use `parse.assert' instead of `assert'.
2004 * TODO (assert): Remove.
2005 * data/bison.m4 (b4_assert_if): Replace with...
2006 (b4_parse_assert_if): this.
2007 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
2008 * doc/bison.texinfo (Decl Summary): Document parse.assert.
2009
fa819509
AD
20102009-04-14 Akim Demaille <demaille@gostai.com>
2011
16dc0d90 2012 variables: use `parse.trace' instead of `debug'.
fa819509
AD
2013 * src/getargs.c (getargs): Map -t to %define trace.parse.
2014 * src/scan-gram.l (%debug): Map to %define trace.parse.
2015 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
2016 names to `_' in macro names.
2017 (b4_debug_if): Replace with...
2018 (b4_parse_trace_if): this.
2019 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2020 * data/yacc.c: Adjust.
2021 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
2022 Use @code to label the variable list.
2023 Document the variable parse.trace.
2024 (Tracing): Promote the parse.trace variable.
2025 * TODO: %printer is not documented.
2026
f7dae1ea
AD
20272009-04-14 Akim Demaille <demaille@gostai.com>
2028
2029 doc: minor fixes.
2030 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
2031 (Table of Symbols): Remove duplicate entry for %debug.
2032
3535c071
EB
20332009-04-10 Eric Blake <ebb9@byu.net>
2034
2035 submodules: update to latest
2036 * submodules/autoconf: Use latest upstream Autoconf.
2037
cf48f675
EB
20382009-04-06 Eric Blake <ebb9@byu.net>
2039
2040 Work around autoconf 2.63b bug in testsuite.
2041 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
2042 autoconf bug related to # in test.
2043
50cca368
JD
20442009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2045
2046 * NEWS (2.5): New section. Describe new -D/--define feature.
2047
3583d96b
AD
20482009-04-06 Akim Demaille <demaille@gostai.com>
2049
2050 Regen.
2051 * src/parse-gram.h, src/parse-gram.c: Regen.
2052
00f5d575
AD
20532009-04-06 Akim Demaille <demaille@gostai.com>
2054
2055 rename muscle_tab.* as muscle-tab.* for consistency.
2056 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
2057 * src/muscle-tab.h, src/muscle-tab.c: these.
2058 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
2059 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
2060
76bf5102
AD
20612009-04-06 Akim Demaille <demaille@gostai.com>
2062
2063 Makefile: introduce $(BISON).
2064 * src/local.mk (BISON): New.
2065 (YACC): Use it.
2066
bc0f5737
AD
20672009-04-06 Akim Demaille <demaille@gostai.com>
2068
2069 parser: handle %locations as %define locations.
2070 * src/getargs.h, src/getargs.c (locations_flag): Remove.
2071 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
2072 to set "locations" to true.
2073 * src/output.c (prepare): Don't output "locations".
2074 * src/scan-gram.l (%locations): Handle it as a %<flag>.
2075 * src/parse-gram.y: It's no longer a token.
2076 Don't handle it.
2077 * data/bison.m4 (b4_locations_if): Define it with
2078 b4_percent_define_if_define.
2079 * data/c.m4, data/glr.cc: Adjust.
2080
697c912f
AD
20812009-04-06 Akim Demaille <demaille@gostai.com>
2082
2083 Regen.
2084 * src/parse-gram.c: Regen.
2085
4920ae8b
AD
20862009-04-06 Akim Demaille <demaille@gostai.com>
2087
2088 muscle: factor the handling of obsolete of obsolete directives.
2089 Suggested by Joel E. Denny.
50cca368 2090
4920ae8b
AD
2091 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
2092 New, extracted from...
2093 * src/parse-gram.y (prologue_declaration: pure-parser): here.
2094 Remove it.
2095 (prologue_declaration: "%<flag>"): Use
2096 muscle_percent_define_ensure.
2097 (%error-verbose, %pure-parser): No longer tokens.
2098 * src/scan-gram.l (pure-parser): Return as a %<flag>.
2099
1d5b3c08
JD
21002009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2101
2102 Fix options documentation.
2103 * build-aux/cross-options.pl: As in --help output, write optional
2104 arguments as [=ARG] not =[ARG].
2105 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
2106
62c99cf4
JD
21072009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2108
2109 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
2110 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
2111 requirements for a correct m4 are stricter.
2112 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
2113 * configure.ac: Update to use AC_PROG_GNU_M4.
2114 Reported by Eric Blake.
2115
1c93f35b
JD
21162009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2117
2118 Help with updating web manual.
2119 * HACKING: Incorporate instructions from gnulib/doc/README.
2120 * bootstrap.conf (gnulib_modules): Add gendocs.
2121
86cfae0a
AD
21222009-04-03 Akim Demaille <demaille@gostai.com>
2123
2124 Regen.
2125 * src/parse-gram.h, src/parse-gram.c: Regen.
2126
ba061fa6
AD
21272009-04-03 Akim Demaille <demaille@gostai.com>
2128
2129 Factor %FLAG at scan level.
2130 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
2131 definitions and associated rules, replaced by....
2132 (PERCENT_FLAG): this new token type, and rule.
2133 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
2134 Use it for %debug and %error-verbose.
2135
b19ebeb3
AD
21362009-04-03 Akim Demaille <demaille@gostai.com>
2137
2138 Regen.
2139 * src/parse-gram.h, src/parse-gram.c: Regen.
2140
001a16a9
AD
21412009-04-03 Akim Demaille <demaille@gostai.com>
2142
2143 Treat %debug as %define debug.
2144 * data/bison.m4 (b4_debug_if): New.
2145 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
2146 * data/lalr1.java: Use it instead of b4_debug_flag.
2147 * src/getargs.h, src/getargs.c (debug_flag): Remove.
2148 * src/output.c (prepare): Don't output it.
2149 * src/parse-gram.y: Treat %debug as %define debug.
2150
21512009-04-03 Akim Demaille <demaille@gostai.com>
2152
2153 Treat %error-verbose as %define error_verbose.
2154 This allows to pass -Derror_verbose on the command line. Better
2155 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
2156 ERROR_VERBOSE being defined as false or true.
2157 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
2158 on b4_percent_define_ifdef, for does not check the defined value,
2159 but only whether the symbol is defined, rely on
2160 b4_percent_define_flag_if, so that a value of "false" is processed
2161 as a false.
2162 If not defined, define the flag to "false".
2163 (b4_error_verbose_if): New.
2164 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
2165 b4_error_verbose_flag.
2166 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
2167 * src/output.c (prepare): Don't output it.
2168 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
2169
92822aff
JD
21702009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2171
2172 Fix strange %define locations for default values.
2173 Reported by Akim Demaille at
2174 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
2175 and discussed again starting at
2176 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
2177 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
2178 because location information is bogus.
2179 Use angle brackets to delimit fake file name because square brackets
2180 look like underexpanded m4. Choose a better fake file name.
2181 Use negative line numbers.
2182 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
2183 * src/location.c (location_print): If line for a boundary is negative,
2184 only print that boundary's file name.
2185 * src/location.h: Document that.
2186 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2187 defaults): Update output.
2188
e021191b
JD
21892009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2190
2191 Pacify ./configure --enable-gcc-warnings.
2192 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
2193 in lib won't compile with it.
2194 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
2195
78f65418
AD
21962009-03-31 Akim Demaille <demaille@gostai.com>
2197
2198 bootstrap: --help to stdout.
2199 * bootstrap (usage): Don't send --help to stderr.
2200 Use a here doc instead of a long string.
2201
f7e241f4
AD
22022009-03-31 Akim Demaille <demaille@gostai.com>
2203
2204 bootstrap: README-hacking no longer exists
2205 * bootstrap (checkout_only_file): Set to HACKING.
2206
31d3e510
AD
22072009-03-26 Akim Demaille <demaille@gostai.com>
2208
2209 doc: merge HACKING and README-hacking.
2210 Two files is confusing.
2211 Reported by Alexandre Duret-Lutz.
1f9d8248 2212
31d3e510
AD
2213 * README-hacking: Merge into...
2214 * HACKING (Working from the repository): here.
2215
81535bfa
AD
22162009-03-26 Akim Demaille <demaille@gostai.com>
2217
2218 doc: update README-hacking.
2219 * README-hacking: We now use git and git submodules.
2220 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
2221
56f772e9
AD
22222009-03-26 Akim Demaille <demaille@gostai.com>
2223
2224 lalr1.cc: avoid GCC 4.3 warnings.
2225 GCC 4.3 now warns about "a || b && c" and asks for explicit
2226 parentheses.
2227 Reported by Alexandre Duret-Lutz.
2228 * data/location.cc: Update copyright years.
2229 (Position::operator==): Use parens to make precedence explicit.
2230 Compare lines and columns first, as they are more likely to be
2231 different, and they are faster to compare.
2232
11c073b7
AD
22332009-03-26 Akim Demaille <demaille@gostai.com>
2234
2235 gnulib: update.
2236 * gnulib: Update to latest.
2237 * src/local.mk (AM_CFLAGS): Move to...
2238 * Makefile.am: here.
2239 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
2240 AM_CFLAGS.
2241
91be6b28
AD
22422009-03-02 Akim Demaille <demaille@gostai.com>
2243
2244 Comment changes.
2245
cbf25ce7
AD
22462009-03-02 Akim Demaille <demaille@gostai.com>
2247
2248 Share b4_yytranslate_define.
2249 * data/lalr1.cc (b4_yytranslate_define): Move to...
2250 * data/c++.m4: here.
2251
882f02ed
AD
22522009-03-02 Akim Demaille <demaille@gostai.com>
2253
2254 Use locations in the variant example.
1f9d8248
AD
2255 Yes, this obfuscates the point of this example, variants only.
2256 But glr.cc cannot work (yet?) without locations. This change
2257 makes it easier to use this example with glr.cc.
11c073b7 2258
882f02ed
AD
2259 * examples/variant.yy (assert): %define it.
2260 (locations): Request them.
2261 (yylex): Bind the location to the stage.
2262
0623bacc
AD
22632009-03-02 Akim Demaille <demaille@gostai.com>
2264
2265 Dub make_TOKEN as a public type interface.
2266 * data/c++.m4 (b4_symbol_constructor_declare)
2267 (b4_symbol_constructor_define): New empty stubs.
2268 (b4_public_types_declare, b4_public_types_define): Use them.
2269 * data/lalr1.cc (b4_symbol_constructor_declare)
2270 (b4_symbol_constructor_declare_)
2271 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
2272 Move to...
2273 * data/variant.hh: here.
2274 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
2275 needed.
2276 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
2277 b4_symbol_constructor_declare, as it is now done by
2278 b4_public_types_define and b4_public_types_declare.
2279
5f5a90df
AD
22802009-03-02 Akim Demaille <demaille@gostai.com>
2281
2282 Coding style changes.
2283 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2284 (b4_symbol_constructor_declarations)
2285 (b4_symbol_constructor_definition_)
2286 (b4_symbol_constructor_definitions)
2287 (b4_yytranslate_definition): Rename as...
2288 (b4_symbol_constructor_declare_)
2289 (b4_symbol_constructor_declare)
2290 (b4_symbol_constructor_define_)
2291 (b4_symbol_constructor_define)
2292 (b4_yytranslate_define): these.
2293 * data/variant.hh (b4_variant_definition): Rename as...
2294 (b4_variant_define): this.
2295
b47b6ff7
AD
22962009-03-02 Akim Demaille <demaille@gostai.com>
2297
2298 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
2299 * data/bison.m4 (b4_percent_define_if_define): New.
2300 * data/c++.m4 (b4_variant_if): Move to...
2301 * data/bison.m4: Here, using b4_percent_define_if_define.
2302 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
2303 * data/bison.m4: Here, using b4_percent_define_if_define.
2304
1d6b689b
AD
23052009-03-02 Akim Demaille <demaille@gostai.com>
2306
2307 Dub symbol_type_base as a public type.
2308 * data/c++.m4 (b4_public_types_declare): Now define
2309 symbol_type_base and symbol_type.
2310 (b4_public_types_define): New.
2311 In both cases, the definitions are taken verbatim from lalr1.cc.
2312 * data/lalr1.cc: Adjust.
2313
4f84717d
AD
23142009-03-02 Akim Demaille <demaille@gostai.com>
2315
2316 b4_public_types_declare.
2317 * data/c++.m4 (b4_public_types_declare): New.
2318 * data/glr.cc, data/lalr1.cc: Use it.
2319
b9e4eb5b
AD
23202009-03-02 Akim Demaille <demaille@gostai.com>
2321
2322 b4_semantic_type_declare.
2323 * data/c++.m4 (b4_semantic_type_declare): New.
2324 Factors and generalizes what was in glr.cc and lalr1.cc.
2325 * data/variant.hh (b4_semantic_type_declare): Redefine it for
2326 variants.
2327 * data/lalr1.cc, data/glr.cc: Use it.
2328
6a6e7f0c
AD
23292009-02-26 Akim Demaille <demaille@gostai.com>
2330
2331 Upgrade gnulib.
2332 * gnulib: Upgrade from master.
2333 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
2334 Regen.
2335
e9e61b00
AD
23362009-02-25 Akim Demaille <demaille@gostai.com>
2337
2338 Remove useless arguments.
2339 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
2340 relevant.
2341
3eead995
AD
23422009-02-25 Akim Demaille <demaille@gostai.com>
2343
2344 Comment changes.
2345 * data/lalr1.cc: here.
2346
87f28efe
AD
23472009-02-25 Akim Demaille <demaille@gostai.com>
2348
2349 Fix glr.cc's debug level handling.
2350 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
2351 glr.c which is used.
2352 (debug_level, set_debug_level): Adjust.
2353
9be2a009
AD
23542009-02-25 Akim Demaille <demaille@gostai.com>
2355
2356 Copyright years.
2357 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
2358
07a6e87d
AD
23592009-02-25 Akim Demaille <demaille@gostai.com>
2360
2361 Style changes.
2362 * etc/bench.pl.in (generate_grammar_list): Consitently use
2363 location_type, not yy::location.
2364
33c78bd2
AD
23652009-02-25 Akim Demaille <demaille@gostai.com>
2366
2367 Comment change.
2368 * data/lalr1.cc: here.
2369
49572920
AD
23702009-02-19 Akim Demaille <demaille@gostai.com>
2371
2372 Make yyparser::error public.
2373 * data/lalr1.cc: here.
2374 There is no good reason to keep it private (and it is convenient
2375 to use it from the scanner for instance). It is already public in
2376 glr.cc.
2377
88654b47
AD
23782009-02-19 Akim Demaille <demaille@gostai.com>
2379
2380 Comment changes.
2381 * data/glr.cc: here.
2382
4524c55b
AD
23832009-02-19 Akim Demaille <demaille@gostai.com>
2384
2385 Remove trailing blanks.
6a6e7f0c
AD
2386 The epilogue has its own ending \n, no need to add another.
2387
4524c55b
AD
2388 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
2389 epilogue.
2390 * data/glr.cc: dnl when extending the epilogue.
2391 Remove stray "private:".
2392
6ceccee8
AD
23932009-02-19 Akim Demaille <demaille@gostai.com>
2394
2395 Use b4_c_modern.
2396 * data/c.m4 (b4_c_function_decl): Here.
2397
9c6a8966
AD
23982009-02-19 Akim Demaille <demaille@gostai.com>
2399
2400 Comment changes.
2401 * data/lalr1.cc: here.
2402
507aa0e2
AD
24032009-02-19 Akim Demaille <demaille@gostai.com>
2404
2405 Extract variant.hh
2406 * data/variant.hh: New, extracted from...
2407 * data/lalr1.cc: here.
2408 Adjust.
2409 * data/local.mk: Adjust.
2410
51bacae6
AD
24112009-02-19 Akim Demaille <demaille@gostai.com>
2412
2413 Extract stack.hh from lalr1.cc.
2414 * data/stack.hh: New.
2415 * data/lalr1.cc: Extract from here.
2416 * data/local.mk: Adjust.
2417
06c3084f
JD
24182009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
2419
2420 Add reminder about uploading public key to keys.gnupg.net.
2421 * HACKING (Release Procedure): Here.
2422
0ea583d2
AD
24232009-01-28 Akim Demaille <demaille@gostai.com>
2424
2425 * NEWS: Update information about 2.4.1 and 2.4.2.
2426
402b123d
AD
24272008-11-04 Akim Demaille <demaille@gostai.com>
2428
2429 Reformat NEWS.
2430 * NEWS: Use more outline-mode markup.
2431 Suggested by Jim Meyering.
2432
74553c98
AD
24332009-01-08 Akim Demaille <demaille@gostai.com>
2434
2435 Fix grep portability issues.
2436 Grep on Solaris does not support -q.
2437 Reported by Summum Bonum.
2438
2439 * NEWS: Add a stub for 2.4.2.
2440 * THANKS: Add Summum Bonum.
2441 * tests/atlocal.in (EGREP): New.
2442 (CC, CXX, XSLTPROC): Make it possible to override them via
2443 envvars.
2444 * tests/java.at: Use $EGREP instead of egrep.
2445 Use AT_CHECK's ignore instead of grep's -q.
2446
84eedf86
AD
24472008-12-11 Akim Demaille <demaille@gostai.com>
2448
2449 Pass the token type to yysyntax_error.
2450 * data/yacc.c (yysyntax_error): Take the transated token instead
2451 of the raw number.
2452 Adjust callers.
2453 * TODO: Update.
2454
5860cc8c
AD
24552008-12-11 Akim Demaille <demaille@gostai.com>
2456
2457 Formatting changes.
2458 * data/glr.c: Formatting changes.
2459
2b008529
AD
24602008-12-11 Akim Demaille <demaille@gostai.com>
2461
2462 Propagate i18n changes into glr.c.
2463 * TODO: Update.
2464 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
2465 building the error message format dynamically.
2466 * data/lalr1.java: Formatting changes.
2467
2cd1af95
AD
24682008-12-11 Akim Demaille <demaille@gostai.com>
2469
2470 Use testsuite -C.
2471 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
2472 Solves problems when top_srcdir is an absolute path.
2473 Suggested by Eric Blake.
2474 * configure.ac: Require Autoconf 2.62.
2475
eeb29422
AD
24762008-12-11 Akim Demaille <demaille@gostai.com>
2477
2478 Simplify the i18n of the error messages.
2479 * data/lalr1.cc: Comment changes.
2480 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
2481 lalr1.cc instead of building dynamically the format string.
2482
6617622c
AD
24832008-12-08 Akim Demaille <demaille@gostai.com>
2484
2485 Fix portability issue in the test suite.
2486 * tests/local.at (AT_MATCHES_CHECK): New.
2487 Based on Perl instead of Sed. Sed has too many portability
2488 pitfalls, not ever Sed is GNU Sed.
2489 * tests/actions.at (Fix user actions without a trailing semicolon):
2490 Use it.
2491
2ca1136c
AD
24922008-12-08 Akim Demaille <demaille@gostai.com>
2493
2494 Update data/README.
2495 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
2496
6c63b895
AD
24972008-12-08 Akim Demaille <demaille@gostai.com>
2498
2499 Install autoconf as a submodule to get m4sugar.
2500 * .gitmodules: Add submodules/autoconf.
2501 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
2502 submodules/autoconf.
2503
417e31d2
AD
25042008-12-08 Akim Demaille <demaille@gostai.com>
2505
2506 Test token.prefix in all the skeletons.
2507 * data/java.m4 (b4_token_enum): Use the token.prefix.
2508 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
2509 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
2510 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
2511 * tests/java.at: Comment changes.
2512 (AT_CHECK_JAVA_MINIMAL): Define the END token.
2513 (Java parser class and package names): Add token.prefix check.
2514
97abf544
AD
25152008-12-08 Akim Demaille <demaille@gostai.com>
2516
2517 Fix regeneration of atconfig.
2518 * tests/local.mk (tests/atconfig): The rule was incorrect, but
2519 remove it: now that there is no tests/Makefile.am, the top-level
2520 Makefile properly updates atconfig when needed.
2521
e8cd1ad6
DJ
25222008-12-07 Di-an Jan <dianj@freeshell.org>
2523
2524 Implement the FIXME that ends an user action with a semicolon
2525 if it seems necessary.
2526 * src/scan-code.l (flex rules section): Flag cpp directive from
2527 any `#' to the first unescaped end-of-line. Semicolon is not
2528 needed after `;', `{', '}', or cpp directives and is needed after
2529 any other token (whitespaces and comments have no effect).
2530 * tests/actions.at (Fix user actions without a trailing semicolon):
2531 New test.
2532 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
2533 to make user actions complete statements.
2534 Adjust column numbers in error messages.
2535 * tests/regression.at (Fix user actions without a trailing semicolon):
2536 Remove. Covered by new test.
2537
ce9447fc
AD
25382008-12-07 Akim Demaille <demaille@gostai.com>
2539
2540 Update gnulib.
2541 * gnulib: Update from master.
2542
d333175f
EB
25432008-12-05 Eric Blake <ebb9@byu.net>
2544
2545 Avoid compiler warning.
2546 * src/output.c (muscle_insert_item_number_table): Delete unused
2547 function.
2548
215b40ac
EB
25492008-12-02 Eric Blake <ebb9@byu.net>
2550
2551 Build testsuite with newer autoconf.
2552 * tests/output.at (m4_expand): Don't override in newer autoconf,
2553 where the underlying implementation changed.
2554 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
2555 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
2556 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
2557 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
2558 since some of them contain unbalanced ')'.
2559
3bb21113
AD
25602008-12-01 Akim Demaille <demaille@gostai.com>
2561
2562 Use b4_symbol for printers and destructors everywhere.
2563 * data/bison.m4 (b4_symbol_action_location): New.
2564 * data/c.m4 (b4_symbol_actions): Remove.
2565 Adjust all callers to use by b4_symbol_foreach and the corresponding
2566 b4_symbol_printer/destructor macro.
2567 * data/glr.cc: Adjust.
2568 * data/lalr1.java: Adjust the %destructor sanity check.
2569 * src/output.c (symbol_code_props_output): Remove, we no longer
2570 need the b4_symbol_printers/destructors tables.
2571
fb7c5b1f
AD
25722008-12-01 Akim Demaille <demaille@gostai.com>
2573
2574 Use b4_symbol_case_.
2575 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
2576 b4_symbol_case_.
2577
cf6fb222
AD
25782008-12-01 Akim Demaille <demaille@gostai.com>
2579
2580 Move b4_symbol based macro to bison.m4.
2581 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
2582 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
2583 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
2584 (b4_type_foreach): Move to...
2585 * data/bison.m4: Here.
2586 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
2587 b4_symbol_value_template instead of b4_symbol_value.
cf6fb222 2588
e3c52a63
AD
25892008-12-01 Akim Demaille <demaille@gostai.com>
2590
2591 b4_symbol/type_foreach.
2592 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
2593 Use them.
2594
2bde9113
AD
25952008-12-01 Akim Demaille <demaille@gostai.com>
2596
2597 Use the symbol properties to output the printer/destructor for lalr1.cc.
30c10faf
AD
2598 Instead of defining complex list of tuples to define various
2599 properties of the symbols, we now prefer to define symbols as
2600 "structs" in m4: using the symbol key (its number), and the
2601 property name, b4_symbol gives it value. Use this to handle
2602 destructors and printers.
2603
2bde9113
AD
2604 * src/output.c (CODE_PROP): New.
2605 (prepare_symbol_definitions): Use it to define the printer and
2606 destructor related attributes of the symbols.
2607 * data/lalr1.cc (b4_symbol_actions): Rename as...
2608 (b4_symbol_action): this.
2609 Use b4_symbol instead of 6 arguments.
2610 (b4_symbol_printer, b4_symbol_destructor): New.
2611 Use them instead of b4_symbol_actions.
2612
44494bf6
AD
26132008-12-01 Akim Demaille <demaille@gostai.com>
2614
2615 Avoid capturing variables too easily.
2616 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
2617 v__ and p__ instead of v and p.
2618
fad814bd
AD
26192008-12-01 Akim Demaille <demaille@gostai.com>
2620
2621 Remove spurious empty line before syncline.
2622 * data/bison.m4 (b4_syncline): Don't output an empty line before
2623 the output.
2624
feda5527
AD
26252008-11-26 Akim Demaille <demaille@gostai.com>
2626
2627 Convert lib/Makefile.am into lib/local.mk.
2628 The real problem is rather gnulib.mk, which itself is extracted
2629 from a Makefile.am that gnulib expects to the "recursive". The
2630 tool prefix-gnulib-mk converts such a gnulib.mk to be
2631 non-recursive. Also, some AC_SUBST variables need to be adjusted.
2632
2633 * etc/prefix-gnulib-mk: New.
2634 * bootstrap (slurp): Use it to convert further gnulib.mk.
2635 No longer try to avoid re-creation of lib/gnulib.mk as the changes
2636 are deeper.
2637 * lib/Makefile.am: Rename as...
2638 * lib/local.mk: this.
2639 Adjust to be prefixed.
2640 * Makefile.am, configure.ac: Adjust.
2641 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
2642
56ddee7f
AD
26432008-11-26 Akim Demaille <demaille@gostai.com>
2644
2645 s/_FLAGS/FLAGS/.
2646 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
2647 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
2648 Reported by Eric Blake.
2649
728e89a0
AD
26502008-11-26 Akim Demaille <demaille@gostai.com>
2651
2652 Use b4_parser_tables_define in glr.cc.
2653 * data/glr.c: Use b4_parser_tables_define instead of defining the
2654 (deterministic integral) tables by hand.
2655
2c1bf9bd
AD
26562008-11-26 Akim Demaille <demaille@gostai.com>
2657
2658 Use b4_parser_tables_define in Java.
2659 * data/java.m4 (b4_typed_parser_table): Rename as...
2660 (b4_typed_parser_table_define): this, for consistency.
2661 Accept a comment as $4.
2662 Move $2 into yy*_.
2663 (b4_integral_parser_table): Rename as...
2664 (b4_integral_parser_table_define): this.
2665 * data/lalr1.java: Adjust all uses.
2666 Use b4_parser_tables_define instead of generation by hand.
2667
ba206cf4
AD
26682008-11-26 Akim Demaille <demaille@gostai.com>
2669
2670 Prepare the convergence bw C style and Java table generation.
2671 * data/bison.m4 (b4_tables_map, b4_tables_declare)
2672 (b4_tables_define): Rename as...
2673 (b4_integral_parser_tables_map, b4_parser_tables_declare)
2674 (b4_parser_tables_define): these.
2675 * data/c.m4 (b4_table_define): Rename as...
2676 (b4_integral_parser_table_define): this.
2677 * data/lalr1.cc: Adjust.
2678 (b4_table_define, b4_table_declare): Rename as...
2679 (b4_integral_parser_table_define)
2680 (b4_integral_parser_table_declare): these.
2681 (yyrline_): Move the comment where it is actually used.
2682 * data/yacc.c: Adjust.
2683 (yyrline): Use b4_integral_parser_table_define.
2684
d12f8e49
AD
26852008-11-26 Akim Demaille <demaille@gostai.com>
2686
2687 Regen.
2688 * src/parse-gram.h, src/parse-gram.c: Regen.
2689
0991e29b
AD
26902008-11-26 Akim Demaille <demaille@gostai.com>
2691
2692 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
2693 * data/lalr1.cc (b4_tables_map): Move to...
2694 * data/bison.m4: here.
2695 Update the comment for yytable during the flight.
2696 (b4_tables_declare, b4_tables_define): New.
2697 * data/lalr1.cc: Use them.
2698 * data/c.m4 (b4_table_define): New.
2699 * data/yacc.c: Use b4_tables_define instead of output the tables
2700 by hand.
2701 * tests/regression.at (Web2c Actions): Adjust the expected output,
2702 the order of the tables changed.
2703
3d3bc1fe
AD
27042008-11-26 Akim Demaille <demaille@gostai.com>
2705
2706 Get rid of (yy)rhs and (yy)prhs.
2707 These tables are no longer needed in the parsers, and they don't seem to
2708 be useful. They are not documented either.
feda5527 2709
3d3bc1fe
AD
2710 * src/output.c (prepare_rules): Get rid of rhs and prhs.
2711 Adjust the computation of (yy)r2.
2712
08c81469
AD
27132008-11-26 Akim Demaille <demaille@gostai.com>
2714
2715 Rule length is unsigned.
2716 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
2717
932b0c96
AD
27182008-11-26 Akim Demaille <demaille@gostai.com>
2719
2720 Get rid of lalr1-split.cc.
2721 It was no longer maintainer.
feda5527 2722
932b0c96
AD
2723 * data/lalr1-split.cc: Remove.
2724 * etc/bench.pl.in (bench_fusion_parser): Remove.
2725 Adjust.
2726
8452c667
AD
27272008-11-26 Akim Demaille <demaille@gostai.com>
2728
2729 Use yy* consistently.
2730 * data/glr.c: Now that yyrhs no longer exists as a global
2731 variable, rename local "rhs" variables into "yyrhs" for
2732 consistency.
2733
783aa653
AD
27342008-11-25 Akim Demaille <demaille@gostai.com>
2735
2736 Get rid of yyrhs and yyprhs in glr.c.
2737 * data/glr.c (yyrhs, yyprhs): Remove.
2738 Instead, use the state stack and yystos.
2739
6130b755
AD
27402008-11-25 Akim Demaille <demaille@gostai.com>
2741
2742 Flag glr tests.
2743 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
2744 as an Autotest keyword.
2745
95a7b1c9
AD
27462008-11-25 Akim Demaille <demaille@gostai.com>
2747
2748 Prefer TESTSUITE_FLAGS.
2749 TESTSUITEFLAGS is barely readable.
feda5527 2750
95a7b1c9
AD
2751 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
2752 for backward compatibility.
2753 Use the former instead of the latter.
2754
b4f18401
AD
27552008-11-25 Akim Demaille <demaille@gostai.com>
2756
2757 Get rid of yyrhs and yyprhs in larl1.java.
2758 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
2759 (yy_reduce_print): Rather, use yystos_ and the state stack.
2760
c265fd6b
AD
27612008-11-25 Akim Demaille <demaille@gostai.com>
2762
2763 Formatting changes.
2764
68dbdee8
AD
27652008-11-25 Akim Demaille <demaille@gostai.com>
2766
2767 Get rid of yyrhs and yyprhs in yacc.c.
30c10faf
AD
2768 They were used to get the symbol types, given a rule number, when
2769 displaying the top of the stack before a reduction. But the
2770 symbol type is available from the state stack. This has two be
2771 benefits: two tables less in the parser (making it smaller), and a
2772 more consistent use of the three stacks which will help to fuse
2773 them.
feda5527 2774
68dbdee8
AD
2775 * data/yacc.c (yyprhs, yyrhs): Remove.
2776 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
2777 (yy_reduce_print): Take yyssp as argument.
2778 Use it, together with yystos, to get the symbol type.
2779 * tests/regression.at (Web2c Report): Remove these tables from the
2780 expected output.
2781
6ab1adbe
AD
27822008-11-25 Akim Demaille <demaille@gostai.com>
2783
2784 b4_tables_map.
2785 The point is to factor the generation of the tables across skeletons.
2786 This is language dependant.
feda5527 2787
6ab1adbe
AD
2788 * data/c.m4 (b4_comment_): New.
2789 Should be usable to define how to generate tables independently of
2790 the language.
2791 (b4_c_comment): New.
2792 (b4_comment): Bounce to b4_c_comment.
2793 Now support $2 = [PREFIX] for indentation.
2794 * data/lalr1.cc (b4_table_declare): Don't output a comment if
2795 there is no comment.
2796 Indent it properly when there is one.
2797 Output the ending semicolon.
2798 (b4_table_define): Space changes.
2799 Output the ending semicolon.
2800 (b4_tables_map): New.
2801 Use it twice instead of declaring and defining the (integral)
2802 tables by hand.
2803
0fddb3d5
AD
28042008-11-25 Akim Demaille <demaille@gostai.com>
2805
2806 b4_table_declare.
2807 * data/lalr1.cc (b4_table_declare): New.
2808 Use it to declare the tables defined with b4_table_define.
2809 (b4_table_define): Declare a third arg to match b4_table_declare
2810 signature.
2811 Move all the comments around invocations of b4_table_define into
2812 the invocations itselves.
2813 Move things around to have the order for declarations and
2814 definitions.
2815
c4ddc0fb
AD
28162008-11-25 Akim Demaille <demaille@gostai.com>
2817
2818 Formatting changes.
2819 * data/lalr1.java: here.
2820
e0c653e7
AD
28212008-11-25 Akim Demaille <demaille@gostai.com>
2822
2823 b4_args is more general than only C++.
2824 * data/lalr1.cc (b4_args, _b4_args): Move to...
2825 * data/bison.m4: here.
2826
4182a0a1
DJ
28272008-11-21 Di-an Jan <dianj@freeshell.org>
2828
2829 Implement no-XXX arguments for --warnings, --report, --trace.
2830 * src/getargs.c (flags_argmatch): Handles no-XXX.
2831 Fix typo in doxygen comment.
2832
01466c3e
AD
28332008-11-21 Akim Demaille <demaille@gostai.com>
2834
2835 Display the changes in cross-options.texi.
2836 * build-aux/cross-options.pl ($sep): New, to separate items.
2837 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
2838 changes.
2839
a7c09cba
DJ
28402008-11-20 Di-an Jan <dianj@freeshell.org>
2841
2842 Improves options in the manual.
2843 * doc/bison.texinfo (-g, -x): Add space before argument.
2844 (Option Cross Key): Implement FIXME: listing directives also.
2845 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
2846 (Short Option): Special case -d. Put arguments inside @option.
feda5527 2847 (Bison Directive): Add column, automatically extracted from
a7c09cba
DJ
2848 src/scan-gram.l (actual name passed as the first argument)
2849 with special case for %define.
2850 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
2851 to build-aux/cross-options.pl.
2852 * src/getargs.c (usage): Document limitations of cross-options.pl.
2853 * src/scan-gram.l: Likewise.
2854
6c88b51e
JD
28552008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2856
2857 Fix unexpanded macros in GLR defines file.
2858 Reported by Csaba Raduly at
2859 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
2860 * THANKS (Csaba Raduly): Add.
2861 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
2862 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
2863 lexer in a separate module that includes the defines file.
2864 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
2865 source.
2866 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
2867 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
2868 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
2869 (AT_DATA_SOURCE_PROLOGUE): New.
2870 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
2871 (AT_DATA_SOURCE): New.
2872 (AT_FULL_COMPILE): Extend to support an additional source file.
2873
1e034807
AD
28742008-11-18 Akim Demaille <demaille@gostai.com>
2875
2876 More TODO.
2877 * TODO: More short term issues.
2878
e3dda35c
AD
28792008-11-18 Akim Demaille <demaille@gostai.com>
2880
2881 Regen.
2882 * src/parse-gram.h, src/parse-gram.c: Regen.
2883
bd187d7b
AD
28842008-11-18 Akim Demaille <demaille@gostai.com>
2885
2886 Use b4_subtract where possible.
2887 * data/lalr1.cc (b4_subtract): Move to...
2888 * data/bison.m4: here.
2889 * data/glr.c (b4_rhs_data): Use it.
2890 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
2891
6085ab0d
AD
28922008-11-18 Akim Demaille <demaille@gostai.com>
2893
2894 Remove incorrect mode specification.
2895 * data/glr.cc: Don't pretend it's C code.
2896
9ce405ce
JD
28972008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2898
2899 Simplify last patch slightly.
2900 * src/getargs.c (getargs): Here.
2901
a8beef7e
JD
29022008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2903
2904 Fix last warning from --enable-gcc-warnings.
2905 * src/getargs.c (getargs): Don't assign const address to non-const
2906 pointer.
2907
d50eea6d
JD
29082008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2909
2910 Don't let maintainer-*-check targets force a version update.
2911 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
2912 handled.
2913
f5f419de
DJ
29142008-11-17 Di-an Jan <dianj@freeshell.org>
2915
2916 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
2917 Align menus. Adjust word wrapping. Use node names for menu names.
2918 (Examples): Don't abbreviate node names.
2919 (LocalWords): Remove abbreviations.
2920 (Copying): Make description a sentence.
d50eea6d 2921 (Java Action Features): Remove period to match the rest of menu.
f5f419de 2922
d73e55e0
DJ
29232008-11-17 Di-an Jan <dianj@freeshell.org>
2924
2925 Handles several --enable-gcc-warnings.
2926 * src/getargs.c (command_line_location): Set parameters to void.
2927 * src/output.c (symbol_type_name_cmp): Make static.
2928 (symbols_by_type_name): Set parameters to void.
2929 (symbol_definitions_output): Remove unused parameter. Rename as...
2930 (prepare_symbol_definitions): this.
2931 (muscles_output): Move symbol_definitions_output to...
2932 (output): here as prepare_symbol_definitions.
2933 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
d50eea6d 2934 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
d73e55e0 2935
68c989de
DJ
29362008-11-17 Di-an Jan <dianj@freeshell.org>
2937
2938 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
2939 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
2940
23ce6f4c
AD
29412008-11-16 Akim Demaille <demaille@gostai.com>
2942
2943 Add missing $(EXEEXT).
2944 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
2945 "src/bison$(EXEEXT)".
2946 Reported by Di-an Jan.
2947
dd704c35
AD
29482008-11-15 Akim Demaille <demaille@gostai.com>
2949
2950 * TODO: Update.
2951
dab244d5
AD
29522008-11-15 Akim Demaille <demaille@gostai.com>
2953
2954 Formatting changes.
2955 * tests/input.at: here.
2956
4b4da9fb
AD
29572008-11-15 Akim Demaille <demaille@gostai.com>
2958
2959 Remove duplicate header inclusion.
2960 * src/LR0.c: here.
2961
4ea3f53d
AD
29622008-11-15 Akim Demaille <demaille@gostai.com>
2963
2964 * src/parse-gram.h, src/parse-gram.c: Regen.
2965
cb823b6f
AD
29662008-11-15 Akim Demaille <demaille@gostai.com>
2967
2968 Support parametric types.
b06df3c2
AD
2969
2970 There are two issues to handle: first scanning nested angle
2971 bracket pairs to support types such as std::pair< std::string,
2972 std::list<std::string> > >.
2973
2974 Another issue is to address idiosyncracies of C++: do not glue two
2975 closing angle brackets together (otherwise it's operator>>), and
2976 avoid sticking blindly a TYPE to the opening <, as it can result
2977 in '<:' which is a digraph for '['.
2978
cb823b6f
AD
2979 * src/scan-gram.l (brace_level): Rename as...
2980 (nesting): this.
2981 (SC_TAG): New.
2982 Implement support for complex tags.
b06df3c2 2983 (tag): Accept
cb823b6f
AD
2984 , but not <.
2985 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
2986 (b4_symbol_variant): Leave space around types as parameters.
2987 * examples/variant.yy: Use nested template types and leading ::.
2988 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
2989 Rename as...
2990 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
2991 * tests/c++.at: Test parametric types.
2992
7b6e6753
AD
29932008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2994
2995 Test token.prefix.
2996 This is not sufficient, but we test at least that the make_SYMBOL
2997 interface is not affected by token.prefix. A more general test
2998 will be implemented when the support of token.prefix is generalized
2999 to more skeletons.
b06df3c2 3000
7b6e6753
AD
3001 * tests/c++.at: One more variant test, using token.prefix.
3002
dddec537
AD
30032008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3004
3005 Test the make_TOKEN interface.
3006 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
3007 Factor the common code in yylex.
3008 Use it to test "%define lex_symbol".
3009
7d3e21ba
AD
30102008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3011
3012 Formatting change.
3013
4fc55348
AD
30142008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3015
3016 Simplify code for variants bench marks.
3017 * etc/bench.pl.in (&generate_grammar_list): Define and use
3018 location_type.
3019 Factor the common code in yylex.
3020
070e6509
AD
30212008-11-15 Akim Demaille <demaille@gostai.com>
3022
3023 Better error message.
3024 * bootstrap (find_tool): Fix the error message.
3025
0078681b
AD
30262008-11-15 Akim Demaille <demaille@gostai.com>
3027
3028 Update variant.yy to newest interface.
3029 * examples/variant.yy: Define lex_symbol.
3030 Adjust.
3031
ff084799
AD
30322008-11-15 Akim Demaille <demaille@gostai.com>
3033
3034 Don't use locations in variant.yy.
3035 * examples/variant.yy: Adjust to not using locations.
3036
b0d79ec6
AD
30372008-11-15 Akim Demaille <demaille@gostai.com>
3038
3039 Comment changes.
3040 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
3041 comments for the license.
3042
d4977ce3
AD
30432008-11-15 Akim Demaille <demaille@gostai.com>
3044
3045 Remove tests/Makefile.am.
3046 * tests/Makefile.am: Rename as...
3047 * tests/local.mk: this.
3048 * Makefile.am, configure.ac: Adjust.
3049 * Makefile.am (DISTCLEANFILES): Define.
3050 (maintainer-check, maintainer-xml-check, maintainer-push-check):
3051 Remove, we no longer need to bounce to the real targets.
3052
87f1149a
AD
30532008-11-15 Akim Demaille <demaille@gostai.com>
3054
3055 Comment changes.
3056
36415906
AD
30572008-11-15 Akim Demaille <demaille@gostai.com>
3058
3059 djgpp/local.mk.
3060 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
3061 * djgpp/local.mk: this new file.
3062
e2c2f696
AD
30632008-11-15 Akim Demaille <demaille@gostai.com>
3064
3065 Remove doc/Makefile.am.
3066 * doc/Makefile.am: Rename as...
3067 * doc/local.mk: this.
3068 Adjust paths
3069 * Makefile.am, configure.ac: Adjust.
3070 * Makefile.am (MOSTLYCLEANFILES): New.
3071 * src/local.mk: Adjust.
3072
2ead32e6
AD
30732008-11-15 Akim Demaille <demaille@gostai.com>
3074
3075 Move sc_tight_scope into maint.mk.
b06df3c2
AD
3076 It does not work, and I don't know how it was supposed to work: it
3077 seems to be looking for sources in the build tree. I just moved
3078 it at a better place, fixing it is still required.
3079
2ead32e6
AD
3080 * src/local.mk (echo): Remove.
3081 (sc_tight_scope): Move to...
3082 * maint.mk: here.
3083
2df9ec37
AD
30842008-11-15 Akim Demaille <demaille@gostai.com>
3085
3086 Regen.
3087 * src/parse-gram.h, src/parse-gram.h: Regen.
3088
0305d25e
AD
30892008-11-15 Akim Demaille <demaille@gostai.com>
3090
3091 Remove src/Makefile.am.
3092 * src/Makefile.am: Rename as...
3093 * src/local.mk: this.
3094 Prefix all the paths with src/.
3095 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
3096 (AM_CPPFLAGS): Find find in builddir/src.
3097 (YACC): Move the flags into...
3098 (AM_YFLAGS): here.
3099 * maint.mk (sc_tight_scope): Disable.
3100 It used to bounce to the version in src/Makefile.am which is now
3101 part of this very Makefile.
3102 * Makefile.am, configure.ac: Adjust.
3103 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
3104 include "..." to find files "here": we are no longer in src/, so
3105 qualify the includes with src/.
3106 * doc/Makefile.am (PREPATH): No longer include the top_builddir
3107 prefix.
3108 (.x.1): Adjust to be able to create src/foo from the top level
3109 Makefile, instead of going bounce to src/Makefile the creation of
3110 foo.
3111
5277c0a3
AD
31122008-11-15 Akim Demaille <demaille@gostai.com>
3113
3114 Remove useless variable.
3115 * doc/Makefile.am (srcsrcdir): Remove.
3116
6a5aa0cd
AD
31172008-11-15 Akim Demaille <demaille@gostai.com>
3118
3119 Remove data/Makefile.am.
3120 * data/Makefile.am: Rename as...
3121 * data/local.mk: this.
3122 Adjust paths.
3123 * Makefile.am, configure.ac: Adjust.
3124
7cb794dc
AD
31252008-11-15 Akim Demaille <demaille@gostai.com>
3126
3127 Remove etc/Makefile.am.
3128 * etc/Makefile.am: Rename as...
3129 * etc/local.mk: this.
3130 Adjust.
3131 * Makefile.am, configure.ac: Adjust.
3132
cd409e3b
AD
31332008-11-15 Akim Demaille <demaille@gostai.com>
3134
3135 Remove examples/local.mk.
3136 examples/calc++/Makefile.am might be interesting to keep as is, since
3137 it is an example in itself.
2df9ec37 3138
cd409e3b
AD
3139 * examples/Makefile.am: Rename as...
3140 * examples/local.mk: this.
3141 Adjust.
3142 * Makefile.am, configure.ac: Adjust.
3143
9a1e4214
AD
31442008-11-15 Akim Demaille <demaille@gostai.com>
3145
3146 Remove build-aux/Makefile.am.
3147 Recursive Makefiles are really way too slow, let's get rid of some of
3148 them.
2df9ec37 3149
9a1e4214
AD
3150 * build-aux/Makefile.am: Rename as...
3151 * build-aux/local.mk: this.
3152 Adjust paths.
3153 * Makefile.am, configure.ac: Adjust.
3154
0634493c
AD
31552008-11-15 Akim Demaille <demaille@gostai.com>
3156
3157 Provide convenience constructors for locations and positions.
3158 * data/location.cc (position::position): Accept file, line and
3159 column as arguments with default values.
3160 Always qualify initial line and column literals as unsigned.
3161 (location::location): Provide convenience constructors.
3162
fe1b448a
AD
31632008-11-15 Akim Demaille <demaille@gostai.com>
3164
b06df3c2
AD
3165 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
3166 token type.
fe1b448a
AD
3167 Using template buys us nothing, and makes it uselessly complex to
3168 construct a symbol. Besides, it could not be generalized to other
3169 languages, while make_FOO would work in C/Java etc.
2df9ec37 3170
fe1b448a
AD
3171 * data/lalr1.cc (b4_symbol_): New.
3172 (b4_symbol): Use it.
3173 (b4_symbol_constructor_declaration_)
3174 (b4_symbol_constructor_definition_): Instead of generating
3175 specializations of an overloaded template function, just generate
3176 several functions whose names are forged from the token names
3177 without the token.prefix.
3178 (b4_symbol_constructor_declarations): Generate them for all the
3179 symbols, not just by class of symbol type, now that instead of
3180 specializing a function template by the token, we generate a
3181 function named after the token.
3182 (b4_symbol_constructor_specialization_)
3183 (b4_symbol_constructor_specializations): Remove.
3184 * etc/bench.pl.in: Adjust to this new API.
3185
5679f311
AD
31862008-11-13 Akim Demaille <demaille@gostai.com>
3187
3188 %define token.prefix.
b06df3c2
AD
3189 Provide a means to add a prefix to the name of the tokens as
3190 output in the generated files. Because of name clashes, it is
3191 good to have such a prefix such as TOK_ that protects from names
3192 such as EOF, FILE etc. But it clutters the grammar itself.
2df9ec37 3193
5679f311
AD
3194 * data/bison.m4 (token.prefix): Empty by default.
3195 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
3196 * data/lalr1.cc (b4_symbol): Ditto.
3197
3204049e
AD
31982008-11-13 Akim Demaille <demaille@gostai.com>
3199
3200 Compute at M4 time some of the subtractions.
90290ce5 3201 * data/lalr1.cc (b4_subtract): New.
3204049e
AD
3202 (b4_rhs_data): Use it.
3203
202598d3
AD
32042008-11-13 Akim Demaille <demaille@gostai.com>
3205
3206 symbol::token.
b06df3c2 3207 This allows the user to get the type of a token returned by yylex.
2df9ec37 3208
202598d3
AD
3209 * data/lalr1.cc (symbol::token): New.
3210 (yytoknum_): Define when %define lex_symbol, independently of
3211 %debug.
3212 (yytoken_number_): Move into...
3213 (symbol::token): here, since that's the only use.
3214 The other one is YYPRINT which was not officially supported
3215 by lalr1.cc, and anyway it did not work since YYPRINT uses this
3216 array under a different name (yytoknum).
3217
fc2476c7
AD
32182008-11-13 Akim Demaille <demaille@gostai.com>
3219
3220 YYERRCODE.
3221 * TODO (YYERRCODE): Mention the case of $undef.
3222
865f1e9f
AD
32232008-11-13 Akim Demaille <demaille@gostai.com>
3224
3225 TODO: YYPRINT.
3226 * TODO (YYPRINT): New.
3227
cb0b136a
AD
32282008-11-13 Akim Demaille <demaille@gostai.com>
3229
3230 Comment changes.
3231 * data/lalr1.cc, data/yacc.c: Fix the description of the
3232 yytranslate and yytoknum tables.
3233
2c086d29
AD
32342008-11-13 Akim Demaille <demaille@gostai.com>
3235
3236 Define make_symbol in the header.
b06df3c2
AD
3237 To reach good performances these functions should be inlined (yet
3238 this is to measure precisely). To this end they must be available
3239 to the caller.
2df9ec37 3240
2c086d29
AD
3241 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
3242 location_type with the class name.
3243 Since will now be output in the header, declare "inline".
3244 No longer use b4_symbol_constructor_specializations, but
3245 b4_symbol_constructor_definitions in the header.
3246 Don't call it in the *.cc file.
3247
1c4af381
AD
32482008-11-13 Akim Demaille <demaille@gostai.com>
3249
3250 Define yytranslate in the header for lex_symbol.
3251 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
3252 into the header file when using %define lex_symbol.
3253 (yytranslate_): Declare inline.
3254
e51b0a82
AD
32552008-11-13 Akim Demaille <demaille@gostai.com>
3256
b06df3c2
AD
3257 Define the constructors of symbol_type in
3258 b4_symbol_constructor_definitions.
e51b0a82 3259 The constructors are called by the make_symbol functions, which a
b06df3c2
AD
3260 forthcoming patch will move elsewhere. Hence the interest of
3261 putting them together.
2df9ec37 3262
b06df3c2
AD
3263 The stack_symbol_type does not need to be moved, it is used only
3264 by the parser.
2df9ec37 3265
e51b0a82
AD
3266 * data/lalr1.cc: Move symbol_type and symbol_base_type
3267 constructors into...
3268 (b4_symbol_constructor_definitions): here.
3269 Adjust.
3270
78835571
AD
32712008-11-13 Akim Demaille <demaille@gostai.com>
3272
3273 Make it easier to move the definition of yytranslate_.
3274 Forthcoming changes will make it possible to use yytranslate_
3275 from outside the parser implementation file.
2df9ec37 3276
78835571
AD
3277 * data/lalr1.cc (b4_yytranslate_definition): New.
3278 Use it.
3279
c1e6c88c
AD
32802008-11-13 Akim Demaille <demaille@gostai.com>
3281
3282 Remove useless class specification.
3283 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
3284 to refer to the class name to use a type defined by the class for
3285 arguments of member functions.
3286
4654b0c0
AD
32872008-11-13 Akim Demaille <demaille@gostai.com>
3288
3289 Finer input type for yytranslate.
3290 This patch is debatable: the tradition expects yylex to return an int
3291 which happens to correspond to token_number (which is an enum). This
3292 allows for instance to return characters (such as '*' etc.). But this
3293 goes against the stronger typing I am trying to have with the new
3294 lex interface which return a symbol_type. So in this case, feed
3295 yytranslate_ with a token_type.
2df9ec37 3296
4654b0c0
AD
3297 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
3298 expect a token_type.
3299
dd735e4e
AD
33002008-11-13 Akim Demaille <demaille@gostai.com>
3301
3302 Honor lex-params in %define lex_symbol mode.
3303 * data/lalr1.cc: Use b4_lex_param.
3304
6659366c
AD
33052008-11-13 Akim Demaille <demaille@gostai.com>
3306
3307 Simplify names.
3308 * src/output.c (symbol_definitions_output): Rename symbol
3309 attributes type_name and has_type_name as type and has_type.
3310 * data/lalr1.cc: Adjust uses.
3311
e9805e57
AD
33122008-11-13 Akim Demaille <demaille@gostai.com>
3313
3314 Use b4_type_names for the union type.
b06df3c2
AD
3315 The union used to compute the size of the variant used to iterate
3316 over the type of all the symbols, with a lot of redundancy. Now
3317 iterate over the lists of symbols having the same type-name.
2df9ec37 3318
e9805e57
AD
3319 * data/lalr1.cc (b4_char_sizeof_): New.
3320 (b4_char_sizeof): Use it.
3321 Adjust to be called with a list of numbers instead of a single
3322 number.
3323 Adjust its caller for new-line issues.
3324
aea10ef4
AD
33252008-11-13 Akim Demaille <demaille@gostai.com>
3326
3327 Define the "identifier" of a symbol.
b06df3c2
AD
3328 Symbols may have several string representations, for instance if
3329 they have an alias. What I call its "id" is a string that can be
3330 used as an identifier. May not exist.
2df9ec37 3331
b06df3c2
AD
3332 Currently the symbols which have the "tag_is_id" flag set are
3333 those that don't have an alias. Look harder for the id.
2df9ec37 3334
aea10ef4
AD
3335 * src/output.c (is_identifier): Move to...
3336 * src/symtab.c (is_identifier): here.
3337 * src/symtab.h, src/symtab.c (symbol_id_get): New.
3338 * src/output.c (symbol_definitions_output): Use it to define "id"
3339 and "has_id".
3340 Remove the definition of "tag_is_id".
3341 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
3342 "tag_is_id" were used to produce code.
3343 We still use "tag" for documentation.
3344
2ea7730c
AD
33452008-11-11 Akim Demaille <demaille@gostai.com>
3346
3347 Locations are no longer required by lalr1.cc.
3348 * data/lalr1.cc (_b4_args, b4_args): New.
3349 Adjust all uses of locations to make them optional.
3350 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
3351 (AT_CHECK_NAMESPACE): Check the use of locations.
3352 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
3353 without locations with lalr1.cc.
3354 Test these cases.
3355 * tests/output.at: Check lalr1.cc with and without location
3356 support.
3357 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
3358 Don't use locations.
3359
7ca2266a
AD
33602008-11-11 Akim Demaille <demaille@gostai.com>
3361
3362 AT_FULL_COMPILE.
3363 * tests/local.at (AT_FULL_COMPILE): New.
3364 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
3365
1a7a65f9
AD
33662008-11-11 Akim Demaille <demaille@gostai.com>
3367
3368 Support parens in calc++.
3369 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
3370 * examples/calc++/test (run): Check the expected output.
3371 Adjust callers.
3372 Check parens too.
3373
c944f7f2
AD
33742008-11-11 Akim Demaille <demaille@gostai.com>
3375
3376 Simplify lalr1.cc since %defines is mandatory.
3377 * data/lalr1.cc: Remove useless calls to b4_defines_if.
3378
dada3cd1
AD
33792008-11-11 Akim Demaille <demaille@gostai.com>
3380
3381 TODO: yyfmt.
3382 * TODO (yysyntax_error): New item.
3383
422c18f4
AD
33842008-11-11 Akim Demaille <demaille@gostai.com>
3385
3386 Prefer M4 to CPP.
3387 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
3388 YYERROR_VERBOSE.
3389
a0ffc175
AD
33902008-11-11 Akim Demaille <demaille@gostai.com>
3391
3392 Support i18n of the parse error messages.
3393 * TODO (lalr1.cc/I18n): Remove.
3394 * data/lalr1.cc (yysyntax_error_): Support the translation of the
3395 error messages, as done in yacc.c.
3396 Stay within the yy* pseudo namespace.
3397
00a8a083
AD
33982008-11-11 Akim Demaille <demaille@gostai.com>
3399
3400 More TODO.
3401 * TODO (single stack, yysyntax_error): New.
3402
09277875
AD
34032008-11-11 Akim Demaille <demaille@gostai.com>
3404
3405 Make it possible to return a symbol_type from yylex.
3406 * data/lalr1.cc (b4_lex_symbol_if): New.
3407 (parse): When lex_symbol is defined, expected yylex to return the
3408 complete lookahead.
3409 * etc/bench.pl.in (generate_grammar_list): Extend to support this
3410 yylex interface.
3411 (bench_variant_parser): Exercise it.
3412
64c1b92a
AD
34132008-11-11 Akim Demaille <demaille@gostai.com>
3414
3415 Remove useless bench case.
3416 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
3417 no longer used.
3418
2722aa42
AD
34192008-11-11 Akim Demaille <demaille@gostai.com>
3420
3421 Improve display of directives.
3422 * etc/bench.pl.in (parse_term): Don't add useless eol.
3423
918eb7c5
AD
34242008-11-11 Akim Demaille <demaille@gostai.com>
3425
3426 Use string_cast in the bench.
3427 * etc/bench.pl.in (generate_grammar_list): Define and use
3428 string_cast.
3429
39be9022
AD
34302008-11-11 Akim Demaille <demaille@gostai.com>
3431
3432 Replace yychar with a Boolean.
3433 * data/lalr1.cc (parse::yychar): Replace by...
3434 (parse::yyempty): this.
3435
a2e3fa77
AD
34362008-11-11 Akim Demaille <demaille@gostai.com>
3437
3438 Factor the tables.
3439 * TODO: New item.
3440
aba12ad1
AD
34412008-11-11 Akim Demaille <demaille@gostai.com>
3442
3443 Let yytranslate handle the eof case.
3444 * data/lalr1.cc (yytranslate_): Handle the EOF case.
3445 Adjust callers.
3446 No longer expect yychar to be equal to yyeof_, rather, test the
3447 lookahead's (translated) kind.
3448
27cb5b59
AD
34492008-11-11 Akim Demaille <demaille@gostai.com>
3450
3451 yychar cannot be empty in yyerrlab.
3452 * TODO (yychar == yyempty_): New.
3453 * data/lalr1.cc: Remove the handling of this case.
3454 This eases forthcoming changes related to yychar and yytranslate.
3455
fce629c0
AD
34562008-11-11 Akim Demaille <demaille@gostai.com>
3457
3458 Bench: syntactic sugar for %define/#define.
3459 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
3460 (&bench_push_parser, bench_variant_parser): Use this feature.
3461 (&eat): New.
3462 Use it.
3463
ce671960
AD
34642008-11-11 Akim Demaille <demaille@gostai.com>
3465
3466 Less memory pressure on the "list" bench.
3467 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
3468 the values, to limit memory pressure.
3469
2873fdf8
AD
34702008-11-11 Akim Demaille <demaille@gostai.com>
3471
3472 Introduce make_symbol.
b06df3c2
AD
3473 make_symbol provides a means to construct a full symbol (kind,
3474 value, location) in a single shot. It is meant to be a Symbol
3475 constructor, parameterized by the symbol kind so that overloading
3476 would prevent incorrect kind/value pairs. Unfortunately
3477 parameterized constructors do not work well in C++ (unless the
3478 parameter also appears as an argument, which is not acceptable),
3479 hence the use of a function instead of a constructor.
2df9ec37 3480
2873fdf8
AD
3481 * data/lalr1.cc (b4_symbol_constructor_declaration_)
3482 (b4_symbol_constructor_declarations)
3483 (b4_symbol_constructor_specialization_)
3484 (b4_symbol_constructor_specializations)
3485 (b4_symbol_constructor_definition_)
3486 (b4_symbol_constructor_definitions): New.
3487 Use them where appropriate to generate declaration, declaration of
3488 the specializations, and implementations of the templated
3489 overloaded function "make_symbol".
3490 (variant::variant): Always define a default ctor.
3491 Also provide a copy ctor.
3492 (symbol_base_type, symbol_type): New ctor overloads for value-less
3493 symbols.
3494 (symbol_type): Now public, so that functions such as yylex can use
3495 it.
3496
8be046d7
AD
34972008-11-11 Akim Demaille <demaille@gostai.com>
3498
3499 Inform m4 whether a tag is a valid id.
3500 * src/output.c (is_identifier): New.
3501 (symbol_definitions_output): Use it to define tag_is_id.
3502 But maybe this should be done at m4 level?
3503
de62edee
AD
35042008-11-11 Akim Demaille <demaille@gostai.com>
3505
3506 Test 214 was failing: it greps with a pattern containing [ ]*
3507 which obviously meant to catch spaces and tabs, but contained only
3508 spaces. Tabulations in sources are a nuisance, so to simplify the
3509 matter, get rid of all the tabulations in the Java sources. The
3510 other skeletons will be treated equally later.
3511
3512 * data/java.m4, data/lalr1.java: Untabify.
3513 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
3514 tabulations are no longer generated.
3515
905f0697
PB
35162008-11-11 Paolo Bonzini <bonzini@gnu.org>
3517
3518 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
3519 * configure.ac: Adjust usage.
3520 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3521 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3522 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
3523
09ccae9b
DJ
35242008-11-10 Di-an Jan <dianj@freeshell.org>
3525
3526 Workaround Java's ``code too large'' problem for parser tables
3527 in most cases, by using one function per initialization.
3528 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
3529 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
3530 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
3531 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
3532 (yytname_): Use b4_typed_parser_table.
3533 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
3534 ``code too large'' error.
3535
1979121c
DJ
35362008-11-10 Di-an Jan <dianj@freeshell.org>
3537
3538 * NEWS: Document them.
de62edee 3539
1979121c
DJ
3540 General Java skeleton improvements.
3541 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
3542 using gcj < 4.3 in the testsuite, according to comments in
3543 gnulib/m4/javacomp.m4.
3544 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
3545 location_type, position_type): Remove extraneous brackets from
3546 b4_percent_define_default.
3547 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
3548 m4_define and m4_define_default.
3549 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
3550 which marks the end of user code with appropriate syncline, like all
3551 the other skeletons.
3552 (b4_user_post_prologue): Add. Don't silently drop.
3553 (yylex): Remove.
3554 (parse): Inline yylex.
3555 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
3556 (%{...%}): Fix typo of %code imports.
3557 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
3558
3559 Support annotations on parser class with %define annotations.
3560 * data/lalr1.java (annotations): Add to parser class modifier.
3561 * doc/bison.texinfo (Java Parser Interface): Document
3562 %define annotations.
3563 (Java Declarations Summary): Document %define annotations.
3564 * tests/java.at (Java parser class modifiers): Test annotations.
3565
3566 Do not generate code for %error-verbose unless requested.
3567 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
3568 Make private. Make conditional on %error-verbose.
3569 (getErrorVerbose, setErrorVerbose): New.
3570 (yytnamerr_): Make conditional on %error-verbose.
3571 (yysyntax_error): Make some code conditional on %error-verbose.
3572 * doc/bison.texinfo (Java Bison Interface): Remove the parts
3573 about %error-verbose having no effect.
3574 (getErrorVerbose, setErrorVerbose): Document.
3575
3576 Move constants for token names to Lexer interface.
3577 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
3578 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
3579 (parse): Qualify EOF to Lexer.EOF.
3580 * doc/bison.texinfo (Java Parser Interface): Move documentation of
3581 EOF and token names to Java Lexer Interface.
3582 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
3583
3584 Make yyerror public.
3585 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
3586 (yyerror): Change to public. Add Javadoc comments. Use longer
3587 parameter names. Make the body rather than the declarator
3588 conditional on %locations.
3589 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
3590
3591 Allow user to add code to the constructor with %code init.
3592 * data/java.m4 (b4_init_throws): New, for %define init_throws.
3593 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
3594 Add %code init to the front of the constructor body.
3595 * doc/bison.texinfo (YYParser.YYParser): Document %code init
3596 and %define init_throws.
3597 (Java Declarations Summary): Document %code init and
3598 %define init_throws.
3599 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
3600 (Java constructor init and init_throws): Add tests.
de62edee 3601
42f832d6
AD
36022008-11-10 Akim Demaille <demaille@gostai.com>
3603
3604 Update TODO.
3605 * TODO (-D): is implemented.
3606 (associativity): Same precedence must have the same associativity.
3607 For instance, how can a * b / c be parsed if * is %left and / is
3608 %right?
3609 (YYERRORCODE, YYFAIL, YYBACKUP): New.
3610
247efe34
AD
36112008-11-10 Akim Demaille <demaille@gostai.com>
3612
3613 Formatting changes.
3614
5d731440
AD
36152008-11-10 Akim Demaille <demaille@gostai.com>
3616
3617 More information about the symbols.
3618 * src/output.c (type_names_output): Document all the symbols,
3619 including those that don't have a type-name.
3620 (symbol_definitions_output): Define "is_token" and
3621 "has_type_name".
3622 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
3623 type-name, now that they are defined too in b4_type_names.
3624
21db118b
AD
36252008-11-10 Akim Demaille <demaille@gostai.com>
3626
3627 Regen.
3628
6ed15cde
AD
36292008-11-10 Akim Demaille <demaille@gostai.com>
3630
3631 Make parser::yytranslate static.
b06df3c2
AD
3632 Small speedup (1%) on the list grammar. And makes yytranslate_
3633 available in non member functions.
de62edee 3634
6ed15cde
AD
3635 * data/lalr1.cc (yytranslate_): Does not need to be a instance
3636 function.
3637
30bb2edc
AD
36382008-11-10 Akim Demaille <demaille@gostai.com>
3639
3640 Avoid trailing spaces.
3641 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
3642 * data/lalr1.cc: Don't indent before rule and symbol actions, as
3643 they can be empty, and anyway this incorrectly indents the first
3644 action.
3645
b3a28fd4
AD
36462008-11-10 Akim Demaille <demaille@gostai.com>
3647
3648 Comment changes.
3649
914202bd
AD
36502008-11-10 Akim Demaille <demaille@gostai.com>
3651
3652 Use "enum" for integral constants.
3653 This is just nicer to read, I observed no speedup.
de62edee 3654
914202bd
AD
3655 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
3656 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
3657 (yyuser_token_number_max_, yyundef_token_): Move into...
3658 (yytranslate_): here.
3659
c17f9a4a
AD
36602008-11-10 Akim Demaille <demaille@gostai.com>
3661
3662 Shortcuts in bench directives.
3663 * etc/bench.pl.in (parse_dirs): New.
3664 Use it.
3665 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
3666 Create the benches in "benches/".
3667
b9855ea5
AD
36682008-11-10 Akim Demaille <demaille@gostai.com>
3669
3670 Formatting changes.
3671 * data/lalr1.cc: here.
3672
6e097787
AD
36732008-11-10 Akim Demaille <demaille@gostai.com>
3674
3675 Adjust verbose message to using emacs.
3676 * etc/bench.pl.in: Inform compilation-mode when we change the
3677 directory.
3678 (generate_grammar_list): Recognize %define "variant" in addition
3679 to %define variant.
3680
4c3cc7da
AD
36812008-11-10 Akim Demaille <demaille@gostai.com>
3682
3683 Classify symbols by type-name.
3684 * src/uniqstr.h (UNIQSTR_CMP): New.
3685 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
3686 (type_names_output): New.
3687 (muscles_output): Use it.
3688 * data/lalr1.cc (b4_symbol_action_): Remove.
3689 (b4_symbol_case_, b4_type_action_): New.
3690 Adjust uses of b4_symbol_action_ to use b4_type_action_.
3691
d69c9694
AD
36922008-11-10 Akim Demaille <demaille@gostai.com>
3693
3694 Change the handling of the symbols in the skeletons.
3695 Before we were using tables which lines were the symbols and which
3696 columns were things like number, tag, type-name etc. It is was
3697 difficult to extend: each time a column was added, all the numbers had
3698 to be updated (you asked for colon $2, not for "tag"). Also, it was
3699 hard to filter these tables when only a subset of the symbols (say the
3700 tokens, or the nterms, or the tokens that have and external number
3701 *and* a type-name) was of interest.
de62edee 3702
d69c9694
AD
3703 Now instead of monolithic tables, we define one macro per cell. For
3704 instance "b4_symbol(0, tag)" is a macro name which contents is
3705 self-decriptive. The macro "b4_symbol" provides easier access to
3706 these cells.
de62edee 3707
d69c9694
AD
3708 * src/output.c (type_names_output): Remove.
3709 (symbol_numbers_output, symbol_definitions_output): New.
3710 (muscles_output): Call them.
3711 (prepare_symbols): Define b4_symbols_number.
3712
5263bea9
AD
37132008-11-10 Akim Demaille <demaille@gostai.com>
3714
3715 --trace=muscles
3716 * src/getargs.h, src/getargs.c (trace_muscle): New.
3717 (trace_types, trace_args): Support it.
3718 * src/output.c (output_skeleton): Use it.
3719
4175f6bb
AD
37202008-11-10 Akim Demaille <demaille@gostai.com>
3721
3722 muscles_output.
3723 * src/output.c (muscles_output): New, extracted from...
3724 (output_skeleton): here.
3725 Adjust.
3726
1de69d6a
AD
37272008-11-10 Akim Demaille <demaille@gostai.com>
3728
3729 Formatting changes.
3730
36db78a7
AD
37312008-11-10 Akim Demaille <demaille@gostai.com>
3732
3733 Update the variant example.
3734 * examples/variant.yy: Formatting changes.
3735 One stage build.
3736
e5eb92e7
AD
37372008-11-10 Akim Demaille <demaille@gostai.com>
3738
3739 Support constructor with an argument.
3740 This improves the "list" bench by 2%.
de62edee 3741
e5eb92e7
AD
3742 * data/lalr1.cc (variant::build): Add an overloaded version with
3743 an argument.
3744 * tests/c++.at (AT_CHECK_VARIANT): Check it.
3745
76307410
AD
37462008-11-10 Akim Demaille <demaille@gostai.com>
3747
3748 Test variants.
3749 * tests/c++.at (AT_CHECK_VARIANTS): New.
3750 Use it with and without %define assert.
3751
d78f0ac9
AD
37522008-11-10 Akim Demaille <demaille@gostai.com>
3753
3754 Add %precedence support.
3755 Unfortunately it is not possible to reuse the %prec directive. This
3756 is because to please POSIX, we do not require to end the rules with a
3757 semicolon. As a result,
de62edee 3758
d78f0ac9 3759 foo: bar %prec baz
de62edee 3760
d78f0ac9
AD
3761 is ambiguous: either a rule which precedence is that of baz, or a rule,
3762 and then a declaration of the precedence of the token baz.
de62edee 3763
d78f0ac9
AD
3764 * doc/bison.texinfo: Document %precedence.
3765 (Precedence Only): New.
3766 * src/assoc.h, src/assoc.c (precedence_assoc): New.
3767 * src/conflicts.c (resolve_sr_conflict): Support it.
3768 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
3769 Parse it.
3770 * tests/calc.at: Use %precedence for NEG.
3771 * tests/conflicts.at (%precedence does not suffice)
3772 (%precedence suffices): New tests.
3773
c85be41a
AD
37742008-11-09 Akim Demaille <demaille@gostai.com>
3775
3776 Make benches in a sub dirs.
3777 * etc/bench.pl.in ($dir): New.
3778 Use it.
3779 Check the use of constructors with an argument.
3780 (bench_variant_parser): Fix.
3781
db65ca1f
AD
37822008-11-09 Akim Demaille <demaille@gostai.com>
3783
3784 fix eof condition
3785
9b0efa5b
AD
37862008-11-09 Akim Demaille <demaille@gostai.com>
3787
3788 Fix --help.
3789
432ac57a
AD
37902008-11-09 Akim Demaille <demaille@gostai.com>
3791
3792 Require the generation of parse-gram.output.
3793 * src/Makefile.am (YACC): Pass --report=all.
3794
deef2a0a
AD
37952008-11-09 Akim Demaille <demaille@gostai.com>
3796
3797 Formatting changes.
3798
df72984a
AD
37992008-11-09 Akim Demaille <demaille@gostai.com>
3800
3801 Update TODO.
3802 * TODO: Remove obsolete items.
3803 Update others.
3804
f10e19fd
AD
38052008-11-09 Akim Demaille <demaille@gostai.com>
3806
3807 Enhance bench.pl.
3808 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
3809 (@token, $grammar, $bench): New.
3810 (generate_grammar_variant): Rename as...
3811 (generate_grammar_list): this.
3812 (generate_grammar): Adjust.
3813 (bench_grammar): Rename as...
3814 (bench): this.
3815 Use it in the various bench-marking routines.
3816 (-b, -g): New options.
3817
5de9c593
AD
38182008-11-09 Akim Demaille <demaille@gostai.com>
3819
3820 Use a static hierarchy for symbols in the C++ parser.
3821 * data/lalr1.cc (symbol_base_type, symbol_type)
3822 (stack_symbol_type): Make it a static hierarchy.
3823 Adjust dependencies.
3824
757f8f98
AD
38252008-11-09 Akim Demaille <demaille@gostai.com>
3826
3827 bench.pl -d, --directive.
3828 * etc/bench.pl.in (@directive): New.
3829 (&bench_grammar): Use it.
3830 (&bench_list_grammar): New, to provide access to the "variant"
3831 grammar.
3832 Use it.
3833 (getopts): Support -d, --directive.
3834
d3be4f6d
AD
38352008-11-09 Akim Demaille <demaille@gostai.com>
3836
3837 Use inline for small operations.
3838 * data/lalr1.cc (symbol_base_type, symbol_type)
3839 (stack_symbol_type): Declare constructor and other operations as
3840 inline.
3841 (yy_destroy_): Inline.
3842
1f7d007b
AD
38432008-11-09 Akim Demaille <demaille@gostai.com>
3844
3845 Introduce a hierarchy for symbols.
3846 * data/lalr1.cc (symbol_base_type, symbol_type): New.
3847 (data_type): Rename as...
3848 (stack_symbol_type): this.
3849 Derive from symbol_base_type.
3850 (yy_symbol_value_print_): Merge into...
3851 (yy_symbol_print_): this.
3852 Rename as...
3853 (yy_print_): this.
3854 (yydestruct_): Rename as...
3855 (yy_destroy_): this.
3856 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
3857 (parser::parse): yyla is now of symbol_type.
3858 Use its type member instead of yytoken.
3859
bc0b0477
AD
38602008-11-09 Akim Demaille <demaille@gostai.com>
3861
3862 Rename data_type and stack_symbol_type.
3863 * data/lalr1.cc (data_type): Rename as...
3864 (stack_symbol_type): this.
3865
57295d14
AD
38662008-11-09 Akim Demaille <demaille@gostai.com>
3867
3868 Handle semantic value and location together.
3869 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
3870 yydata.value and yydata.location.
3871 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
3872 (YY_SYMBOL_PRINT): Now take semantic value and location as a
3873 single arg.
3874 Adjust all callers.
3875 (yydestruct_): New overload for a stack symbol.
3876
e9b0834e
AD
38772008-11-09 Akim Demaille <demaille@gostai.com>
3878
3879 Push a complete symbol, not connected parts.
3880 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
3881 state, value and location.
3882 Adjust callers.
3883
6082531a
AD
38842008-11-09 Akim Demaille <demaille@gostai.com>
3885
3886 Agregate yylval and yylloc.
3887 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
3888 (parser::yyla): this.
3889
33c195cc
AD
38902008-11-09 Akim Demaille <demaille@gostai.com>
3891
3892 Rely on the state stack to display reduction traces.
b06df3c2
AD
3893 To display rhs symbols before a reduction, we used information
3894 about the rule reduced, which required the tables yyrhs and
3895 yyprhs. Now use rely only on the state stack to get the same
3896 information.
de62edee 3897
33c195cc
AD
3898 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
3899 Use them.
3900 (parser::yyrhs_, parser::yyprhs_): Remove.
3901 (parser::yy_reduce_print_): Use the state stack.
3902
e1f93869
AD
39032008-11-09 Akim Demaille <demaille@gostai.com>
3904
3905 Fuse yyval and yyloc into yylhs.
3906 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
3907 yylhs.
3908 (parse): Replace yyval and yyloc with yylhs.value and
3909 yylhs.location.
3910 After a user action, compute yylhs.state earlier.
3911 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
3912 fresh error_token.
3913
2935744b
DJ
39142008-11-09 Di-an Jan <dianj@freeshell.org>
3915
3916 Remove unused variable.
3917 * src/output.c (type_names_output): Remove unused variable sep.
3918
bbf9ca37
PB
39192008-11-09 Paolo Bonzini <bonzini@gnu.org>
3920
3921 Change tests/output.at quoting.
3922 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
3923 expanding arguments.
3924
d9a9b96b
JD
39252008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3926
3927 Don't add a semicolon to actions for %skeleton or %language.
3928 It breaks Java test cases as reported by Akim Demaille.
3929 * src/scan-code.l: Implement.
3930
51365192
JD
39312008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3932
3933 Clean up %skeleton and %language priority implementation.
3934 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
3935 remove static qualifier because others will soon need to see it.
3936 (language_prio): Likewise.
3937 (getargs): Use command_line_prio rather than 0.
3938 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
3939 enum fields.
3940 (skeleton_prio): Extern it.
3941 (language_prio): Extern it.
3942 * src/parse-gram.y: Use grammar_prio rather than 1.
3943
9380cfd0
AD
39442008-11-07 Akim Demaille <demaille@gostai.com>
3945
3946 Moving push traces into yypush_.
3947 * data/lalr1.cc (yypush_): Now takes a optional trace message.
3948 Adjust all uses.
3949
8901f32e
AD
39502008-11-07 Akim Demaille <demaille@gostai.com>
3951
3952 The single-stack C++ parser is now the standard one.
3953 * data/lalr1.cc: Rename as...
3954 * data/lalr1-split.cc: this.
3955 * data/lalr1-fusion.cc: Rename as...
3956 * data/lalr1.cc: this.
3957 * etc/bench.pl.in: Adjust.
3958
8cdabf02
AD
39592008-11-07 Akim Demaille <demaille@gostai.com>
3960
3961 Avoid empty-if warnings.
3962 Reported by Quentin Hocquet.
de62edee 3963
8cdabf02
AD
3964 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
3965 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
3966
5a893c2b
AD
39672008-11-07 Akim Demaille <demaille@gostai.com>
3968
3969 Pass command line location to skeleton_arg and language_argmatch.
3970 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
3971 The location argument is now mandatory.
3972 Adjust all dependencies.
3973 (getargs): Use command_line_location.
3974
58697c6d
AD
39752008-11-07 Akim Demaille <demaille@gostai.com>
3976
3977 -D, --define.
3978 * src/getargs.c (usage): Document -D.
3979 Fix help string for --locations.
3980 (command_line_location): New.
3981 (short_options, long_options, getargs): Support -D, --define.
3982 (getargs): Move -d support at the right place.
3983 * doc/bison.texinfo (Bison Options): Update.
3984 * tests/input.at (%define, --define): New.
3985
9fe5a457
AD
39862008-11-07 Akim Demaille <demaille@gostai.com>
3987
3988 Initialize the muscle table before parsing the command line.
3989 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
3990 (getargs): Define file_name.
3991 * src/main.c (main): Initialize muscle_tab before calling
3992 getargs.
3993 * src/muscle_tab.c (muscle_init): No longer define file_name, as
3994 its value is not available yet.
3995
56c5eca9
AD
39962008-11-07 Akim Demaille <demaille@gostai.com>
3997
3998 Locations without columns for command line arguments.
3999 * src/location.c (location_print): Don't display negative columns.
4000 * src/location.h: Document this.
4001
9b9e0a7d
AD
40022008-11-07 Akim Demaille <demaille@gostai.com>
4003
4004 Fix --help.
4005 * src/getargs.c (usage): Fix help string for -W.
4006
74eae918
AD
40072008-11-07 Akim Demaille <demaille@gostai.com>
4008
4009 Handle more general types of option arguments.
4010 * build-aux/cross-options.pl: The argument ends at the first
4011 space, not the first non-symbol character.
4012 Use @var for each word appearing the argument description.
4013
a3d4c6fb
AD
40142008-11-07 Akim Demaille <demaille@gostai.com>
4015
4016 Destroy the variants that remain on the stack in case of error.
4017 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
4018 destructor.
4019 Display the value only if yymsg is nonnull.
4020 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
4021
2d32fc9f
AD
40222008-11-07 Akim Demaille <demaille@gostai.com>
4023
4024 Add "%define assert" to variants.
4025 This is used to help the user catch cases where some value gets
4026 ovewritten by a new one. This should not happen, as this will
4027 probably leak.
de62edee 4028
2d32fc9f
AD
4029 Unfortunately this uncovered a bug in the C++ parser itself: the
4030 lookahead value was not destroyed between two calls to yylex. For
4031 instance if the previous lookahead was a std::string, and then an int,
4032 then the value of the std::string was correctly taken (i.e., the
4033 lookahead was now an empty string), but std::string structure itself
4034 was not reclaimed.
de62edee 4035
2d32fc9f
AD
4036 This is now done in variant::build(other&) (which is used to take the
4037 value of the lookahead): other is not only stolen from its value, it
4038 is also destroyed. This incurs a new performance penalty of a few
4039 percent, and union becomes faster again.
de62edee 4040
2d32fc9f
AD
4041 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
4042 (b4_variant_if): New.
4043 (variant::built): New.
4044 Use it whereever the status of the variant changes.
4045 * etc/bench.pl.in: Check the penalty of %define assert.
4046
f6038cb8
AD
40472008-11-07 Akim Demaille <demaille@gostai.com>
4048
4049 Use "%define variant" in bench.pl.
4050 * etc/bench.pl.in: No longer use the pseudo directive %variants,
4051 just use %define variants.
4052
ccde1f98
AD
40532008-11-07 Akim Demaille <demaille@gostai.com>
4054
4055 Regen.
4056 * src/parse-gram.h, src/parse-gram.c: Regen.
4057
58bd33b7
JD
40582008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
4059
4060 Fix user actions without a trailing semicolon.
4061 Reported by Sergei Steshenko at
4062 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
4063 * THANKS (Sergei Steshenko): Add.
4064 * src/scan-code.l (SC_RULE_ACTION): Fix it.
4065 * tests/regression.at (Fix user actions without a trailing semicolon):
4066 New test case.
4067
639867b5
AD
40682008-11-04 Akim Demaille <demaille@gostai.com>
4069
4070 Use b4_copyright_years.
4071 * data/yacc.c (b4_copyright_years): New.
4072 Fix its value according to the comments in the file.
4073 Use it and undefine it.
4074
3c262606
AD
40752008-11-04 Akim Demaille <demaille@gostai.com>
4076
4077 Formatting changes.
4078 * data/lalr1-fusion.cc, src/parse-gram.y: here.
4079
a2b93d52
AD
40802008-11-04 Akim Demaille <demaille@gostai.com>
4081
4082 Formatting changes.
4083 * data/lalr1-fusion.cc: here.
4084
3a2803df
AD
40852008-11-04 Akim Demaille <demaille@gostai.com>
4086
4087 Use strict on bench.pl.
4088 * etc/bench.pl.in (&run, &generate_grammar): New.
4089 Rename the grammar generating functions for consistency.
4090 Change the interface so that the list of benches to run is passed
4091 as (optionless) arguments.
4092 (&compile): Use &run.
4093
a0d4650a
AD
40942008-11-04 Akim Demaille <demaille@gostai.com>
4095
4096 Remove spurious initial empty lines.
4097 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
4098 * data/yacc.c: End the @output lines with an @.
4099
cac9e09b
AD
41002008-11-04 Akim Demaille <demaille@gostai.com>
4101
4102 Improve the display of sizes.
4103 * etc/bench.p.in: Higher precision.
4104 Sort by decreasing size.
4105
4af4348a
AD
41062008-11-04 Akim Demaille <demaille@gostai.com>
4107
4108 Don't memcpy C++ structures.
4109 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
4110 arguments.
4111 (variant::build): New overload for
4112 copy-construction-that-destroys.
4113 (variant::swap): New.
4114 (parser::yypush_): Use it in variant mode.
4115
ef05c4d6
AD
41162008-11-04 Akim Demaille <demaille@gostai.com>
4117
4118 Better defaults for bench.pl.
4119 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
4120 default values.
4121 Adjust &verbose uses.
4122 (-q, --quiet): New.
4123
9718cfa9
AD
41242008-11-04 Akim Demaille <demaille@gostai.com>
4125
4126 Make variant.yy more complex.
4127 std::list cannot be copied via memcpy, they are more demanding than
4128 std::string. Use one std::list to strengthen the test.
de62edee 4129
9718cfa9
AD
4130 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
4131 Adjust.
4132 Create a list of strings, instead of a single large string.
4133
a6df593d
AD
41342008-11-04 Akim Demaille <demaille@gostai.com>
4135
4136 bench.pl --bench.
4137 * etc/bench.pl.in (--bench, $bench): New.
4138
006a0303
AD
41392008-11-04 Akim Demaille <demaille@gostai.com>
4140
4141 Sort methods.
4142 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
4143 Define it after as().
4144
faef3466
AD
41452008-11-04 Akim Demaille <demaille@gostai.com>
4146
4147 Useless parens.
4148 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
4149
2141aded
AD
41502008-11-04 Akim Demaille <demaille@gostai.com>
4151
4152 Issue missing synclines after user actions.
4153 * data/c.m4 (b4_case): Issue synclines on the output file.
4154
e426d17b
AD
41552008-11-04 Akim Demaille <demaille@gostai.com>
4156
4157 Remove trailing empty line.
4158 * data/lalr1-fusion.cc: Don't add an empty line after the user's
4159 epilogue.
4160
a9ce3f54
AD
41612008-11-04 Akim Demaille <demaille@gostai.com>
4162
4163 Fix output of copyright years.
4164 * data/bison.m4 (b4_copyright): Fix the indentation of the
4165 copyright year paragraph.
4166 Use b4_copyright_years when no years are given.
4167 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
4168 (b4_copyright_years): New.
4169 Use it.
4170
59c544c2
AD
41712008-11-04 Akim Demaille <demaille@gostai.com>
4172
4173 Avoid the spurious initial empty line.
4174 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
4175 the end of @output request to suppress the empty line that
4176 results.
4177
96b15448
AD
41782008-11-04 Akim Demaille <demaille@gostai.com>
4179
4180 Remove parser::rhs_number_type.
4181 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
4182 (yyrhs_): Use b4_table_define.
4183
f0633174
AD
41842008-11-04 Akim Demaille <demaille@gostai.com>
4185
4186 Fix iteration type.
4187 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
4188
417b8004
AD
41892008-11-04 Akim Demaille <demaille@gostai.com>
4190
4191 Factor the declaration of the integer tables.
4192 * data/lalr1-fusion.cc (b4_table_define): New.
4193 Use it.
4194
1a5246c6
AD
41952008-11-03 Akim Demaille <demaille@gostai.com>
4196
4197 Fix indentation of tables in lalr1.cc
4198 * data/lalr1-fusion.cc: Fix the indentation.
4199
f8a95c9c
AD
42002008-11-03 Akim Demaille <demaille@gostai.com>
4201
4202 Destroy the lhs symbols after reduction.
4203 * data/lalr1-fusion.cc (parse): After the user action, when in
4204 variant mode, destroy the lhs symbols.
4205
d7f4d823
AD
42062008-11-03 Akim Demaille <demaille@gostai.com>
4207
4208 Simplify yysyntax_error_ use.
4209 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
4210 type, but make it unnamed in the declaration when it is not used.
4211
8b9c89fb
AD
42122008-11-03 Akim Demaille <demaille@gostai.com>
4213
4214 Let yy::variant::build return an lvalue.
4215 * data/lalr1-fusion.cc (variant::build): Return a reference to the
4216 object.
4217
83243c24
AD
42182008-11-03 Akim Demaille <demaille@gostai.com>
4219
4220 Define yy::variant only when needed.
4221 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
4222 used.
4223
429b4848
AD
42242008-11-03 Akim Demaille <demaille@gostai.com>
4225
4226 Bench the three-stack lalr1.cc.
4227 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
4228 one-stack one.
4229
414c76a4
AD
42302008-11-03 Akim Demaille <demaille@gostai.com>
4231
4232 Fail on parse error in calc++.
4233 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
4234 status.
4235 * examples/calc++/test ($me, $number, $exit, run): New.
4236 Use them to propagate errors to the exit status.
4237
8a5783fd
AD
42382008-11-03 Akim Demaille <demaille@gostai.com>
4239
4240 Don't specify the skeleton twice in the example.
4241 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
4242 file does what is needed.
4243
0cc5bead
AD
42442008-11-03 Akim Demaille <demaille@gostai.com>
4245
4246 bench: Improve output.
4247 * etc/bench.pl.in (bench_grammar): Tune the printf format.
4248
5b421a4e
AD
42492008-11-03 Akim Demaille <demaille@gostai.com>
4250
4251 bench: check impact of %debug on variants.
4252 * etc/bench.pl.in (variant_grammar): Fix the computation of
4253 $variant.
4254 Generate a grammar file that can work with or without %debug.
4255 Do use the @directive.
4256 (bench_variant_parser): Check impact of %debug.
4257 (@directives): Rename all the occurrences to...
4258 (@directive): this, for consistency.
4259
d11ee647
AD
42602008-11-03 Akim Demaille <demaille@gostai.com>
4261
4262 bench: report the size too.
4263 * etc/bench.pl.in ($iterations): Defaults to -3.
4264 (&bench_grammar): Require hireswallclock.
4265 Compute and display the size of the result.
4266 More comments.
4267
e1b74b92
AD
42682008-11-03 Akim Demaille <demaille@gostai.com>
4269
4270 bench: More use of the verbosity level.
4271 * etc/bench.pl.in ($verbose, &verbose): New.
4272 Use them.
4273 More POD documentation.
4274
7e5f9c54
AD
42752008-11-03 Akim Demaille <demaille@gostai.com>
4276
4277 bench.pl: a command line interface
4278 * etc/bench.pl.in: More doc.
4279 Some fixes in the documentation.
4280 ($cflags, $iterations, &help, &getopt): New.
4281 Use them.
4282 (&variant_grammar): Let the number of stages be 10 times what is
4283 specified.
4284
7109a18d
AD
42852008-11-03 Akim Demaille <demaille@gostai.com>
4286
4287 Bench the use of Boost.Variants.
4288 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
4289 New.
4290 (&compile): Be ready to compile C++ parsers.
4291 (&bench_push_parser): Move debug information to the outermost
4292 level.
4293 * THANKS: Add Michiel De Wilde.
4294
922730fe
AD
42952008-11-03 Akim Demaille <demaille@gostai.com>
4296
4297 bench.pl: Pass directives as a list instead of as a string.
4298 * etc/bench.pl.in (&directives): New.
4299 (&triangular_grammar, &calc_grammar): Use it to format the Bison
4300 directives.
4301 (&triangular_grammar): Do use the directives (were ignored).
4302 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
4303 directives.
4304
7484f1d4
AD
43052008-11-03 Akim Demaille <demaille@gostai.com>
4306
4307 Improve genericity of bench.pl.
4308 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
4309 argument.
4310 (&bench_push_parser): New.
4311 Call it.
4312
15129f25
AD
43132008-11-03 Akim Demaille <demaille@gostai.com>
4314
4315 Add documentation to bench.pl.
4316 * etc/bench.pl.in: Comment changes.
4317
0e0ed236
AD
43182008-11-03 Akim Demaille <demaille@gostai.com>
4319
4320 Fuse the three stacks into a single one.
de62edee 4321
b06df3c2
AD
4322 In order to make it easy to perform benchmarks to ensure that
4323 there are no performance loss, lalr1.cc is forked into
4324 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
4325 lalr1.cc.
4326
4327 Meanwhile, to make sure that lalr1-fusion.cc is correctly
4328 exercized by the test suite, the user must install a symbolic link
4329 from lalr1.cc to it.
de62edee 4330
b06df3c2
AD
4331 Instead of having three stacks (state, value, location), use a
4332 stack of triples. This considerably simplifies the code (and it
4333 will be easier not to require locations as currently does the C++
4334 parser), and also gives a 10% speedup according to
4335 etc/bench (probably mainly since memory allocation is done once
4336 instead of three times).
de62edee 4337
0e0ed236
AD
4338 Another motivation is to make it easier to destruct properly
4339 semantic values: now that they are bound to their state (hence
4340 symbol type) it will be easier to call the appropriate destructor.
de62edee 4341
0e0ed236 4342 These changes should probably benefit the C parser too.
de62edee 4343
b06df3c2
AD
4344 * data/lalr1.cc: Copy as...
4345 * data/lalr1-fusion.cc: this new file.
0e0ed236
AD
4346 (b4_rhs_value, b4_rhs_location): New definitions overriding those
4347 from c++.m4.
4348 (state_stack_type, semantic_stack_type, location_stack_type)
4349 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
4350 (data_type, stack_type, yystack_): New.
4351 (YYLLOC_DEFAULT, yypush_): Adjust.
4352 (yyerror_range): Now based on data_type, not location_type.
4353
7dedf26e
AD
43542008-11-03 Akim Demaille <demaille@gostai.com>
4355
4356 Push the state, value, and location at the same time.
4357 This is needed to prepare a forthcoming patch that fuses the three
4358 stacks into one.
de62edee 4359
7dedf26e
AD
4360 * data/lalr1.cc (parser::yypush_): New.
4361 (parser::yynewstate): Change the semantics: instead of arriving to
4362 this label when value and location have been pushed, but yystate
4363 is to be pushed on the state stack, now the three of them must
4364 have been pushed before. yystate still must be the new state.
4365 This allows to use yypush_ everywhere instead of individual
4366 handling of the stacks.
4367
c4585f1e
AD
43682008-11-03 Akim Demaille <demaille@gostai.com>
4369
4370 Prefer references to pointers.
4371 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
4372 definition to use references instead of pointers.
4373 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
4374 Take the value and location as references.
4375 Adjust callers.
4376
56017c17
AD
43772008-11-03 Akim Demaille <demaille@gostai.com>
4378
4379 stack::size instead of stack::height.
4380 * data/lalr1.cc (stack::height): Rename as...
4381 (stack::size): this.
4382 Fix the output type.
4383 Comment changes.
4384
5ab8c47b
AD
43852008-11-03 Akim Demaille <demaille@gostai.com>
4386
4387 Use variants to support objects as semantic values.
b06df3c2
AD
4388 This patch was inspired by work by Michiel De Wilde. But he used
4389 Boost variants which (i) requires Boost on the user side, (ii) is
4390 slow, and (iii) has useless overhead (the parser knows the type of
4391 the semantic value there is no reason to duplicate this
4392 information as Boost.Variants do).
4393
4394 This implementation reserves a buffer large enough to store the
4395 largest objects. yy::variant implements this buffer. It was
4396 implemented with Quentin Hocquet.
de62edee 4397
5ab8c47b
AD
4398 * src/output.c (type_names_output): New.
4399 (output_skeleton): Invoke it.
4400 * data/c++.m4 (b4_variant_if): New.
4401 (b4_symbol_value): If needed, provide a definition for variants.
4402 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
4403 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
4404 (b4_char_sizeof, yy::variant): New.
4405 (parser::parse): If variants are requested, define
4406 parser::union_type, parser::variant, change the definition of
4407 semantic_type, construct $$ before running the user action instead
4408 of performing a default $$ = $1.
4409 * examples/variant.yy: New.
4410 Based on an example by Michiel De Wilde.
4411
1fa5d8bb
AD
44122008-11-03 Akim Demaille <demaille@gostai.com>
4413
4414 Parameterize the extraction of semantic values.
4415 To make future changes easier, no longer rely on ".TYPE" being the
4416 way to get a semantic value.
de62edee 4417
1fa5d8bb
AD
4418 * data/c.m4 (b4_symbol_value): New.
4419 Use it.
4420 * data/c++.m4, data/yacc.c: Use it.
4421 * data/glr.c: Use b4_symbol_value.
4422 (b4_rhs_data): New.
4423 Use it.
4424
91ba8a55
AD
44252008-11-03 Akim Demaille <demaille@gostai.com>
4426
4427 Prepare easier M4 changes.
4428 * data/lalr1.cc: Use escaped [] instead of literals to prepare
4429 future changes.
4430
c9ba9e59
JD
44312008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4432
4433 Initiate further development.
4434 * NEWS: Create an empty section for new entries.
4435 * gnulib: Update submodule to HEAD.
4436
bfb40910
JD
44372008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4438
4439 * NEWS: Version 2.4.
4440
241fda7a
JD
44412008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4442
4443 Prepare for next release.
4444 * NEWS: Briefly mention changes since 2.3b.
4445 * README: Say GNU m4 1.4.6, which we've been requiring in release
4446 announcements already, not 1.4.3, which breaks the build.
4447
ed4d67dc
JD
44482008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4449
4450 Say %language is experimental.
4451 We're thinking of extending it's effect on output file naming. See the
4452 thread at
4453 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
4454 * NEWS: Say it's experimental.
4455 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
4456 recommend it over %skeleton for now.
4457 (Bison Options): Likewise.
4458 (C++ Bison Interface): Use %skeleton not %language.
4459 (Calc++ Parser): Use %skeleton not %language.
4460 * src/getargs.c (usage): Say it's experimental.
4461
e254a580
DJ
44622008-11-01 Di-an Jan <dianj@freeshell.org>
4463 Paolo Bonzini <bonzini@gnu.org>
4464
4465 Support all Java parser class modifiers.
4466 * data/java.m4 (b4_percent_define_get3): New.
4467 (b4_final_if, b4_strictfp_if): New.
4468 * data/lalr1.java (final, strictfp, extends, implements): Support.
4469 * doc/bison.texinfo (final, strictfp, extends, implements): Add
4470 documentation.
4471 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
4472 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
4473 (AT_CHECK_JAVA_GREP): New.
4474 (Java parser class modifiers): New test.
4475 (Java parser class extends and implements): New test.
4476
4477 Model exception propagation better with throws and lex_throws.
4478 * data/java.m4 (b4_list2): New.
4479 (throws): Change default.
4480 * data/lalr1.java (yyaction): Add throws.
4481 (parse): Add lex_throws in addition to throws.
4482 * doc/bison.texinfo (throws, lex_throws): Add documentation.
4483 * tests/java.at (Java throws specifications): New test.
4484
4485 Improve documentation for Java parsers.
4486 * doc/bison.texinfo (Java Parsers): Add subsections.
4487 Don't quote first argument of %define.
4488 (Java Bison Interface): Document output files. Move documentation
4489 of parser class and merge into Java Parser Interface. Document
4490 features that error out. Document directives with no effect.
4491 Move note about Javadoc higher.
4492 (Java Semantic Values): Explicitly mention stype.
4493 Document that generic types cannot be used.
4494 (Java Location Values): Use @deftypeivar. Document constructors.
4495 Correct return value for toString.
4496 (Java Parser Interface): List undocumented constants/fields.
4497 Move documentation of fields added by %parse-param closer to list
4498 of members. Document that token names are added as fields.
4499 Document constructors accurately. Remove error method.
4500 (Java Scanner Interface): Move note on %pure-parser to Java Bison
4501 Interface. Describe %code lexer and yylex accutately.
4502 Remove documentation that does not match the code.
4503 (Java Action Features): New.
4504 (Java Differences): Add reference. Add item on semantic values.
4505 Add note about @{ ... @}. Clarify %% epilogue placement.
4506 (Java Declarations Summary): New.
4507
4508 Fix Java skeleton.
4509 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
4510 (b4_remove_comma): Quote test argument.
4511 (b4_identification): Remove "bison" field.
4512 * tests/java.at (Java parser class and package names): New test.
4513 (Java %parse-param and %lex-param): New test.
4514 (Java stype, position_class and location_class): New test.
4515
f259e4e6
PB
45162008-10-31 Di-an Jan <dianj@freeshell.org>
4517
4518 * data/lalr1.jave: Update copyright years.
4519 (YYParser): Correct name of "generated from" file in Javadoc:
4520 use b4_file_name instead of @ofile@.
4521 (Location constructor): Correct Javadoc parameter name.
4522 (yylloc): Add missing opening m4 quote after b4_location_if.
4523 This removes a stray [ in the Javadoc of Lexer.getStartPos.
4524 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
4525 (YYParser constructor): Correct Javadoc parameter name.
4526
cae5057f
JD
45272008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
4528
4529 Always put auxiliary code files in the same dir as other output files.
4530 * src/files.c (compute_file_name_parts): When the user specifies
4531 --output but not --file-prefix, extract the directory prefix from the
4532 file prefix not from the grammar file name. This affects the location
4533 of files like location.hh generated by the C++ skeleton. The includes
4534 in the other output files require this fix.
4535 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
4536 for expected output files.
4537 (Output files): Add a test for the above.
4538
4af432ba
JD
45392008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
4540
4541 * gnulib: Update submodule to HEAD.
4542
e26d4e43
JD
45432008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4544
4545 Update copyright year.
4546 * src/files.c: Here.
4547
c0ee9e21
DJ
45482008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
4549
4550 Don't overwrite the input file.
4551 * src/files.c (output_file_name_check): Fatal error if using input file
4552 for output.
4553 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
4554 argument.
4555 (Conflicting output files): Add test.
4556
482dc52f
AD
45572008-10-28 Akim Demaille <demaille@gostai.com>
4558
4559 Space changes.
4560 * data/lalr1.cc: Formatting changes.
4561
52cbbe84
AD
45622008-10-28 Akim Demaille <demaille@gostai.com>
4563
4564 Don't define debugging functions when !YYDEBUG.
4565 * data/lalr1.cc (debug_stream, set_debug_stream)
4566 (debug_level_type, debug_level, set_debug_level): Don't
4567 declare them when YYDEBUG is not defined.
4568 The implementation are already YYDEBUG-aware.
4569
0925d5bf
AD
45702008-10-28 Akim Demaille <demaille@gostai.com>
4571
4572 Prefer "continue" for empty loop bodies.
4573 * etc/bench.pl.in: Use "continue" instead of {}.
4574
cf98343c
AD
45752008-10-28 Akim Demaille <demaille@gostai.com>
4576
4577 Space and comments changes.
4578 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
4579 * data/c.m4, data/lalr1.cc: Space changes.
4580
9f467b7d
AD
45812008-10-28 Akim Demaille <demaille@gostai.com>
4582
4583 Make gnulib a submodule.
4584 * gnulib: New.
4585 * .gitmodules (gnulib): New.
4586
0f0e1ace
JD
45872008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4588
4589 Fix yyerror_range for user-defined location type in C++. Reported by
4590 Georg Sauthoff at
4591 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
4592 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
4593 * THANKS (Georg Sauthoff): Add.
4594
548e2104
JD
45952008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4596
4597 Update several administrative files mainly to facilitate releasing.
4598 * HACKING (Administrivia): Make the git-merge-changelog notes more
4599 helpful.
4600 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
4601 (Release Procedure): Update for git and add numerous details that were
4602 previously missing.
4603 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
4604 * maint.mk (announcement): Don't list bison as a bootstrap tool so
4605 that announcements don't claim we bootstrapped with whatever bison
4606 happened to be in PATH. Add flex as a bootstrap tool.
4607 * Makefile.maint: Remove, previously replaced by maint.mk.
4608 * Makefile.cfg: Remove, and migrate settings to...
4609 * cfg.mk: ... here for the sake of `make announcement'.
4610 * bootstrap.conf (gnulib_modules): Add announce-gen.
4611 * README: Say GNU Bison instead of just Bison. Suggested by Karl
4612 Berry.
4613
ddf17a6e
PB
46142008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
4615
4616 Small but important bugfixes for the Java skeleton.
4617 * data/lalr1.java (yyerror): Change Location to b4_location_type.
4618 (yy_symbol_print): Call toString on yyvaluep.
4619
e1145ad8
AD
46202008-08-29 Akim Demaille <demaille@gostai.com>
4621
4622 Clarify UPDATED use.
215b40ac 4623 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 4624 not to the release date of Bison.
215b40ac 4625 Reported by Joel E. Denny.
e1145ad8 4626
0df72d78
AD
46272008-08-29 Akim Demaille <demaille@gostai.com>
4628
4629 * README: Update FAQ pointer.
4630 Reported by Joel E. Denny.
4631
9a90b6bb
EB
46322008-08-27 Eric Blake <ebb9@byu.net>
4633
4634 Resync m4sugar from autoconf.
4635 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
4636 (m4_init): Adjust to latest m4.git changes.
4637 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
4638 effects.
4639 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
4640 (_m4_list_cmp): Reduce side effects.
4641
65015668
AD
46422008-08-27 Akim Demaille <demaille@gostai.com>
4643
4644 Check yyerrok in calc.at.
215b40ac
EB
4645 * tests/calc.at (calc.y): Use yyerrok on "( error )".
4646 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
4647 expected.
65015668 4648
98e26a92
AD
46492008-08-27 Akim Demaille <demaille@gostai.com>
4650
4651 Support yyerrok in lalr1.cc.
4652 YYBACKUP is still to import back into lalr1.cc.
215b40ac 4653 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 4654
86c0e784
JD
46552008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4656
4657 For maintainer-check*, don't recompile for a $(VERSION) update.
4658 * cfg.mk: New file.
4659 (_is-dist-target): Override the one in GNUmakefile.
4660 * Makefile.am (EXTRA_DIST): Add cfg.mk.
4661
88511166
JD
46622008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4663
4664 Update for recent change to gnulib.
4665 * src/parse-gram.y: Don't include strverscmp.h. It comes from
4666 string.h now.
4667
6bbb2ed5
EB
46682008-08-15 Eric Blake <ebb9@byu.net>
4669
d67c52e8
EB
4670 Remaining m4sugar merge from autoconf.
4671 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
4672 * data/m4sugar/foreach.m4: New file, copied from autoconf.
4673 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
4674 * src/output.c (output_skeleton): Tell m4 how to find it.
4675
6bbb2ed5
EB
4676 Partial m4sugar merge from autoconf: m4_map.
4677 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
4678 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
4679 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
4680 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
4681 for empty list.
4682 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
4683 Likewise.
4684 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
4685 declares it.
4686
8dce3875
JD
46872008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
4688
4689 Keep .version and PACKAGE_VERSION in sync.
4690 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
4691 dependency, and add comments justifying this in more detail. Discussed
4692 starting at
4693 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
4694
882a1fbf
EB
46952008-08-06 Eric Blake <ebb9@byu.net>
4696
a3764451
EB
4697 Partial m4sugar merge from autoconf: m4_shiftn.
4698 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
4699 (m4_shift2, m4_shift3): New macros.
4700 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
4701 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
4702 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
4703 * data/java.m4 (b4_remove_comma): Likewise.
4704
882a1fbf
EB
4705 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
4706 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
4707 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
4708 (m4_init): Consolidate wrapped text into single m4_wrap.
4709 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
4710 in wrapped text.
4711
a30e920d
EB
47122008-08-05 Eric Blake <ebb9@byu.net>
4713
dfcc5959
EB
4714 Partial m4sugar merge from autoconf: builtins, version.m4.
4715 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
4716 (m4_prepend): Remove, as it is unused and inherently quadratic,
4717 whereas m4_append is linear in newer m4.
4718 (m4_mkstemp): New builtin.
4719 (m4_symbols): Make rename conditional.
4720 (m4_version_prereq): Ensure fatal error if used in bison, which
4721 intentionally lacks version.m4.
4722
a30e920d
EB
4723 Fix comments in m4sugar.
4724 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
4725
445b7470
JD
47262008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4727
4728 Update for recent .gitignore fix in Gnulib.
4729 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
4730 anchored .gitignore entries.
4731
a1e50014
JD
47322008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4733
4734 Set gnu or gnits strictness.
4735 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
4736 development and gnits strictness for releases. Based on Eric Blake's
4737 suggestion at
4738 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
4739
d43f77e7
PB
47402008-07-31 Paolo Bonzini <bonzini@gnu.org>
4741
4742 * NEWS: Clarify documentation of %language.
4743
fee2ed87
PB
47442008-07-31 Paolo Bonzini <bonzini@gnu.org>
4745
4746 Support usage of git-merge-changelog.
4747 * .gitattributes: New.
4748 * HACKING: Document usage of git-merge-changelog.
4749 * bootstrap: Install git-merge-changelog entries in .git/config
4750 if appropriate.
4751
78029cd5
JD
47522008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4753
4754 Remove remaining dependence on CVS Id keyword.
4755 * ChangeLog: For the sake of people still using CVS, don't use dollars
4756 when mentioning Id.
4757 * data/xslt/bison.xsl: Remove Id from header comments, where it was
4758 unusual anyway.
4759 * data/xslt/xml2dot.xsl: Likewise.
4760 * data/xslt/xml2text.xsl: Likewise.
4761 * data/xslt/xml2xhtml.xsl: Likewise.
4762 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
4763 * doc/Makefile.am (neutralize): Remove, no longer needed.
4764 (.x.1): Don't use neutralize.
4765 (edit): Don't substitute for ID.
4766 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
4767
c53d18b1
JD
47682008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4769
4770 Fix dependence on computed configure variables.
4771 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
4772 $(top_srcdir)/configure.ac so that changes to computed variables, such
4773 as PACKAGE_VERSION, are seen.
4774 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
4775
5523ac79
JD
47762008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
4777
4778 Update copyright dates for recent changes.
4779 * Makefile.am: Here.
4780 * src/Makefile.am: Here.
4781 * src/reduce.c: Here.
4782 * tests/reduce.at: Here.
4783
8fa36911
JD
47842008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
4785
4786 Use git-version-gen for version names between releases.
4787 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
4788 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
4789 * .prev-version: New.
4790 * .version.in: Remove.
78029cd5 4791 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
4792 revision.
4793 * GNUmakefile: Remove, now copied from Gnulib.
4794 * Makefile.am: Add code suggested by comments in
4795 build-aux/git-version-gen.
4796 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
4797 .prev-version, and .version.
4798 * NEWS (2.3b+): Rename to...
4799 (?.?): ... this because we're dropping the "+" version naming scheme,
4800 but, in general, we still can't be sure of our next release name.
4801 * bootstrap: Add a quick hack to remove from .gitignore the
4802 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
4803 entry. This should really be fixed in gnulib instead.
4804 * bootstrap.conf (gnulib_modules): Add gnumakefile.
4805 * configure.ac (AC_INIT): Set version name by invoking
4806 build-aux/git-version-gen.
4807 (AC_CONFIG_FILES): Remove .version, now generated by
4808 build-aux/git-version-gen.
4809 * maint.mk: New, copied from coreutils.
4810 * doc/.cvsignore (bison.1): Add.
4811 * doc/.gitignore (/bison.1): Add.
4812 * doc/bison.1: Remove, generated.
4813 * src/.cvsignore (revision.c): Remove.
4814 * src/.gitignore (/revision.c): Remove.
4815 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
4816 (BUILT_SOURCES): Remove revision.c.
4817 (revision.c): Remove.
4818 * src/getargs.c (version): Don't print revision after the VERSION.
4819 * src/revision.h: Remove.
4820
bcf07cb7
JD
48212008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4822
4823 Fix untranslatable composition of sentences. Reported by Goran
4824 Uddeborg at
4825 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
4826 * THANKS (Goran Uddeborg): Add.
4827 * src/reduce.c (reduce_print): Report the number of nonterminals and
4828 rules useless in the grammar in separate sentences.
4829 * tests/reduce.at (Useless Rules): Update output.
4830 (Reduced Automaton): Likewise.
4831 (Underivable Rules): Likewise.
4832 (Empty Language): Likewise.
4833
9aacab9a
JD
48342008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4835
4836 Fix some .gitignore and .cvsignore problems.
4837 * bootstrap (insert_sorted_if_absent): Replace all uses with...
4838 (insert_vc_ignore): ... this new function, which prepends `/' to all
4839 .gitignore entries before passing them to insert_sorted_if_absent.
4840 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
4841 .cvsignore files are maintained even though Bison developers run
4842 bootstrap while using Git.
4843 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
4844 unneeded by Bison.
4845 (gnulib): Add.
4846 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
4847 unneeded. Reported by Eric Blake.
4848 * lib/.gitignore (/*~): Add.
4849 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
4850 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
4851 Blake.
4852 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
4853
a9fc7990
JD
48542008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4855
4856 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
4857 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
4858 * bootstrap.conf (gnulib_modules): Add unsetenv.
4859 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
4860 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
4861 (/setenv.m4): Add.
4862 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
4863 the first argument because it may become position-dependent, and unset
4864 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
4865 Add comments explaining these issues in more detail.
4866
0f1d6f10
JD
48672008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
4868
4869 Add .gitignore everywhere based on .cvsignore.
4870 * .gitignore: New.
4871 * build-aux/.gitignore: New.
4872 * data/.gitignore: New.
4873 * doc/.gitignore: New.
4874 * etc/.gitignore: New.
4875 * examples/.gitignore: New.
4876 * examples/calc++/.gitignore: New.
4877 * lib/.gitignore: New.
4878 * m4/.gitignore: New.
4879 * po/.gitignore: New.
4880 * runtime-po/.gitignore: New.
4881 * src/.gitignore: New.
4882 * tests/.gitignore: New.
4883
7bd1665a
JD
48842008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4885
4886 * NEWS (2.3b+): New section, empty for now.
4887 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
4888
72c5b982
JD
48892008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4890
4891 * NEWS (2.3b): Update release date since there has been a delay in
4892 getting the announcements and tarballs out.
4893
bd02cd5d
JD
48942008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4895
4896 * NEWS: Version 2.3b.
4897 * configure.ac (AC_INIT): Likewise.
4898 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
4899
9126263e
JD
49002008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4901
4902 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
4903 been doing it for years.
4904 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
4905 (Release Procedure): Add FIXME about make alpha being unmaintained.
4906
fa6aa7b3
JD
49072008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
4908
4909 * data/yacc.c: Reformat m4 a little for readability.
4910 * src/lalr.c (build_relations): Correct comment.
4911
d30b312d
JMG
49122008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4913
4914 DJGPP specific issue.
4915 * djgpp/config.sed: Fixes required to run configure scripts generated
4916 by autoconf 2.62.
4917
138d4cd9
JD
49182008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4919
4920 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
4921 coordinator@translationproject.org.
4922
8f7e2e1f
JD
49232008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4924
4925 * THANKS: Add Eric Blake.
4926
f55efa38
JD
49272008-04-23 Eric Blake <ebb9@byu.net>
4928
4929 Revert prior patch, by working around autoconf regression.
4930 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
4931 ("Output file name: ("): Uncomment test.
4932 ("Output file name: )"): Likewise.
4933 Based on an idea from Noah Misch.
4934
096c9f9d
JD
49352008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4936
4937 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
4938 2.61. Reported by Juan Manuel Guerrero at
4939 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
4940 * tests/output.at ("Output file name: ("): Comment out test case for
4941 now.
4942 ("Output file name: )"): Likewise.
4943
0f664b89
JD
49442008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4945
4946 * GNUmakefile: Update git-version-gen invocation so make dist
4947 succeeds.
4948
1cfe6375
JD
49492008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4950
4951 Update to the current gnulib CVS repository, and fix trigraph handling
4952 in Bison.
4953 * bootstrap: Update gnulib CVS repository URL.
4954 (symlink_to_dir): Encapsulate the code that guarantees the destination
4955 directory exists into...
4956 (check_dst_dir): ... this new function, and...
4957 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
4958 fail when copying files into lib/uniwidth/.
4959 * src/output.c (prepare_symbols): When writing yytname muscles, where
4960 symbol names will be encoded in C-string literals, tell quotearg to
4961 escape trigraphs. This used to be the default in gnulib.
4962 * tests/regression.at (Token definitions): Because of the change in
4963 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
4964 escapes trigraphs in symbol names. Thus, yytname no longer has
4965 trigraphs unnecessarily doubly escaped. Update test case output.
4966 Extend test case to be sure Bison's own error messages will no longer
4967 have trigraphs in symbol names unnecessarily escaped once.
4968
74c52fc8
JD
49692008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
4970
4971 Fix make dist infinite loop reported by Juan Manuel Guerrero at
4972 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
4973 * .cvsignore: Add .version.
4974 * .version.in: New.
4975 * bootstrap.conf (gnulib_modules): Add git-version-gen.
4976 * configure.ac (AC_CONFIG_FILES): Add .version.
4977 * build-aux/.cvsignore: Add git-version-gen.
4978
8e55b3aa
JD
49792008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4980
4981 * NEWS (2.3a+): Mention that -g now takes an argument.
4982 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
4983 consistency. Update the -g and -x entries now that they take
4984 arguments. Use brackets to indicate optional arguments.
4985 * src/getargs.c (usage): Explain the relationship between arguments of
4986 long and short options more completely. Document --defines and -d
4987 separately since the former takes an argument but, for POSIX Yacc, the
4988 latter does not.
4989 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 4990 (getargs): Sort cases.
8e55b3aa 4991
59c5ac72
AD
49922008-02-28 Akim Demaille <demaille@gostai.com>
4993
4994 * doc/bison.texinfo: Fix a few typos.
4995
118d4978
AD
49962008-02-28 Akim Demaille <akim@epita.fr>
4997
4998 * doc/bison.texinfo (Bison Options): Document -W.
4999 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
5000
7020f1e9
AD
50012008-02-28 Akim Demaille <akim@epita.fr>
5002
5003 * src/getargs.c (short_options): Split and sort for readability.
5004 -g and -x take optional arguments, just like their long options.
5005 * build-aux/cross-options.pl: Use /x to make the regexp easier to
5006 understand.
5007 Fix the handling of $opt which resulted in all the argument to be
5008 considered as optional.
5009
59da312b
JD
50102008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
5011
5012 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
5013 say its interface is experimental.
5014 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5015 Java.
5016 (Bison Options): In the -L and --language entry, mention Java.
5017 (Java Bison Interface): Say the interface is experimental.
5018 * src/getargs.c (usage): Mention -L and --language.
5019
5020 * NEWS (2.3a+): Say the push parsing interface is experimental.
5021 * doc/bison.texinfo (Push Decl): Likewise.
5022 (Decl Summary): Likewise in the "%define api.push_pull" entry.
5023 (Push Parser Function): Likewise.
5024 (Pull Parser Function): Likewise.
5025 (Parser Create Function): Likewise.
5026 (Parser Delete Function): Likewise.
5027 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
5028 yypull_parse, and yypush_parse entries.
5029
5030 * NEWS (2.3a+): Mention XML support, and say the schema is
5031 experimental.
5032 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
5033 * src/getargs.c (usage): Say the XML schema is experimental.
5034
5035 * NEWS (2.3a+): Say option instead of flag.
5036
2bb3ebec
WP
50372008-02-21 Wojciech Polak <polak@gnu.org>
5038
5039 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
5040 text.
5041
333e670c
JD
50422008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
5043
5044 Fix impure push parser compile error reported by Bob Rossi at
5045 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
5046 * data/yacc.c: Clean up whitespace in the output a little.
5047 (yypstate_allocated): Define for impure push parsers regardless of
5048 whether the pull interface is also requested.
5049 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
5050 check impure push parsers without the pull interface.
5051
5052 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
5053 yyerror takes arguments specified by %parse-param while yypstate_new
5054 does not.
5055 * doc/bison.texinfo (Parser Create Function): Document that
5056 yypstate_new returns 0 for multiple impure parser instances.
5057 * tests/push.at (Push Parsing: Multiple impure instances): Update
5058 expected stderr output.
5059
798096e1
JD
50602008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5061
5062 * runtime-po/POTFILES.in (push.c): Remove.
5063
9ca7f077
JD
50642008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5065
5066 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
5067 * data/push.c: Rename to...
5068 * data/yacc.c: ... this, overwriting it.
5069 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
5070 `%push-pull-parser' -> `%define api.push_pull "both"'.
5071 Remove old yacc.c tests, and update push.c tests to yacc.c.
5072
42ee26bb
JD
50732008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5074
5075 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
5076 `"%code top" blocks' instead of `%code "top" blocks'.
5077 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
5078 Clean up whitespace in the output a little.
5079
b1cc23c4
JD
50802008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5081
5082 Fix documentation problems reported by Tim Josling at
5083 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
5084 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
5085 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
5086 integers. Explain the effect of literal string aliases on error
5087 messages. Copy token 0 documentation from the C++ skeleton
5088 documentation.
5089
ab7f29f8
JD
50902008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5091
5092 Accept a token number in a %left, %right, or %nonassoc for POSIX
5093 conformance. Reported by Tim Josling at
5094 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
5095 * NEWS (2.3a+): Mention.
5096 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
5097 and code numbers are treated by precedence declarations.
5098 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
5099 of symbols.1.
5100 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
5101 of symbol.
5102 (symbol.prec): New, just like symbol but allows INT.
5103 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
5104 longer holds.
5105 * tests/regression.at (Token number in precedence declaration): New
5106 test case.
5107
a924ef36
JMG
51082008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5109
5110 DJGPP specific issues.
5111 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
5112 be changed. Copyright timestamp adjusted.
5113 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
5114 be changed. Copyright timestamp adjusted.
5115 * djgpp/config.site: Copyright timestamp adjusted.
5116 * djgpp/config_h.sed: Copyright timestamp adjusted.
5117 * djgpp/djunpack.bat: Copyright timestamp adjusted.
5118 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
5119 filename translation list.
5120 * djgpp/subpipe.c (init_subpipe): Check the environment variables
5121 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
5122 files shall be created. Before trying to use the temp dir where the
5123 environment variable points to check that the dir really exists. If
5124 not default to the cwd as temp dir. Copyright timestamp adjusted.
5125 * djgpp/subpipe.h: Copyright timestamp adjusted.
5126 * djgpp/testsuite.sed: Copyright timestamp adjusted.
5127
389c8cfd
PE
51282008-01-30 Paul Eggert <eggert@cs.ucla.edu>
5129
5130 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
5131
5d1cfef4
PE
51322008-01-09 Paul Eggert <eggert@cs.ucla.edu>
5133
5134 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
5135 Problem reported by Claudio Saavedra in
5136 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
5137
e2dcf996
WP
51382008-01-05 Wojciech Polak <polak@gnu.org>
5139
5140 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
5141 document's title with the input grammar file name.
5142
da730230
JD
51432007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
5144
5145 Automate regression testing of the XML/XSLT implementation. Discussed
5146 starting at
5147 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
5148 * configure.ac (XSLTPROC): New substitution.
5149 * Makefile.am (maintainer-xml-check): New phony target invoking...
5150 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
5151 invoking make maintainer-check with BISON_TEST_XML=1.
5152 * tests/atlocal.in (XSLTPROC): New.
5153 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
5154 not to report reachable memory when Bison is expected to have a
5155 non-zero exit status and (2) to compare XML/XSLT output with --graph
5156 and --report=all output for every working grammar when
5157 BISON_TEST_XML=1.
5158 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
5159 (AT_BISON_CHECK_XML): New.
5160 (AT_QUELL_VALGRIND): New.
5161 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
5162 (AT_CHECK): ... don't redefine this since this was the old way to
5163 quell Valgrind.
5164 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
5165 AT_BISON_CHECK invocations.
5166 * tests/c++.at: Likewise.
5167 * tests/calc.at: Likewise.
5168 * tests/conflicts.at: Likewise.
5169 * tests/cxx-type.at: Likewise.
5170 * tests/existing.at: Likewise.
5171 * tests/glr-regression.at: Likewise.
5172 * tests/headers.at: Likewise.
5173 * tests/input.at: Likewise.
5174 * tests/java.at: Likewise.
5175 * tests/output.at: Likewise.
5176 * tests/push.at: Likewise.
5177 * tests/reduce.at: Likewise.
5178 * tests/regression.at: Likewise.
5179 * tests/sets.at: Likewise.
5180 * tests/skeletons.at: Likewise.
5181 * tests/synclines.at: Likewise.
5182 * tests/torture.at: Likewise.
5183 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
5184 tends to hang xsltproc.
5185 (Big horizontal): Likewise.
5186
408476bc
JD
51872007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5188
5189 In XML output, remove redundant class attribute on symbol element.
5190 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
5191 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
5192 look up a symbol to determine whether it's a nonterminal or terminal.
5193 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
5194 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
5195
5196 Add prec/assoc information to XML output.
5197 * src/gram.c (grammar_rules_print_xml): For each rule that has a
5198 %prec, add a percent_prec attribute.
5199 * src/print-xml.c (print_grammar): For each terminal that has a
5200 precedence or associativity, add a prec or assoc attribute.
5201 (xml_indent): New.
5202 (xml_puts): Use xml_indent.
5203 (xml_printf): Use xml_indent.
5204 * src/print-xml.h (xml_indent): Prototype.
5205
5206 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
5207 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5208
d4a26c48
JD
52092007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5210
5211 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
5212 (bison:ruleByNumber): ... this for clarity.
5213 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
5214 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
5215 (xsl:template match="reduction"): Update.
5216 (xsl:template match="item"): Update.
5217 (xsl:template match="reduction"): Update.
5218
5219 In the XML output, don't print the list of rules where symbols appear.
5220 Compute it in XSLT instead. Discussed at
5221 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
5222 * data/xslt/bison.xsl (bison:ruleByLhs): New.
5223 (bison:ruleByRhs): New.
5224 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
5225 bison:ruleByRhs.
5226 (xsl:template match="terminal/rule"): Remove.
5227 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5228 bison:ruleByRhs.
5229 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5230 Remove.
5231 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
5232 bison:ruleByRhs and mode="number-link" for rule template.
5233 (xsl:template match="terminal/rule"): Remove.
5234 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5235 bison:ruleByRhs and mode="number-link" for rule template.
5236 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5237 Rewrite as...
5238 (xsl:template match="rule" mode="number-link"): ... this.
5239 * src/print-xml.c (print_grammar): Don't print the list of rules.
5240
ef1b4273
JD
52412007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5242
5243 Don't let --report affect XML output; always print all information.
5244 Discussed at
5245 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
5246 * src/conflicts.c (log_resolution): Implement.
5247 * src/print-xml.c (print_core): Implement.
5248 (print_state): Implement.
5249 (print_xml): Implement.
5250
5251 * NEWS (2.3a+): Fix quotes.
5252 * src/parse-gram.y (prologue_declaration): For consistency with -v,
5253 don't let %verbose clear the list specified by --report.
5254
0f6cd9e3
AD
52552007-11-26 Akim Demaille <akim@epita.fr>
5256
5257 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
5258
d80fb37a
JD
52592007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
5260
5261 In the XML output, list useless and unused symbols and rules with the
5262 useful ones and add a "usefulness" attribute. Discussed starting at
5263 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
5264 * src/gram.c (grammar_rules_partial_print_xml): Remove.
5265 (grammar_rules_print_xml): Print all rules instead of just those
5266 useful in the grammar, and add a "usefulness" attribute.
5267 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
5268 * src/print-xml.c (print_rules_useless_in_parser): Remove.
5269 (print_grammar): Print all nonterminals instead of just useful ones,
5270 and add a "usefulness" attribute to nonterminals and terminals.
5271 (print_xml): Don't print a separate "reductions" or
5272 "rules-useless-in-parser" element.
5273 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
5274 (reduce_xml): Remove.
5275 (reduce_token_unused_in_grammar): New.
5276 (reduce_nonterminal_useless_in_grammar): New.
5277 * src/reduce.h (reduce_xml): Remove prototype.
5278 (reduce_token_unused_in_grammar): Add prototype.
5279 (reduce_nonterminal_useless_in_grammar): Add prototype.
5280 * data/xslt/xml2text.xsl: Update for XML changes.
5281 * data/xslt/xml2xhtml.xsl: Update for XML changes.
5282 * tests/reduce.at (Useless Terminals): Update output.
5283 (Useless Rules): Update output.
5284 (Reduced Automaton): Update output.
5285
5286 Say "Terminals unused in grammar" instead of "Unused terminals".
5287 * NEWS (2.3a+): Update.
5288 * doc/bison.texinfo (Understanding): Update example output.
5289 * src/reduce.c (reduce_output): Implement.
5290 * data/xslt/xml2text.xsl: Implement.
5291 * data/xslt/xml2xhtml.xsl: Implement.
5292
1bb2bd75
JD
52932007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
5294
5295 Accept --report-file=FILE to override the default `.output' filename.
5296 * NEWS (2.3a+): Mention.
5297 * doc/bison.texinfo (Bison Options): Add an entry.
5298 * src/files.c (compute_output_file_names): Don't override
5299 spec_verbose_file if already set.
5300 * src/getargs.c (usage): Document --report-file.
5301 (REPORT_FILE_OPTION): New anonymous enum member.
5302 (long_options): Add entry for it.
5303 (getargs): Add case for it setting spec_verbose_file.
5304
5305 * build-aux/cross-options.pl: Don't record a short option just because
5306 there's an arg.
5307 * doc/.cvsignore: Add yacc.1.
5308
a005a9c4
AD
53092007-11-14 Akim Demaille <akim@epita.fr>
5310
5311 * doc/yacc.1.in: New.
5312 * configure.ac, doc/Makefile.am: Adjust.
5313 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
5314 config.h symbol.
5315 Use AC_SUBST for assignments too.
5316 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
5317
cff03fb2
JD
53182007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5319
5320 * src/gram.c: Remove comments that duplicate comments in gram.h.
5321
5322 When reporting useless rules and nonterminals, say "useless in grammar"
5323 instead of "useless", and say "useless in parser" instead of "never
5324 reduced". Discussed starting at
5325 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
5326 * NEWS (2.3a+): Mention this change.
5327 * data/xslt/xml2text.xsl: Update output text and expected input XML
5328 element names to match changes below.
5329 * data/xslt/xml2xhtml.xsl: Likewise.
5330 (xsl:template match="bison-xml-report"): Add missing entry in Table of
5331 Contents: "Rules useless in parser due to conflicts".
5332 * doc/bison.texinfo (Decl Summary): Reword a little.
5333 (Understanding): Update example output for changes below.
5334 * src/gram.c: (rule_useful_p): Rename to...
5335 (rule_useful_in_grammar_p): ... this.
5336 (rule_useless_p): Rename to...
5337 (rule_useless_in_grammar_p): ... this.
5338 (rule_never_reduced_p): Rename to...
5339 (rule_useless_in_parser_p): ... this.
5340 (grammar_rules_print): Update for renames.
5341 (grammar_rules_print_xml): Update for renames.
5342 (grammar_rules_never_reduced_report): Rename to...
5343 (grammar_rules_useless_report): ... this since it is used for either
5344 kind of useless rule.
5345 * src/gram.h: Reword comments and update function names in prototypes.
5346 * src/main.c (main): Say "rule useless in parser due to conflicts".
5347 * src/print-xml.c (print_rules_never_reduced): Rename to...
5348 (print_rules_useless_in_parser): ... this, and rename output XML
5349 element "rules-never-reduced" to "rules-useless-in-parser".
5350 (print_xml): Update for rename.
5351 * src/print.c (print_results): Say "Rules useless in parser due to
5352 conflicts".
5353 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
5354 (nonterminals_reduce): Say "nonterminal useless in grammar".
5355 (reduce_output): Say "Nonterminals useless in grammar".
5356 Say "Rules useless in grammar".
5357 (reduce_xml): Rename output XML element "useless" to
5358 "useless-in-grammar".
5359 (reduce_print): Don't report the count of grammatically useless rules
5360 as "rules never reduced" just because %yacc is specified.
5361 In the correct report of this count, say nonterminal(s) and rule(s)
5362 "useless in grammar".
5363 * tests/conflicts.at (S/R in initial): Update expected output.
5364 (Defaulted Conflicted Reduction): Likewise.
5365 (Unreachable States After Conflict Resolution): Likewise.
5366 * tests/existing.at (GNU pic Grammar): Likewise.
5367 * tests/reduce.at (Useless Nonterminals): Likewise.
5368 (Useless Rules): Likewise.
5369 (Reduced Automaton): Likewise.
5370 (Underivable Rules): Likewise.
5371 (Empty Language): Likewise.
5372
66f0441d
JD
53732007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5374
5375 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
5376 here document and before the EOF so that BSD's implementation of Bourne
5377 shell doesn't parse the delimiter as part of the here document.
5378 * doc/.cvsignore: Add cross-options.texi.
5379 * src/getargs.c (usage): Add a blank line after the warning categories.
5380
d0ee4105
PB
53812007-11-08 Paolo Bonzini <bonzini@gnu.org>
5382
5383 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
5384
e8b1fb9b
AD
53852007-11-05 Akim Demaille <akim@epita.fr>
5386
5387 Remove Id: from bison.1.
5388 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
5389 (perl -0777 -pi -e 's/\.PP\nId): New.
5390 (.x.1): Use it to ignore the version control revision.
5391
2f7a96b5
AD
53922007-11-05 Akim Demaille <demaille@gostai.com>
5393
5394 * build-aux/Makefile.am: Ship cross-options.pl.
5395 * doc/Makefile.am: Always refer to cross-options.texi with
5396 $(srcdir).
5397 (MAINTAINERCLEANFILES): Add it.
5398
f4101aa6
AD
53992007-11-04 Akim Demaille <demaille@gostai.com>
5400
5401 Generate the long/short option cross-table.
5402 * build-aux/cross-options.pl: New.
5403 * doc/Makefile.am (cross-options.texi): New.
5404 * doc/bison.texinfo: Use it.
5405
727a1401
AD
54062007-11-04 Akim Demaille <demaille@gostai.com>
5407
5408 Generate bison.1 using help2man.
5409 * doc/common.x, doc/bison.x: New.
5410 * doc/Makefile.am (bison.1, .x.1): New.
5411 The code is taken from autoconf-2.61/man/Makefile.am.
5412 * configure.ac: Look for help2man.
5413
6aeb9c57
AD
54142007-11-04 Akim Demaille <demaille@gostai.com>
5415
5416 Complete --help.
5417 * src/getargs.c (usage): Document -W, make it clear that -d,
5418 -g and -x have optional arguments.
5419
d7be4085
AD
54202007-11-04 Akim Demaille <demaille@gostai.com>
5421
5422 Find sha1sum when named gsha1sum.
5423 * bootstrap (find_tool): New.
5424 ($SHA1SUM): New.
5425
d9df47b6
JD
54262007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5427
5428 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
5429 at
5430 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
5431 * NEWS (2.3a+): Mention.
5432 * data/bison.m4 (b4_pure_if): Don't define it here.
5433 * data/c.m4 (b4_identification): Depend on individual skeletons to
5434 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
5435 values of the %define variables api.pure or api.push_pull. Define
5436 YYPURE, YYPUSH, and YYPULL accordingly.
5437 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
5438 glr.cc has already defined b4_pure_flag.
5439 * data/push.c: Define b4_pure_if based on `%define api.pure'.
5440 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 5441 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
5442 * doc/bison.texinfo (Pure Decl): Update.
5443 (Push Decl): Update.
5444 (Decl Summary): Add api.pure to %define entry.
5445 In %pure-parser entry, say it's deprecated and reference %define.
5446 (Pure Calling): Update.
5447 (Error Reporting): Update.
5448 (C++ Scanner Interface): Update.
5449 (How Can I Reset the Parser): Update.
5450 (Table of Symbols): In %pure-parser entry, say it's deprecated and
5451 reference %define.
5452 * src/getargs.c (pure_parser): Remove global variable.
5453 * src/getargs.h (pure_parser): Remove extern.
5454 * src/output.c (prepare): Don't define pure_flag muscle.
5455 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
5456 wrapper around `%define api.pure'.
5457 * tests/calc.at (Simple LALR Calculator): Update.
5458 (Simple GLR Calculator): Update.
5459 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
5460 Update.
5461 (GLR: Resolve ambiguity, pure, locations): Update.
5462 (GLR: Merge conflicting parses, pure, no locations): Update.
5463 (GLR: Merge conflicting parses, pure, locations): Update.
5464 * tests/glr-regression.at (Uninitialized location when reporting
5465 ambiguity): Update
5466 * tests/input.at (Unused %define api.pure): New test case.
5467 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
5468 AT_PURE_IF and AT_PURE_AND_LOC_IF.
5469 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5470
c373bf8b
JD
54712007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5472
5473 %define push_pull -> %define api.push_pull. Discussed starting at
5474 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
5475 * data/push.c: Expect the new name.
5476 * data/yacc.c: Likewise.
5477 * doc/bison.texinfo (Push Decl): Update.
5478 (Decl Summary): Update %define entry.
5479 (Push Parser Function): Update.
5480 (Pull Parser Function): Update.
5481 (Parser Create Function): Update.
5482 (Parser Delete Function): Update.
5483 * tests/calc.at (Simple LALR Calculator): Update.
5484 * tests/input.at (%define enum variables): Update.
5485 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5486 (Push Parsing: Multiple impure instances): Update.
5487 (Push Parsing: Unsupported Skeletons): Update.
5488 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
5489 (Exploding the Stack Size with Malloc): Update.
5490
5491 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
5492 other entries some.
5493
32f19b6b
JD
54942007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
5495
5496 For the XML output's terminal element, rename @number to @token-number,
5497 and add @symbol-number. In the nonterminal element, rename @number to
5498 @symbol-number. Discussed starting at
5499 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
5500 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
5501 renames.
5502 (xsl:template match="nonterminal"): Likewise.
5503 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
5504 (xsl:template match="nonterminal"): Likewise.
5505 * src/print-xml.c (print_grammar): Implement.
5506
255a6b90
JD
55072007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5508
5509 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
5510 2007-10-11 change, the child elements here are items not rules.
408476bc 5511 (xsl:template match="item"): New.
255a6b90
JD
5512 (xsl:template match="rule"): Update for new reduced itemset.
5513 (xsl:template match="point"): Remove.
5514 (xsl:template match="empty"): For consistency with --graph, don't
5515 output "/* empty */".
5516 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
5517 line-wrap, don't pass a negative value as first-line-length since this
5518 won't work with the following changes.
5519 (xsl:template name="line-wrap"): Simplify slightly.
5520 (xsl:template name="ws-search"): Eliminate recursion.
5521 * src/print_graph.c (print_core): Don't print a reduction's lookahead
5522 set next to an item whose dot is not at the end of the RHS even if it
5523 happens to be associated with the same rule.
5524
88c78747
JD
55252007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5526
31984206
JD
5527 Add %define lr.keep_unreachable_states.
5528 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
5529 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
5530 * src/main.c (main): Implement it.
5531 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5532 Extend to test it, and fix a typo.
5533
55342007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5535
5536 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
5537 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
5538 the example .output text.
5539 * tests/regression.at (Extra lookahead sets in report): Improve wording
5540 of comments.
5541
b7a70162
WP
55422007-10-17 Wojciech Polak <polak@gnu.org>
5543
5544 * src/print-xml.c (print_grammar): Renamed
5545 <terminal> and <nonterminal> attributes:
5546 "type" to "number" and "symbol" to "name".
5547 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
5548 Use new attribute names.
5549 (xsl:template match="nonterminal"): Likewise.
5550 * data/xslt/xml2xhtml.xsl: Likewise.
5551
a0de5091
JD
55522007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
5553
5554 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
5555 (Option Cross Key): Likewise.
5556
5557 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
5558 next to an item whose dot is not at the end of the RHS even if it
5559 happens to be associated with the same rule.
5560 * src/print.c (print_core): Likewise.
5561 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
5562 (Resolved SR Conflicts): Update output.
5563 * tests/regression.at (Extra lookahead sets in report): New test case.
5564
4c20d18d
WP
55652007-10-11 Wojciech Polak <polak@gnu.org>
5566
5567 * src/print-xml.c (print_core): Remove item set
5568 redundancy.
5569 * data/xslt/bison.xsl (bison:ruleNumber): New key.
5570 Improve processing time. Suggested by Joel E. Denny.
5571 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
5572 Write xsl:param "required" attribute as comment.
5573 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
5574 (xsl:template match="rule"): Support new reduced itemset.
5575 (xsl:template match="point"): Remove.
5576 * data/xslt/xml2xhtml.xsl: Likewise.
5577
f506ad1c
JD
55782007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5579
5580 * src/getargs.c (version): Update copyright year.
5581
21f1b063
JD
55822007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5583
5584 Make xml2dot.xsl and --graph produce the same output.
5585 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
5586 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
5587 escaped later.
5588 (xsl:template name="output-node"): Use the new escape template instead
5589 of the string-replace template directly.
5590 (xsl:template name="output-edge"): Likewise.
5591 (xsl:template name="escape"): New, escapes backslashes and newlines in
5592 addition to quotation marks.
5593 * src/graphviz.c (start_graph, output_node, output_edge): Add
5594 whitespace to output for legibility.
5595
5596 Make xml2text.xsl and --report produce the same output, and remove the
5597 XML "conflicts" element since a conflict summary is easily extracted
5598 from the automaton.
5599 * data/xslt/bison.xsl: New.
5600 (xsl:template match="state" mode="bison:count-conflicts): New.
5601 * data/xslt/xml2text.xsl: Import bison.xsl.
5602 (xsl:template match="bison-xml-report"): Instead of styling the
5603 "conflicts" element, style the "automaton" element with mode
5604 "conflicts". Unlike the former, the latter lists S/R and R/R
5605 conflicts for a state on the same line.
5606 (xsl:template match="conflicts"): Remove.
5607 (xsl:template match="conflict"): Remove.
5608 (xsl:template match="terminal"): Line-wrap the list of rules in which
5609 the terminal is used.
5610 (xsl:template match="nonterminal"): Likewise for nonterminals.
5611 (xsl:template match="automaton" mode="conflicts"): New.
5612 (xsl:template match="state" mode="conflicts"): New.
5613 (xsl:template name="line-wrap"): New.
5614 (xsl:template name="ws-search"): New.
5615 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
5616 (xsl:template match="bison-xml-report"): Instead of styling the
5617 "conflicts" element, style the "automaton" element with mode
5618 "conflicts."
5619 (xsl:template match="conflicts"): Remove.
5620 (xsl:template match="conflict"): Remove.
5621 (xsl:template match="automaton" mode="conflicts"): New.
5622 (xsl:template match="state" mode="conflicts): New.
5623 * src/conflicts.c (conflicts_output_xml): Remove.
5624 * src/conflicts.h (conflicts_output_xml): Remove prototype.
5625 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
5626 * src/print.c (print_grammar): Consistently wrap at the 66th column so
5627 the corresponding XSLT is easier. Also, never wrap between a word and
5628 the comma that follows it.
5629
793fbca5
JD
56302007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5631
5632 Improve C++ namespace support. Discussed starting at
5633 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
5634 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
5635 b4_namespace_close): New macros that interpret the %define variable
5636 "namespace" so its value can contain "::" to indicate nested
5637 namespaces.
5638 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
5639 the above macros.
5640 * data/lalr1.cc (b4_namespace): Likewise.
5641 * data/location.cc (b4_namespace): Likewise.
5642 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
5643 inside a new table in the general %define entry. Document `%define
5644 namespace' there as well. Point the %name-prefix entry to it since it
5645 explains it more completely in the case of C++.
5646 (C++ Bison Interface): Mention `%define namespace' instead of
5647 %name-prefix.
5648 (Table of Symbols): Remove the `%define push_pull' entry. The %define
5649 entry suffices.
5650 * tests/c++.at (Relative namespace references): New test case.
5651 (Absolute namespace references): New test case.
5652 (Syntactically invalid namespace references): New test case.
5653 * tests/input.at (C++ namespace reference errors): New test case.
5654
35b8730d
JD
56552007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5656
5657 Add syncline support and location accessor to internal %define
5658 interfaces.
5659 * data/bison.m4 (b4_percent_define_get_loc): New.
5660 (b4_percent_define_get_syncline): New.
5661 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
5662 (b4_percent_define_default): Record defining location as line 1 rather
5663 than 0 for the sake of synchronizing #line's, and define
5664 b4_percent_define_syncline(VARIABLE).
5665 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
5666 * src/muscle_tab.c (muscle_syncline_grow): New.
5667 (muscle_code_grow): Use muscle_syncline_grow.
5668 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
5669 define b4_percent_define_syncline(VARIABLE).
5670 (muscle_percent_define_get_loc): New.
5671 (muscle_percent_define_get_syncline): New.
5672 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
5673 remove some unused variables.
5674 (muscle_percent_define_default): Record defining location as line 1
5675 rather than 0 for the sake of synchronizing #line's, and define
5676 b4_percent_define_syncline(VARIABLE).
5677 (muscle_percent_define_check_values): Use
5678 muscle_percent_define_get_loc.
5679 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
5680 (muscle_percent_define_get_syncline): Prototype.
5681 * tests/skeletons.at (%define Boolean variables: invalid skeleton
5682 defaults): Update output for location change.
5683 (Complaining during macro argument expansion): Extend to test
5684 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
5685
7dc4a694
JD
56862007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
5687
5688 Fix some error-reporting macro bugs.
5689 * data/bison.m4 (b4_cat): New.
5690 (b4_error, b4_error_at): Use b4_cat to send error directives directly
5691 to stdout so they don't become arguments to other macros. Update
5692 comments and add examples.
5693 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
5694 add examples.
5695 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
5696 after printing the error directive so that M4 doesn't report subsequent
5697 problems that are induced by this problem.
5698 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
5699 instead of just in them. Recognize @\n in both places. Both expand to
5700 the empty string. Needed by b4_cat.
5701 * tests/skeletons.at (Complaining during macro argument expansion):
5702 New test case.
5703 (Fatal errors make M4 exit immediately): New test case.
5704
d4bd2295
JD
57052007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
5706
5707 Implement --print-datadir.
5708 * src/getargs.c (usage): Mention.
5709 (PRINT_DATADIR_OPTION): New anonymous enum member.
5710 (long_options): Add entry for it.
5711 (getargs): Add case for it calling compute_pkgdatadir.
5712 * src/output.c (output_skeleton): Encapsulate data directory
5713 computation from here...
5714 (prepare): ... and from here...
5715 (compute_pkgdatadir): ... into this new function.
5716 * src/output.h (compute_pkgdatadir): Prototype.
5717
34cdeddf
JD
57182007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
5719
5720 * src/print-xml.c (escape_bufs): New static global variable
5721 replacing...
5722 (xml_escape_n): ... the static local variable buf here.
5723 (print_xml): Free memory for escape_bufs.
5724 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
5725
d782395d
JD
57262007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
5727
5728 Replace `%push-parser' and `%push-pull-parser' with
5729 `%define push_pull "push"' and `%define push_pull "both"'.
5730 `%define push_pull "pull"' is the default.
5731 * doc/bison.texinfo (Push Decl, Push Parser Function,
5732 Pull Parser Function, Parser Create Function, Parser Delete Function):
5733 Update declarations.
5734 (Decl Summary, Table of Symbols): Replace %push-parser and
5735 %push-pull-parser entries with a %define push_pull entry.
5736 * data/bison.m4 (b4_percent_define_check_values): New macro.
5737 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
5738 definitions...
5739 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
5740 definitions...
5741 * data/push.c: ... to here and compute them from the value of the
5742 %define variable push_pull.
5743 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
5744 parsing requests here...
5745 * data/yacc.c: ... hack this to switch to push.c any time
5746 b4_use_push_pull_flag or the %define variable push_pull is set. This
5747 will go away when we mv push.c yacc.c.
5748 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
5749 push parsing is not supported since unused %define variables are
5750 reported anyway.
5751 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
5752 * src/muscle_tab.h (muscle_percent_define_check_values): Update
5753 comments for consistency with b4_percent_define_check_values.
5754 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
5755 muscles.
5756 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
5757 Remove.
5758 (prologue_declaration): Remove %push-parser and %push-pull-parser
5759 rules.
5760 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
5761 * tests/calc.at: Update declarations.
5762 * tests/input.at (%define enum variables): New test case.
5763 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
5764 declaration.
5765 (Push Parsing: Multiple impure instances): Update declaration.
5766 (Push Parsing: Unsupported Skeletons): New test case.
5767 * tests/torture.at (Exploding the Stack Size with Alloca): Update
5768 declaration.
5769 (Exploding the Stack Size with Malloc): Update declaration.
5770
3f999f78
WP
57712007-09-24 Wojciech Polak <polak@gnu.org>
5772
5773 Add XSLT transformations.
5774
5775 * data/xslt/xml2dot.xsl: Transform XML into DOT.
5776 * data/xslt/xml2text.xsl: Transform XML into plain text.
5777 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
5778 * data/Makefile.am (xsltdir): New variable.
5779 (dist_xslt_DATA): Add xslt/*.xsl files.
5780
a4f75309
PE
57812007-09-23 Paul Eggert <eggert@cs.ucla.edu>
5782
5783 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
5784 Problem reported by Wojciech Polak.
5785 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
5786 (xml_printf): Undo change I made on 21 September; that is,
5787 indent 2 spaces, not 1.
5788
ad5feac4
JD
57892007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
5790
5791 Pacify ./configure --enable-gcc-warnings.
5792 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
5793 `char const *' instead of `char *'.
5794 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
5795 local variable `sep'.
5796
41d7a5f2
PE
57972007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5798
5799 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
5800 elsewhere.
5801 * src/print-xml.c: Prefer "const" after types; that's more consistent.
5802 (xml_printf): Indent just 1 space for level.
5803 (e_char, xlate_char): Remove.
5804 (xml_escape_string): Rewrite to avoid undefined behavior (used
5805 storage that was freed from the stack).
5806 (xml_escape_n): Don't bother checking for subscript error.
5807
3f999f78
WP
58082007-09-21 Wojciech Polak <polak@gnu.org>
5809
5810 Add Bison XML Automaton Report.
41d7a5f2
PE
5811
5812 Add support for an -x option to generate an XML report.
5813 It is not documented yet.
5814 * src/print-xml.c: New file.
5815 * src/print-xml.h: Likewise.
5816 * lib/timevar.def (TV_XML): New var.
5817 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
5818 * src/conflicts.c: Include print-xml.h.
5819 (solved_conflicts_xml_obstack): New var.
5820 (log_resolution, conflicts_solve, conflicts_free):
5821 Add support for XML report.
5822 (conflicts_output_val): New function.
5823 * src/conflicts.h (conflicts_output_val): New decl.
5824 * src/files.c (spec_xml_file): New var.
5825 (compute_output_file_names, output_file_names_free): Add XML support.
5826 * src/files.h (spec_xml_file): New decl.
5827 * src/getargs.c (xml_flag): New var.
5828 (usage, short_options, long_options, getargs): Add XML support.
5829 * src/getargs.h (xml_flag): New decl.
5830 * src/gram.c: Include print-xml.h.
5831 (rule_lhs_print_xml, rule_rhs_print_xml):
5832 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
5833 New functions.
5834 * src/gram.h: Declare external ones.
5835 * src/main.c: Include print-xml.h.
5836 (main): Add XML support.
5837 * src/reduce.c: Include print-xml.h.
5838 (reduce_xml): New function.
5839 * src/reduce.h: Declare it.
5840 * src/state.c: Include print-xml.h.
5841 (state_new): Add XML support.
5842 (state_rule_lookahead_tokens_print_xml): New function.
5843 * src/state.h: Declare it.
5844 (struct state): New member solved_conflicts_xml.
5845 * src/symtab.c (symbol_class_get_string): New function.
5846 * src/symtab.h: Declare it.
5847
6d8e724d
PE
58482007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5849
5850 * GNUmakefile: Switch to coreutils's version.
5851 * bootstrap: Likewise.
5852 * Makefile.cfg: Adjust to new GNUmakefile.
5853 * README-hacking: Likewise.
5854
5855 Import from gnulib:
5856
5857 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
5858 Bruno Haible <bruno@clisp.org>
5859
5860 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
5861 and is a script that invokes bison. Tighten the code. Add comments.
5862
922bdd7f
JD
58632007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
5864
5865 Spell "boolean" as "Boolean". Reported by Akim Demaille.
5866 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
5867 * doc/bison.texinfo (Decl Summary): Fix.
5868 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
5869 * tests/input.at (Boolean %define variables): Update output.
5870 * tests/skeletons.at (%define boolean variables: invalid skeleton
5871 defaults): Rename to...
5872 (%define Boolean variables: invalid skeleton defaults): ... this and
5873 update output.
5874
1b17b01d
JD
58752007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
5876
5877 In impure push mode, don't allow more than one yypstate to be allocated
5878 since multiple impure parsers would corrupt yynerrs.
5879 * data/push.c (yypstate_allocated): New static global variable
5880 initialized to 0.
5881 (yypull_parse): If yypstate_new returns 0, don't report it as memory
5882 exhaustion if yypstate_allocated is 1, but still return 2.
5883 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
5884 already 1. Otherwise, set it to 1.
5885 (yypstate_delete): Set it to 0.
5886 * tests/push.at (Push Parsing: Multiple impure instances): New test
5887 case.
5888
9987d1b3
JD
58892007-08-17 Bob Rossi <bob@brasko.net>
5890
5891 * doc/bison.texinfo (Push Decl): Document the push parser.
5892 (Table of Symbols): Ditto.
5893 (Pure Decl): Ditto.
5894 (Decl Summary): Ditto.
5895 (Multiple Parsers, Push Parser Function, Pull Parser Function,
5896 Parser Create Function, Parser Delete Function):
5897 Add new push parser symbols.
5898 (Table of Symbols): Document push-parser, push-pull-parser,
5899 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
5900
f16b0819
PE
59012007-08-15 Paul Eggert <eggert@cs.ucla.edu>
5902
5903 Update to GPLv3.
5904 * doc/gpl-3.0.texi: New file.
5905 * doc/gpl.texi: Remove.
5906 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
5907 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
5908 * README-hacking, TODO, bootstrap, bootstrap.conf:
5909 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
5910 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
5911 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
5912 * data/lalr1.cc, data/lalr1.java, data/location.cc:
5913 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
5914 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
5915 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
5916 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
5917 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
5918 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
5919 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
5920 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
5921 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
5922 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
5923 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
5924 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
5925 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
5926 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
5927 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
5928 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
5929 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
5930 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
5931 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
5932 * src/complain.c, src/complain.h, src/conflicts.c:
5933 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
5934 * src/files.h, src/flex-scanner.h, src/getargs.c:
5935 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
5936 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
5937 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
5938 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
5939 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
5940 * src/print.c, src/print.h, src/print_graph.c:
5941 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
5942 * src/reduce.h, src/relation.c, src/relation.h:
5943 * src/revision.h, src/scan-code.h, src/scan-code.l:
5944 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
5945 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
5946 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
5947 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
5948 * tests/Makefile.am, tests/actions.at, tests/c++.at:
5949 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
5950 * tests/existing.at, tests/glr-regression.at:
5951 * tests/headers.at, tests/input.at, tests/java.at:
5952 * tests/local.at, tests/output.at, tests/push.at:
5953 * tests/reduce.at, tests/regression.at, tests/sets.at:
5954 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
5955 * tests/torture.at:
5956 Update to GPLv3.
5957
728c4be2
JD
59582007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5959
5960 Get rid of broken %no-parser, -n, and --no-parser implementation and
5961 documentation.
5962 * TODO: Don't mention them.
5963 * doc/bison.1: Likewise.
5964 * doc/bison.texinfo (Decl Summary): Likewise.
5965 (Bison Options): Likewise.
5966 (Option Cross Key): Likewise.
5967 * src/getargs.c (no_parser_flag): Remove global variable.
5968 (usage): Don't print description of -n and --no-parser.
5969 (long_options): Remove --no-parser entry here.
5970 (getargs): Remove -n case in the switch here.
5971 * src/getargs.h (no_parser_flag): Remove extern.
5972 * tests/regression.at (Web2c Actions): Remove comment that mentions
5973 --no-parser.
5974
5d31a216
JD
59752007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5976
5977 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
5978 name user variables starting with `yy'. Just pass NULL instead of a
5979 dummy local &yylval to yypush_parse.
5980 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
5981 starting with `yy'.
5982
a2ea208d
JD
59832007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
5984
5985 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
5986 true since it's then always used regardless of whether yyoverflow is
5987 defined. Reported by Christian Burger at
5988 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
5989 * THANKS: Add Christian Burger.
5990
91661ebb
JD
5991 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5992 node names: say "Decl Summary" not "Bison Declaration Summary".
5993
cbd50549
JD
59942007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
5995
5996 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
5997 determine whether this function has already complained about an invalid
5998 value for a %define boolean variable, don't check whether Bison has
5999 ever examined the value. As written, the check was a tautology.
6000 Instead, record and check for this complaint using a separate muscle.
6001
eb1b0740
JD
60022007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
6003
6004 Fix push parsing memory leak reported by Brandon Lucia at
6005 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
6006 * THANKS: Add Brandon Lucia.
6007 * data/push.c (yypstate_delete): Free the stack if it was reallocated
6008 but the parse never completed and thus freed it.
6009 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
6010 * tests/testsuite.at: Include push.at.
6011 * test/push.at: New.
6012 (Push Parsing: Memory Leak for Early Deletion): New test case.
6013
9d774aff
JD
60142007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
6015
6016 Improve handling of multiple S/R conflicts in the same state and of S/R
6017 conflicts involving multiple reductions.
6018 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
6019 set for a state here or Bison will abort if it is reassigned on a
6020 later conflicted reduction in the same state.
6021 Similarly, don't finalize and assign the solved conflicts report here
6022 or it will be lost if it is reassigned on a later conflicted reduction
6023 in the same state.
6024 (set_conflicts): Instead, assign them both here after all S/R conflicts
6025 in the state have been fully examined.
6026 * src/print.c (shift_set): Rename to...
6027 (no_reduce_set): ... this.
6028 (print_reductions): Update for rename, and add %nonassoc error action
6029 tokens to no_reduce_set so that, when printing the first remaining
6030 reduction on an error action token, the reduction is enclosed in
6031 brackets.
6032 (print_results): Update for rename.
6033 * tests/conflicts.at (Solved conflicts report for multiple reductions
6034 in a state): New test case.
6035 (%nonassoc error actions for multiple reductions in a state): New test
6036 case.
6037
6038 * src/main.c (main): Don't depend on C99 features.
6039
10159d2a
JD
60402007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
6041
6042 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
6043 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
6044 uniwidth.
10159d2a 6045
953b3935
JD
60462007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
6047
6048 * bootstrap (slurp): Create target directories that don't exist.
6049 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
6050
6ce2d93a
JD
60512007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6052
6053 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
6054 than item number.
6055 * closure.c (closure): Likewise.
6056 * state.h (reductions): Comment sorting of rules.
6057 (state): Comment sorting of items.
6058
ce3448d5
JD
60592007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
6060
6061 Fix C++ test cases after recent Gnulib changes. Discussed starting at
6062 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
6063 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
6064 definition in order to avoid Gnulib headers since we don't use config.h
6065 here.
6066 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
6067 rather than AT_DATA so that config.h is included.
6068
8a86eef0
JD
60692007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
6070
6071 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
6072 instead of fprintf. Guard these functions with #if YYDEBUG instead of
6073 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
6074 and so that YYFPRINTF is guaranteed to be defined here.
6075
b1a81613
JD
60762007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6077
6078 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
6079 with...
6080 (muscle_percent_define_check_values): ... this more helpful function.
6081 Again, it's not used yet, but it will be.
6082 * src/muscle_tab.h: Likewise.
6083
71b61d4d
JD
6084 Improve some comments in parser table construction.
6085 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
6086 (generate_states): Don't mention ruleset, which is internal to closure.
6087 * src/closure.c (closure): Explain sorting of core and itemset, which
6088 is required for this function to behave correctly.
6089 * src/closure.h (closure): Mention sorting.
6090
2a6b783d
JD
60912007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
6092
6093 * src/lalr.c (state_lookahead_tokens_count): For code readability,
6094 move the check for disabled transitions to an aver since conflict
6095 resolution hasn't happened yet.
6096
6097 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
6098 labels a state as inconsistent just because it has error transitions.
6099 The original form of this check appeared in revision 1.1 of lalr.c,
6100 which was committed on 1991-12-21. Now (at least), changing the
6101 consistency label on such a state appears to have no useful effect in
6102 any of the places it is examined, which I enumerate below. The key
6103 point to understanding each item in this enumeration is that a state
6104 with an error transition is labelled consistent in the first place only
6105 if it has no rules, so the check cannot matter for states that have
6106 rules. (1) Labelling a state as inconsistent will cause set_conflicts
6107 to try to identify its conflicts, and a state must have *rules* to have
6108 conflicts. (2) Labelling a state as inconsistent will affect how
6109 action_row sets the default *rule* for the state. (3) Labelling a
6110 state as inconsistent will cause build_relations to add lookback edges
6111 to *rules* in that state.
6112 * src/state.h (struct state): Word the comment for member consistent
6113 more carefully.
6114
14462c2b
JD
61152007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
6116
6117 Don't depend on C99 features.
6118 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
6119 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
6120 * src/reader.c (check_and_convert_grammar): Fix for-loop.
6121 * src/state.c (state_mark_reachable_states): Fix for-loop.
6122 (state_remove_unreachable_states): Fix for-loop.
6123
6124 Don't widen struct state with member reachable just to temporarily
6125 record reachability. Instead, use a local bitset.
6126 * src/state.h (struct state): Remove member.
6127 * src/state.c (state_new): Don't initialize it.
6128 (state_mark_reachable_states): Rename to...
6129 (state_record_reachable_states): ... this, and use bitset.
6130 (state_remove_unreachable_states): Use bitset.
6131
5a43d418
JD
61322007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
6133
6134 * src/Makefile.am (yacc): Quote target action commands properly so
6135 that the yacc script isn't corrupt. Reported by Hans Aberg at
6136 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
6137
0c650a20
JD
6138 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
6139 the case of pure parsers. Reported by Frans Englich at
6140 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
6141 * THANKS: Add Frans Englich.
6142
61fee93e
JD
6143 * NEWS (2.3a+): In the %code entry, reference section `Bison
6144 Declaration Summary' from the manual now since the %code summary has
6145 moved there.
6146 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
6147 in the rules section must be terminated by semicolons.
6148
f124d423
JD
61492007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
6150
6151 Extend the front-end API for %define variables to more completely
6152 mirror the back-end. This will be useful in the future.
6153 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
6154 Update comments to mention the new front-end counterparts of these
6155 macros.
6156 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
6157 for muscle_string_decode and muscle_location_decode.
6158 (muscle_string_decode): New static function.
6159 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
6160 (muscle_percent_define_get, muscle_percent_define_ifdef): New
6161 functions.
6162 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
6163 muscle_percent_define_get to mimic the b4_percent_define_flag_if
6164 implementation more closely.
6165 (muscle_percent_define_invalid_value): New function.
6166 * src/muscle_tab.h (muscle_percent_define_get,
6167 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
6168 Prototype.
6169
75ad86ee
JD
61702007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
6171
6172 * NEWS (2.3a+): Mention yesterday's state-removal change.
6173 (2.3a): Remove the %language entry, which was added after 2.3a.
6174 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
6175 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
6176 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
6177 tests/existing.at: Update copyright date.
6178
5967f0cf
JD
61792007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6180
6181 If conflict resolution makes states unreachable, remove those states,
6182 report rules that are then unused, and don't report conflicts in those
6183 states.
6184 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
6185 New global function.
6186 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
6187 function.
6188 * src/main.c (main): After conflict resolution, remove the unreachable
6189 states and update all data structures that reference states by number.
6190 * src/state.c (state_new): Initialize each state's reachable member to
6191 false.
6192 (state_mark_reachable_states): New static function.
6193 (state_remove_unreachable_states): New global function.
6194 * src/state.h (struct state): Add member bool reachable.
6195 (state_remove_unreachable_states): Prototype.
6196 * tests/conflicts.at (Unreachable States After Conflict Resolution):
6197 New test case.
6198 * tests/existing.at (GNU pic Grammar): Update test case output now that
6199 an unused rule is discovered.
6200
b09f4f48
JD
62012007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6202
6203 Minor code cleanup in parser table construction.
6204 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
6205 (new_itemsets, save_reductions): Update for rename to nitemset.
6206 * src/closure.c (nritemset): Rename to...
6207 (nitemset): ... this since the "r" appears to meaningless and isn't
6208 used in the comments.
6209 (closure): Update for rename.
6210 * src/closure.h (nritemset): Update extern to...
6211 (nitemset): ... this.
6212 * src/lalr.c (LA): Fix a typo in comments.
6213 * src/print.c (print_core): Update for rename to nitemset.
6214 * src/print_graph.c (print_graph): Likewise.
6215 * src/state.h: Fix some typos in header comments.
6216
bbb44d83
PE
62172007-04-04 Paul Eggert <eggert@cs.ucla.edu>
6218
9b33de72
PE
6219 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
6220 still sticks to ASCII. Sorry!
6221
bbb44d83
PE
6222 * README-hacking: New file, taken mostly from coreutils, with changes
6223 for Bison. Contains much of the contents of:
6224 * README-cvs: Remove.
6225 * bootstrap: Sync from gnulib.
6226 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
6227 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
6228
29553547
JD
62292007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
6230
6231 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
6232 Setzer.
6233 (Java Differences): Fix some typos.
6234 * THANKS: Add Sebastian Setzer.
6235
01b477c6
PB
62362007-03-07 Paolo Bonzini <bonzini@gnu.org>
6237
730739e4
AD
6238 * data/java.m4 (b4_single_class_if): Remove.
6239 (b4_abstract_if): Look at "%define abstract".
6240 (b4_lexer_if): New.
6241 (b4_union_name): Rename...
6242 (b4_yystype): ... to this. Map to "%define stype".
6243 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
6244 b4_maybe_throws): Fix quoting.
6245 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
6246 * data/lalr1.java (Lexer interface): Always define.
6247 (Lexer interface within parser class): Remove.
6248 (YYLexer class): New, used when "%code lexer" is present.
6249 (constructor): When "%code lexer" is used, pass %lex-param
6250 to the lexer constructor.
6251 (yylex, yyparse): Remove %lex-param from method invocations
6252 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
6253
6254 * doc/bison.texinfo (Java Bison Interface): Mention "%define
6255 abstract". Rename "%define union_name" to "%define stype".
6256 Rename method names according to previous patch.
6257 (Java Scanner Interface): Describe "%code lexer" instead of
6258 "%pure-parser" and "%define single_class".
6259 (Java Differences): Mention "%code lexer".
6260
6261 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
6262 Include scanner here, using macros from tests/local.at.
6263 (AT_DATA_CALC_Y): Remove final argument.
6264 (_AT_CHECK_JAVA_CALC): Likewise.
6265 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
6266 of %locations and %error-verbose.
6267 (main): Test with and without %lex-param.
6268 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
6269 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 6270
122bea3a
JMG
62712007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6272
6273 DJGPP spefic issue. Inhibit the use of disallowed characters for
6274 file name genertion on Win98, WinXP, etc. These are |<>":?*\
6275 and concern testsuite case 46.
6276 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
6277 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
6278 * djgpp/config.bat: Inhibit the use of disallowed characters.
6279
9611cfa2
JD
62802007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6281
6282 Miscellaneous %define and %code cleanup.
6283 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
6284 values are interpreted.
6285 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
6286 documentation a little more.
6287 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
6288 muscle_percent_define_insert, muscle_percent_code_grow): New
6289 functions/macros.
6290 * src/muscle_tab.h (muscle_percent_define_insert,
6291 muscle_percent_code_grow): Prototype.
6292 * src/parse-gram.y (prologue_declaration): Use
6293 muscle_percent_define_insert and muscle_percent_code_grow when parsing
6294 %define and %code directives.
6295
6296 Make it easy to share %define boolean variables between the front-end
6297 and back-end. Though not used yet, this will be useful in the future.
6298 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
6299 Bison uses of names rather than just skeleton uses of names.
6300 (b4_percent_define_get, b4_percent_define_ifdef): Rename
6301 b4_percent_define_skeleton_variables(VARIABLE) to
6302 b4_percent_define_bison_variables(VARIABLE).
6303 (b4_percent_code_get, b4_percent_code_ifdef): Rename
6304 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
6305 b4_percent_code_bison_qualifiers(QUALIFIER).
6306 (b4_check_user_names_wrap): Update for renames.
6307 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
6308 muscle_percent_define_default): New functions mimicking
6309 b4_percent_define_flag_if and b4_percent_define_default.
6310
6311 For %define variables, report locations for invalid values and
bbb44d83 6312 redefinitions.
9611cfa2
JD
6313 * data/bison.m4 (b4_percent_define_flag_if): Read
6314 b4_percent_define_loc(VARIABLE) to report the location of an invalid
6315 value for VARIABLE.
6316 (b4_percent_define_default): Save a special location in
6317 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
6318 must later be reported as invalid.
6319 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
6320 functions.
6321 (muscle_percent_define_insert): Record the location of VARIABLE in
6322 muscle percent_define_loc(VARIABLE), and use it to report the previous
6323 location for a redefinition.
6324 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
6325 (muscle_percent_define_default): Update like b4_percent_define_default.
6326 (muscle_grow_user_name_list): Rename to...
6327 (muscle_user_name_list_grow): ... this for consistency and use
6328 muscle_location_grow.
6329 * src/muscle_tab.h (muscle_location_grow): Prototype.
6330 * tests/input.at (%define errors): Update expected output.
6331 * tests/skeletons.at (%define boolean variables: invalid skeleton
6332 defaults): New test case.
6333
0bf92491
JD
63342007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
6335
6336 * src/print.c (lookahead_set, state_default_rule): Remove.
6337 (print_reductions): Replace state_default_rule invocation with
6338 equivalent use of yydefact, which was computed in token_actions in
6339 tables.c.
6340 (print_results): Don't allocate lookahead_set.
6341
d3b12988
PB
63422007-02-27 Paolo Bonzini <bonzini@gnu.org>
6343
6344 * data/lalr1.java: Prefix all private members with yy.
6345
f57a7536
JD
63462007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
6347
6348 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 6349 Sebastien Fricker at
f57a7536 6350 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 6351 * THANKS: Add Sebastien Fricker.
f57a7536
JD
6352 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
6353 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
6354 accept a variable number of arguments.
6355
6404a5bf
JD
63562007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
6357
6358 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
6359
e4e09639
JMG
63602007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6361
6362 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
6363 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
6364 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
6365
d7e0a1a7
PE
63662007-02-11 Paul Eggert <eggert@cs.ucla.edu>
6367
6368 Undo my 2007-02-07 change, switching back to the c-strcase module
6369 introduced in the 2007-02-03 change. Bruno Haible reported that
6370 the 2007-02-07 change would be dangerous in Turkish if we add a
6371 language whose name contains "i", since "i" is not lowercase "I"
6372 in Turkish.
6373 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
6374 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
6375 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
6376 * m4/.cvsignore: Remove strcase.m4.
6377 * src/getargs.c: Revert 2007-02-07 change, as follows.
6378 Include c-strcase.h.
6379 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
6380
deee93a1
JD
63812007-02-11 Bruno Haible <bruno@clisp.org>
6382
6383 Enable the Java related testsuite tests when the only Java compiler
6384 found is a gcj < 4.3. Discussed at
6385 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
6386 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
6387
574add85
JD
63882007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
6389
6390 * data/Makefile.am: Update copyright date.
6391 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
6392 yypstate_new returns NULL.
6393 (yypstate_new): Return NULL if malloc does.
6394 * src/reader.c (packgram): Move translation of rule actions from the
6395 beginning of packgram to...
6396 (check_and_convert_grammar): ... here right before packgram is invoked
6397 so it's easier to write more complete comments, and remove redundant
6398 code.
6399
e785ccf7
JD
64002007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
6401
6402 As in semantic actions, make @$ in %initial-action, %destructor, and
6403 %printer imply %locations.
6404 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
6405 scanning @$.
6406 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
6407 (@$ in %initial-action implies %locations,
6408 @$ in %destructor implies %locations,
6409 @$ in %printer implies %locations): ... these new test cases.
6410
1cfe1ed7
PE
64112007-02-07 Paul Eggert <eggert@cs.ucla.edu>
6412
6413 Undo most of the 2007-02-03 change, switching to the strcase module
6414 now that gnulib strcase has been fixed.
6415 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
6416 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
6417 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
6418 * m4/.cvsignore: Add strcase.m4.
6419 * src/getargs.c: Revert 2007-02-03 change, as follows.
6420 Don't include c-strcase.h.
6421 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
6422 strcasecmp has "unspecified behavior" outside the POSIX locale,
6423 but it works fine in practice if at least one argument is ASCII,
6424 as is the case in Bison.
6425
0049ec86
PB
64262007-02-07 Paolo Bonzini <bonzini@gnu.org>
6427
6428 * tests/java.at: Skip tests if only one of javac/java is present.
6429 Reported by Joel E. Denny.
6430 * tests/atlocal.in: Adjust copyright years.
6431
64322007-02-05 Paolo Bonzini <bonzini@gnu.org>
6433
6434 * data/lalr1.java (Stack): Work around old verifiers that disallow
6435 access to the private fields of an inner class, from the outer class.
6436 We can make Stack's fields public because user code doesn't have access
6437 to the instance of Stack used by parse(). Reported by Paul Eggert.
6438
2c2b7220
PE
64392007-02-03 Paul Eggert <eggert@cs.ucla.edu>
6440
6441 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
6442 the right spot for these files?
6443 * bootstrap.conf (gnulib_modules): Add c-strcase.
6444 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
6445 c-strncasecmp.c.
6446 * src/getargs.c: Include c-strcase.h.
6447 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
6448 to avoid unspecified behavior.
6449
b2b81dae
JD
64502007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
6451
6452 * doc/bison.texinfo (Decl Summary): Correct typo.
6453
c1d19e10
PB
64542007-01-30 Paolo Bonzini <bonzini@gnu.org>
6455
6456 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
6457 Complain if the value does not match empty, "true" or "false".
6458 * data/c++.m4: Adjust default definitions of %define variables.
6459 * data/java.m4: Adjust default definitions of %define variables.
6460 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
6461 to above behavior.
6462 * tests/input.at (Boolean %define variables): Test new behavior.
6463
8405b70c
PB
64642007-01-29 Paolo Bonzini <bonzini@gnu.org>
6465
6466 * NEWS: Mention java.
6467 * TODO: Remove things that are done.
6468 * bootstrap.conf: Add javacomp-script and javaexec-script.
6469 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
6470
6471 * data/Makefile.am: Add new files.
6472 * data/java-skel.m4: New.
6473 * data/java.m4: New.
6474 * data/lalr1.java: New.
6475
6476 * doc/bison.texinfo: Put "A Complete C++ Example" under
6477 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
6478 under Other Languages.
6479
6480 * src/getargs.c (valid_languages): Add Java.
6481 * src/getargs.h (struct bison_language): Update size of string fields.
6482
6483 * tests/Makefile.am: Add java.at.
6484 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
6485 * tests/java.at: New.
6486 * tests/testsuite.at: Include it.
6487
3eb82471
JD
64882007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
6489
6490 Clean up.
6491 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
6492 at_directive_argv arguments so these no longer have to be global
6493 variables. Also, update the implementation for the following changes.
6494 (fail_for_at_directive_too_many_args,
6495 fail_for_at_directive_too_few_args): Add at_directive_name argument.
6496 (at_directive_name): Remove as at_directive_argv[0] will be used for
6497 this now.
6498 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
6499 for the directive name.
6500 (at_directive_argc, at_directive_argv): Make these local within
6501 skel_lex instead of global.
6502 (INITIAL): Update directive start action for above changes.
6503 (SC_AT_DIRECTIVE_ARG): Rename to...
6504 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
6505 (SC_AT_DIRECTIVE_SKIP_WS): Update.
6506 (scan_skel): Move yylex_destroy to...
6507 (skel_scanner_free): ... here.
6508 * tests/skeletons.at (installed skeleton file name): Rename to...
6509 (installed skeleton file names): ... this.
6510
148d66d8
JD
65112007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
6512
6513 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6514 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
6515 Summary" not "Directives".
6516 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
6517 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
6518 since the former is now the more complete one.
6519 (Prologue Alternatives): Likewise and do the same for %defines.
6520 (Table of Symbols): Add summary of %code, add summary of %define, and
6521 move full %code documentation to...
6522 (Decl Summary): ... here for consistency with other entries in these
6523 sections.
6524 Move %define entry in order to keep this list alphabetized.
6525 Reword %define entry a little to put less emphasis on the skeleton
6526 concept, which most users shouldn't have to think about.
6527
665f0c24
PE
65282007-01-26 Paul Eggert <eggert@cs.ucla.edu>
6529
6530 Adjust to recent gnulib changes.
6531 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
6532 Add string.h, string_.h, unistd_.h, wchar_.h.
6533 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
6534 * src/system.h: Don't include <stpcpy.h>; this is now done by
6535 <string.h>.
6536
592d0b1e
PB
65372007-01-23 Paolo Bonzini <bonzini@gnu.org>
6538
6539 Simplify implementation of unqualified %code, implement macros for
6540 uniform treatment of boolean %define flags. Document %define.
6541 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
6542 b4_percent_code_ifdef): New.
6543 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
6544 * data/c++.m4: Define default value for global_tokens_and_yystype.
6545 * data/glr.cc: Likewise.
6546 * data/location.cc: Use b4_percent_define_flag_if.
6547
148d66d8 6548 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
6549
6550 * src/parse-gram.y (Unqualified %code): Change muscle name to
6551 b4_percent_code().
6552 (content.opt): Default to empty.
6553
a7867f53
JD
65542007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6555
6556 Implement support for relative and absolute skeleton file names.
6557 Discussed starting at
6558 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
6559 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
6560 (Bison Options): Document in --skeleton entry.
6561 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
6562 full_skeleton can't necessarily hold all of pkgdatadir.
6563 If the specified skeleton file name contains a `/', don't prepend
6564 pkgdatadir.
6565 * src/parse-gram.y (prologue_declaration): If the specified skeleton
6566 file name contains a `/', prepend the grammar file directory.
6567 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
6568 * skeletons.at: New file.
6569 (relative skeleton file names): New test case.
6570 (installed skeleton file names): New test case.
6571 * tests/testsuite.at: Include skeletons.at.
6572
6573 * bootstrap: Update copyright to 2007.
6574
830c9b18
PB
65752007-01-17 Paolo Bonzini <bonzini@gnu.org>
6576
6577 * bootstrap: Remove occurrences of .#bootmp from the files.
6578
a8c2e813
AD
65792007-01-17 Akim Demaille <akim@epita.fr>
6580
6581 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
6582 nonterminals.
6583 Use per-type %printer.
6584
279cabb6
JD
65852007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6586
6587 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
6588 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6589 djgpp/config.site, src/files.c, src/files.h, src/main.c,
6590 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
6591 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
6592 tests/glr-regression.at, tests/input.at, tests/local.at,
6593 tests/output.at, tests/torture.at: Update copyright to 2007.
6594
bb32f4f2
AD
65952007-01-16 Akim Demaille <akim@epita.fr>
6596
6597 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
6598 error code.
6599 (Calc++ Scanner): Exit with failure if we can't open the input
6600 file.
6601 Accept "-" standing for stdin.
6602 (Calc++ Top Level): Print the result only if the parsing was
6603 successful.
6604
7cff04b5
AD
66052007-01-16 Akim Demaille <akim@epita.fr>
6606
6607 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
6608
a4e25e1d
JD
66092007-01-15 Paolo Bonzini <bonzini@gnu.org>
6610 and Joel E. Denny <jdenny@ces.clemson.edu>
6611
6612 Clean up %define and %code implementation in M4 some. Most
6613 importantly, rename all related macros to be in the b4_percent_define
6614 and b4_percent_code namespaces. Also, complete support for `.' in
6615 %define variable names and %code qualifiers.
6616 * data/bison.m4 (b4_check_user_names): Check for special
6617 "SKELETON-NAMESPACE(name)" macros instead of using two nested
6618 m4_foreach loops.
6619 (b4_get_percent_define, b4_get_percent_code): Rename to...
6620 (b4_percent_define_get, b4_percent_code_get): ... these.
6621 Extend documentation with examples.
6622 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
6623 b4_percent_define_skeleton_variables and
6624 b4_percent_code_skeleton_qualifiers.
6625 Expect any value for the %define variable `foo' to be stored in the
6626 macro named `b4_percent_define(foo)'; expect any %code blocks for the
6627 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
6628 expect any unqualified %code blocks to be stored in a macro named
6629 `b4_percent_code_unqualified'.
6630 Use m4_indir so that %define variable names and %code qualifiers can
6631 contain `.', which is allowed by the grammar parser.
6632 (b4_percent_define_default): New macro to set a default value for a
6633 %define variable.
6634 (m4_wrap): Update wrapped code, and fix some underquoting.
6635 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
6636 Expect grammar uses of %define variables and %code qualifiers to be
6637 defined in b4_percent_define_user_variables and
6638 b4_percent_code_user_qualifiers.
6639 * data/c++.m4: Use b4_percent_define_default rather than
6640 m4_define_default. Fix some underquoting. Skeleton usage of %define
6641 variable define_location_comparison now implies skeleton usage of
6642 %define variable filename_type.
6643 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6644 data/push.c, data/yacc.c: Update macro names.
6645 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
6646 muscle names.
6647
e37c665c
JMG
66482007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6649
6650 DJGPP specific issues.
6651
6652 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
6653 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
6654
7d2d521f
JD
66552007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6656
6657 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
6658 run parsers in all tests so that Valgrind is invoked during
6659 maintainer-check-valgrind.
6660 (Duplicate representation of merged trees): Free all semantic values.
6661 (Duplicated user destructor for lookahead): Likewise.
6662
e0ac9b4b
JD
66632007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6664
6665 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
6666 command-line prefix.
6667 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
6668 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
6669 miss Valgrind messages.
6670 (Exploding the Stack Size with Malloc): Likewise.
6671
78143faa
JD
66722007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6673
6674 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
6675 locals. Reported by Juan Manuel Guerrero at
6676 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
6677 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
6678 Fix some indentation also.
6679 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
6680 explaining this issue.
6681
7ecec4dd
JD
66822007-01-09 Paolo Bonzini <bonzini@gnu.org>
6683 and Joel E. Denny <jdenny@ces.clemson.edu>
6684
6685 Simplify union and prologue handling, and escape union and lex/parse
6686 params with digraphs.
6687 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
6688 values to the empty string since these are no longer guaranteed
6689 initialized by the front-end.
6690 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
6691 braces around b4_user_stype since this is no longer done by the
6692 front-end.
6693 * src/files.c, src/files.h (pre_prologue_obstack,
6694 post_prologue_obstack): Remove.
6695 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
6696 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
6697 with digraphs. This fixes lex params and parse params.
6698 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
6699 * src/output.c (prepare): Remove muscle insertion of the prologues.
6700 (output): Remove freeing of pre_prologue_obstack and
6701 post_prologue_obstack.
6702 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
6703 than prologue_augment for prologue parsing so you don't need prologue
6704 obstacks.
5c80250c
JD
6705 (grammar_declaration): For %union RHS, use `braceless' instead of
6706 "{...}" so that braces are already stripped and code is escaped with
6707 digraphs.
7ecec4dd
JD
6708 * src/reader.c (prologue_augment): Remove.
6709 (reader): Remove initialization of pre_prologue_obstack and
6710 post_prologue_obstack.
6711 * src/reader.h (prologue_augment): Remove.
6712
6713 * data/c.m4: Remove stray parenthesis.
6714
16dc6a9e
JD
67152007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6716
6717 Remove quotes from variables names in %define directives and from
6718 qualifiers in %code directives, and restrict the characters that are
6719 allowed in them to M4-friendly ones. For %define, continue to support
6720 the quoted form as a deprecated feature. Discussed starting at
6721 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
6722 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
6723 %code.
6724 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
6725 (Decl Summary): In %defines entry, update mention of `%code requires'
6726 and `%code provides'.
16dc6a9e
JD
6727 (C++ Location Values): Update %define uses.
6728 (Calc++ Parser Interface): Likewise.
6729 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 6730 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
6731 * src/parse-gram.y (prologue_declaration): For %define variables, use
6732 `variable' instead of `STRING'.
6733 (grammar_declaration): For %code qualifiers, use `ID' instead of
6734 `STRING'.
6735 (variable): New nonterminal that takes an `ID' or a `STRING'.
6736 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
6737 and %define uses.
6738 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
6739 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
6740 (%define errors): Update %define uses.
6741
e9813cd4
JD
67422007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6743
6744 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
6745 instead of muscle_insert for %define values so that M4-special
6746 characters are replaced with digraphs.
6747 * tests/input.at (%define errors): Extend to check weird values.
6748
6afc30cc
JD
67492007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6750
6751 Instead of having skeletons declare all valid %define variables and
6752 %code qualifiers, provide macros that retrieve the associated values
6753 and build these lists automatically. Thus Bison will now warn when a
6754 variable or qualifier is not used by the skeleton in the current
6755 invocation regardless of whether it might sometimes be used by that
6756 skeleton in other invocations. Also, move all %define value macros to
6757 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
6758 form, which is replaced by %code.
6759 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
6760 (b4_check_user_names): ... this, and change the series of valid name
6761 arguments to a single list argument for names used in the skeleton
6762 similar to the existing list argument for names used in the grammar.
6763 Warn instead of complaining.
6764 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
6765 values and %code code, to format %code code properly, and to build
6766 lists of all %define variables and %code qualifiers used in the
6767 skeleton: b4_skeleton_percent_define_variables and
6768 b4_skeleton_percent_code_qualifiers.
6769 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
6770 Remove, and...
6771 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
6772 the skeleton names lists can finish building first. In place of
6773 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
6774 expect the lists b4_user_percent_define_variables and
6775 b4_user_percent_code_qualifiers.
6776 * data/c++.m4: Where setting default values for b4_parser_class_name,
6777 b4_location_type, b4_filename_type, b4_namespace, and
6778 b4_define_location_comparison, update their names to the
6779 b4_percent_define_ namespace.
6780 * data/glr.c: Don't use b4_check_percent_define_variables and
6781 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6782 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
6783 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 6784 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
6785 * data/location.cc: Use b4_get_percent_define.
6786 * data/push.c: Don't use b4_check_percent_define_variables and
6787 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6788 * data/yacc.c: Likewise, and don't call m4_exit in
6789 b4_use_push_for_pull_if or m4_wrap code will never execute.
6790 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
6791 Rename to...
6792 (muscle_grow_user_name_list): ... this for consistency with the
6793 terminology used in bison.m4.
6794 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
6795 %define variable names, and rename muscle used_percent_define_variables
6796 to user_percent_define_variables.
6797 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
6798 user_percent_code_qualifiers.
6799 (content): Remove.
6800 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
6801 {CODE} form is no longer accepted.
6802 * tests/input.at (Reject bad %code qualifiers): Rename to...
6803 (Reject unused %code qualifiers): ... this, and update test output.
6804 (%define error): Update test output.
6805
7eb8a0bc
JD
68062007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
6807
6808 Check for unrecognized %define variables similar to checking for
6809 unrecognized %code qualifiers. Check for redefined %define variables.
6810 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
6811 generalizes...
6812 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
6813 (b4_check_percent_define_variables): New, also wraps it.
6814 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
6815 variables using b4_check_percent_define_variables.
6816 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
6817 all those exercised in the test suite and all those listed in the
6818 `Default values' section of c++.m4. Are there others?
6819 * data/push.c, data/yacc.c: Declare no valid %define variables.
6820 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
6821 similar to muscle_find, but it works even when the muscle stores a
6822 const value.
6823 (muscle_grow_used_name_list): New function for constructing the used
6824 name list muscles that b4_check_for_unrecognized_names requires.
6825 * src/parse-gram.y (prologue_declaration): Warn if a variable is
6826 %define'd more than once. Define the b4_used_percent_define_variables
6827 muscle with muscle_grow_used_name_list.
6828 (grammar_declaration): Abbreviate %code code with
6829 muscle_grow_used_name_list.
6830 * tests/input.at (%define errors): New.
6831
3fc65ead
JD
68322007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6833
6834 Provide warn_at, complain_at, and fatal_at function callbacks to the
6835 skeletons, and use this for %code qualifier complaints.
6836 * data/bison.m4 (b4_error_at): New, invoked by...
6837 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
6838 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
6839 @fatal_at(...@) directives.
6840 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
6841 qualifiers in b4_used_percent_code_qualifiers and to use
6842 b4_complain_at.
6843 * src/location.c, src/location.h (boundary_set_from_string): New global
6844 function.
6845 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
6846 function.
6847 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
6848 to b4_used_percent_code_qualifiers.
6849 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
6850 function.
6851 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
6852 (lineno): Rename to...
6853 (out_lineno): ... this so I don't misunderstand it again.
6854 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
6855 here; these newlines are in the input but not the output file.
6856 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
6857 (at_directive_perform): ... this new static function, and add handling
6858 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
6859 directives.
6860 * tests/input.at (Reject bad %code qualifiers): Update test output with
6861 locations and extend.
6862
6863 * tests/output.at (Output file name: [, Output file name: ]): Remove
6864 bogus comment about these tests failing.
6865
1c7b7e1d
JD
68662007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6867
6868 Clean up b4_check_percent_code_qualifiers a little.
6869 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
6870 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
6871 documentation and add examples.
6872 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
6873 qualifiers here.
6874
08af01c2
JD
68752007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6876
6877 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
6878 unreliable -- especially when they're hidden inside another macro.
6879 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
6880 data/c.m4: Remove m4_divert(-1).
6881 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6882 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
6883 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 6884 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
6885 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
6886 pushed and popped by m4sugar, should be first on the stack.
6887
6888 Provide warn, complain, and fatal function callbacks to the skeletons.
6889 This provides more flexibility than m4_fatal, improves the error
6890 message format, and captures messages for translation. Discussed
6891 starting at
6892 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
6893 * data/bison.m4 (b4_error): New, invoked by...
6894 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
6895 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
6896 directives. Because these M4 macros might be called when the current
6897 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
6898 the previous removal of uses of m4_divert, which caused trouble.
6899 (b4_check_percent_code_qualifiers): Use b4_complain instead of
6900 m4_fatal to report unrecognized %code qualifiers.
6901 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
6902 push parser requests.
6903 * data/glr.c: Use b4_complain instead of m4_fatal to report
6904 non-deterministic push parser requests.
6905 Update @output usage to @output(...@) form.
6906 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
6907 report missing %defines. Update @output usage to @output(...@) form.
6908 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
6909 @output(...@) form.
6910 * src/main.c (main): Invoke skel_scanner_free.
6911 * src/scan-skel.h (skel_scanner_free): Prototype new function.
6912 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
6913 obstack_for_string from flex-scanner.h.
6914 (YY_DECL): Use to declare skel_lex static.
6915 (decode_at_digraphs): Remove; now handled in the new
6916 SC_AT_DIRECTIVE_ARG start condition.
6917 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
6918 functions.
6919 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
6920 at_directive_argv): New static globals.
6921 (INITIAL): Use fail_for_invalid_at.
6922 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
6923 recognize the start of a generalized `@directive(...@)' form and
6924 start...
6925 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
6926 directive args (using the new obstack_for_string), to decode the
6927 contained @ diagraphs, and to perform the directive. It recognizes
6928 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
6929 @output(...@).
6930 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
6931 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
6932 `@,'.
6933 (scan_skel): Initialize obstack_for_string on the first call.
6934 (skel_scanner_free): New function to free obstack_for_string.
6935 * tests/input.at (Reject bad %code qualifiers): Update test output.
6936
8e0a5e9e
JD
69372007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
6938
6939 Consolidate the 4 prologue alternative directives (%code, %requires,
6940 %provides, and %code-top) into a single %code directive with an
6941 optional qualifier field. Discussed at
6942 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
6943 * NEWS (2.3a+): Rewrite the existing entry for the prologue
6944 alternatives.
6945 * doc/bison.texinfo (Prologue Alternatives): Update.
6946 (Decl Summary): Update to %code "requires" and %code "provides".
6947 (Calc++ Parser): Update to %code "requires".
148d66d8 6948 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
6949 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
6950 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
6951 are replaced by b4_percent_code_provides and b4_percent_code_requires,
6952 which are skeleton-specific.
6953 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
6954 declare what %code qualifiers it supports and to complain if any other
6955 qualifiers were used in the grammar.
6956 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
6957 and b4_user_code([b4_percent_code_provides]) in place of
6958 b4_user_requires and b4_user_provides.
6959 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
6960 Add b4_user_code([b4_percent_code_top]) and
6961 b4_user_code([b4_percent_code]).
6962 Invoke b4_check_percent_code_qualifiers.
6963 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6964 PERCENT_REQUIRES): Remove.
6965 (grammar_declaration): Remove RHS's for %code-top, %provides, and
6966 %requires. Rewrite the %code RHS as the unqualified form defining the
6967 muscle b4_percent_code. Add another RHS for the qualified %code form,
6968 which defines muscles of the form b4_percent_code_QUALIFIER and the
6969 b4_used_percent_code_qualifiers muscle.
6970 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6971 PERCENT_REQUIRES): Remove.
6972 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
6973 %code "requires" and %code "provides".
6974 * tests/input.at (Reject bad %code qualifiers): New.
6975
95021767
JD
69762007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6977
6978 Use the new code_props interface for destructors and printers.
6979 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
6980 printer_location members, and change the type of the destructor and
6981 printer members to code_props.
6982 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
6983 symbol_printer_get, semantic_type_destructor_set,
6984 semantic_type_printer_set, default_tagged_destructor_set,
6985 default_tagless_destructor_set, default_tagged_printer_set,
6986 default_tagless_printer_set): Use code_props in arguments and return
6987 types in place of char const * and location.
6988 (symbol_destructor_location_get, symbol_printer_location_get): Remove
6989 since the locations are now contained in the return of
6990 symbol_destructor_get and symbol_printer_get.
6991 * src/output.c (symbol_destructors_output, symbol_printers_output):
6992 Replace with...
6993 (symbol_code_props_output): ... this to eliminate duplicate code.
6994 (output_skeleton): Update to use symbol_code_props_output.
6995 * src/reader.c (symbol_should_be_used): Update use of
6996 symbol_destructor_get.
6997 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6998 Update uses of the various _destructor_set and _printer_set functions.
6999 * src/symtab.c: (default_tagged_destructor_location,
7000 default_tagless_destructor_location, default_tagged_printer_location,
7001 default_tagless_printer_location): Remove since we...
7002 (default_tagged_destructor, default_tagless_destructor,
7003 default_tagged_printer, default_tagless_printer): ... change the type
7004 of these to code_props.
7005 (symbol_new, semantic_type_new, symbol_destructor_set,
7006 semantic_type_destructor_set, symbol_destructor_get,
7007 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
7008 symbol_check_alias_consistency, default_tagged_destructor_set,
7009 default_tagless_destructor_set, default_tagged_printer_set,
7010 default_tagless_printer_set): Update.
7011 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
7012 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
7013 code_props members.
7014 (symbol_print): Use SYMBOL_CODE_PRINT.
7015
f6857bbf
JD
70162007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7017
7018 Use the new code_props interface for rule actions.
7019 * src/symlist.h (symbol_list): Replace action, action_location, and
7020 used members with a code_props action_props member.
7021 * src/reader.c (symbol_should_be_used, grammar_rule_check,
7022 grammar_midrule_action, grammar_current_rule_merge_set,
7023 grammar_current_rule_symbol_append, packgram): Update.
7024 * src/scan-code.h (translate_rule_action): Remove, no longer used.
7025 * src/scan-code.l (handle_action_dollar): Update.
7026 (translate_rule_action): Remove, no longer used.
7027 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
7028
7c0c6181
JD
70292007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7030
7031 Use the new code_props interface in parse-gram.y.
7032 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
7033 Update all uses of translate_* functions to use the new code_props
7034 interface and to use gram_scanner_last_string_free and
7035 code_scanner_last_string_free where possible.
7036 (grammar_declaration): symbol_list_destructor_set and
7037 symbol_list_printer_set now perform the translation, so don't do it
7038 here. Use gram_scanner_last_string_free where possible.
7039 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
7040 translate_code): Remove, no longer used.
7041 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
7042 symbol_list_printer_set): Perform code translation here rather than
7043 depending on the caller to do so.
7044
7045 * src/symlist.h (struct symbol_list): Correct some documentation typos.
7046 * src/scan-gram.h (gram_last_string): Remove declaration.
7047 * src/scan-gram.l (last_string): Declare it static.
7048
28e52c0d
JD
70492007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7050
7051 Encapsulate code properties and related functionality for the various
7052 destructors, printers, and actions into a code_props structure and
7053 interface. This patch merely implements code_props in scan-code.h and
7054 scan-code.l. Future patches will rewrite other modules to use it.
7055 Discussed starting at
7056 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
7057 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
7058 consistently initialize const structs that have an empty location
7059 field.
7060 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
7061 to ensure consistency.
7062 * src/scan-code.h (code_props): New structure.
7063 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
7064 function, macro, and const global variable for initializing a
7065 code_props with no code.
7066 (code_props_plain_init, code_props_symbol_action_init,
7067 code_props_rule_action_init, code_props_translate_code): The rest of
7068 the new code_props functional interface. Among other things, the init
7069 functions set the code_props kind field so that
7070 code_props_translate_code will know whether to behave like
7071 translate_symbol_action, translate_rule_action, or translate_code.
7072 These old translate functions must remain until all other modules are
7073 updated to use the new code_props interface.
7074 (code_scanner_last_string_free): New function similar to
7075 gram_scanner_last_string_free.
7076 (code_scanner_free): Add documentation.
7077 * src/scan-code.l: Implement the new interface.
7078 (code_lex): Make it static, add a code_props* argument, and remove the
7079 rule argument.
7080 (last_string): New static global similar to the one in scan-gram.l.
7081 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
7082 instead of rule.
7083 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
7084 code_props since Bison may one day use this information for destructors
7085 and printers.
7086 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
7087 (handle_action_dollar): Use symbol_list_n_get and set used flag
7088 directly since symbol_list_n_used_set is removed.
7089 (translate_action): Add a code_props* argument and remove the rule,
7090 action, and location arguments. Pass the code_props* on to code_lex.
7091 (translate_rule_action, translate_symbol_action, translate_code):
7092 Rewrite as wrappers around the new code_props interface.
7093 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
7094 it would eventually need to break the encapsulation of code_props.
7095
96034983
JD
70962007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7097
7098 * etc/.cvsignore: New.
7099
945e396c
JD
71002007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7101
7102 Add maintainer-push-check to run maintainer-check using push parsing in
7103 place of pull parsing where available.
7104 * Makefile.am (maintainer-push-check): New.
7105 * data/bison.m4 (b4_use_push_for_pull_if): New.
7106 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
7107 appropriately based on their existing values.
7108 (yypush_parse): Don't print push-parser-specific diagnostics if push
7109 parsing is being used in place of pull parsing.
7110 * data/yacc.c: If push parsing should replace pull parsing, redirect to
7111 push.c.
7112 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
7113 variable, and insert b4_use_push_for_pull_flag into muscles.
7114 * tests/Makefile.am (maintainer-push-check): New.
7115
7d596384
JD
71162006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7117
7118 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
7119 (whether successful or failed) so that yypush_parse can be invoked
7120 again to start a new parse using the same yypstate.
7121 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
7122 check multiple yypull_parse invocations on the same yypstate. For pull
7123 mode, extend to check multiple yyparse invocations.
7124 (Exploding the Stack Size with Alloca): Extend to try with
7125 %push-pull-parser.
7126 (Exploding the Stack Size with Malloc): Likewise.
7127
7128 * tests/calc.at (Simple LALR Calculator): Don't specify
7129 %skeleton "push.c" since %push-pull-parser implies that now.
7130 * tests/headers.at (export YYLTYPE): Don't check for the push
7131 declarations. Otherwise, this test case can't be used to see if push
7132 mode can truly emulate pull mode.
7133 * tests/input.at (Torturing the Scanner): Likewise.
7134 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
7135 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
7136 AT_YACC_IF, which now includes the case of push mode since %skeleton
7137 need not be used for push mode. This will be more intuitive once
7138 push.c is renamed to yacc.c.
7139
7172e23e
JD
71402006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7141
7142 For push mode, convert yyparse from a macro to a function, invoke yylex
7143 instead of passing a yylexp argument to yypull_parse, and don't
7144 generate yypull_parse or yyparse unless %push-pull-parser is declared.
7145 Discussed starting at
7146 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
7147 * data/bison.m4 (b4_pull_if): New.
7148 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
7149 * data/push.c: Improve M4 quoting a little.
7150 (b4_generate_macro_args, b4_parenthesize): Remove.
7151 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
7152 any time a pull parser is requested.
7153 Don't #define this as a wrapper around yypull_parse. Instead, when
7154 both push and pull are requested, make it a function that does that
7155 same thing.
7156 (yypull_parse): If there's a b4_prefix, #define this to
7157 b4_prefix[pull_parse] when both push and pull are requested.
7158 Don't define this as a function unless both push and pull are
7159 requested.
7160 Remove the yylexp argument and hard-code yylex invocation instead.
7161 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
7162 %push-parser.
7163 * src/getargs.c (pull_parser): New global initialized to true.
7164 * getargs.h (pull_parser): extern it.
7165 * src/output.c (prepare): Insert pull_flag muscle.
7166 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
7167 (prologue_declaration): Set both push_parser and pull_parser = true for
7168 %push-pull-parser. Set push_parser = true and pull_parser = false for
7169 %push-parser.
7170 * src/scan-gram.l: Don't accept %push_parser as an alternative to
7171 %push-parser since there's no backward-compatibility concern here.
7172 Scan %push-pull-parser.
7173 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
7174 instead of %push-parser.
7175 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
7176 prototype it in the module that calls yyparse.
7177 * tests/input.at (Torturing the Scanner): Likewise.
7178 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
7179
2e7944cb
JD
71802006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
7181
7182 Update etc/bench.pl. Optimize push mode a little (the yyn change
7183 deserves most of the credit).
7184 * Makefile.am (SUBDIRS): Add etc subdirectory.
7185 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
7186 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
7187 yytoken, yyval, and yyloc declarations to...
7188 (yyparse or yypush_parse): ... here to improve performance. For
7189 yypush_parse invocations after the first, be sure to assign yyn its old
7190 value again.
7191 (yypstate_new): Don't bother initializing the yyresult field since the
7192 initial value isn't used.
7193 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
7194 remove the #define that, in push mode, set it to yyps->NAME.
7195 * etc/Makefile.am: New.
7196 * etc/bench.pl: Remove and build it instead from...
7197 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
7198 "tests/bison" from the build directory by default rather than just
7199 invoking "bison" from $PATH.
7200 (calc_grammar): Update push parser code: don't declare yylval globally,
7201 don't define yyparse_wrapper, and don't #define yyparse.
7202 (bench_grammar): Update to check all working combinations of yacc.c,
7203 push.c, impure, pure, pull, and push.
7204
c3d50342
JD
72052006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7206
7207 For push mode, add pull wrappers around yypush_parse.
7208 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
7209 (yypull_parse): New function wrapping yypush_parse.
7210 (yyparse): New #define wrapping yypull_parse.
7211 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
7212 is declared.
7213 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
7214 prototype yylex in the module that calls yyparse, and don't prototype
7215 yyparse there. Otherwise, the yyparse expansion won't compile.
7216 * tests/input.at (Torturing the Scanner): Likewise.
7217
94ebeba5
JD
72182006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7219
7220 Enable push parsers to operate in impure mode. Thus, %push-parser no
7221 longer implies %pure-parser. The point of this change is to move
7222 towards being able to test the push parser code by running the entire
7223 test suite as if %push-parser had been declared.
7224 * data/push.c (yypush_parse): For impure mode, remove the
7225 yypushed_char, yypushed_val, and yypushed_loc arguments.
7226 Instead, declare these as local variables initialized to the global
7227 yychar, yylval, and yylloc.
7228 For the first yypush_parse invocation only, restore the initial values
7229 of these global variables when it's time to read a token since they
7230 have been overwritten.
7231 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
7232 %push-parser.
7233 * tests/calc.at (Simple LALR(1) Calculator): Always declare
7234 %pure-parser along with %push-parser since this test case was designed
7235 for pure push parsers.
7236 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
7237 (AT_YACC_OR_PUSH_IF): New.
7238 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
7239 add a note that it's still wrong for some cases (as it has been for a
7240 while).
7241 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
7242 %push-parser no longer implies %pure-parser.
7243
a0633178
JD
72442006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7245
7246 Remove some unnecessary differences between the pull parser code and
7247 the push parser code. This patch enables yynerrs in push mode.
7248 * data/push.c: Reformat M4 a little.
7249 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
7250 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
7251 because push mode is on. Instead, if pure mode is on, move yynerrs
7252 to...
7253 (b4_declare_parser_state_variables): ... here.
7254 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
7255 to yyps->NAME so it can be used in yypush_parse.
7256 (yypush_parse): Don't omit uses of yynerrs in push mode.
7257
8646b6a3
JD
72582006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7259
7260 Fix bug such that the first pushed token's value and location are
7261 sometimes overwritten (sometimes by %initial-action) before being used.
7262 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
7263 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
7264 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
7265 more closely mimic the pull parser logic.
7266 Don't copy the pushed token to yychar, yylval, and yylloc until it's
7267 time to read a token, which is after any initialization of yylval and
7268 yylloc.
7269 (gottoken): Rename label to...
7270 (yyread_pushed_token): ... for clarity and to avoid infringing on the
7271 user namespace.
7272
9baf4d74
JD
72732006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7274
7275 Rearrange initialization of the parser state variables so that the
7276 skeleton doesn't have to have a copy for pull mode and another for push
7277 mode. This patch also fixes at least a bug such that yylloc was not
7278 initialized (with b4_location_initial_line and
7279 b4_location_initial_column) upon calling yypush_parse. However, that
7280 initialization now overwrites the first token's location;
7281 %initial-action assigning @$ already did the same thing, and both bugs
7282 will be fixed in a later patch.
7283 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
7284 (b4_declare_parser_state_variables): Remove initialization of yytoken,
7285 yyss, yyvs, yyls, and yystacksize.
7286 (yypstate_new): Remove initialization of some yypstate fields: yystate,
7287 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
7288 yylsp.
7289 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
7290 yyps->NAME so it can be used in yypush_parse.
7291 (yyparse or yypush_parse): For yypush_parse, don't print the
7292 "Starting parse" diagnostic for invocations after the first.
7293 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
7294 yypush_parse, only do it for the first invocation.
7295 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
7296 initialization to occur in yypush_parse but only on the first
7297 invocation.
7298
23522164
JD
72992006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7300
7301 * data/push.c: Add CPP guards around push parser declarations in both
7302 the header and the code file.
7303 In the code file, move the push parser declarations to the same place
7304 they appear in the header file.
7305 Clean up the M4 some, especially the inconsistent underquoting in
7306 some b4_c_function_def and b4_c_function_decl uses.
7307
bb010fe5
JD
73082006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7309
7310 Encapsulate the push parser state variables into an M4 macro so the
7311 push skeleton doesn't have to list them again for pull mode's yyparse.
7312 For push mode, remove yypush_parse's local equivalents of these
7313 variables to eliminate unnecessary copying between the two sets at
7314 run-time. This patch also fixes at least a bug related to multiple
7315 %initial-action invocations in push mode.
7316 * data/push.c (b4_declare_parser_variables): Rename to...
7317 (b4_declare_scanner_communication_variables): ... this for clarity and
7318 update both uses.
7319 (b4_declare_yyparse_variables): Remove and move its contents to the one
7320 spot where it was invoked.
7321 (b4_declare_parser_state_variables): New macro containing the parser
7322 state variables required by push mode.
7323 (struct yypstate): Replace all fields but yynew with
7324 b4_declare_parser_state_variables.
7325 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
7326 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
7327 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
7328 (yyparse or yypush_parse): For yyparse in pull mode, replace local
7329 parser state variable declarations with
7330 b4_declare_parser_state_variables.
7331 Don't initialize parser state variables when calling yypush_parse since
7332 yypstate_new already does that.
7333 Invoke the user's initial action only upon the first yypush_parse
7334 invocation.
7335 Remove all code that copies between the local parser state variables
7336 and the yypstate.
7337
2d212f8c
JD
73382006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7339
7340 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
7341 prevent a name collision in a future patch where these names will
7342 sometimes be #define'd.
7343 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
7344 since it no longer has the same name as the existing argument.
7345 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
7346
e6e704dc
JD
73472006-12-19 Paolo Bonzini <bonzini@gnu.org>
7348 and Joel E. Denny <jdenny@ces.clemson.edu>
7349
7350 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
7351 that the argument is case-insensitive, and there's no `=' here.
7352 For the %skeleton entry, mention that %language is better.
7353 (Bison Options): Likewise for --language and --skeleton. Move the
7354 --skeleton entry so that the `Tuning the parser' section is sorted
7355 alphabetically on long options.
7356 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
7357 %language directive in detail here; cross-reference the %language
7358 documentation instead.
7359 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
7360 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 7361 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
7362 * examples/extexi (normalize): Instead of replacing every %require
7363 argument with the current Bison version, just substitute for
7364 `@value{VERSION}'. This guarantees that we're testing what actually
7365 appears in the documentation.
7366 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
7367 rather than `@VERSION@'.
7368
0e021770
PE
73692006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7370
fd575f05
PE
7371 * NEWS: Reword the %language news a bit, and put it earlier.
7372
0e021770
PE
7373 * src/getargs.c (skeleton_arg): Last arg is now location const *.
7374 Rewrite to simplify the logic.
7375 (language_argmatch): Likewise.
fd575f05
PE
7376 (program_name): We now own this var.
7377 * src/getargs.h (struct bison_language): Use char[] rather than
7378 const char *.
0e021770
PE
7379
7380 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
7381 Java is supported.
7382 * src/complain.c (program_name): Remove decl; no longer needed.
7383 * src/main.c (program_name): Remove; now belongs to getargs.
7384
73852006-12-18 Paolo Bonzini <bonzini@gnu.org>
7386
7387 * NEWS: Document %language.
7388
7389 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
7390
7391 * data/c-skel.m4, data/c++-skel.m4: New files.
7392 * data/glr.c: Complain on push parsers.
7393
7394 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
7395 over %skeleton.
148d66d8 7396 (Decl Summary): Document %language and %skeleton.
0e021770
PE
7397 (Command line): Document -L.
7398
7399 * examples/extexi: Rewrite %require directive.
7400 * examples/calc++/Makefile.am: Pass VERSION to extexi.
7401
7402 * src/files.c (compute_exts_from_gc): Look in language structure
7403 for .y extension.
7404 (compute_file_name_parts): Check whether .tab should be added.
7405 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
7406 (language, skeleton_arg, language_argmatch): New.
7407 (long_options): Add --language.
7408 (getargs): Use skeleton_arg, add -L/--language.
7409 * src/getargs.h: Include location.h.
7410 (struct bison_language, language, skeleton_arg, language_argmatch): New.
7411 * src/output.c (prepare): Pick default skeleton from struct language.
7412 Don't dispatch C skeletons here.
7413 * src/parse-gram.y (PERCENT_LANGUAGE): New.
7414 (prologue_declaration): Add "%language" rule, use skeleton_arg.
7415 * src/scan-gram.l ("%language"): New rule.
7416
7417 * tests/calc.at: Test %skeleton and %language.
7418 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
7419 (AT_GLR_IF): Look for %skeleton "glr.cc".
7420 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
7421 (AT_YACC_IF): Reject %language.
7422
5691bf57
PE
74232006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7424
db06f0ce
PE
7425 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
7426 since it wasn't used; only the typedef name 'semantic_type' is needed.
7427 Also, omit trailing white space.
7428
5691bf57
PE
7429 * bootstrap: Sync from coreutils.
7430 (gnulib_extra_files): Add build-aux/announce.gen.
7431 (slurp): Adjust .gitignore files like .cvsignore files.
7432 * build-aux/announce-gen: Remove from CVS, since bootstrap
7433 now creates this.
7434
791934e4
JD
74352006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
7436
7437 Make %push-parser imply %pure-parser. This fixes several bugs; see
7438 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
7439 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
7440 pure_parser = true.
7441 * data/push.c: Don't bother testing b4_push_if when deciding whether
7442 to expand b4_declare_parser_variables globally.
7443 (yypush_parse): Likewise in here.
7444
7445 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
7446 (yy_reduce_print): Reformat M4 for readability.
7447
ee5abb37
JD
74482006-12-15 Bob Rossi <bob@brasko.net>
7449 and Joel Denny <jdenny@ces.clemson.edu>
7450
7451 * data/push.c (yypstate): Add typedef, and update all uses of
7452 struct yypstate to just yypstate.
7453 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
7454
16ca01f9
JD
74552006-12-14 Bob Rossi <bob@brasko.net>
7456
7457 * data/push.c (yypush_parse): Declare prototype regardless of
7458 %locations option.
7459
ab8e7e1a
JD
74602006-12-14 Bob Rossi <bob@brasko.net>
7461
7462 * data/push.c (yyparse): Remove the prototype and the #define when in
7463 push-parser mode.
7464
9bf32be3
JD
74652006-12-13 Bob Rossi <bob@brasko.net>
7466
7467 * data/push.c (yypstate_init): Rename to...
7468 (yypstate_new): ... this and use b4_c_function_def.
7469 (yypstate_delete): New.
7470 (yypush_parse): Change parameters yynval and yynlloc to be const.
7471 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
7472 yypstate_delete functions.
7473
f02e2948
JD
74742006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
7475
7476 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
7477 strange test case titles. Reported by Bob Rossi.
7478
38eb7751
PE
74792006-12-13 Paul Eggert <eggert@cs.ucla.edu>
7480
7481 * TODO: Add pointer to Sylvain Schmitz's work on static detection
7482 of potential ambiguities in GLR grammers.
7483
bd9d212b
JD
74842006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
7485
7486 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
7487 `bison ', use m4_index instead of m4_substr since chopping up a string
7488 containing M4-special characters causes problems here.
7489
7490 Fix a couple of bugs related to special characters in user-specified
7491 file names, and make it easier for skeletons to compute output file
7492 names with the same file name prefix as Bison-computed output file
7493 names.
7494 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
7495 b4_parser_file_name and b4_spec_defines_file instead of
7496 @output_parser_name@ and @output_header_name@, which are now redundant.
7497 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
7498 b4_parser_file_name, b4_spec_defines_file, and the new
7499 @basename(FILENAME@) instead of @output_parser_name@ and
7500 @output_header_name@, which inappropriately escaped the file names as
7501 C string literals.
7502 * src/files.c (all_but_ext): Remove static qualifier.
7503 (compute_output_file_names): Move `free (all_but_ext)' to...
7504 (output_file_names_free): ... here since all_but_ext is needed later.
7505 * src/files.h (all_but_ext): Extern.
7506 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
7507 exactly what MUSCLE_INSERT_STRING used to do.
7508 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
7509 characters are escaped properly.
7510 * src/output.c (prepare): Define muscle file_name_all_but_ext as
7511 all_but_ext.
7512 For pkgdatadir muscle, maintain previous functionality by using
7513 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
7514 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
7515 digraphs would never be expanded. Hopefully no one has M4-special
7516 characters in his Bison installation path.
7517 * src/scan-skel.l: Don't parse @output_header_name@ and
7518 @output_parser_name@ anymore since they're now redundant.
7519 In @output, use decode_at_digraphs.
7520 Parse a new @basename command that invokes last_component.
7521 (decode_at_digraphs): New.
7522 (BASE_QPUTS): Remove unused.
7523 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
7524 (Output file name): New tests.
7525
3f7ca628
JD
75262006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
7527
7528 Warn about output files that are generated by the skeletons and that
7529 conflict with other output files.
7530 * data/glr.c: Don't generate the header file here when glr.cc does.
7531 * src/files.c (file_names, file_names_count): New static globals.
7532 (compute_output_file_names): Invoke output_file_name_check for files
7533 not generated by the skeletons and remove existing checks.
7534 (output_file_name_check): New function that warns about conflicting
7535 output file names.
7536 (output_file_names_free): Free file_names.
7537 * src/files.h (output_file_name_check): Declare.
7538 * src/scan-skel.l: Invoke output_file_name_check for files generated by
7539 the skeletons.
7540 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
7541 (Conflicting output files): New tests.
7542
178e123e
PE
75432006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7544
7545 * doc/bison.texinfo: Fix a couple of typos.
7546
75472006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
7548
7549 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
7550 Rename to...
7551 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
7552 update all uses.
7553 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
7554 (yypush_parse): Rename yypvars argument to yyps and remove redundant
7555 local pv.
7556 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
7557 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
7558
ea17f233
JD
75592006-12-07 Bob Rossi <bob@brasko.net>
7560 and Joel Denny <jdenny@ces.clemson.edu>
7561
7562 * data/push.c (yypvarsinit): Change return type from void* to struct
7563 yypvars*. No longer cast to void* on return.
7564 (struct yypvars): Remove yylen since it need not be remembered between
7565 yypushparse invocations.
7566 (yypushparse): Don't copy between yylen and pv->yylen.
7567
55a30bda
JD
75682006-12-05 Bob Rossi <bob@brasko.net>
7569
7570 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
7571 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
7572 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
7573 (struct yypvars): Remove b4_declare_parser_variables.
7574 (yypvarsinit): Remove init code for removed variables.
7575 (global scope): Do not declare b4_declare_parser_variables if
7576 push or pure mode.
7577 (yypushparse): Add b4_declare_parser_variables.
7578 Init new local variables, and remove init code for removed
7579 yypvars variables.
7580 (yyparse): Delete.
7581 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
7582 and yyparse for other modes.
7583 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
7584 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
7585 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
7586 (AT_PURE_LEX_IF): True if pure or push parser.
7587
85894313
JD
75882006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
7589
7590 Document Yacc prologue alternatives and default %destructor's and
7591 %printer's as experimental. Don't mention Java yet. Discussed at
7592 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
7593 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
7594 (2.3a): Annotate this entry to say the old forms of these features were
7595 also experimental.
7596 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 7597 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
7598 of Java (we'll want this back eventually).
7599
02975b9a
JD
76002006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
7601
7602 Support a file name argument to %defines. Deprecate `=' in
7603 %file-prefix, %name-prefix, and %output. Discussed at
7604 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
7605 * NEWS (2.3a+): Mention.
148d66d8 7606 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
7607 form of %defines, and remove `=' from entries for %file-prefix,
7608 %name-prefix, and %output.
7609 * src/parse-gram.y (prologue_declaration): Implement.
7610 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
7611 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
7612 all but one occurrence of %name-prefix.
7613 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
7614 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
7615 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
7616 occurrence of each of %file-prefix and %output. Add check for %defines
7617 with argument.
7618 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
7619 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
7620 Remove the `=' from %output.
7621
287b314e
JD
76222006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
7623
7624 Don't escape $ in test case titles since Autoconf 2.61 now does that
7625 correctly.
7626 * tests/actions.at (Default %printer and %destructor are not for error
7627 or $undefined): Here.
7628 (Default %printer and %destructor are not for $accept): Here.
7629 * tests/input.at (Invalid $n and @n): Here.
7630
3ebecc24
JD
76312006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
7632
7633 Rename <!> to <>. Discussed starting at
7634 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
7635 * NEWS (2.3a+): Update.
148d66d8 7636 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
7637 Update.
7638 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
7639 * src/scan-gram.l (INITIAL): Implement.
7640 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
7641 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
7642 comment.
7643 * tests/actions.at (Default tagless %printer and %destructor,
7644 Default tagged and per-type %printer and %destructor,
7645 Default %printer and %destructor are not for error or $undefined,
7646 Default %printer and %destructor are not for $accept,
7647 Default %printer and %destructor for mid-rule values): Update.
7648 * tests/input.at (Default %printer and %destructor redeclared,
7649 Unused values with default %destructor): Update.
7650
26b8a438
JD
76512006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
7652
7653 Don't let %prec take a nonterminal.
7654 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
7655 token.
7656 * tests/input.at (%prec takes a token): New test checking that %prec
7657 won't take a nonterminal.
7658
07c39ae9
JD
76592006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7660
405d53b7
JD
7661 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
7662 it was double-quoted.
07c39ae9
JD
7663 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
7664 grammar is maintained with Bison's highest standards.
7665 * src/getargs.c: Fix some typos in Doxygen comments.
7666
580b8926
JD
76672006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7668
7669 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
7670 later. Reported by Paul Eggert in
7671 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
7672 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
7673 * src/scan-code.l (translate_action): Don't bother invoking
7674 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
7675 (code_scanner_free): Instead of invoking
7676 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
7677 which frees more.
7678 * src/scan-gram.l (gram_scanner_free): Likewise.
7679 * src/scan-skel.l (scan_skel): Likewise.
7680
4502eadc
JD
76812006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
7682
7683 * src/files.c (tr): Change return type to void.
7684 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
7685 has been called previously for the same key.
7686 (muscle_find): Return storage instead of value so that
7687 --enable-gcc-warnings doesn't produce warnings that the return discards
7688 const. aver that the value and storage are the same since storage
7689 could potentially be NULL when value is not.
7690 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
7691 same as 0.
7692
7746c8f6
PE
76932006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7694
7695 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
7696 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
7697 us a slightly cleaner distribution, and also works.
7698 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
7699 gnulib changes.
7700
eb095650
PE
77012006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
7702 and Paul Eggert <eggert@cs.ucla.edu>
7703
7704 Don't let Bison leak memory except when it complains.
7705 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
7706 (spec_defines_file, dir_prefix): Now char *, not const char *,
7707 since they are freed.
7708 * src/files.c: Likewise.
7709 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
7710 Likewise.
7711 (tr): Now operates in-place. All uses changed.
7712 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
7713 values.
7714 (compute_file_name_parts, compute_output_file_names): Don't store
7715 read-only data in variables that will be freed.
7716 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
7717 src_extension, and header_extension.
7718 (output_file_names_free): New public function to free
7719 spec_verbose_file, spec_graph_file, spec_defines_file,
7720 parser_file_name, and dir_prefix.
7721 * src/getargs.c (getargs): Don't store read-only data in variables that
7722 will be freed.
7723 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
7724 (which previously existed but was unused), and quotearg_free.
7725 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
7726 * src/muscle_tab.c: Likewise.
7727 (muscle_entry): Make the value char const *,
7728 and add a new storage member that is char * and can be freed.
7729 (muscle_entry_free): New private function.
7730 (muscle_init): Use it instead of free.
7731 (muscle_insert, muscle_grow): Update and use new storage member.
7732 (muscle_code_grow): Free the string passed to muscle_grow
7733 since it's not needed anymore.
7734 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
7735 add a new `char *code' member.
7736 ("{...}"): Declare semantic type as code.
7737 * src/scan-code.h (translate_rule_action):
7738 (translate_symbol_action, translate_code, translate_action): Return
7739 `char const *' rather than `char *' since external code should not free
7740 these strings.
7741 * src/scan-code.l: Likewise.
7742 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
7743 which is "{...}" in the parser.
7744 * tests/Makefile.am (maintainer-check-valgrind): Set
7745 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
7746 Valgrind.
7747 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
7748 complain.
7749 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
7750 expecting a non-zero exit status sets --leak-check=summary and
7751 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
7752 this case, and we don't want to hear about it.
7753
ac564be4
PE
77542006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7755
7756 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
7757 instead of from the template, to simplify configuration a bit.
7758 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
7759 and m4/wint_t.m4, as they are needed with the latest gnulib.
7760
17bd8a73
JD
77612006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7762
7763 Disable unset/unused mid-rule value warnings by default, and recognize
7764 --warnings=midrule-values to enable them. Discussed starting at
7765 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
7766 * NEWS (2.3a+): Mention.
7767 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
7768 warnings): Add entry for midrule-values subargument.
7769 * src/reader.c (symbol_should_be_used): Don't return true just because
7770 the value is a set/used mid-rule value unless
7771 --warnings=midrule-values was specified.
7772 * tests/input.at (Unused values, Unused values before symbol
7773 declarations): Run tests with and without --warnings=midrule-values.
7774
7775 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
7776 than LIST_FREE directly.
7777
89eb3c76
JD
77782006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7779
7780 Finish implementing --warnings=error, which should not be implied by
7781 --warnings=all (or by its synonyms -W and --warnings without
7782 subarguments).
7783 * src/complain.c (set_warning_issued): New function to report that
7784 warnings are being treated as errors and to record an error if so.
7785 Invoke...
7786 (warn_at, warn): ... here.
7787 * src/getargs.c (warnings_args, warnings_types): Reorder so that
7788 "error - warnings are errors" does not appear above "all - all of the
7789 above".
7790 (getargs): For -W and --warnings without subarguments, don't let
7791 FLAGS_ARGMATCH set warnings_error in warnings_flag.
7792 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
7793
ba7560e2
JD
77942006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7795
7796 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
7797 empty subargument list. For example: `bison --warnings= parser.y'.
7798
31283fc3
JD
77992006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7800
7801 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
7802 the parser header file so that gcc doesn't warn.
7803
12e35840
JD
78042006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7805
7806 Split the default %destructor/%printer into two kinds: <*> and <!>.
7807 Discussed starting at
7808 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
7809 * NEWS (2.3a+): Mention.
7810 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
7811 previous change today related to mid-rules.
148d66d8 7812 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 7813 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
7814 (TYPE_TAG_ANY): Add as <*>.
7815 (TYPE_TAG_NONE): Add as <!>.
7816 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
7817 for <*> and <!>.
7818 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
7819 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
7820 * src/symlist.c (symbol_list_default_new): Split into tagged and
7821 tagless versions.
7822 (symbol_list_destructor_set, symbol_list_printer_set): Split
7823 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
7824 SYMLIST_DEFAULT_TAGLESS.
7825 * src/symlist.h: Update symbol_list_default*_new prototypes.
7826 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
7827 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
7828 * src/symtab.c (default_destructor, default_destructor_location,
7829 default_printer, default_printer_location): Split each into tagged and
7830 tagless versions.
7831 (symbol_destructor_get, symbol_destructor_location_get,
7832 symbol_printer_get, symbol_printer_location_get): Implement tagged
7833 default and tagless default cases.
7834 (default_destructor_set, default_printer_set): Split each into tagged
7835 and tagless versions.
7836 * src/symtab.h: Update prototypes.
7837 * tests/actions.at (Default %printer and %destructor): Rename to...
7838 (Default tagless %printer and %destructor): ... this, and extend.
7839 (Per-type %printer and %destructor): Rename to...
7840 (Default tagged and per-type %printer and %destructor): ... this, and
7841 extend.
7842 (Default %printer and %destructor for user-defined end token): Extend.
7843 (Default %printer and %destructor are not for error or $undefined):
7844 Update.
7845 (Default %printer and %destructor are not for $accept): Update.
7846 (Default %printer and %destructor for mid-rule values): Extend.
7847 * tests/input.at (Default %printer and %destructor redeclared): Extend.
7848 (Unused values with default %destructor): Extend.
7849
f91b1629
JD
78502006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7851
7852 Don't apply the default %destructor/%printer to an unreferenced midrule
7853 value. Mentioned at
7854 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
7855 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
7856 like $@n instead of just @n so that the default %destructor/%printer
7857 logic doesn't see them as user-defined symbols.
7858 (symbol_is_dummy): Check for both forms of the name.
7859 * src/reader.c (packgram): Remove the `$' from each midrule symbol
7860 name for which the midrule value is referenced in any action.
7861 * tests/actions.at (Default %printer and %destructor for mid-rule
7862 values): New test.
7863 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
7864 for change to dummy symbol names.
7865
519d0004
JD
78662006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7867
7868 Warn about unset midrule $$ if the corresponding $n is used.
7869 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
7870 $n usage.
7871 (packgram): Before invoking grammar_rule_check on any rule, make sure
7872 all actions have already been scanned in order to set `used' flags.
7873 Otherwise, checking that a midrule's $$ is set will not always work
7874 properly because the midrule check must forward-reference the midrule's
7875 parent rule.
7876 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
7877 warning.
7878
a501eca9
JD
78792006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7880
7881 More improvements to the documentation of the prologue alternatives:
7882 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
7883 Bison manual.
7884 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
7885 some text to clarify the relative importance of the new directives and
7886 to show how these directives may be viewed as code labels.
7887
2cbe6b7f
JD
78882006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
7889
7890 Similar to the recently removed %before-header, add %code-top as the
7891 alternative to the pre-prologue. Mentioned at
7892 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
7893 Also, let the prologue alternatives appear in the grammar section.
7894 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
7895 (prologue_declaration): Move the existing prologue alternatives to...
7896 (grammar_declaration): ... here and add %code-top.
7897 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
7898
7899 Clean up and extend documentation for the prologue alternatives.
7900 * NEWS (2.3a+): Describe prologue alternatives.
7901 * doc/bison.texinfo (Prologue): Move discussion of prologue
7902 alternatives to...
7903 (Prologue Alternatives): ... this new section, and extend it to discuss
7904 all 4 directives in detail.
148d66d8
JD
7905 (Table of Symbols): Clean up discussion of prologue alternatives and
7906 add %code-top.
2cbe6b7f 7907
e557d3ea
JMG
79082006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7909
7910 DJGPP specific issues.
7911
7912 * djgpp/config.bat: config.hin has been moved to lib. Adjust
7913 config.bat accordingly.
7914 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
7915 * djgpp/config.site: Likewise.
7916
136a0f76
PB
79172006-10-16 Paolo Bonzini <bonzini@gnu.org>
7918
27bd5d67
PB
7919 Replace %*-header with %provides, %requires, %code. See discussion at
7920 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
7921
136a0f76
PB
7922 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
7923 (b4_user_start_header): Remove.
7924 * data/glr.c: Use new macros instead of b4_*start_header
7925 and b4_*end_header.
7926 * data/glr.cc: Likewise.
7927 * data/lalr1.cc: Likewise.
7928 * data/push.c: Likewise.
7929 * data/yacc.c: Likewise.
7930
7931 * doc/bison.texinfo: Remove %before-header, rename
7932 %{start,end,after}-header to %requires, %provides, %code.
7933
7934 * src/parse-gram.y: Likewise (also rename token names accordingly).
7935 * src/scan-gram.l: Likewise.
7936 * tests/actions.at: Likewise.
7937
10f429ef
PE
79382006-10-14 Paul Eggert <eggert@cs.ucla.edu>
7939
7940 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
7941 Problem reported by Joel E. Denny.
7942
79432006-10-14 Jim Meyering <jim@meyering.net>
7944
7945 (Sync from coreutils.)
7946 Work also when the working directory (with e.g. coreutils sources)
7947 is version controlled with git, rather than CVS.
7948 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
7949 rather than CVS.
7950 In messages and comments, say e.g., "checked-out sources",
7951 rather than "CVS sources".
7952 (version_controlled_file): New function. Work for git as well as
7953 for CVS. Don't use grep's -q option.
7954 (slurp): Call it here, in place of CVS-specific code.
7955
c4bd5bf7
JD
79562006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
7957
7958 Fix testsuite for ./configure --enable-gcc-warnings:
7959 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
7960 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
7961 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
7962 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
7963 * test/regression.at (Diagnostic that expects two alternatives):
7964 Likewise.
7965
46356ea4
PE
79662006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7967
231ed89a
PE
7968 * bootstrap.conf (gnulib_modules): Add config-h.
7969 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
7970 worry about HAVE_CONFIG_H.
7971 * lib/abitset.c: Likewise.
7972 * lib/bitset.c: Likewise.
7973 * lib/bitset_stats.c: Likewise.
7974 * lib/bitsetv-print.c: Likewise.
7975 * lib/bitsetv.c: Likewise.
7976 * lib/ebitset.c: Likewise.
7977 * lib/get-errno.c: Likewise.
7978 * lib/lbitset.c: Likewise.
7979 * lib/subpipe.c: Likewise.
7980 * lib/timevar.c: Likewise.
7981 * lib/vbitset.c: Likewise.
7982 * lib/bitset.c: Include "bitset.h" first, to test interface.
7983 * lib/bitset_stats.c: Include "bitset_stats.h" first.
7984 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
7985 * lib/bitsetv.c: Include "bitsetv.h" first.
7986 * lib/get-errno.c: Include "get-errno.h" first.
7987 * m4/.cvsignore: Add config-h.m4.
7988 * tests/actions.at (Default %printer and %destructor for ...):
7989 Adjust expected line numbers in output to reflect removal of #if
7990 HAVE_CONFIG_H lines.
7991 * tests/glr-regression.at (Missed %merge type warnings when ...):
7992 Likewise.
7993 * tests/regression.at (Braced code in declaration in rules section):
7994 Likewise.
7995 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
7996 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
7997 Include <config.h> unconditionally.
7998
46356ea4
PE
7999 * bootstrap: Sync from coreutils, as follows:
8000
8001 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8002
8003 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
8004 variable was sometimes used without being initialized. This
8005 messed up the installation of the INSTALL file in some cases.
8006
8007 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8008
8009 * bootstrap (usage, main program, symlink_to_gnulib): Add option
8010 --copy. Inspired by a suggestion from Bruno Haible.
8011
8012 2006-10-03 Jim Meyering <jim@meyering.net>
8013
8014 * bootstrap: Undo last change to this file, since now gnulib-tool
8015 sticks with the automake default in generating dependencies.
8016
dd4bf078
PE
80172006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8018
cf2a5f7c
PE
8019 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
8020 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
8021
8022 * doc/bison.1: Add copyright notice.
8023
8024 * data/glr.c: Don't include <stdarg.h>; not used.
8025
35fe0834
PE
8026 * NEWS: The -g and --graph options now output graphs in Graphviz
8027 DOT format, not VCG format.
8028 * doc/bison.1: Likewise.
8029 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
8030 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
8031 of this change in
8032 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
8033 * TODO: Remove Graphviz entry.
8034 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
8035 remove vcg.c, vcg.h, vcg_defaults.h.
8036 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
8037 * src/graphviz.c, src/graphviz.h: New files.
8038 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
8039 * src/files.h: Make comment more generic.
8040 * src/main.c (main): Likewise.
8041 * src/print_graph.h: Likewise.
8042 * src/getargs.c (usage): Make usage description more generic.
8043 * src/print_graph.c: Include graphviz.h rather than vcg.h.
8044 (static_graph, fgraph): Remove. All uses changed to pass
8045 arguments instead of sharing a static var.
8046 (print_core, print_actions, print_state, print_graph):
8047 Output graphviz format rather than VCG format.
8048 * tests/.cvsignore: Remove *.vcg; add *.dot.
8049 * tests/output.at: Expect *.dot files, not *.vcg files.
8050
dd4bf078
PE
8051 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
8052 accommodates the 2006-10-08 change.
8053
efdd7421
PE
80542006-10-11 Bob Rossi <bob@brasko.net>
8055
8056 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
8057 (b4_yyssa, b4_yyerror_range): New macros.
8058 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
8059 (yypvarsinit): Remove init of removed fields.
8060 (yypushparse): Remove use of removed fields; use new macros instead.
8061
96a1981a
PE
80622006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8063
8064 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
8065 in a push parser. Reindent slightly to match yacc.c better.
8066
80672006-10-11 Bob Rossi <bob@brasko.net>
8068
46356ea4
PE
8069 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
8070 yymsg_alloc fields.
8071 (yypvarsinit, yypushparse): Remove init of removed fields.
8072 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 8073
c1630a8b
PE
80742006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8075
8076 * THANKS: Add Paolo Bonzini and Bob Rossi.
8077
90b9908d
PB
80782006-10-08 Paolo Bonzini <bonzini@gnu.org>
8079
8080 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
8081 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
8082 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
8083 b4_define_user_cde and uses): Remove.
8084 (b4_comment, b4_prefix, b4_sync_start): New.
8085 * data/bison.m4: New file, with most of the content removed from c.m4.
8086 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
8087 * src/output.c (output_skeleton): Pass bison.m4.
8088 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
8089 only if specified.
8090
cf806753
PE
80912006-10-05 Paul Eggert <eggert@cs.ucla.edu>
8092
8093 Fix test failure reported by Tom Lane in
8094 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
8095 and try to make such failures easier to catch in the future.
8096 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
8097 that's now the caller's responsibility.
8098 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
8099 Set yychar = YYEOF if it's negative.
8100 * tests/actions.at (yylex): Abort if asked to read past EOF.
8101 * tests/conflicts.at (yylex): Likewise.
8102 * tests/cxx-type.at (yylex): Likewise.
8103 * tests/glr-regression.at (yylex): Likewise.
8104 * tests/input.at (yylex): Likewise.
8105 * tests/regression.at (yylex): Likewise.
8106 * tests/torture.at (yylex): Likewise.
8107
0e2f006a
PE
81082006-10-01 Paul Eggert <eggert@cs.ucla.edu>
8109
8110 Fix problems with translating English-language diagnostics.
8111 * bootstrap: Fix bug introduced in recent bootstrap changes, with
8112 respect to bison-runtime pot generation. The YY_ stuff
8113 wasn't being captured.
8114 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
8115 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
8116 * runtime-po/POTFILES.in: Add data/push.c.
8117
e3ddc1e3
PE
81182006-09-29 Paul Eggert <eggert@cs.ucla.edu>
8119
8120 Merge bootstrap changes from coreutils.
8121
8122 2006-09-28 Jim Meyering <jim@meyering.net>
8123
8124 Automatically generated dependencies are important even
8125 when all of the sources in a directory come from gnulib.
8126 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
8127 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
8128
8129 2006-09-23 Jim Meyering <jim@meyering.net>
8130
8131 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
8132
8133 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8134
8135 * bootstrap: Add support for --force.
8136 (usage): New function. Describe usage less tersely.
8137 (CVS_only_file): New var.
8138
01e972b3
PE
81392006-09-21 Paul Eggert <eggert@cs.ucla.edu>
8140
8141 * data/push.c (YYPUSH_MORE): Make it an enum instead.
8142 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
8143 Adjust white space and comments to match GNU style better.
8144
c63d3e90
PE
81452006-09-20 Bob Rossi <bob@brasko.net>
8146
8147 * data/push.c (yyresult_get): Remove function.
8148 (YYPUSH_MORE): Add #define.
8149 (yypushparse): Modify return value.
8150
e70f46d1
PE
81512006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8152
8153 * stamp-h.in: Remove; no longer needed.
8154 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
8155 Remove config.h, config.hin, intl (no longer created).
8156 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
8157 stamp-h1.
8158
8159 Sync bootstrap from coreutils, as follows:
8160
8161 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
8162
8163 * bootstrap (symlink_to_gnulib): New function.
8164 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
8165 to copies-of-gnulib.
8166 (cp_mark_as_generated, slurp, gnulib_files):
8167 Avoid making a copy if it's the same as the old version.
8168 (gnulib_files): Add support for this variable (used by Bison).
8169
a92be413
PE
81702006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8171
8172 * src/getargs.c (usage): Rework to use conventions similar to
8173 coreutils, to make translation a bit easier and the code a bit
8174 smaller. Problem reported by Tim Van Holder.
8175
4f82b42a
PE
81762006-09-15 Paul Eggert <eggert@cs.ucla.edu>
8177
3b2942e6
PE
8178 Use some of gnulib's new modules, taken from coreutils.
8179
8180 * bootstrap: Sync from coreutils, except add support for gnulib_files.
8181 * bootstrap.conf: New file.
8182 (gnulib_modules): Add configmake, inttypes, unistd.
8183 (XGETTEXT_OPTIONS): Add complain, complain_at,
8184 fatal, fatal_at, warn, warn_at, unexpected_end.
8185 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
8186 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
8187 (gl_EARLY): Add.
8188 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
8189 (gl_INIT): Add
8190 (GNULIB_AUTOCONF_SNIPPET): Remove.
8191 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
8192 the pickiest.
8193 * lib/.cvsignore: Add inttypes_.h.
8194 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
8195 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
8196 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
8197 no-longer-necessary initializations.
8198 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
8199 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
8200 use the unistd module.
8201 * src/system.h: Likewise.
8202 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
8203 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
8204 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
8205 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
8206 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
8207 * src/system.h: Include inttypes.h unconditionally, now that we
8208 use the inttypes module. Don't bother to include stdint.h, since
8209 inttypes.h now does that for us.
8210 (LOCALEDIR): Remove, now that we use the configmake module.
8211 * src/getargs.c: Include configmake.h.
8212 * src/main.c: Likewise.
8213 * src/output.c: Likewise.
8214 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
8215 not from $abs_top_builddir, since config.h moved.
8216
8217
4f82b42a
PE
8218 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
8219 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
8220
8221 * src/parse-gram.y (symbol_declaration): Don't put statements
8222 before declarations; it's not portable to C89.
8223 * src/scan-code.l (handle_action_at): Likewise.
8224
8225 * src/scan-code.l: Always initialize braces_level; the old code
8226 left it uninitialized and therefore had undefined behavior.
8227
8228 Don't attempt to redefine 'assert', since it runs afoul of
8229 systems where standard headers (mistakenly) include <assert.h>.
8230 Instead, define and use our own alternative, called 'aver'.
8231 * src/reader.c: Don't include assert.h, since we no longer
8232 use assert.
8233 * src/scan-code.l: Likewise.
8234 * src/system.h (assert): Remove, replacing with....
8235 (aver): New function, taking a bool arg. All uses changed.
8236 * src/tables.c (pack_vector): Ensure that aver arg is bool,
8237 not merely an integer.
8238
31c10e38
PE
82392006-09-15 Bob Rossi <bob@brasko.net>
8240
d6bdb90a
JD
8241 Add support for push parsing. Based on the original work of
8242 Odd Arild Olsen <oao@fibula.no>.
31c10e38
PE
8243 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
8244 * data/c.m4 (YYPUSH): New.
8245 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
d6bdb90a 8246 * data/push.c: New file.
31c10e38
PE
8247 * src/getargs.c (push_parser): New var.
8248 * src/getargs.h (push_parser): New declaration.
8249 * src/output.c (prepare): Add macro insertion of `push_flag'.
8250 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
8251 (prologue_declaration): Parse %push-parser.
8252 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
8253 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
8254 list of removed lines from the traces observed.
8255 (AT_CHECK_CALC_LALR): Added push parser tests.
8256
fa7b79c0
PE
82572006-09-13 Paul Eggert <eggert@cs.ucla.edu>
8258
21fe08ca
PE
8259 * NEWS: Version 2.3a.
8260 * configure.ac (AC_INIT): Likewise.
8261
e8ec4d9b
PE
8262 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
8263 "#define YYSTYPE int" that caused "make maintainer-check" to fail
8264 due to header ordering dependencies. I don't know why the #define
8265 was there.
8266
fa7b79c0
PE
8267 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
8268 runtime cost when YYDEBUG is not defined, and so that some tests
8269 that used to fail now work. Problem and initial suggestion by
8270 Paolo Bonzini.
8271 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
8272 * data/glr.cc (b4_parser_class_name):
8273 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
8274 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
8275 (yydebug_) [YYDEBUG]: New member.
8276 (yycdebug_): Now defined only if YYDEBUG.
8277 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
8278 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
8279 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
8280 if YYYDEBUG.
8281 (debug_stream, set_debug_stream, debug_level, set_debug_level):
8282 Define only if YYDEBUG.
8283 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
8284 set_debug_level.
8285 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
8286 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
8287 AT_CHECK_CALC_GLR_CC that are working now.
8288
4ec13d60
PE
82892006-09-12 Paul Eggert <eggert@cs.ucla.edu>
8290
8291 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
8292 We don't need them in glr.cc, and glr.c defines them.
8293 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
8294 assumes that defining it to anything is the same as defining
8295 it to 1. Problem reported by Paolo Bonzini.
8296
8e1687ae
PE
82972006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
8298
8299 * data/c.m4 (b4_null, b4_case): Define.
8300 * src/output.c (prepare_symbols): Use b4_null.
8301 (user_actions_output): Use b4_case.
8302
3dc5e96b
PE
83032006-09-11 Paul Eggert <eggert@cs.ucla.edu>
8304
aef3da86
PE
8305 * data/glr.c (b4_shared_declarations): Put start-header first,
8306 before any #includes that we generate, so that feature-test
8307 macros work. Problem reported by Michael Deutschmann in
8308 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
8309 * data/lalr1.cc: Likewise.
8310 * doc/bison.texinfo (Prologue): Document that feature-test macros
8311 should be defined before any Bison declarations.
8312 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
8313 that depend on location.hh after, not before, Bison decls, since
8314 we now include location.hh after the first user prologue.
8315
3dc5e96b
PE
8316 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
8317 Sander Brandenburg in
8318 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
8319 Also, fix minor white space and comment issues.
aef3da86
PE
8320 (Prologue): Mention that it's better to define feature-test macros
8321 before Bison declarations. Problem reported by Michael Deutschmann.
8322
8323 * README-cvs: Fix typo: "&" should be "&&". Problem reported
8324 by Jim Meyering.
8325 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
8326 This adjusts to recent gnulib changes.
3dc5e96b 8327
b2a0b7ca
JD
83282006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8329
8330 Finish implementation of per-type %destructor/%printer. Discussed
8331 starting at
8332 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
8333 and
8334 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
8335 * NEWS (2.3+): Add a description of this feature to the default
8336 %destructor/%printer description.
8337 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
8338 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
8339 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
8340 list node contains a semantic type.
8341 * src/symtab.c, src/symtab.h: Extend with a table that associates
8342 semantic types with their %destructor's and %printer's.
8343 (semantic_type_from_uniqstr, semantic_type_get,
8344 semantic_type_destructor_set, semantic_type_printer_set): New functions
8345 composing the public interface of that table.
8346 (symbol_destructor_get, symbol_destructor_location_get,
8347 symbol_printer_get, symbol_printer_location_get): If there's no
8348 per-symbol %destructor/%printer, look up the per-type before trying
8349 the default.
8350 * tests/actions.at (Per-type %printer and %destructor): New test case.
8351 * tests/input.at (Default %printer and %destructor redeclared):
8352 Extend to check that multiple occurrences of %symbol-default in a
8353 single %destructor/%printer declaration is an error.
8354 (Per-type %printer and %destructor redeclared, Unused values with
8355 per-type %destructor): New test cases.
8356
3be03b13
JD
83572006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8358
8359 Require default %destructor/%printer to be declared using
8360 %symbol-default instead of an empty symbol list, and start working on
8361 new per-type %destructor/%printer. Discussed at
8362 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
8363 * NEWS (2.3+): Add %symbol-default to example.
8364 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 8365 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
8366 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
8367 (generic_symlist, generic_symlist_item): New nonterminals for creating
8368 a list in which each item is a symbol, semantic type, or
8369 %symbol-default.
8370 (grammar_declaration): Use generic_symlist in %destructor and %printer
8371 declarations instead of symbols.1 or an empty list.
8372 (symbol_declaration, precedence_declaration, symbols.1): Update actions
8373 for changes to symbol_list.
8374 * src/reader.c: Update for changes to symbol_list.
8375 * src/scan-code.l: Likewise.
8376 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
8377 * src/symlist.c, src/symlist.h: Extend such that a list node may
8378 represent a semantic type or a %symbol-default in addition to just an
8379 ordinary symbol. Add switched functions for setting %destructor's and
8380 %printer's.
8381 * tests/actions.at, tests/input.at: Add %symbol-default to all default
8382 %destructor/%printer declarations.
8383
3508ce36
JD
83842006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
8385
8386 Whether the default %destructor/%printer applies to a particular symbol
8387 isn't a question of whether the user *declares* that symbol (in %token,
8388 for example). It's a question of whether the user by any means
8389 *defines* the symbol at all (by simply using a char token, for
8390 example). $end is defined by Bison whereas any other token with token
8391 number 0 is defined by the user. The error token is always defined by
8392 Bison regardless of whether the user declares it with %token, but we
8393 may one day let the user define error as a nonterminal instead.
8394 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
8395 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
8396 the meaning of "user-defined".
8397 * tests/actions.at (Default %printer and %destructor for user-declared
8398 end token): Rename to...
8399 (Default %printer and %destructor for user-defined end token): ...
8400 this.
8401
8402 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
8403 computation of whether to apply the default, don't maintain a list of
8404 every Bison-defined symbol. Instead, just check for a first character
8405 of '$', which a user symbol cannot have, and check for the error token.
8406
9350499c
JD
84072006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
8408
8409 Don't apply the default %destructor or %printer to the error token,
8410 $undefined, or $accept. This change fits the general rule that the
8411 default %destructor and %printer are only for user-declared symbols,
8412 and it solves several difficulties that are described in the new test
8413 cases listed below.
8414 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
8415 * tests/actions.at (Default %printer and %destructor are not for error
8416 or $undefined, Default %printer and %destructor are not for $accept):
8417 New test cases.
8418
4d7370cb
JD
84192006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
8420
8421 Allow %start after the first rule.
8422 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
8423 when parsing the first rule.
8424 (check_and_convert_grammar): Search for it here after all grammar
8425 declarations have been parsed. Skip midrules, which have dummy LHS
8426 nonterminals.
8427 * src/symtab.c (symbol_is_dummy): New function.
8428 * src/symtab.h (symbol_is_dummy): Declare it.
8429 * tests/input.at (%start after first rule): New test.
8430
6d0ef4ec
JD
84312006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8432
8433 Redo some of the previous commit: add back the ability to use
8434 non-aliased/undeclared string literals since it might be useful to
8435 those declaring %token-table.
8436 * src/reader.c (check_and_convert_grammar): Undo changes in previous
8437 commit: don't worry about complaints from symbols_pack.
8438 * src/symtab.c (symbol_new, symbol_class_set,
8439 symbol_check_alias_consistency): Undo changes in previous commit: count
8440 each string literal as a new symbol and token, assign it a symbol
8441 number, and don't complain about non-aliased string literals.
8442 (symbols_pack): Since symbol_make_alias still does not decrement symbol
8443 and token counts but does still set aliased tokens to the same number,
8444 symbol_pack_processor now leaves empty slots in the symbols array.
8445 Remove those slots.
8446 * tests/regression.at (Undeclared string literal): Remove test case
8447 added in previous commit since non-aliased string literals are allowed
8448 again.
8449 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
8450 remove unnecessary string literal declarations.
8451 * tests/sets.at (Firsts): Likewise.
8452
965537bc
JD
84532006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8454
8455 Don't allow an undeclared string literal, but allow a string literal to
8456 be used before its declaration.
8457 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
8458 symbols_pack complained.
8459 * src/symtab.c (symbol_new): Don't count a string literal as a new
8460 symbol.
8461 (symbol_class_set): Don't count a string literal as a new token, and
8462 don't assign it a symbol number since symbol_make_alias does that.
8463 (symbol_make_alias): It's not necessary to decrement the symbol and
8464 token counts anymore. Don't assume that an alias declaration occurs
8465 before any uses of the identifier or string, and thus don't assert that
8466 one of them has the highest symbol number so far.
8467 (symbol_check_alias_consistency): Complain if there's a string literal
8468 that wasn't declared as an alias.
8469 (symbols_pack): Bail if symbol_check_alias_consistency failed since
8470 symbol_pack asserts that every token has been assigned a symbol number
8471 although undeclared string literals have not.
8472 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 8473 string literal): New test cases.
965537bc
JD
8474 (Characters Escapes, Web2c Actions): Declare string literals as
8475 aliases.
8476 * tests/sets.at (Firsts): Likewise.
8477
47aee066
JD
84782006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
8479
8480 In the grammar scanner, STRING_FINISH unclosed constructs and return
8481 them to the parser in order to improve error messages.
8482 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
8483 SC_BRACED_CODE, SC_PROLOGUE): Implement.
8484 * tests/input.at (Unclosed constructs): New test case.
8485 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
8486 seen.
8487
8488 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
8489 unused global.
8490
1f6b3679
JD
84912006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
8492
8493 Handle string aliases for character tokens correctly.
8494 * src/symtab.c (symbol_user_token_number_set): If the token has an
8495 alias, check and set its alias's user token number instead of its own,
8496 which is set to indicate the alias. Previously, every occurrence of
8497 the character token in the grammar overwrote that alias indicator with
8498 the character code.
8499 * tests/input.at (String aliases for character tokens): New test.
8500
219741d8
JD
85012006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
8502
8503 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
8504
11daa4e7
PE
85052006-08-11 Paul Eggert <eggert@cs.ucla.edu>
8506
8507 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
8508 to prevent failures when building on older platforms.
8509 Check for autopoint failure.
8510 Set XGETTEXT_OPTIONS to values that check for C format strings,
8511 so that translators are warned about them (this also helps
8512 prevent core dumps).
8513
8514 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
8515 function, since it simplifies our code a bit.
8516
8517 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
8518 rather than -W, so we don't get bogus warnings about sign comparisons.
8519 Add -Wpointer-arith, since that warning is useful (it reports code
8520 that does not conform to C89 and that some compilers reject).
8521 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
8522 since it's no longer needed.
8523
f9bfc42a
JD
85242006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
8525
8526 Clean up scanners a bit.
8527 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
8528 definitions so gcc won't warn when obstack_for_string is unused.
8529 * src/scan-code.l: config.h and system.h are already #include'd by
8530 scan-code-c.c, so get rid of them here.
8531 * src/scan-gram.l: Likewise.
8532 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
8533 definitions rather than duplicating the rest of it.
8534 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
8535
06e8700a
JD
85362006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
8537
8538 Suppress signed/unsigned comparison warnings for yycheck.
8539 * data/c.m4 (b4_safest_int_type): New macro.
8540 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
8541 a signed int type, cast it to b4_safest_int_type first.
8542 * data/yacc.c: Likewise.
8543 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
8544 also overwritten.
8545
9c437126
PE
85462006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
8547
8548 * doc/bison.texinfo: Fix some typos.
8549
284d8a13
PE
85502006-08-02 Paul Eggert <eggert@cs.ucla.edu>
8551
8552 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
8553 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
8554
8555 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
8556 the latest gnulib does this a different way.
8557 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
8558 translation was patched, so stop omitting it.
8559
ec5479ce
JD
85602006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8561
8562 Enable declaration of default %printer/%destructor. Make the parser
8563 use these for all user-declared grammar symbols for which the user does
8564 not declare a specific %printer/%destructor. Thus, the parser uses it
8565 for token 0 if the user declares it but not if Bison generates it as
8566 $end. Discussed starting at
8567 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
8568 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
8569 and
8570 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
8571 * NEWS (2.3+): Mention.
8572 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
8573 declare a %destructor for a mid-rule's semantic value. It's just
8574 impossible to declare one specific to it.
8575 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
8576 code. Describe default %destructor form.
8577 * src/parse-gram.y (grammar_declaration): Parse default
8578 %printer/%destructor declarations.
8579 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
8580 and symbol_destructor_location_get rather than accessing the destructor
8581 and destructor_location members of struct symbol.
8582 (symbol_printers_output): Likewise but for %printer's.
8583 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
8584 again.
8585 * src/symtab.c (default_destructor, default_destructor_location,
8586 default_printer, default_printer_location): New static global
8587 variables to record the default %destructor and %printer.
8588 (symbol_destructor_get, symbol_destructor_location_get,
8589 symbol_printer_get, symbol_printer_location_get): New functions to
8590 compute the appropriate %destructor and %printer for a symbol.
8591 (default_destructor_set, default_printer_set): New functions to set the
8592 default %destructor and %printer.
8593 * src/symtab.h: Prototype all those new functions.
8594 * tests/actions.at (Default %printer and %destructor): New test to
8595 check that the right %printer and %destructor are called, that they're
8596 not called for $end, and that $$ and @$ work correctly.
8597 (Default %printer and %destructor for user-declared end token): New
8598 test to check that the default %printer and %destructor are called for
8599 a user-declared end token.
8600 * tests/input.at (Default %printer and %destructor redeclared, Unused
8601 values with default %destructor): New tests to check related grammar
8602 warnings and errors.
8603
868d2d96
JD
86042006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8605
8606 Clean up handling of %destructor for the end token (token 0).
8607 Discussed starting at
8608 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
8609 and
8610 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
8611
8612 Make the skeletons consistent in how they pop the end token and invoke
8613 its %destructor.
8614 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
8615 state, which has token number 0, since this would invoke the
8616 %destructor for the end token.
8617 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
8618 until after shifting the end token, or else it won't be popped.
8619 * data/yacc.c (yyparse): Likewise.
8620
8621 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
8622 it's the end token. Upon termination, destroy an unshifted lookahead
8623 even when it's the end token.
8624 * data/lalr1.cc (yy::parser::parse): Likewise.
8625 * data/yacc.c (yyparse): Likewise.
8626
8627 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
8628 value warnings for the end token when the user gives the end token a
8629 %destructor.
8630
8631 * tests/actions.at (Printers and Destructors): Test all the above.
8632
62a9592d
PE
86332006-07-24 Paul Eggert <eggert@cs.ucla.edu>
8634
8635 Update to latest gnulib and gettext versions.
8636 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
8637 Add fopen-safer.
8638 (gnulib_files): Add m4/warning.m4. Don't worry about files
8639 overwritten by autopoint.
8640 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
8641 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
8642 rejects them.
8643 Don't use autoreconf; instead, invoke autopoint etc. by hand,
8644 so that we can remove the intl files at a better time.
8645 (intl_files_to_remove): Remove aclocal.m4, since it gets
8646 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
8647 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
8648 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
8649 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
8650 Remove datarootdir hack; no longer needed.
8651 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
8652 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
8653 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
8654 strdup.h.
8655 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
8656 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
8657
10d6970f
PE
86582006-07-20 Paul Eggert <eggert@cs.ucla.edu>
8659
8660 * bootstrap: Adjust to today's change to gnulib-tool by invoking
8661 it with --assume-autoconf='latest-stable'.
8662
50a33993
JD
86632006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
8664
8665 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
8666 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
8667 YYSTYPE' and `{'.
8668 * src/muscle_tab.h (muscle_grow): Replace the header comments with
8669 those from muscle_tab.c since the old ones are misleading.
8670
2ce4ed68
AD
86712006-07-13 Akim Demaille <akim@epita.fr>
8672
8673 Support %define "KEY" {VALUE}.
8674 * src/scan-code.h, src/scan-code.l (translate_action)
8675 (translate_rule_action, translate_symbol_action, translate_code):
8676 Return char *, not const char *.
8677 * src/parse-gram.y (declaration): Rename as...
8678 (prologue_declaration): this.
8679 (string_content): Remove this nonterminal, use STRING.
8680 (braceless, content, content.opt): New nonterminal.
8681 Use them.
8682 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
8683 as value.
8684 * src/scan-gram.l (getargs.h): Don't include it.
8685
db7e5eb5
PE
86862006-07-12 Paul Eggert <eggert@cs.ucla.edu>
8687
8688 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
8689 rather than a for-loop that declares a local bool variable. This
8690 should work around a compatibility problem with a Cray x1e C++
8691 compiler reported by Hung Nguyen in
8692 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
8693 The for-loop was introduced in the 2004-11-17 change but I don't
8694 know why it was needed.
8695
a5d80ba5
AD
86962006-07-12 Akim Demaille <akim@epita.fr>
8697
8698 * data/c.m4: Comment changes.
8699
23eb2a69
AD
87002006-07-10 Akim Demaille <akim@lrde.epita.fr>
8701
8702 * src/complain.c (error_message, ERROR_MESSAGE): New.
8703 To factor...
8704 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
8705 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
8706
ddc8ede1
PE
87072006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8708
8709 * NEWS: Instead of %union, you can define and use your own union type
8710 YYSTYPE if your grammar contains at least one <type> tag.
8711 Your YYSTYPE need not be a macro; it can be a typedef.
8712 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
8713 (Union Decl, Decl Summary): Document this.
8714 * data/glr.c (YYSTYPE): Implement this.
8715 * data/glr.cc (YYSTYPE): Likewise.
8716 * data/lalr1.cc (YYSTYPE): Likewise.
8717 * data/yacc.c (YYSTYPE): Likewise.
8718 * src/output.c (prepare): Output tag_seen_flag.
8719 * src/parse-gram.y (declaration, grammar_declaration):
8720 Use 'union_seen' rather than 'typed' to determine whether
8721 %union has been seen, since grammars can now be typed without
8722 %union.
8723 (symbol_declaration, type.opt, symbol_def):
8724 Keep track of whether a tag has been seen.
8725 * src/reader.c (union_seen, tag_seen): New vars.
8726 (typed): remove.
8727 * src/reader.h (union_seen, tag_seen, typed): Likewise.
8728 * src/scan-code.l (untyped_var_seen): New variable.
8729 (handle_action_dollar): Adjust to above changes.
8730 (handle_action_dollar, handle_action_at):
8731 Improve overflow checking for outlandish numbers.
8732 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
8733 avoid new diagnostics generated by above changes.
8734 * tests/regression.at (YYSTYPE typedef): Add test to check
8735 for type tags without %union.
8736
8737 * src/symlist.c (symbol_list_length): Return int, not unsigned
8738 int, since callers expect int. This may need to get revisited
8739 once we have proper integer overflow checking.
8740
8741 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
8742 object is now static.
8743
8744 * src/getargs.c (flags_argmatch): Return void, not int,
8745 to pacify ./configure --enable-gcc-warnings.
8746
8747 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
8748 since last_string is already defined to FLEX_PREFIX (last_string).
8749
7b42569e
AD
87502006-07-09 Akim Demaille <akim@lrde.epita.fr>
8751
8752 Implement --warnings/-W.
8753 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
8754 replaced by...
8755 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
8756 Adjust callers.
8757 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
8758 (warnings_args, warnings_types): New.
8759 (getargs, short_options, long_options): Accept -W/--warnings.
8760 Sort the options by alphabetical order, upper case letter right
8761 before its lower case.
8762
3b452f4e
JD
87632006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
8764
8765 Change %merge result type clash warnings to errors. Discussed at
8766 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
8767 * src/reader.c (record_merge_function_type): Use complain_at.
8768 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8769 declared later): Update test case results.
8770
b8a41559
AD
87712006-07-09 Akim Demaille <akim@lrde.epita.fr>
8772
8773 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
8774 to be in alphabetical order.
8775 (trace_args): Spelling fixes.
8776
cd9e1ba2
PE
87772006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8778
8779 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
8780 so they don't collide with user-defined macros.
8781 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
8782 this was never guaranteed, and now that we're using gnulib stdint,
8783 which defines int_fast16_t to long int, the problem is exposed.
8784
cb48f191
PE
87852006-07-08 Paul Eggert <eggert@cs.ucla.edu>
8786
b8445a15
PE
8787 * data/c.m4 (b4_basename): Simplify a bit, since we don't
8788 need the full POSIX semantics (and weren't implementing them
8789 anyway).
8790
cb48f191
PE
8791 Adjust to Autoconf 2.60 and today's gnulib.
8792 * bootstrap (gnulib_modules): Add stdint.
8793 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
8794 no longer copies it.
8795 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
8796 since stdint needs the former and wcwidth (which is now required
8797 by mbswidth) needs the latter.
8798 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
8799 work around a compatibility glitch between gettext 0.14.6 and
8800 Autoconf 2.60.
8801 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
8802 Do not check for uintptr_t, since new stdint module does the right
8803 thing.
8804 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
8805 Add stdint.h, stdint_.h, wcwidth.h.
8806 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
8807 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
8808 stdint.m4, wchar_t.m4, wcwidth.m4.
8809 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
8810 usual order for ../lib/*.h files.
8811 (file_name_split): Use last_component, not base_name, to adjust
8812 to gnulib changes.
8813 * src/parse-gram.h: Include <strverscmp.h> in the usual order
8814 for ../lib/*.h files.
8815 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
8816 Define unconditionally, since we now assume the stdint module.
8817 * src/scan-skel.l: Include <dirname.h>.
8818 (BASE_QPUTS): Use last_component, not base_name.
8819 * src/system.h: Include <unlocked-io.h> in the usual order
8820 for ../lib/*.h files. Include <stdint.h> unconditionally,
8821 since we now use the stdint module.
8822 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
8823 HAVE_UINTPTR_T, since we now use the stdint module.
8824 (base_name): Remove decl, since files now include <dirname.h>
8825 to get the decl.
8826
cd48d21d
AD
88272006-07-08 Akim Demaille <akim@lrde.epita.fr>
8828
8829 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
8830 New, default to 1.
8831 * data/yacc.c, data/glr.c, data/location.cc: Use them.
8832 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
8833 default.
8834 * tests/calc.at: Adjust.
8835
8ec0a172
AD
88362006-07-08 Akim Demaille <akim@lrde.epita.fr>
8837
b8445a15 8838 * data/c.m4 (b4_basename): New.
8ec0a172
AD
8839 (b4_syncline): Also output the location of its invocation (from
8840 the skeleton).
8841 (b4_user_action, b4_define_user_action, b4_user_actions)
8842 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
8843 (b4_user_stype): New.
8844 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
8845
4a678af8
JD
88462006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8847
8848 In the grammar file, the first column is 1 not 0 on the first line as
8849 on every other line.
8850 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
8851 * tests/input.at (Torturing the Scanner): Update output.
8852
8853 * src/scan-gram.l (scanner_cursor): Declare it static.
8854
dd60572a
JD
88552006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8856
8857 In warnings, say "previous declaration" rather than "first
8858 declaration".
8859 * src/symtab.c (redeclaration): Do that here.
8860 * src/reader.c (record_merge_function_type): In the case of a result
8861 type clash, report the previous declaration rather than the very first
8862 one in the grammar file.
8863 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8864 declared later): Add a third declaration to check this behavior.
8865 * tests/input.at (Incompatible Aliases): Update output.
8866
2073e1b6
AD
88672006-06-27 Akim Demaille <akim@epita.fr>
8868
8869 * doc/Doxyfile.in: New.
8870 * doc/Makefile.am: Use it.
8871 * src/lalr.h, src/symtab.h: Initial doxygenation.
8872
8ee5b538
JD
88732006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8874
8875 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
8876 declared after the %merge. This continues the effort of the previous
8877 patch.
8ee5b538
JD
8878 * src/reader.c (get_merge_function): Don't set the merger type yet.
8879 (record_merge_function_type): New function for setting the merger type
8880 and checking for clashes.
8881 (grammar_current_rule_merge_set): Set the location of the %merge for
8882 the current rule.
8883 (packgram): Invoke record_merge_function_type for each rule now that
8884 all symbol type declarations have been parsed.
8885 * src/reader.h (merger_list.type_declaration_location): New member
8886 storing the location of the first %merge from which the type for this
8887 merging function was derived.
8888 * src/symlist.h (symbol_list.merger_declaration_location): New member
8889 storing the location of a rule's %merge, if any.
8890 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8891 declared later): New test to catch the error fixed by the above patch.
8892
ffa4ba3a
JD
88932006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8894
8895 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
8896 declarations appear after the rules. Discussed at
8897 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
8898 and
8899 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
8900 Don't mistake the type of $$ in a midrule to be that of its parent
8901 rule's $$.
ffa4ba3a
JD
8902 * src/reader.c (grammar_current_rule_end): Don't invoke
8903 grammar_rule_check yet since not all symbol declarations may have been
8904 parsed yet.
8905 (grammar_midrule_action): Likewise.
8906 Don't record whether the midrule's $$ has been used yet since actions
8907 haven't been translated yet.
8908 Record the midrule's parent rule and its RHS index within the parent
8909 rule.
8910 (grammar_current_rule_action_append): Don't translate the action yet
8911 since not all symbol declarations may have been parsed yet and, thus,
8912 warnings about types for $$, $n, @$, and @n can't be reported yet.
8913 (packgram): Translate the action and invoke grammar_rule_check now that
8914 all symbol declarations have been parsed.
8915 * src/scan-code.l (handle_action_dollar): Now that this is invoked
8916 after parsing the entire grammar file, the symbol list here in the case
8917 of a midrule is actually the midrule's empty RHS, so reference its
8918 parent rule's RHS where necessary.
8919 On the other hand, now that you can already know it's a midrule, you
8920 aren't forced to think $$ has the same type as its parent rule's $$.
8921 (handle_action_at): In the case of a midrule, reference the parent rule
8922 where necessary.
8923 * src/symlist.c (symbol_list_new): Initialize new midrule-related
8924 members.
8925 (symbol_list_length): Now that this is invoked after all rules have
8926 been parsed, a NULL symbol (rather than a NULL symbol list node)
8927 terminates a rule. symbol_list_print already does this correctly.
8928 * src/symlist.h (symbol_list.midrule_parent_rule,
8929 symbol_list.midrule_parent_rhs_index): New members so that midrules can
8930 remember their relationships with their parents.
8931 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
8932 fixed by the above patch.
8933 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
8934 implementing...
8935 (Unused values): ... this old test case and...
8936 (Unused values before symbol declarations): ... this new test case.
8937 This one is the same as `Unused values' except that all symbol
8938 declarations appear after the rules in order to catch the rest of the
8939 errors fixed by the above patch.
8940
e256e17f
JD
89412006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8942
300a1930
JD
8943 More cleanup.
8944 * src/reader.c (current_rule): Declare it static since it's no longer
8945 used outside this file.
8946 (grammar_current_rule_action_append): Remove redundant arguments from
8947 translate_rule_action invocation.
8948 * src/reader.h (current_rule): Remove this unused extern.
8949 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
8950 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 8951
381ecb06
JD
89522006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
8953
8954 Clean up yesterday's patch.
8955 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
8956 to...
8957 * src/reader.c (grammar_current_rule_action_append): ... here for
8958 consistency with grammar_current_rule_symbol_append.
8959 * tests/regression.at (Braced code in declaration in rules section):
8960 Make yyerror and yylex static as usual.
8961
4210cd0b
JD
89622006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
8963
8964 Fix bug that mistakes braced code in a declaration in the rules section
8965 to be a rule action. Mentioned at
8966 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
8967 * src/scan-gram.l: Move midrule action detection from the start of the
8968 scanning of any braced code to...
8969 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
8970 action. For readability, use $2 and @2 rather than the equivalent
8971 global variables.
8972 * tests/regression.at (Braced code in declaration in rules section):
8973 New test to catch the error fixed by the above patch.
8974
8975 Work on code readability some.
8976 * src/scan-code.l (current_rule): Get rid of this misleading and
8977 redundant declaration: it's actually extern'ed in reader.h.
8978 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
8979 translate_action): Add a rule argument and use it instead of the global
8980 current_rule.
8981 (translate_rule_action): This already receives current_rule through an
8982 argument, so pass it on to translate_action instead of assigning
8983 current_rule to current_rule.
8984 (translate_symbol_action, translate_code): Pass rule = NULL to
8985 translate_action.
8986
34f98f46
JD
89872006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
8988
8989 Rename %before-definitions to %start-header and %after-definitions to
8990 %end-header. Don't use these declarations to separate pre-prologue
8991 blocks from post-prologue blocks. Add new order-independent
8992 declarations %before-header and %after-header as alternatives to the
8993 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
8994 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
8995 * NEWS (2.3+): Update for these changes.
8996 * data/glr.c (b4_before_definitions): Update to...
8997 (b4_start_header): ... this.
8998 (b4_after_definitions): Update to...
8999 (b4_end_header): ... this.
9000 * data/glr.cc: Likewise.
9001 * data/lalr1.cc: Likewise.
9002 * data/yacc.c: Likewise.
9003 * doc/bison.texinfo (The prologue): Update names, and replace remaining
9004 prologue blocks with %*-header declarations.
9005 (Calc++ Parser): Likewise.
91661ebb 9006 (Decl Summary): Update names.
148d66d8 9007 (Table of Symbols): Update description.
34f98f46
JD
9008 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
9009 (PERCENT_END_HEADER): ... this.
9010 (PERCENT_BEFORE_DEFINITIONS): Update to...
9011 (PERCENT_START_HEADER): ... this.
9012 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9013 (declaration): Update token names and m4 macro names.
9014 When parsing %end-header and %start-header, invoke translate_code
9015 before muscle_code_grow, and no longer set global booleans to remember
9016 whether these declarations have been seen.
9017 Parse new %after-header and %before-header.
9018 * src/reader.c (before_definitions, after_definitions): Remove.
9019 (prologue_augment): Accept a new bool argument to specify whether to
9020 augment the pre-prologue or post-prologue.
9021 * src/reader.h (before_definitions, after_definitions): Remove these
9022 extern's.
9023 (prologue_augment): Add new bool argument.
9024 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
9025 (PERCENT_END_HEADER): ... this.
9026 (PERCENT_BEFORE_DEFINITIONS): Update to...
9027 (PERCENT_START_HEADER): ... this.
9028 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9029 * tests/actions.at (Printers and Destructors): Update names.
9030
31b2b07e
JD
90312006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
9032
9033 Add comparison operators for C++ location classes. Discussed at
9034 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
9035 * data/c++.m4 (b4_define_location_comparison): New boolean %define
9036 declaration indicating whether filename_type has an operator==. If
9037 filename_type is `std::string', it defaults to `1', `0' otherwise.
9038 * data/location.cc: Iff b4_define_location_comparison is `1', add
9039 operator== and operator!= for class position and for class location.
9040
9041 Some minor fixes.
9042 * src/scan-action.l: Remove unused file.
9043 * src/symtab.c (symbol_printer_set): Use printer_location not
9044 destructor_location.
9045 * src/symtab.h (struct symbol): Replace incorrect source comment for
9046 printer members.
9047 * tests/input.at (Incompatible Aliases): Update output with correct
9048 printer location.
9049
9bc0dd67
JD
90502006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
9051
9052 Don't put the pre-prologue in the header file. For the yacc.c code
9053 file and the glr.c header and code files, move the pre-prologue before
9054 the token definitions. Add new %before-definitions and
9055 %after-definitions to declare code that will go in both the header file
9056 and code file. Discussed at
9057 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
9058 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
9059 and
9060 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
9061 * NEWS (2.3+): Describe these changes.
9062 * data/glr.c (b4_pre_prologue): Move from within to before...
9063 (b4_shared_declarations): ... this.
9064 Add new b4_before_definitions before b4_token_enums.
9065 Add new b4_after_definitions at the end.
9066 * data/glr.cc (b4_pre_prologue): Replace with...
9067 (b4_before_definitions): ... this in the header file.
9068 (b4_after_definitions): New near the end of the header file.
9069 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
9070 code file right before including the header file.
9071 (b4_before_definitions): New in the previous position of
9072 b4_pre_prologue in the header file.
9073 (b4_after_definitions): New near the end of the header file.
9074 * data/yacc.c: Clean up some m4 quoting especially in the header file.
9075 (b4_token_enums_defines): In the code file, move to right before
9076 YYSTYPE for consistency with the header file.
9077 (b4_before_definitions): New right before b4_token_enums_defines in
9078 both the header and code file.
9079 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
9080 header and code file.
9081 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
9082 of prologues for %union dependencies.
91661ebb
JD
9083 (Decl Summary): In %defines description, mention the effect of
9084 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
9085 (Calc++ Parser): Forward declare driver in a %before-definitions rather
9086 than in the pre-prologue so that make check succeeds.
148d66d8 9087 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
9088 %after-definitions.
9089 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
9090 %before-definitions.
9091 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
9092 (declaration): Parse those declarations and append to
9093 b4_before_definitions and b4_after_definitions, respectively.
9094 * src/reader.c (before_definitions, after_definitions): New bools to
9095 track whether those declarations have been seen.
9096 (prologue_augment): Add to the post-prologue if %union,
9097 %before-definitions, or %after-definitions has been seen.
9098 * src/reader.h (before_definitions, after_definitions): New extern's.
9099 * src/scan-gram.l: Scan the new declarations.
9100 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
9101 prologue block in a %before-definitions or a %after-definitions based
9102 on whether the %union is declared.
9103 * tests/regression.at (Early token definitions with --yacc, Early token
9104 definitions without --yacc): Move tests for token definitions into the
9105 post-prologue since token names are no longer defined in the
9106 pre-prologue.
9107
203b9274
AD
91082006-06-20 Akim Demaille <akim@epita.fr>
9109
9110 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
9111 (symbol_get): Use it.
9112 * src/parse-gram.y: Use it.
9113
a7ee59cf
JD
91142006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
9115
9116 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
9117 build succeeds when configured with --enable-gcc-warnings.
9118
5a2baae7
PE
91192006-06-19 Paul Eggert <eggert@cs.ucla.edu>
9120
33ad1a9c
PE
9121 * src/parse-gram.y (char_name): New function.
9122 (CHAR, STRING, string_content): For %printer, properly escape.
9123 (ID): Prefer fputs to fprintf.
9124 (id): Reindent to be consistent with other rules.
9125 Properly quote char.
9126
5a2baae7
PE
9127 The Translation Project changed its way of publishing translations
9128 to maintainers. I haven't received any responses to my request
9129 for supporting the old way, or for documenting the new way. I
9130 have modified 'bootstrap' to use screen scraping
9131 (in this case, HTML scraping). This is unreliable and inelegant,
9132 but I don't see any better way. Yuck.
9133 * bootstrap (TP_URL, WGET_COMMAND): New vars.
9134 (get_translations): New function, which uses HTML scraping to
9135 deduce locations of latest translations.
9136 Use this function to grab both bison and bison-runtime .po files.
9137 Don't bother priming the pump for the runtime-po domain any more,
9138 as it's now translated better than bison is.
9139
58d7a1a1
AD
91402006-06-19 Akim Demaille <akim@epita.fr>
9141
9142 * src/scan-gram.l: No longer "parse" things after `%union' until
9143 `{'. Rather, return a single "%union" token.
9144 No longer make symbols: return strings, and leave the conversion
9145 to symbols to the parser.
9146 (SC_PRE_CODE, token_type): Remove.
9147 * src/parse-gram.y (%union): New field `character'.
9148 Sort tokens.
9149 (CHAR): New token.
9150 (ID, ID_COLON): Now that the scanner no longer makes them
9151 identifiers, adjust all uses to invoke symbol_get.
9152 (id_colon): New, wraps the conversion from string to symbol.
9153 (%union): Accept a possible union_name.
9154 (symbol): Now can be a char.
9155 * data/c.m4 (b4_union_name): Leave a default value.
9156 * data/glr.c, data/yacc.c: Use it.
9157
b931235e
JD
91582006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
9159
9160 For associating token numbers with token names for "yacc.c", don't use
9161 #define statements unless `--yacc' is specified; always use enum
9162 yytokentype. Most important discussions start at:
9163 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
9164 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
9165 and
9166 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
9167 * NEWS (2.3+): Mention.
9168 * data/c.m4 (b4_yacc_if): New.
9169 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
9170 token #define's.
9171 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
9172 on token name definitions.
9173 * src/getargs.c (usage): Capitalize `Yacc' in English.
9174 * src/output.c (prepare): Define b4_yacc_flag.
9175 * tests/regression.at (Early token definitions): Test that tokens names
9176 are defined before the pre-prologue not just before the post-prologue.
9177 Remove this test case and copy to...
9178 (Early token definitions with --yacc): ... this to test #define's.
9179 (Early token definitions without --yacc): ... and this to test enums.
9180
9e6e7ed2
PE
91812006-06-11 Paul Eggert <eggert@cs.ucla.edu>
9182
9183 * NEWS: Reword the post-2.3 change to not be so optimistic about
9184 removing the old "look-ahead" spelling.
9185 Update previous look-ahead/lookahead change reports.
9186 * REFERENCES: look-ahead -> lookahead (since that's
9187 what he actually wrote).
9188 * doc/refcard.tex: look ahead -> lookahead,
9189 look-ahead -> lookahead
9190
742e4900
JD
91912006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
9192
9193 For consistency, use `lookahead' instead of `look-ahead' or
9194 `look_ahead'. Discussed starting at
9195 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
9196 and then at
9197 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
9198 * NEWS: For the next release, note the change to `--report'.
9199 * TODO, doc/bison.1: Update English.
9200 * doc/bison.texinfo: Update English.
9201 (Understanding Your Parser, Bison Options): Document as
9202 `--report=lookahead' rather than `--report=look-ahead'.
9203 * src/conflicts.c: Update English in comments.
9204 (lookahead_set): Rename from look_ahead_set.
9205 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
9206 (resolve_sr_conflict): Rename local look_ahead_tokens to
9207 lookahead_tokens, and update other uses.
9208 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
9209 count_rr_conflicts, conflicts_free): Update uses.
9210 * src/getargs.c (report_args): Move "lookahead" before alternate
9211 spellings.
9212 (report_types): Update uses.
9213 (usage): For `--report' usage description, state `lookahead' spelling
9214 rather than `look-ahead'.
9215 * src/getargs.h (report.report_lookahead_tokens): Rename from
9216 report_look_ahead_tokens.
9217 * src/lalr.c: Update English in comments.
9218 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
9219 (state_lookahead_tokens_count): Rename from
9220 state_look_ahead_tokens_count.
9221 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9222 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
9223 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9224 Update other uses.
9225 Update English in output.
9226 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
9227 * src/print.c: Update English in comments.
9228 (lookahead_set): Rename from look_ahead_set.
9229 (print_reduction): Rename argument lookahead_token from
9230 look_ahead_token.
9231 (print_core, state_default_rule, print_reductions, print_results):
9232 Update uses.
9233 * src/print_graph.c: Update English in comments.
9234 (print_core): Update uses.
9235 * src/state.c: Update English in comments.
9236 (reductions_new): Update uses.
9237 (state_rule_lookahead_tokens_print): Rename from
9238 state_rule_look_ahead_tokens_print, and update other uses.
9239 * src/state.h: Update English in comments.
9240 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
9241 (state_rule_lookahead_tokens_print): Rename from
9242 state_rule_look_ahead_tokens_print.
9243 * src/tables.c: Update English in comments.
9244 (conflict_row, action_row): Update uses.
9245 * tests/glr-regression.at
9246 (Incorrect lookahead during deterministic GLR,
9247 Incorrect lookahead during nondeterministic GLR): Rename
9248 print_look_ahead to print_lookahead.
9249 * tests/torture.at: Update English in comments.
9250 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
9251 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
9252 (Many lookahead tokens): Update uses.
9253 * data/glr.c: Update English in comments.
9254 * lalr1.cc: Likewise.
9255 * yacc.c: Likewise.
9256 * src/conflicts.h: Likewise.
9257 * src/lalr.h: Likewise.
9258 * src/main.c: Likewise.
9259 * src/output.c: Likewise.
9260 * src/parse-gram.c: Likewise.
9261 * src/tables.h: Likewise.
9262 * tests/calc.at: Likewise.
9263
3c40d0b5
JD
92642006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
9265
9266 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
9267
5d278082
PE
92682006-06-07 Paul Eggert <eggert@cs.ucla.edu>
9269
9270 * TODO: Add request from Nelson H. F. Beebe to be able to install
9271 Bison without installing the yacc script.
9272
9e668899
JD
92732006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9274
9275 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
9276 and yytext if they're already #define'd.
9277 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
9278 * src/scan-code-c.c: ... here.
9279 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
9280 <config.h>.
9281
0c8e079f
JD
92822006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9283
9284 Get Bison to build again when configured with --enable-gcc-warnings.
9285 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
9286 missing #include's.
9287 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
9288 loc argument as it shadows a global.
9289 * src/scan-gram.l: Remove stray comma that prevents boundary_set
9290 invocation.
9291
9292 * src/.cvsignore: Add scan-code.c.
9293
2346344a
AD
92942006-06-07 Akim Demaille <akim@epita.fr>
9295
9296 * src/scan-gram.l: Move the "add a trailing ; to actions" code
9297 to...
9298 * src/scan-code.l: here.
9299 * tests/input.at (Torturing the Scanner): Fix another location
9300 error.
9301
4862bdfd
AD
93022006-06-07 Akim Demaille <akim@epita.fr>
9303
9304 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
9305
e9071366
AD
93062006-06-06 Akim Demaille <akim@epita.fr>
9307
9308 Extract the parsing of user actions from the grammar scanner.
9309 As a consequence, the relation between the grammar scanner and
9310 parser is much simpler. We can also split "composite tokens" back
9311 into simple tokens.
9312 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
9313 * src/scan-gram.l (add_column_width, adjust_location): Move to and
9314 rename as...
9315 * src/location.h, src/location.c (add_column_width)
9316 (location_compute): these.
9317 Fix the column count: the initial column is 0.
9318 (location_print): Be robust to ending column being 0.
9319 * src/location.h (boundary_set): New.
9320 * src/main.c: Adjust to scanner_free being renamed as
9321 gram_scanner_free.
9322 * src/output.c: Include scan-code.h.
9323 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
9324 Use boundary_set.
9325 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
9326 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
9327 which is now, again, a separate token.
9328 Adjust all dependencies.
9329 Whereever actions with $ and @ are used, use translate_code.
9330 (action): Remove this nonterminal which is now useless.
9331 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
9332 (grammar_current_rule_action_append): Use translate_code.
9333 (packgram): Bound check ruleno, itemno, and rule_length.
9334 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
9335 (last_string, last_braced_code_loc, max_left_semantic_context)
9336 (scanner_initialize, scanner_free, scanner_last_string_free)
9337 (gram_out, gram_lineno, YY_DECL_): Move to...
9338 * src/scan-gram.h: this new file.
9339 (YY_DECL): Rename as...
9340 (GRAM_DECL): this.
9341 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
9342 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9343 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9344 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9345 Move these declarations, and...
9346 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
9347 these to...
9348 * src/flex-scanner.h: this new file.
9349 * src/scan-gram.l (rule_length, rule_length_overflow)
9350 (increment_rule_length): Remove.
9351 (last_braced_code_loc): Rename as...
9352 (gram_last_braced_code_loc): this.
9353 Adjust to the changes of the parser.
9354 Move all the handling of $ and @ into...
9355 * src/scan-code.l: here.
9356 * src/scan-gram.l (handle_dollar, handle_at): Remove.
9357 (handle_action_dollar, handle_action_at): Move to...
9358 * src/scan-code.l: here.
9359 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
9360 scan-code.h, scan-code-c.c, scan-gram.h.
9361 (EXTRA_bison_SOURCES): Add scan-code.l.
9362 (BUILT_SOURCES): Add scan-code.c.
9363 (yacc): Be robust to white spaces.
9364
9365 * tests/conflicts.at, tests/input.at, tests/reduce.at,
9366 * tests/regression.at: Adjust the column numbers.
9367 * tests/regression.at: Adjust the error message.
7891a7c4 9368
184e42f0
JD
93692006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9370
9371 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9372 Use Akim's wording from
9373 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
9374
7891a7c4
JD
93752006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9376
9377 Between Bison releases, manually append `+' to the previous Bison
9378 release number, and use that as a signal to automatically print the
9379 ChangeLog's CVS Id keyword from --version. Discussed starting at
9380 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
9381 * ChangeLog: Add Id header.
9382 * configure.ac (AC_INIT): Append `+' to `2.3'.
9383 * src/.cvsignore: Add revision.c.
9384 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
9385 (BUILT_SOURCES): Add revision.c.
9386 (revision.c): New target rule. This file defines a new global variable
9387 named revision. It initializes it with either the Id from ChangeLog
9388 or, if VERSION doesn't contain `+', with the empty string.
9389 * src/getargs.c (version): Print the value of revision.
9390 * src/revision.h: Extern revision.
9391
4ad3ed84
PE
93922006-06-05 Paul Eggert <eggert@cs.ucla.edu>
9393
9394 * NEWS: Version 2.3.
9395 * configure.ac (AC_INIT): Likewise.
9396
02103984
PE
93972006-05-30 Paul Eggert <eggert@cs.ucla.edu>
9398
9399 * data/glr.c (YYRECOVERING): Define to be a function-like macro
9400 with no arguments, not as an object-like macro. This is for
9401 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
9402 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
9403 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
9404 Document this.
9405
2c08afa5
JD
94062006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
9407
9408 * src/getargs.c (usage): Back out yesterday's modification of the
9409 --help output so that we don't have to wait for translation before
9410 releasing 2.3.
9411
6077da58
PE
94122006-05-29 Paul Eggert <eggert@cs.ucla.edu>
9413
9414 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
9415 Problem reported by Akim Demaille.
9416
2a26b6c2
JD
94172006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
9418
9419 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9420
aefef0d6
PE
94212006-05-26 Paul Eggert <eggert@cs.ucla.edu>
9422
9423 * data/yacc.c (yy_reduce_print): Omit trailing white space in
9424 generated source code. Problem reported by Frans Englich in
9425 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
9426
fcd8e201
PE
94272006-05-22 Paul Eggert <eggert@cs.ucla.edu>
9428
9429 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
9430 shell, not within 'make', so that 'make' by an ordinary builder
9431 (using GNU make) does not worry about configuring gzip. This also
9432 works around a bug reported independently by Keith Thompson and by
9433 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
9434 stderr rather than stdout, messing up the build logs.
9435
7b5cdcbd
JD
94362006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9437
9438 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
9439 to make sure that YYID will never be unused. This fixes a 'make
9440 maintainer-check' failure caused by the recent changes to the 'Trivial
9441 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
9442 not used.
9443 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
9444
5ad0a449
JD
94452006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9446
9447 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
9448 state before an empty RHS is always resolved here. Only the location
9449 of that state is guaranteed to be resolved, and that's enough. This
9450 fixes the remaining bug reported by Derek M. Jones in
9451 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9452 * tests/glr-regression.at (Uninitialized location when reporting
9453 ambiguity): Test the above case.
9454 Also, the embedded comments in this test case claim it checks the case
9455 of an empty RHS that has inherited the initial location. However, the
9456 corresponding LHS was already resolved, so yyresolveLocations didn't
9457 actually have reason to modify it. Fix this by forcing
9458 nondeterministic operation at the beginning of the parse.
9459
50cce58e
PE
94602006-05-20 Paul Eggert <eggert@cs.ucla.edu>
9461
9462 * data/c.m4 (b4_yy_symbol_print_generate):
9463 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
9464 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
9465 of the bugs reported today by Derek M Jones in
9466 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9467 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
9468 defined to be a type name without parens or brackets.
9469 (Location Type): Similarly for YYLTYPE.
9470 * tests/regression.at (Trivial grammars): Put in a test for this
9471 bug that will be caught by 'make maintainer-check' (though not,
9472 alas, by 'make check' unless your compiler is picky).
9473
ab8d9dc5
PE
94742006-05-19 Paul Eggert <eggert@cs.ucla.edu>
9475
0d2c8934 9476 * NEWS: Version 2.2.
ab8d9dc5
PE
9477 * configure.ac (AC_INIT): Likewise.
9478
9138c575
JD
94792006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
9480
9481 * data/glr.c (yyreportTree): Make room in yystates for the state
9482 preceding the RHS. This fixes the segmentation fault reported by Derek
9483 M. Jones in
9484 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
9485 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
9486 to the user. Reported for yyreportTree by Derek M. Jones later in the
9487 same thread.
9488 * THANKS: Add Derek M. Jones.
9489 Update my email address.
9490 Fix typo in Steve Murphy's name.
9491
276f48df
PE
94922006-05-14 Paul Eggert <eggert@cs.ucla.edu>
9493
d6645148
PE
9494 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
9495 checking against YYLAST that caused the parser to miss a potential
9496 alternative in its diagnostic.
9497 Problem reported by Maria Jose Moron Fernandez in
9498 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
9499 * data/lalr1.cc (yysyntax_error_): Likewise.
9500 * data/yacc.c (yysyntax_error): Likewise.
9501 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
9502 tokens, in case we run into an older C compiler.
9503 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
9504 Use them to check for the off-by-one error fixed above.
9505
276f48df
PE
9506 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
9507 YYSIZE_T, not size_t.
9508 * tests/regression.at (Trivial grammars): New test, to catch
9509 the error fixed by the above patch.
9510
cd8b5791
AD
95112006-05-14 Akim Demaille <akim@lrde.epita.fr>
9512
9513 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
9514 scheme.
9515 Reported by Steve Murphy.
9516
34376418
AD
95172006-05-14 Akim Demaille <akim@lrde.epita.fr>
9518
9519 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
9520 * data/glr.cc: b4_location_flag is now b4_locations_flag.
9521
327afc7c
AD
95222006-05-14 Akim Demaille <akim@lrde.epita.fr>
9523
9524 Implement --trace=m4.
9525 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
9526 * src/output.c (output_skeleton): When set, pass -dV to m4.
9527
9528 Factor the handling of flags in m4.
9529 * src/output.c (prepare): Rename the muscle names debug, defines,
9530 error_verbose to debug_flag, defines_flag, error_verbose_flag.
9531 * data/c.m4: Adjust.
9532 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
9533 Use b4_define_flag_if to define other b4_FLAG_if macros.
9534 (b4_location_if): As a consequence, rename as...
9535 (b4_locations_if): this, for consistency.
9536 Adjust all the skeletons.
9537
ba9ecd19
AD
95382006-05-14 Akim Demaille <akim@lrde.epita.fr>
9539
9540 * etc/bench.pm: Shorten bench names.
9541
4e83ea15
AD
95422006-05-14 Akim Demaille <akim@lrde.epita.fr>
9543
9544 * src/output.h, src/output.c (error_verbose): Move to...
9545 * src/getargs.h, src/getargs.c: here.
9546 Sort the flags.
9547 Adjust dependencies.
9548
6e93d810
PE
95492006-05-13 Paul Eggert <eggert@cs.ucla.edu>
9550
9551 * data/c.m4 (b4_copyright): Put the special exception for Bison
9552 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
9553 uses changed. Suggested by Akim Demaille. Also, wrap the
9554 copyright notice, in case it is longer than 80 columns. Replace
9555 comma by newline after title.
6e93d810 9556
eaea13f5
PE
95572006-05-11 Paul Eggert <eggert@cs.ucla.edu>
9558
9559 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
9560 incompatibility, not a bug. Mention that it wasn't fixed as of
9561 flex 2.5.33.
9562
3cf084ec
AD
95632006-05-11 Akim Demaille <akim@lrde.epita.fr>
9564
9565 * examples/extexi: Enforce the precedence of concatenation over
9566 >>.
0a9f1c7d 9567 Reported by Tommy Nordgren.
3cf084ec 9568
32c96bd7
AD
95692006-05-11 Akim Demaille <akim@lrde.epita.fr>
9570
9571 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
9572 with the member "token".
f94705b2 9573 Reported by Martin Nylin.
32c96bd7 9574
eaea13f5
PE
95752006-05-08 Paul Eggert <eggert@cs.ucla.edu>
9576
9577 * data/glr.c: Switch to Bison 2.2 special-exception language in
9578 the copyright notice. Use more-regular format for titles and
9579 copyright notices.
9580 * data/glr.cc: Likewise.
9581 * data/location.cc: Likewise.
9582 * data/yacc.cc: Likewise.
9583 * doc/bison.texinfo (Conditions): Document this.
9584 * NEWS: likewise. Upgrade version to 2.2.
9585
6e2d1146
AD
95862006-04-27 Akim Demaille <akim@lrde.epita.fr>
9587
9588 * data/glr.cc: Remove dead code.
9589
47671055
PE
95902006-04-25 Paul Eggert <eggert@cs.ucla.edu>
9591
9592 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
9593 that variable and the line breaks the bootstrap. Problem reported
9594 by Juan M. Guerrero.
9595
ed2e6384
AD
95962006-04-24 Akim Demaille <akim@lrde.epita.fr>
9597
9598 * doc/bison.texinfo (Multiple start-symbols): New.
9599
3cedc2dc
AD
96002006-04-24 Akim Demaille <akim@lrde.epita.fr>
9601
9602 * etc/README, etc/bench.pl: New.
9603
b2ddc3f3
AD
96042006-04-03 Akim Demaille <akim@lrde.epita.fr>
9605
9606 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
9607 rule.
9608 Reported by Mickael Labau.
9609 * tests/input.at (Torturing the Scanner): Test it.
9610
91e3ac9a
PE
96112006-03-16 Paul Eggert <eggert@cs.ucla.edu>
9612
9613 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
9614 Problem reported by Bob Rossi.
9615
96162006-03-13 Paul Eggert <eggert@cs.ucla.edu>
9617
9618 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
9619 and didn't really work.
9620 For the index, use @ifnotinfo, not @iftex.
9621 Minor cleanups of spacing and terminology.
9622
5cf61e93
AD
96232006-03-12 Akim Demaille <akim@lrde.epita.fr>
9624
9625 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
9626 of AT_NAME_PREFIX when %name-prefix is not used.
9627
aa08666d
AD
96282006-03-12 Akim Demaille <akim@lrde.epita.fr>
9629
9630 Apply --prefix to C++ skeletons too: they change the namespace.
9631 The test suite already exercize these cases.
9632 * data/c++.m4 (b4_namespace): New.
9633 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
9634 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
9635 * data/yacc.c, data/glr.c: Remove a useless `[]'.
9636 * doc/bison.texinfo: Document it.
9637 (Option Cross Key): Use @multitable in all formats. It looks
9638 nicer, even in TeX outputs.
9639 (Rules): Use the same code whatever the output type is.
9640 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
9641 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
9642 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 9643
45567173
AD
96442006-03-10 Akim Demaille <akim@lrde.epita.fr>
9645
9646 * TODO: Remove dead items.
9647
e9d8f881 96482006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
9649
9650 * doc/FAQ: Remove, merged into...
9651 * doc/bison.texinfo (FAQ): this.
9652 * doc/Makefile.am (EXTRA_DIST): Adjust.
9653
c095d689
AD
96542006-03-10 Akim Demaille <akim@lrde.epita.fr>
9655
9656 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
9657 even if empty.
9658 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
9659 * doc/bison.texinfo (Calc++ Scanner): Use it.
9660
6e0f8287
PE
96612006-03-09 Paul Eggert <eggert@cs.ucla.edu>
9662
9663 Fix two nits reported by twlevo, plus one more that I discovered.
9664
9665 * src/assoc.h (assoc_to_string): Give a name to the arg, as
9666 this is the usual Bison style.
9667 * src/location.h (location_print): Likewise.
9668
9669 * src/reader.h (token_name): Likewise.
9670
d6b771c3
PE
96712006-03-08 Paul Eggert <eggert@cs.ucla.edu>
9672
9673 Fix some nits reported by twlevo.
9674 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
9675 and "POSIX". Use more-modern syntax for URLs. Mention C++
9676 and ask for Java. Don't hardwire OS version numbers. Add
9677 copyright notice.
9678 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
9679 * src/conflicts.c (solved_conflicts_obstack): Now static.
9680
1e137b71
JD
96812006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
9682
9683 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
9684 page. Say "you can use it" not "you may use it" as on the web page;
9685 we're describing capabilities not granting permission.
9686
73f2e47e
PE
96872006-03-06 Paul Eggert <eggert@cs.ucla.edu>
9688
6d05403d
PE
9689 * data/glr.c (yyresolveLocations): Rename local variables to avoid
9690 shadowing warnings. Use usual patter for iterating through RHS.
9691 * tests/glr-regression.at
9692 (Uninitialized location when reporting ambiguity):
9693 Modify yylex so that it uses its argument, rather than trying
9694 to rely on ARGSUSED (which doesn't work for gcc with warnings).
9695 const char -> char const.
9696
73f2e47e
PE
9697 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
9698 Don't use tabs inside commands; it messes up 'ps'.
9699 Problem reported by twlevo.
9700
8710fc41
JD
97012006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
9702
9703 * tests/glr-regression.at (Uninitialized location when reporting
9704 ambiguity): New test case.
9705 * data/glr.c (yyresolveLocations): New function, which uses
9706 YYLLOC_DEFAULT.
9707 (yyresolveValue): Invoke yyresolveLocations before reporting an
9708 ambiguity.
9709 * doc/bison.texinfo (Default Action for Locations): Note
9710 YYLLOC_DEFAULT's usage for ambiguity locations.
9711 (GLR Semantic Actions): Cross-reference those notes.
9712
ae952af2
JD
97132006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
9714
9715 * tests/glr-regression.at (Leaked semantic values when reporting
9716 ambiguity): Remove unnecessary union and type declarations.
9717 (Leaked lookahead after nondeterministic parse syntax error): New test
9718 case.
9719 * data/glr.c (yyparse): Check for zero stacks remaining before
9720 attempting to shift the lookahead so that you don't lose it.
9721
35ee866a
JD
97222006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9723
9724 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
9725 * tests/glr-regression.at (Leaked semantic values when reporting
9726 ambiguity): New test case.
9727 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
9728 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
9729 now unnecessary yystackp parameter.
9730 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
9731 destructors can be called.
9732
9733 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
9734 in existing testcases.
9735
520181ab
JD
97362006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9737
9738 Don't leak semantic values for parent RHS when a user action cuts the
9739 parser, and clean up related code a bit.
9740 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
9741 cuts parse): Rename to...
9742 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
9743 for leaked parent RHS values.
9744 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
9745 between an unresolved state (non-empty chain of semantic options) and
9746 an incomplete one (signaled by an empty chain).
ae952af2 9747 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
9748 successfully or unsuccessfully resolved yyGLRState to...
9749 (yyresolveValue): ... here so that yyresolveValue always leaves a
9750 yyGLRState with consistent data and thus is easier to understand.
9751 Remove the yyvalp and yylocp parameters since they are always just
9752 taken from the yys parameter. When reporting a discarded merged value
9753 in debugging output, note that it is incompletely merged. Document the
9754 interface.
9755 (yyresolveAction): If resolving any of the RHS states fails, destroy
9756 them all rather than leaking them. Thus, as long as user actions are
9757 written to clean up the RHS correctly, yyresolveAction always cleans up
9758 the RHS of a semantic option. Document the interface.
9759
18d9185c
PE
97602006-02-27 Paul Eggert <eggert@cs.ucla.edu>
9761
9762 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
9763 led to a segmentation fault in GNU Pascal. Problem reported
9764 by Waldek Hebisch.
9765
841a7737
JD
97662006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
9767
9768 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
9769 mid-rule action inside a nonterminal symbol in order to declare a
9770 destructor for its semantic value.
9771
fc3f467f
PE
97722006-02-16 Paul Eggert <eggert@cs.ucla.edu>
9773
9774 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
9775 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
9776 __cplusplus && ! defined _STDLIB_H && !
9777 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
9778 defined free))]: Include <stdlib.h> rather than rolling our own
9779 declarations of malloc and free, to avoid problems with
9780 incompatible declarations (using 'throw') C++'s stdlib.h. This
9781 should fix Debian bug 340012
9782 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
9783 reported by Guillaume Melquiond.
9784
a3af26dd
PE
97852006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9786
4d7bc38c
PE
9787 * NEWS: Clarify symbols versus types in unused-value warnings.
9788
a3af26dd
PE
9789 * configure.ac (AC_INIT): Bump version number.
9790
4e26c69e
PE
97912006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9792
9793 * NEWS: Version 2.1a.
9794 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
9795 since C99 requires this.
9796
498e897c
PE
97972006-02-11 Paul Eggert <eggert@cs.ucla.edu>
9798
9799 * m4/c-working.m4: New file.
9800 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
9801
57bb17ca
PE
98022006-02-10 Paul Eggert <eggert@cs.ucla.edu>
9803
9804 * Makefile.maint: Merge from coreutils.
9805
0be105dc
PE
98062006-02-09 Paul Eggert <eggert@cs.ucla.edu>
9807
9808 More portability fixes for problems summarized by Nelson H. F. Beebe.
9809
9810 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
9811 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
9812 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
9813 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
9814 messes up because C++ code is compiled in 32-bit mode but linked
9815 in 64-bit mode.
9816
6fc0c024
PE
98172006-02-08 Paul Eggert <eggert@cs.ucla.edu>
9818
9819 More portability fixes for problems summarized by Nelson H. F. Beebe.
9820
7870f699
PE
9821 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
9822 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
9823
6fc0c024
PE
9824 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
9825 nodist_PROGRAMS, since we don't need to actually compile the
9826 example if we're just doing a plain 'make'. This avoids bothering
9827 the installer unnecessarily about problems due to weird C++
9828 compilers.
9829
fe6c2fde
PE
98302006-02-06 Paul Eggert <eggert@cs.ucla.edu>
9831
9832 More portability fixes for problems summarized by Nelson H. F. Beebe.
9833
9834 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
9835 than #include "...", and compile with -I'.'. The old method was
9836 not portable, according to Posix and the C standard, and it does
9837 not work with Sun C 5.7, where previous #line directives affect
9838 the working directory used in later #include "..." directives.
9839
927b425b
JMG
98402006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9841
9842 Various DJGGP specific issues in /djgpp
9843
d9735e9e
PE
98442006-02-02 Paul Eggert <eggert@cs.ucla.edu>
9845
9846 More portability fixes for problems summarized by Nelson H. F. Beebe.
9847
9848 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
9849 '#include <map>' works and that you can apply ++ to iterators.
9850
5a6755af
PE
98512006-02-01 Paul Eggert <eggert@cs.ucla.edu>
9852
67a0dc4f
PE
9853 Work around portability problems summarized by Nelson H. F. Beebe in
9854 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
9855
8c86f0ef
PE
9856 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9857 that '#include <string>' works.
9858
de35dd59
PE
9859 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
9860 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
9861 "warning: sorry: semantics of inline function static data `const
9862 unsigned char translate_table[262]' are wrong (you'll wind up with
9863 multiple copies)".
9864
67a0dc4f
PE
9865 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
9866 or, xor to not_, and_, or_, and xor_, respectively. This works
9867 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
9868 random system header somewhere that includes the equivalent of
9869 <iso646.h>.
9870
5a6755af
PE
9871 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
9872 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 9873 Suite Version 2.0.
5a6755af 9874
3f001415
JD
98752006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
9876
9877 During deterministic GLR operation, user actions should be able to
9878 influence the parse by changing yychar. To make this easier to fix and
9879 to make glr.c easier to evolve in general, don't maintain yytoken in
9880 parallel with yychar; just compute yytoken when needed.
9881 * tests/glr-regression.at (Incorrect lookahead during deterministic
9882 GLR): Check that setting yychar in a user action has the intended
9883 effect.
9884 * data/glr.c (yyGLRStack): Remove yytokenp member.
9885 (yyclearin): Don't set *yytokenp.
9886 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
9887 yychar rather than *yytokenp to determine the current lookahead.
9888 Compute yytoken locally when needed.
9889 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
9890 point to.
9891
9892 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
9893 after `--report' documentation.
9894
e2a8c0f5
PE
98952006-01-30 Paul Eggert <eggert@cs.ucla.edu>
9896
9897 * src/parse-gram.y (grammar_declaration): Location of printer
9898 symbol is @1, not list->location. Bug reported by twlevo.
9899 * tests/input.at (Incompatible Aliases): Adjust to above change.
9900
6b702268
PE
99012006-01-29 Paul Eggert <eggert@cs.ucla.edu>
9902
27622431
PE
9903 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
9904 all the test at once. This makes the output easier to read in the
9905 normal case.
9906
6b702268
PE
9907 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
9908 got from <http://bro-ids.org/download.html>. The bug is that
9909 when two actions appeared in succession, the second one was
9910 scanned before the first one was added to the grammar rule
9911 as a midrule action. Bison then output the incorrect warning
9912 "parse.y:905.17-906.36: warning: unused value: $3".
9913 * src/parse-gram.y (BRACED_CODE, action): These are no longer
9914 associated with a value.
9915 (rhs): Don't invoke grammar_current_rule_action_append.
9916 (action): Invoke it here instead.
9917 * src/reader.c (grammar_midrule_action): Now extern.
9918 (grammar_current_rule_action_append): Don't invoke
9919 grammar_midrule_action; that is now the scanner's job.
9920 * src/reader.h (last_string, last_braced_code_loc):
9921 (grammar_midrule_action): New decls.
9922 * src/scan-gram.l (last_string): Now extern, sigh.
9923 (last_braced_code_loc): New extern variable.
9924 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
9925 rule already has an action.
9926 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
9927 * tests/input.at (AT_CHECK_UNUSED_VALUES):
9928 Add some tests to check that the above changes fixed the bug.
9929
d40ba6c2
PE
99302006-01-27 Paul Eggert <eggert@cs.ucla.edu>
9931
9932 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
9933 All used changed. Check whether the symbol has a destructor,
9934 not whether it is typed.
9935 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
9936 that the values are still reported as unused. All line numbers
9937 adjusted.
9938
401aace6
PE
99392006-01-23 Paul Eggert <eggert@cs.ucla.edu>
9940
9941 Work around a bug in bro 0.8, which underparenthesizes its
9942 definition of YYLLOC_DEFAULT.
9943 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
9944 their arguments.
9945 * data/lalr1.cc: Likewise.
9946 * data/yacc.cc: Likewise.
9947
06f01bc4
PE
99482006-01-22 Paul Eggert <eggert@cs.ucla.edu>
9949
401aace6
PE
9950 Work around a bug in Pike 7.0, and give the Pike folks a
9951 better way to override the usual int widths.
9952 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
9953 user can override the types.
9954 (short): #undef, to work around a bug in Pike 7.0.
9955 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
9956 (union yyalloc.yyss): Use yytype_int16 rather than short.
9957 All uses changed.
9958 (yysigned_char): Remove.
9959 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
9960 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
9961 * tests/regression.at (Web2c Actions): Adjust to above changes.
9962
9963 * src/reader.c (check_and_convert_grammar): New function.
9964 (reader): Close the input file even if something went wrong during
9965 parsing. Minor file descriptor leak reported by twlevo.
9966
06f01bc4
PE
9967 * src/assoc.c (assoc_to_string): Use a default: abort (); case
9968 to pacify gcc -Wswitch-default.
9969 * src/scan-gram.l (adjust_location): Use a default: break; case
9970 to pacify gcc -Wswitch-default.
9971 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
9972 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9973 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9974 Move these decls to scan-skel.l, since they don't need to be
9975 visible elsewhere.
9976 * src/scan-skel.l: Accept the above decls.
9977 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
9978 is used.
9979
02650b7f
PE
99802006-01-21 Paul Eggert <eggert@cs.ucla.edu>
9981
9982 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
9983 since we don't want to insist on a version number at the start
9984 of the changelog every time.
9985 * Makefile.maint: Sync from coreutils a bit better.
9986 (sc_trailing_blank): Renamed from sc_trailing_space.
9987 All uses changed.
9988 (sc_no_if_have_config_h, sc_require_config_h):
9989 (sc_prohibit_assert_without_use): New rules.
9990 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
9991 (sc_dd_max_sym_length): Fix leading spaces in rule.
9992 (sc_system_h_headers): Prefix with @.
9993 (sc_useless_cpp_parens, m4-check): Output line numbers.
9994 (changelog-check): Allow version only in head.
9995 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
9996 satisfy new Makefile.maint rule.
9997 * data/glr.c: Likewise.
9998 * data/glr.cc: Likewise.
9999 * data/lalr1.cc: Likewise.
10000 * data/yacc.c: Likewise.
10001 * lib/ebitsetv.c: Likewise.
10002 * lib/lbitset.c: Likewise.
10003 * lib/subpipe.c: Likewise.
10004 * lib/timevar.c: Likewise.
10005 * src/system.h: Likewise.
10006 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
10007 * djgpp/Makefile.maint: Add copyright notice.
10008 * djgpp/README.in: Likewise.
10009 * djgpp/config.bat: Likewise.
10010 * djgpp/config.site: Likewise.
10011 * djgpp/config_h.sed: Likewise.
10012 * djgpp/djunpack.bat: Likewise.
10013 * djgpp/config.sed: Fix copyright notice to match standard format.
10014 * djgpp/subpipe.h: Likewise.
10015 * lib/bitsetv-print.c: Likewise.
10016 * lib/bitsetv.c: Likewise.
10017 * lib/subpipe.h: Likewise.
10018 * lib/timevar.c: Likewise.
10019 * lib/timevar.h: Likewise.
10020 * djgpp/subpipe.c: Use standard recipe for config.h.
10021 * lib/abitset.c: Likewise.
10022 * lib/bitset.c: Likewise.
10023 * lib/bitset_stats.c: Likewise.
10024 * lib/bitsetv-print.c: Likewise.
10025 * lib/bitsetv.c: Likewise.
10026 * lib/ebitsetv.c: Likewise.
10027 * lib/get-errno.c: Likewise.
10028 * lib/lbitset.c: Likewise.
10029 * lib/subpipe.c: Likewise.
10030 * lib/timevar.c: Likewise.
10031 * lib/vbitset.c: Likewise.
10032 * tests/local.at: Likewise.
10033 * src/scan-gram.l: Don't include verify.h, since system.h does
10034 that for us.
10035 * .x-sc_require_config_h: New file.
10036 * .x-sc_unmarked_diagnostics: New file.
10037
287c78f6
PE
100382006-01-20 Paul Eggert <eggert@cs.ucla.edu>
10039
287c78f6
PE
10040 Be a bit more systematic about using 'abort'.
10041 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
10042 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
10043 Put 'default: abort ();' before some other case, to satisfy older
10044 pedantic compilers.
10045 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10046 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
10047 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
10048 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
10049 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
10050 (get_decision_str, get_orientation_str, get_node_alignment_str):
10051 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
10052 (get_linestyle_str, get_arrowstyle_str): Likewise.
10053 * src/conflicts.c (resolve_sr_conflict):
10054 Use a default case rather than one for the one remaining enum
10055 value, to catch invalid enum values as well.
10056 * src/lalr.c (set_goto_map, map_goto):
10057 Prefer "assert (FOO);" to "if (!FOO) abort ();".
10058 * src/nullable.c (nullable_compute, token_definitions_output):
10059 Likewise.
10060 * src/reader.c (packgram, reader): Likewise.
10061 * src/state.c (transitions_to, state_new, state_reduction_find):
10062 Likewise.
10063 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
10064 (symbol_pack): Likewise.
10065 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
10066 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
10067 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
10068 * src/system.h: Don't include <assert.h>.
10069 (assert): New macro.
10070
10071 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
10072 (Destructor Decl, Parser Function, Pure Calling):
10073 Describe rules for braces inside C code more carefully.
287c78f6 10074
c66dfadd
PE
100752006-01-19 Paul Eggert <eggert@cs.ucla.edu>
10076
c21493b8
PE
10077 Fix some porting glitches found by Nelson H. F. Beebe.
10078 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
10079 compilers that don't understand that abort () does not return.
10080 * src/state.c (transitions_to): Likewise.
10081 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
10082 that '#include <cstdlib>' works.
10083 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
10084 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
10085 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
10086 for the benefit of some pre-C99 compilers.
10087
b6e3facf
PE
10088 * bootstrap: Undo changes to gnulib files that autoreconf made.
10089
c66dfadd
PE
10090 Minor fixups to get 'make maintainer-check' to work.
10091 * configure.ac: Don't use -Wnested-externs, as it's incompatible
10092 with the new verify.h implementation.
10093 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
10094 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
10095 * data/yacc.c (YYUSE): Likewise.
10096 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
10097 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
10098 * src/parse-gram.y (declaration): Don't pass a string constant
10099 to a function that expects char *, since GCC might complain
10100 about the constant value.
10101 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
10102 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
10103 before #defining them.
10104 * tests/glr-regression.at
10105 (Incorrectly initialized location for empty right-hand side in GLR):
10106 In yyerror, use the msg arg.
10107 (Corrupted semantic options if user action cuts parse):
10108 (Incorrect lookahead during deterministic GLR):
10109 (Incorrect lookahead during nondeterministic GLR):
10110 Don't name a local var 'index'; it shadows string.h's 'index'.
10111
ed94ef2a
AD
101122006-01-19 Akim Demaille <akim@epita.fr>
10113
10114 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
10115 location, not just parts of it.
10116
e9ad4aec
PE
101172006-01-18 Paul Eggert <eggert@cs.ucla.edu>
10118
d6ca7905
PE
10119 * NEWS: Document the fact that multiple %unions are now allowed.
10120 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
10121 * TODO: This feature is now implemented, so remove it from
10122 the wishlist.
d6ca7905 10123
ef1b70e0
PE
10124 * Makefile.maint: Merge with coreutils Makefile.maint.
10125 (CVS_LIST): Use build-aux version if available.
10126 (VERSION_REGEXP): New macro.
10127 (syntax-check-rules): Add sc_no_if_have_config_h,
10128 sc_prohibit_assert_without_use, sc_require_config_h,
10129 sc_useless_cpp_parens.
10130 (sc_obsolete_symbols): Check for O_NDELAY.
10131 (sc_dd_max_sym_length): Track coreutils.
10132 (sc_unmarked_diagnostics): Look in all files, not just *.c.
10133 (sc_useless_cpp_parens): New rule.
10134 (news-date-check): Look for version or today's date.
10135 (changelog-check): Don't require version number near head.
10136 (copyright-check): Use current year instead of hardwiring 2005.
10137 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
10138 (announcement): Add --gpg-key-ID.
10139
10140 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
10141 with "file system".
10142
2073ce56 10143 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
10144 array. Problem reported by twlevo.
10145 * src/reader.c (packgram): Prepend a new sentinel before ritem.
10146 * src/lalr.c (build_relations): Rely on new sentinel.
10147 * src/gram.c (gram_free): Adjust to new sentinel.
10148
b7691f15
JD
101492006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
10150
10151 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
10152 yylookaheadNeeds. All uses updated.
10153 (yysplitStack): Rename local yynewLookaheadStatuses to
10154 yynewLookaheadNeeds.
10155 * data/glr-regression.at (Incorrect lookahead during nondeterministic
10156 GLR): In comments, change `lookahead status' to `lookahead need'.
10157
ddee1b06
PH
101582006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10159
10160 * data/glr.c (yysplitStack): A little stylistic rewrite.
10161
12f4614d
PH
101622006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10163
10164 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
10165
32c29292
JD
101662006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
10167
10168 * doc/bison.texinfo: Fix some typos.
10169 (GLR Semantic Actions): New subsection discussing special
10170 considerations because GLR semantic actions might be deferred.
10171 (Actions): Mention look-ahead usage of yylval.
10172 (Actions and Locations): Mention look-ahead usage of yylloc.
10173 (Special Features for Use in Actions): Add YYEOF entry and mention it
10174 in the yychar entry.
10175 In the yychar entry, remove mention of the local yychar case (pure
10176 parser) since this is irrelevant information when writing semantic
148d66d8 10177 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
10178 yychar is otherwise described as an external variable.
10179 In the yychar entry, don't call it the `current' look-ahead since it
10180 isn't when semantic actions are deferred.
10181 In the yychar and yyclearin entries, add note about deferred semantic
10182 actions.
10183 Add yylloc and yylval entries discussing look-ahead usage.
10184 (Look-Ahead Tokens): When discussing yychar, don't call it the
10185 `current' look-ahead, and do mention yylval and yylloc.
10186 (Error Recovery): Cross-reference `Action Features' when mentioning
10187 yyclearin.
148d66d8 10188 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
10189 look-ahead.
10190 In the yylloc and yylval entries, mention look-ahead usage.
10191
de366a2f 101922006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
10193
10194 * tests/glr-regression.at: Update copyright year to 2006.
10195
bf70fa87
JD
101962006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10197
10198 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
10199 use during nondeterministic operation to track which stacks have
10200 actually needed the current lookahead.
10201 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
10202 Allocate, deallocate, resize, and otherwise shuffle space for
10203 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
10204 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
10205 appropriately during nondeterministic operation.
10206 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
10207 members to store the current lookahead to be used by the deferred
10208 user action.
10209 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
10210 from which the RHS is taken. Set the lookahead members of the new
10211 yySemanticOption according to the lookahead status for stack yyk.
10212 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
10213 yyaddDeferredAction.
10214 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
10215 members of yySemanticOption before invoking yyuserAction, and then set
10216 them back to their current values afterward.
10217 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
10218 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
10219 * tests/glr-regression.at: Remove `.' from the ends of recent test case
10220 titles for consistency.
10221 (Leaked merged semantic value if user action cuts parse): In order to
10222 suppress lint warnings, use arguments in merge function, and assign
10223 char value < 128 in main.
10224 (Incorrect lookahead during deterministic GLR): New test case.
10225 (Incorrect lookahead during nondeterministic GLR): New test case.
10226
05449a2c
JD
102272006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10228
de366a2f 10229 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
10230 !yyvaluep as signal that no semantic value is available to print.
10231 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
10232 to print a semantic value.
10233
4158e0a1 102342006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 10235
4158e0a1
JD
10236 * tests/glr-regression.at: For consistency with my newer test cases,
10237 don't thank myself.
10238
d659304d
JD
102392006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
10240
10241 * data/glr.c (yyresolveValue): When merging semantic options, if at
10242 least one user action succeeds but a later one cuts the parse, then
10243 destroy the semantic value before returning rather than leaking it.
10244 (yyresolveStates): If a user action cuts the parse and thus
10245 yyresolveValue fails, ignore the (unset) semantic value rather than
10246 corrupting the yyGLRState, and empty the semantic options list since
10247 the user actions should have called all necessary destructors.
10248 Simplify code with YYCHK.
10249 * tests/glr-regression.at (Corrupted semantic options if user action
10250 cuts parse): New test case.
10251 (Undesirable destructors if user action cuts parse): New test case.
10252 Before applying any of this patch, this test case never actually failed
10253 for me... but only because the corrupted semantic options usually
10254 masked this bug.
10255 (Leaked merged semantic value if user action cuts parse): New test
10256 case.
10257
6ec2c0f2
AD
102582006-01-05 Akim Demaille <akim@epita.fr>
10259
10260 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
10261
1b9c21fb
PE
102622006-01-04 Paul Eggert <eggert@cs.ucla.edu>
10263
10264 * data/c.m4 (b4_c_modern): New macro, with a new provision for
10265 _MSC_VER. Problem reported by Cenzato Marco.
10266 (b4_c_function_def): Use it.
10267 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
10268 b4_c_modern.
10269 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
10270 than rolling our own.
10271
84866159
AD
102722006-01-04 Akim Demaille <akim@epita.fr>
10273
10274 Also warn about non-used mid-rule values.
10275 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
10276 member.
10277 (symbol_list_new): Adjust.
10278 * src/reader.c (symbol_typed_p): New.
10279 (grammar_rule_check): Use it.
10280 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
10281 Check its rule.
10282 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
10283 Use it.
10284 * tests/actions.at (Exotic Dollars): Adjust.
10285
378f4bd8
AD
102862006-01-04 Akim Demaille <akim@epita.fr>
10287
10288 * src/reader.c (grammar_midrule_action): If $$ is set in a
10289 mid-rule, move the `used' bit to its lhs.
10290 * tests/input.at (Unused values): New.
10291 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
10292
e2a21b6f
PE
102932006-01-03 Paul Eggert <eggert@cs.ucla.edu>
10294
54662697
PE
10295 * doc/bison.texinfo (Bison Options): Say more accurately what
10296 --yacc does.
10297 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
10298 about declarations in the grammar when in Yacc mode, as POSIX does
10299 not require a diagnostic when the grammar uses extensions.
10300
10301 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
10302
073f9288
PE
10303 Warn about dubious constructions like "%token T T".
10304 Reported by twlevo.
10305 * src/symtab.h (struct symbol.declared): New member.
10306 * src/symtab.c (symbol_new): Initialize it to false.
10307 (symbol_class_set): New arg DECLARING, specifying whether
10308 this is a declaration that we want to warn about, if there
10309 is more than one of them. All uses changed.
10310
1221b78a
PE
10311 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
10312 Allow multiple %union directives, whose contents concatenate.
10313 * src/parse-gram.y (grammar_declaration): Likewise.
10314 Use muscle_code_grow, so that we don't need stype_line any more.
10315 All uses changed.
10316
10317 * src/muscle_tab.c (muscle_grow): Fix comment.
10318
e2a21b6f
PE
10319 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
10320 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
10321 Update copyright year to 2006.
10322
8f7e3cf9
AD
103232006-01-03 Akim Demaille <akim@epita.fr>
10324
10325 Have glr.cc pass (some of) the calc.at tests.
10326 * data/glr.cc (b4_parse_param_orig): New.
10327 (b4_parse_param): Improve its definition, and bound it more
10328 clearly in the skeleton.
10329 (b4_epilogue): Append, instead of prepending, in order to keep
10330 #line consistency.
10331 Simplify the generation of auxiliary functions: locations and
10332 purity are mandated.
10333 (b4_global_tokens_and_yystype): Honor it.
10334 * data/location.cc (c++.m4): Don't include it.
10335 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
10336 and AT_SKEL_CC_IF.
10337 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
10338 AT_LALR1_CC_IF.
10339 Be sure to initialize the first position's filename.
10340 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
10341 mandated anyway.
10342 (AT_CHECK_CALC_GLR_CC): New.
10343 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
10344
3953ed88
AD
103452006-01-02 Akim Demaille <akim@epita.fr>
10346
10347 * src/output.c (output_skeleton): Don't hard wire the inclusion of
10348 c.m4.
0a96ba81 10349 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
10350 * data/glr.cc: Do not include stack.hh.
10351
9ecafbbf
AD
103522006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
10353
10354 * data/glr.c: Reformat whitespace with tabs.
10355 (b4_lpure_formals): Remove this unused m4 macro.
10356 * tests/cxx-type.at: Reformat whitespace with tabs.
10357 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
10358 since it's a member. Rename type to isNterm for clarity.
10359
c4d497a0
AD
103602005-12-29 Akim <akim@sulaco.local>
10361
10362 Let glr.cc catch up with symbol_value_print.
10363 * data/glr.cc (b4_yysymprint_generate): Replace by...
10364 (b4_yy_symbol_print_generate): this.
10365 (yy_symbol_print, yy_symbol_value_print): Declare them.
10366
4517da37
PE
103672005-12-28 Paul Eggert <eggert@cs.ucla.edu>
10368
10369 * src/location.h (boundary): Note that a line or column equal
10370 to INT_MAX indicates an overflow.
10371 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
10372 (rule_length_overflow, increment_rule_length, add_column_width):
10373 New functions.
10374 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
10375 (<SC_BRACED_CODE>"}"):
10376 Use increment_rule_length rather than incrementing it by hand.
10377 (adjust_location, handle_syncline): Diagnose overflow.
10378 (handle_action_dollar, handle_action_at):
10379 Fix bug with monstrosities like $-2147483648.
10380 Remove now-unnecessary checks.
10381 (scan_integer): Verify assumptions and remove now-unnecessary checks.
10382 (convert_ucn_to_byte): Verify assumptions.
10383 (handle_syncline): New arg LOC. All callers changed.
10384 Don't store through a value derived from char const * pointer.
10385
10386 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
10387 GCC warnings.
10388
e3233bf6
PE
103892005-12-27 Paul Eggert <eggert@cs.ucla.edu>
10390
10391 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
10392 Remove unnecessary forward static decls.
10393
8f3596a6
AD
103942005-12-27 Akim Demaille <akim@epita.fr>
10395
10396 * src/reader.c (grammar_current_rule_check): Also check that $$
10397 is used.
10398 Take the rule to check as argument, hence rename as...
10399 (grammar_rule_check): this.
10400 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
10401 Rename as...
10402 (grammar_rule_begin, grammar_rule_end): these, for consistency.
10403 (grammar_midrule_action, grammar_symbol_append): Now static.
10404 * tests/torture.at (input): Don't rely on the default action
10405 being always performed.
10406 * tests/calc.at: "Set" $$ even when the action is "cut" with
10407 YYERROR or other.
10408 * tests/actions.at (Exotic Dollars): Instead of using unused
10409 values, check that the warning is issued.
10410
721be13c
PE
104112005-12-22 Paul Eggert <eggert@cs.ucla.edu>
10412
10413 * NEWS: Improve wording for unused-value warnings.
10414
a0af42fc
AD
104152005-12-22 Akim Demaille <akim@epita.fr>
10416
10417 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
10418 (b4_yysymprint_generate): Rename as...
10419 (b4_yy_symbol_print_generate): this.
10420 Generate yy_symbol_print instead of yysymprint.
10421 Generate also yy_symbol_value_print, and use it.
10422
affac613
AD
104232005-12-22 Akim Demaille <akim@epita.fr>
10424
721be13c 10425 * NEWS: Warn about unused values.
affac613
AD
10426 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
10427 a `used' member.
10428 (symbol_list_n_get, symbol_list_n_used_set): New.
10429 (symbol_list_n_type_name_get): Use symbol_list_n_get.
10430 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
10431 * src/reader.c (grammar_current_rule_check): Check that values are
10432 used.
10433 * src/symtab.c (symbol_print): Accept 0.
10434 * tests/existing.at: Remove the type information.
10435 Empty the actions.
10436 Remove useless actions (beware of mid-rule actions: perl -000
10437 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
10438 * tests/actions.at (Exotic Dollars): Use unused values.
10439 * tests/calc.at: Likewise.
10440 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10441 Likewise.
10442
10443 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
10444 rule_useful_p.
10445
9d9b8b70
PE
104462005-12-21 Paul Eggert <eggert@cs.ucla.edu>
10447
8bb4c753
PE
10448 Undo 2005-12-01 tentative license wording change. The wording is
10449 still being reviewed by the lawyers, and we don't want to wait for
10450 them before publishing a test release. For now, revert to the
10451 previous wording.
10452 * NEWS: Undo 2005-12-01 change.
10453 * data/glr.c: Revert to previous license wording.
10454 * data/glr.cc: Likewise.
10455 * data/lalr1.cc: Likewise.
10456 * data/location.cc: Likewise.
10457 * data/yacc.c: Likewise.
10458
9d9b8b70
PE
10459 * NEWS: Reword %destructor vs YYABORT etc.
10460 * data/glr.c: Use American spacing, for consistency.
10461 * data/glr.cc: Likewise.
10462 * data/lalr1.cc: Likewise.
10463 * data/yacc.c: Likewise.
10464 * data/yacc.c: Reformat comments slightly.
10465 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
10466 for consistency. Fix some spelling errors and reword recently-included
10467 text slightly.
10468 * tests/cxx-type.at: Cast results of malloc, for C++.
10469
2c3b392a
AD
104702005-12-21 Joel E. Denny <address@hidden>
10471
10472 * tests/cxx-type.at: Construct a tree, count the parents of shared
10473 nodes, and free each node once and only once. Previously, the memory
10474 for semantic values was leaked instead.
10475
d6cff4dc
AD
104762005-12-21 Joel E. Denny <address@hidden>
10477
10478 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
10479 (yylval, yylloc): If pure, #define to yystackp->yyval and
10480 yystackp->yyloc similar to yychar and yynerrs.
10481 (yyparse): If pure, remove local yylval and yylloc. Add local
10482 yystackp to accommodate pure definitions of yylval and yylloc.
10483 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
10484 yylvalp and yyllocp to &yylval and &yylloc.
10485 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
10486 namespace. Previously, nerrs and char were missing, but lval and lloc
10487 weren't necessary.
10488 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
10489 yylvalp and yyllocp parameters since, if pure, these are now always
10490 accessible through yystackp. If not pure, they are still accessible
10491 globally.
10492 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
10493 `if (YYID (N))' to pacify lint.
10494
a85284cf
AD
104952005-12-21 Akim Demaille <akim@epita.fr>
10496
10497 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
10498 destroy the RHS symbols of a rule.
10499 * data/yacc.c (yylen): Initialize to 0.
10500 Keep its value to the number of items to possibly shift.
10501 In particular, a regular successful parse that ends on YYFINAL by
10502 a (internal) YYACCEPT must not have yylen != 0.
10503 (yyerrorlab, yyreturn): Pop the RHS.
10504 Reorder a bit to emphasize the `shifting' bits of code.
10505 (YYPOPSTACK): Now accept a number of items to pop.
10506 * data/lalr1.cc: Likewise.
10507 * data/glr.c: Formatting changes.
10508 Use goto instead of fall through.
10509 * doc/bison.texinfo (Destructor Decl): Complete.
10510
d508c281
JMG
105112005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10512
10513 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10514 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
10515 * djgpp/config.bat: Replace every occurence of the file name
10516 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10517 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10518 * djgpp/config.sed: Replace every occurence of the file name
10519 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10520 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10521 * djgpp/djunpack.bat: DJGPP specific file.
10522 * djgpp/fnchange.lst: DJGPP specific file.
10523 * djgpp/README.in: Add new information about how to unpack the bison
10524 source on MSDOS and other systems which have 8.3 file name restrictions
10525 using djunpack.bat and fnchange.lst.
10526
3e7a2cd9
PE
105272005-12-12 Paul Eggert <eggert@cs.ucla.edu>
10528
10529 * bootstrap (build_cvs_prefix): Remove; unused.
10530 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
10531 when getting gnulib.
10532
105332005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
10534
10535 * data/glr.c: Reorder typedef declarations for structs to match order
10536 of struct declarations.
10537 Rename yystack everywhere to yystackp except in yyparse where it's not
10538 a pointer.
10539 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
10540 consistency.
10541 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
10542 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
10543 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
10544 lint.
10545
877519f8
PE
105462005-12-09 Paul Eggert <eggert@cs.ucla.edu>
10547
0eca5a39
PE
10548 * tests/sets.at (Accept): Fix typos in regular expression used to
10549 sed out the final state number.
10550
2cec9080
PE
10551 Work around portability problem on Solaris 10: flex-generated
10552 files include <stdio.h> before <config.h>, which messes up
10553 because the latter defines __EXTENSIONS__. Address the problem
10554 by creating two new little files that include <config.h> first,
10555 then include the flex-generated files. Rewrite everyone else
10556 to include <config.h> first, as well.
10557 * lib/timevar.c: Always include "config.h".
10558 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
10559 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
10560 (EXTRA_bison_SOURCES): New macro.
10561 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
10562 * src/system.h: Don't include config.h.
10563 * src/LR0.c: Include <config.h> first.
10564 * src/assoc.c: Likewise.
10565 * src/closure.c: Likewise.
10566 * src/complain.c: Likewise.
10567 * src/conflicts.c: Likewise.
10568 * src/derives.c: Likewise.
10569 * src/files.c: Likewise.
10570 * src/getargs.c: Likewise.
10571 * src/gram.c: Likewise.
10572 * src/lalr.c: Likewise.
10573 * src/location.c: Likewise.
10574 * src/main.c: Likewise.
10575 * src/muscle_tab.c: Likewise.
10576 * src/nullable.c: Likewise.
10577 * src/output.c: Likewise.
10578 * src/parse-gram.y: Likewise.
10579 * src/print.c: Likewise.
10580 * src/print_graph.c: Likewise.
10581 * src/reader.c: Likewise.
10582 * src/reduce.c: Likewise.
10583 * src/relation.c: Likewise.
10584 * src/state.c: Likewise.
10585 * src/symlist.c: Likewise.
10586 * src/symtab.c: Likewise.
10587 * src/tables.c: Likewise.
10588 * src/uniqstr.c: Likewise.
10589 * src/vcg.c: Likewise.
10590
877519f8
PE
10591 * src/parse-gram.y: Fix minor problems uncovered by lint.
10592 (current_lhs, current_lhs_location): Now static.
10593 (current_assoc): Remove unused variable.
10594
10595 Cleanups so that Bison-generated parsers have less lint.
10596 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
10597 Prepend /*ARGSUSED*/, for lint's sake.
10598 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
10599 definition if 'lint' is defined.
10600 (YYID): New macro (or function, if lint).
10601 All uses of /*CONSTCOND*/0 replaced by YYID(0).
10602 * data/yacc.c: Likewise.
10603 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
10604 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
10605 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
10606 is C++ only.
10607 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
10608 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
10609 Use YYID(0) rather than 0, for lint.
10610 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
10611 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
10612
f5228370
PE
106132005-12-07 Paul Eggert <eggert@cs.ucla.edu>
10614
10615 * tests/glr-regression.at
10616 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10617 Close memory leak reported by twlevo.
10618
69ce078b
PE
106192005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
10620
6ff99711
PE
10621 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
10622 all stacks.
10623 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
10624 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10625 New test case.
10626 (Duplicated user destructor for lookahead): This test now is expected
10627 to succeed.
10628
af3412cd
PE
106292005-12-01 Paul Eggert <eggert@cs.ucla.edu>
10630
32b5b719 10631 * NEWS: Document the following change.
af3412cd
PE
10632 * data/yacc.c: Say "parser skeleton" rather than "file", since
10633 it's no longer just a file.
10634 * data/glr.c: Grant a special exception for C GLR parsers, that
10635 reads like the already-existing exception for C LALR(1) parsers.
10636 * data/glr.cc: Likewise.
10637 * data/lalr1.cc: Likewise.
10638 * data/location.cc: Likewise.
10639 * data/yacc.c: Reword the "written by" statement to clarify that
10640 it was the parser skeleton, not the entire output file.
10641 * data/glr.c: Written by Paul Hilfinger.
10642 * data/glr.cc: Written by Akim Demaille.
10643 * data/lalr1.cc: Likewise.
10644
035aa4a0
PE
106452005-11-18 Paul Eggert <eggert@cs.ucla.edu>
10646
d9963c85
PE
10647 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
10648 Fix typos in previous change that broke 'make check'.
10649 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
10650 supported in C.
10651 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
10652 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
10653 We can revert this once things settle down.
10654
035aa4a0
PE
10655 * src/conflicts.c (conflicts_print): Don't print file name twice
10656 when %expect fails because there were no conflicts.
10657 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
10658 change.
10659 * tests/conflicts.at (%expect not enough, %expect too much):
10660 (%expect with reduce conflicts): Adjust to new behavior.
10661
106622005-11-18 Akim Demaille <akim@epita.fr>
10663
10664 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
10665 errors.
10666 * NEWS: Document this.
10667 * doc/bison.texinfo (Expect Decl): Likewise.
10668
d1ff7a7c
AD
106692005-11-16 Akim Demaille <akim@epita.fr>
10670
10671 Generalize the display of semantic values and locations in traces.
10672 * data/glr.c (yy_reduce_print): Fix indices (again).
10673 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
10674 literal integers.
10675 * data/lalr1.cc (yyreduce_print): Rename as...
10676 (yy_reduce_print): this.
10677 Display values and locations.
10678 * data/yacc.c (yy_reduce_print): Likewise.
10679 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
10680 (yysymprint): Move higher to be visible from yy_reduce_print).
10681 (yyparse): Adjust.
10682 * tests/calc.at: Adjust the expected length of the traces.
10683
6de5398d
AD
106842005-11-14 Akim Demaille <akim@epita.fr>
10685
10686 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
10687 from 1 to N, while values and location start at 0.
10688 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
10689
a1373f55
AD
106902005-11-14 Akim Demaille <akim@epita.fr>
10691
10692 * data/glr.c (yy_reduce_print): Fix the $ number.
10693
613d8952
AD
106942005-11-14 Akim Demaille <akim@epita.fr>
10695
10696 "Use" parse parameters.
10697 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
10698 * data/glr.c, data/glr.cc: Use them.
10699 * data/glr.c (YYUSE): Have a C++ definition that supports
10700 non-pointer types.
10701
b2741627
AD
107022005-11-14 Akim Demaille <akim@epita.fr>
10703
10704 * data/glr.c (yyexpandGLRStack): Declare only if defined.
10705
5059b5c8
AD
107062005-11-14 Akim Demaille <akim@epita.fr>
10707
42249483
AD
10708 * data/glr.cc: New.
10709 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 10710
4626a15d
AD
107112005-11-12 Akim Demaille <akim@epita.fr>
10712
10713 Let position and location be PODs.
10714 * data/location.cc (position::initialize, location::initialize): New.
10715 (position::position, location::location): Define only if
10716 b4_location_constructors is defined.
10717 * data/lalr1.cc (b4_location_constructors): Define it for backward
10718 compatibility.
10719 * doc/bison.texinfo (Initial Action Decl): Use initialize.
10720
107212005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
10722
10723 * data/lalr1.cc: Move the body of the ctor and dtor into the
10724 parser file (instead of the header).
10725 Wrap the implementations in a "namespace yy".
10726
107272005-11-12 Akim Demaille <akim@epita.fr>
10728
10729 Have glr.c include its header file when created.
10730 * data/glr.c (b4_shared_declarations): New.
10731 Output them verbatim in the parser if !%defines, otherwise
10732 output then in the header file, and include it instead.
10733
1989d947
AD
107342005-11-11 Akim Demaille <akim@epita.fr>
10735
10736 * data/glr.c: Comment changes.
10737
107382005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
10739
10740 When yydebug, report semantic and location values for reductions.
10741 * data/glr.c (yy_reduce_print): Report the semantic values and the
10742 locations.
10743 (YY_REDUCE_PRINT): Adjust.
10744 (yyglrReduce): Use them.
10745 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
10746 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
10747 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
10748 traces.
10749
02998094
AD
107502005-11-10 Akim Demaille <akim@epita.fr>
10751
10752 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
10753 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
10754 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
10755
5210672f
PE
107562005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
10757
10758 * m4/cxx.m4, examples/Makefile.am: Don't build
10759 examples/calc++ if no C++ compiler is available. (trivial change)
10760
a8991a1d
AD
107612005-11-09 Akim Demaille <akim@epita.fr>
10762
10763 * src/scan-skel.l: Use a couple of asserts.
10764
36b5e963
AD
107652005-11-03 Akim Demaille <akim@epita.fr>
10766
10767 In some (weird) cases, the final state number is incorrect.
10768 Reported by Alexandre Duret-Lutz.
10769 * src/LR0.c (state_list_append): Remove the computation of
10770 final_state.
10771 (save_reductions): Do it here.
10772 (get_state): Alpha conversion.
10773 (generate_states): Use a for loop.
10774 * src/gram.h (item_number_is_rule_number)
10775 (item_number_is_symbol_number): New.
10776 * src/state.c: Use assert.
10777 * src/system.h: Include assert.h.
10778 * tests/sets.at (Accept): New.
10779
44e7ead1
PH
107802005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10781
10782 * data/glr.c (yyfill): Adjust comment.
36b5e963 10783 (yyresolveAction): Initialize default location properly
44e7ead1
PH
10784 for empty right-hand sides.
10785 (yydoAction): Ditto.
10786 Add comment explaining apparently dead code.
36b5e963
AD
10787 * tests/glr-regression.at
10788 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 10789 New test.
36b5e963 10790
e10a80ee
PE
107912005-10-30 Paul Eggert <eggert@cs.ucla.edu>
10792
10793 * bootstrap (cleanup_gnulib): New function. Use it to clean up
10794 gnulib when interrupted. This fixes some race conditions and
10795 works around some portability problems (one noted by Paul
10796 Hilfinger).
10797
067b32ee
AD
107982005-10-22 Akim <akim@epita.fr>
10799
10800 * Makefile.cfg: Adjust to config -> build-aux.
10801 Reported by twledo.
10802
4b367315
AD
108032005-10-21 Akim Demaille <akim@epita.fr>
10804
10805 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
10806 the %parse-params.
10807 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
10808 * data/yacc.c (b4_Pure_if): Rename as...
10809 (b4_yacc_pure_if): this.
10810 (YY_SYMBOL_PRINT, yyparse): Adjust.
10811 * doc/bison.texinfo: Formatting changes.
10812
24cc23d9
AD
108132005-10-21 Akim Demaille <akim@epita.fr>
10814
10815 Finish the transition config -> build-aux.
10816 * configure.ac, Makefile.am: Use build-aux.
10817 * config/prev-version, config/announce-gen, config/Makefile.am:
10818 Move to...
10819 * build-aux/prev-version, build-aux/announce-gen,
10820 * build-aux/Makefile.am: here.
10821
d4476375
AD
108222005-10-14 Akim Demaille <akim@epita.fr>
10823
10824 * examples/calc++/test: Use set -x only when VERBOSE.
10825
302c0aee
PE
108262005-10-13 Paul Eggert <eggert@cs.ucla.edu>
10827
10828 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
10829 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
10830
7625ec2c
AD
108312005-10-13 Akim Demaille <akim@epita.fr>
10832
10833 * src/scan-skel.l: Output the base name parts of the parser and
10834 header file names.
302c0aee 10835 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
10836 additional checks.
10837 Use this to exercise C++ outputs in subdirs.
10838 Reported by Oleg Smolsky.
10839
ba0fe3c7
PE
108402005-10-12 Paul Eggert <eggert@cs.ucla.edu>
10841
10842 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
10843 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
10844 Problem reported by John P. Hartmann.
10845 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
10846 already defined it.
10847
9b8a5ce0
AD
108482005-10-12 Akim Demaille <akim@epita.fr>
10849
10850 * src/parse-gram.y (version_check): Exit 63 to please missing
10851 (stands for "version mismatch).
10852 * tests/input.at, doc/bison.texinfo: Adjust.
10853
4f6e011e
PE
108542005-10-10 Paul Eggert <eggert@cs.ucla.edu>
10855
10856 Work around portability problems with Visual Age C compiler
10857 (xlc and xlC_r) reported by John P. Hartmann.
10858 * data/location.cc (initial_column, initial_line): Remove.
10859 All uses replaced by 0 and 1.
10860 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
10861 that xlc complains about.
10862 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 10863 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 10864 as __STDC__.
4d7aa45e
PE
10865 * data/yacc.c (YYMODERN_C): New macro, which also looks at
10866 __STDC_VERSION__. Use it everywhere instead of looking at
10867 __STDC__ and __cplusplus.
4f6e011e 10868
a1b3bf8c
AD
108692005-10-10 Akim Demaille <akim@epita.fr>
10870
10871 * examples/calc++/test: Be quiet unless VERBOSE.
10872
412e44aa
PE
108732005-10-05 Paul Eggert <eggert@cs.ucla.edu>
10874
2a4647a3
PE
10875 * data/c.m4 (yydestruct, yysymprint):
10876 Use YYUSE instead of casting to void.
10877 * data/glr.c (YYUSE): New macro.
10878 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10879 Use it instead of rolling our own.
10880 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10881 (YYCHK1):
10882 Use /*CONSTCOND*/ to suppress lint warnings.
10883 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10884 (YY_STACK_PRINT): Use 'false' not '0'.
10885 (YYUSE): New macro.
10886 (yysymprint_, yydestruct_): Use it instead of rolling our own.
10887 * data/yacc.c (YYUSE): New macro.
10888 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
10889 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
10890 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
10891
10892
412e44aa
PE
10893 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
10894 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
10895
88c6637f
PE
108962005-10-04 Paul Eggert <eggert@cs.ucla.edu>
10897
2f4f028d
PE
10898 Undo the parts of the unlocked-I/O change that substituted
10899 putc or puts for printf. This might hurt performance a bit,
10900 but some people prefer the printf style.
10901 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
10902 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
10903 All uses replaced by YYFPRINTF and YYDPRINTF.
10904 * data/yacc.c: Likewise.
10905 * lib/bitset.c (bitset_print): Likewise.
10906 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
10907 putc and puts.
10908 * lib/lbitset.c (debug_lbitset): Likewise.
10909 * src/closure.c (print_firsts, print_fderives): Likewise.
10910 * src/gram.c (grammar_dump): Likewise.
10911 * src/lalr.c (look_ahead_tokens_print): Likewise.
10912 * src/output.c (escaped_output): Likewise.
10913 (user_actions_output): Break apart two printfs.
10914 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
10915 * src/reduce.c (reduce_print): Likewise.
10916 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
10917 * src/system.h: Include unlocked-io.h rathe than stdio.h.
10918
88c6637f
PE
10919 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10920 Use assignments rather than casts-to-void to suppress
10921 unused-variable warnings. This pacifies 'lint'.
10922 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
10923 unused-variable warnings.
10924
fb32e373
JMG
109252005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10926
10927 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10928
edb8f44f
PE
109292005-10-02 Paul Eggert <eggert@cs.ucla.edu>
10930
fb9c0b33
PE
10931 Use unlocked I/O for a minor performance improvement on hosts like
10932 GNU/Linux and Solaris that support unlocked I/O. The basic idea
10933 is to use the gnlib unlocked-io module, and to prefer putc and
10934 puts to printf when either will work (since the latter doesn't
10935 come in an unlocked flavor).
10936 * bootstrap (gnulib_modules): Add unlocked-io.
10937 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
10938 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
10939 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
10940 and similarly for puts and putc and printf.
10941 * data/yacc.c: Likewise.
10942 * lib/bitset.c (bitset_print): Likewise.
10943 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
10944 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
10945 to printf.
10946 * lib/lbitset.c (debug_lbitset): Likewise.
10947 * src/closure.c (print_firsts, print_fderives): Likewise.
10948 * src/gram.c (grammar_dump): Likewise.
10949 * src/lalr.c (look_ahead_tokens_print): Likewise.
10950 * src/output.c (escaped_output): Likewise.
10951 (user_actions_output): Coalesce two printfs.
2f4f028d 10952 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
10953 * src/reduce.c (reduce_print): Likewise.
10954 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 10955 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 10956
edb8f44f
PE
10957 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
10958 this confuses xgettext.
10959
b50d2359
AD
109602005-10-02 Akim Demaille <akim@epita.fr>
10961
10962 * bootstrap (gnulib_modules): Add strverscmp.
10963 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
10964 * m4/.cvsignore: Add strverscmp.m4.
10965 * src/parse-gram.y (%require): New token, new rule.
10966 (version_check): New.
10967 * src/scan-gram.l (%require): Adjust.
10968 * tests/input.at (AT_REQUIRE): New.
10969 Use it.
10970 * doc/bison.texinfo (Require Decl): New.
10971 (Calc++ Parser): Use %require.
10972
21667f64
AD
109732005-10-02 Akim Demaille <akim@epita.fr>
10974
10975 * data/location.cc: New.
10976
2b81e969
AD
109772005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
10978 Akim Demaille <akim@epita.fr>
10979
10980 Make sure -odir/foo.cc creates dir/location.hh etc.
10981 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
10982 (spec_file_prefix, spec_verbose_file, spec_graph_file)
10983 (spec_defines_file): Now const.
10984 (dir_prefix): New.
10985 (short_base_name): Remove.
10986 * src/files.c: Adjust.
10987 (dirname.h): Include.
10988 (base_name): Don't prototype it.
10989 (finput): Remove, duplicates gram_in.
10990 (full_base_name, short_base_name): Replace by...
10991 (all_but_ext, all_but_tab_ext): these.
10992 (compute_base_names): Rename as...
10993 (compute_file_name_parts): this.
10994 Update to compute the new variables, including dir_prefix.
10995 Adjust dependencies.
10996 * src/output.c (prepare): Output them.
10997 * src/reader.c: Adjust to use gram_in, not finput.
10998 * src/scan-skel.l (@dir_prefix@): New.
10999
ad6a9b97
JMG
110002005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11001
11002 * lib/subpipe.c: New function end_of_output_subpipe() added
11003 to allow support for non-posix systems. This is a no-op function
11004 for posix systems.
11005
11006 * lib/subpipe.h: New function end_of_output_subpipe() added
11007 to allow support for non-posix systems. This is a no-op function
11008 for posix systems.
11009
11010 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
11011 handle the lack of pipe/fork functionality on non-posix systems.
11012
11013 * djgpp/Makefile.maint: DJGPP specific file.
11014
11015 * djgpp/README.in: DJGPP specific file.
11016
11017 * djgpp/config.bat: DJGPP specific configuration file.
11018
11019 * djgpp/config.sed: DJGPP specific configuration file.
11020
11021 * djgpp/config.site: DJGPP specific configuration file.
11022
11023 * djgpp/config_h.sed: DJGPP specific configuration file.
11024
11025 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
11026
11027 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
11028
fc695704
AD
110292005-10-02 Akim Demaille <akim@epita.fr>
11030
11031 * data/location.cc: New, extract from...
11032 * data/lalr1.cc: here.
11033 (location.hh): Include it after the user prologue, in case the
11034 filename type is defined by the user.
11035 Forward declation location and position before the pre-prologue.
11036 (yyresult_): Rename as...
11037 (yyresult): this, it's a local variable, not an attribute.
11038 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
11039
110402005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
11041
11042 * examples/extexi: Restore the #line generation.
11043
fb9712a9
AD
110442005-09-30 Akim Demaille <akim@epita.fr>,
11045 Alexandre Duret-Lutz <adl@gnu.org>
11046
11047 Move the token type and YYSTYPE in the parser class.
11048 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
11049 (parser::token): New, from the moved free definition of tokens.
11050 (parser::semantic_value): Now a full definition instead of an
11051 indirection to YYSTYPE.
11052 (b4_post_prologue): No longer included in the header file, but
11053 in the implementation file.
11054 * doc/bison.texi (C+ Language Interface): Update.
11055 * src/parse-gram.y: Support unary %define.
11056 * tests/actions.at: Define global_tokens_and_yystype for backward
11057 compatibility until we update the tests.
11058 * tests/calc.at: Idem.
11059 (first_line, first_column, last_line, last_column): Define for lalr1.cc
11060 to simplify the code.
11061
55f0c7b1
PE
110622005-09-29 Paul Eggert <eggert@cs.ucla.edu>
11063
11064 Port to SunOS 4.1.4, which lacks strtoul and strerror.
11065 Ah, the good old days! Problem reported by Peter Klein.
11066 * bootstrap (gnulib_modules): Add strerror, strtoul.
11067 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
11068 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
11069
fb9712a9 110702005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
11071
11072 * data/c.m4 (b4_error_verbose_if): New.
11073 * data/lalr1.cc: Use it.
11074 (YYERROR_VERBOSE_IF): Remove.
11075 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
11076 parser members, replaced by...
11077 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
11078 local variables.
11079 (yysyntax_error_): Takes the state number as argument.
11080 (yyreduce_print_): Use the argument yyrule, not the former
11081 attribute yyn_.
11082
8a6f72f3
PE
110832005-09-26 Paul Eggert <eggert@cs.ucla.edu>
11084
11085 * bootstrap (gnulib_modules): Add verify.
11086 * lib/.cvsignore: Add verify.h.
11087 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
11088 * src/system.h (verify): Remove.
11089 Include verify.h instead.
11090 * src/tables.c (tables_generate): Use new API for 'verify'.
11091
0d50976f
PE
110922005-09-21 Paul Eggert <eggert@cs.ucla.edu>
11093
ebc3737e
PE
11094 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
11095 local variables whose names begin with 'yy'.
11096 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
11097 Trivial changes from Joel E. Denny.
11098
0d50976f
PE
11099 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
11100 it itself.
11101 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
11102 don't use alloca any more.
11103
11104 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
11105 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 11106 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
11107 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
11108 to match yacc.c, to test more hosts.
11109
a05b79df
PE
111102005-09-20 Paul Eggert <eggert@cs.ucla.edu>
11111
55289366
PE
11112 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
11113 doesn't affect behavior.
11114 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
11115 Solaris, AIX, MSC.
11116 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
11117 This works a bit better with glibc, if user code has already included
11118 stdlib.h.
11119 * doc/bison.texinfo (Bison Parser): Document that users can't
11120 arbitrarily use malloc and free for other purposes. Document
11121 that <alloca.h> and <malloc.h> might be included.
11122 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
11123 user must declare alloca.
11124
a05b79df
PE
11125 * HACKING (release): Forwarn the Translation Project about
11126 stable releses.
11127
3ab2ca22
AD
111282005-09-20 Akim Demaille <akim@epita.fr>
11129
11130 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
11131
a9739e7c
PE
111322005-09-19 Paul Eggert <eggert@cs.ucla.edu>
11133
a702593e
PE
11134 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
11135 (YYSTACK_ALLOC_MAXIMUM): Use it.
11136 (yysyntax_error): New function.
11137 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
11138 multiple syntax errors are reported, and alloca is being used.
11139 Instead, reallocate buffers twice as big each time, so that
11140 we waste at most half the allocated memory. Start with a small
11141 (128-byte) buffer that will suffice in most cases anyway.
11142 Use yysyntax_error to do most of the work.
11143
11144 * doc/bison.texinfo (Error Reporting, Table of Symbols):
11145 yynerrs is the number of errors reported, not the number of
11146 errors encountered.
11147
a9739e7c
PE
11148 * tests/glr-regression.at (Duplicated user destructor for lookahead):
11149 Mark it as expected to fail.
11150 Cast result of malloc; problem reported by twlevo@xs4all.nl.
11151 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
11152 Don't start user-code symbols with "yy", to avoid name space problems.
11153
f479c6c6
AD
111542005-09-19 Akim Demaille <akim@epita.fr>
11155
11156 Remove the traits, failed experiment.
11157 It never proved useful, and anyway because of the current
11158 definition, it was not possible to have several specialization of
11159 this traits, making it useless.
11160 * data/lalr1.cc (yy:traits): Remove.
11161 Inline its definitions in the parser class.
11162
e2586f82
AD
111632005-09-19 Akim Demaille <akim@epita.fr>
11164
11165 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
11166 least Mac OSX with a /usr/local install of gettext.
11167
2e8cf949
AD
111682005-09-19 Akim Demaille <akim@epita.fr>
11169
11170 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
11171 and yytoken for similarity with the other skeletons.
11172
c7fb0b90
AD
111732005-09-19 Akim Demaille <akim@epita.fr>
11174
4e26c69e 11175 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 11176
1bd0deda
PE
111772005-09-16 Paul Eggert <eggert@cs.ucla.edu>
11178
11179 * NEWS: Version 2.1.
11180
11181 * NEWS: Remove notice of yytname change, since it was never in an
11182 official release.
11183 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
11184 diagnostic.
11185 * src/output.c (prepare): Likewise.
11186 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
11187 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
11188 is not defined. This is an awful hack, but it's enough for now.
11189 All callers changed.
11190 * tests/glr-regression-at (make_value): Args are const pointers now,
11191 to avoid GCC warning.
11192 (Duplicated user destructor for lookahead): New test. Currently
11193 skipped. It fails on my host but I'm not sure it'll always fail.
11194
111952005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
11196
11197 * src/symtab.h (struct symbol): Declare the printer and destructor
11198 as const, to avoid accidental calls to free.
11199 (symbol_destructor_set, symbol_printer_set): Adjust.
11200 * src/symtab.c: Adjust.
11201
1bd0deda 112022005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
11203
11204 * data/c.m4 (b4_token_enums): New.
11205 (b4_token_defines): Rename as...
11206 (b4_token_enums_defines): this.
11207 (b4_token_defines): New, output only the #defines.
11208 * data/yacc.c, data/glr.c: Adjust.
11209 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
11210 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
11211 as default values.
11212
dbcdae2d
AD
112132005-09-16 Akim Demaille <akim@epita.fr>
11214
11215 * data/lalr1.cc (yylex_): Remove, inline its code.
11216 (yyreport_syntax_error_): Remove, replaced by...
11217 (yysyntax_error_): this which returns a string and leaves to the
11218 caller the call to the users' error function.
11219 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
11220 Move from members of the parser object...
11221 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
11222 to local variables of the parse function.
11223
70d8f291
AD
112242005-09-16 Akim Demaille <akim@epita.fr>
11225
11226 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
11227 since it's in Bison's name space.
11228
b47dbebe
PE
112292005-09-15 Paul Eggert <eggert@cs.ucla.edu>
11230
ae199bf1
PE
11231 * data/glr.c (yyresolveValue): Add default case to pacify
11232 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
11233
b47dbebe
PE
11234 * NEWS: Document when yyparse started to return 2.
11235 * doc/bison.texinfo (Parser Function): Document when yyparse
11236 returns 2.
11237
11238 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
11239 (b4_filename_type): Renamed back from b4_file_name_type. All uses
11240 changed.
11241 (class position): file_name -> filename (reverting). All uses changed.
11242
112432005-09-14 Paul Eggert <eggert@cs.ucla.edu>
11244
11245 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
11246 do anything if $@ exists. This reverts part of the 2005-07-07
11247 patch.
11248
00292f66
PE
112492005-09-11 Paul Eggert <eggert@cs.ucla.edu>
11250
11251 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
11252 contains obsolete information and isn't worth distributing as a
11253 separate file anyway.
11254 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
11255 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
11256 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
11257 (yyparse): Abort if user code uses longjmp to throw an unexpected
11258 value.
11259
a420f962
PE
112602005-09-09 Paul Eggert <eggert@cs.ucla.edu>
11261
00292f66
PE
11262 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
11263 Suggested by twlevo@xs4all.nl.
11264
127287e9
PE
11265 * data/glr.c (YYCHK1): Do not assume YYE is in range.
11266 This avoids a diagnostic from gcc -Wswitch-enum.
11267 Problem reported by twlevo@xs4all.nl.
11268
a420f962
PE
11269 * doc/bison.texinfo: Don't use "filename", as per GNU coding
11270 standards. Use "file name" or "file" or "name", depending on
11271 the context.
11272 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
11273 not to hack/foo.tab.c.
11274 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
11275 * data/glr.c: b4_filename -> b4_file_name.
11276 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
11277 All uses changed.
11278 (class position): filename -> file_name. All uses changed.
11279 * data/yacc.c: b4_filename -> b4_file_name.
11280 * lib/bitset.h: filename -> file_name in local vars.
11281 * lib/bitset_stats.c: Likewise.
11282 * src/files.c: Likewise.
11283 * src/scan-skel.l ("@output ".*\n): Likewise.
11284 * src/files.c (file_name_split): Renamed from filename_split.
11285 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
11286
112872005-09-08 Paul Eggert <eggert@cs.ucla.edu>
11288
11289 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
11290 to accommodate latest gnulib.
11291
11292 * tests/glr-regression.at (Duplicate representation of merged trees):
11293 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
11294
11295 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
11296 needed.
11297
42a6501d
PE
112982005-08-26 Paul Eggert <eggert@cs.ucla.edu>
11299
11300 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
11301 All uses changed. Invoke user destructor after an error during a
11302 split parse (trivial change from Joel E. Denny).
11303
11304 * tests/glr-regression.at
11305 (User destructor after an error during a split parse): New test case.
11306 Problem reported by Joel E. Denny in:
11307 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
11308
ef9a1faf
PE
113092005-08-25 Paul Eggert <eggert@cs.ucla.edu>
11310
5b4aaf78
PE
11311 * README-cvs: Give URLs for recommended tools.
11312 Mention Gzip version problem, and bootstrapping issues.
11313 Remove troubleshooting section, as it's somewhat obsolete.
11314
b5240ba5
PE
11315 * bootstrap (no_cache): New var, to accommodate different wget
11316 variants. Use it instead of '-C off'. Problem reported by
11317 twlevo@xs4all.nl.
11318
ef9a1faf
PE
11319 * data/glr.c (yydestroyStackItem): New function.
11320 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
11321 debugging information. Problem reported by Joel E. Denny.
11322
e6efa9da
AD
113232005-08-25 Akim Demaille <akim@epita.fr>
11324
11325 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
11326
adc90f13
PE
113272005-08-24 Paul Eggert <eggert@cs.ucla.edu>
11328
11329 * data/glr.c (yyrecoverSyntaxError, yyreturn):
11330 Don't invoke destructor on unresolved entries.
11331 * tests/glr-regression.at
11332 (User destructor for unresolved GLR semantic value): New test case.
11333 Problem reported by Joel E. Denny in:
11334 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
11335
f9315de5
PE
113362005-08-21 Paul Eggert <eggert@cs.ucla.edu>
11337
15d29c1f
PE
11338 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
11339 Add strnlen.c.
11340 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
11341 lib-prefix.m4, po.m4.
11342
dd5f2af2
PE
11343 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
11344 in yydestruct diagnostic, since it might not be an error.
11345 Problem reported by Joel Denny near end of
11346 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 11347 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
11348 * data/yacc.c (yyreturn): Likewise.
11349 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
11350
11351 * src/files.c: Remove obsolete FIXME comment.
11352
11353 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
11354 with the other templates, and to fix bogus run-on messages such
11355 as the one reported at the end of
11356 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
11357 All callers changed to avoid the newline.
11358 (yyprocessOneStack): Output two lines rather than one, to accommodate
11359 the above change. This changes the debug output format slightly.
11360
f9315de5
PE
11361 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
11362 reported by Joel E. Denny in
11363 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
11364 (trivial change).
11365 * tests/glr-regression.at (Duplicate representation of merged trees):
11366 New test, from Joel E. Denny in:
11367 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
11368 * THANKS: Add Joel E. Denny.
11369
11370 * configure.ac (AC_INIT): Bump to 2.0c.
11371
04098407
PE
113722005-07-24 Paul Eggert <eggert@cs.ucla.edu>
11373
11374 * NEWS: Version 2.0b.
11375
ca5d2013
PE
11376 * Makefile.am (SUBDIRS): Put examples before tests, so that
11377 "make check" doesn't finish with "All 1 tests passed".
11378
3d54b576
PE
11379 * tests/regression.at (Token definitions): Don't rely on
11380 AT_PARSER_CHECK for data that contains backslashes. It currently
11381 uses 'echo', and 'echo' isn't portable if its argument contains
11382 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
11383 that the byte '\0xff' is not printable in the C locale; it is,
11384 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
11385 not printable, so use '\0x81' to test.
11386
d53ae497
PE
11387 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
11388 version of GCC, since the macro is used with non-GCC compilers.
11389
fc01665e
PE
11390 Fix core dump reported by Pablo De Napoli in
11391 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
11392 * tests/regression.at (Invalid inputs with {}): New test.
11393 * src/parse-gram.y (token_name): Translate type before using
11394 it as an index.
11395
04098407
PE
11396 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
11397 the user's name space. All uses changed to __attribute__
11398 ((__unused__)).
11399 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
11400 Add __attribute__ ((__noreturn__)).
11401
11402 * etc/clcommit: Remove. We weren't using it, and it failed
11403 "make maintainer-distcheck".
11404 * Makefile.maint: Merge from coreutils.
11405 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
11406 (syntax-check-rules): Change list of rules as described below.
11407 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
11408 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
11409 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
11410 (sc_trailing_space): New rules.
11411 (sc_xalloc_h_in_src): Remove.
11412 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
11413 (sc_space_tab, sc_error_exit_success, sc_changelog):
11414 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
11415 (makefile-check, po-check, author_mark_check):
11416 (makefile_path_separator_check, copyright-check):
11417 Use grep -n, to make it easier to find violations.
11418 Use CVS_LIST and CVS_LIST_EXCEPT.
11419 (header_regexp, h_re): Remove.
11420 (dd_c): New macro.
11421 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
11422 (my-distcheck): Use more-modern GCC flags.
11423 (signatures, %.asc): Remove.
11424 (rel-files, announcement): Remove signatures.
11425 Restore old updating code, even though we don't use it, so
11426 that we're the same as coreutils.
11427 (alpha, beta, major): Depend on news-date-check.
11428 Make the upload commands.
11429
11430 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
11431 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
11432 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
11433 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
11434 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
11435 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
11436 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
11437 * tests/sets.at: Likewise.
11438
11439 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
11440 we comment out the Autoconf version number.
11441 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
11442 it's error-prone and "make maintainer-distcheck" rejects it.
11443
11444 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
11445 Indent calls to "error" to pacify "make maintainer-distcheck",
11446 when the calls are not intended to be translated.
11447 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
11448
11449 * src/Makefile.am (DEFS): Use +=, to pacify
11450 "make maintainer-distcheck".
11451 (bison_SOURCES): Add scan-skel.h.
11452 (sc_tight_scope): New rule, from coreutils.
11453
11454 * src/files.c (src_extension, header_extension):
11455 Now static, not extern.
11456 * src/getargs.c (short_options): Likewise.
11457 * src/muscle_tab.c (muscle_table): Likewise.
11458 * src/parse-gram.y (current_class, current_type, current_prec):
11459 Likewise.
11460 * src/reader.c (grammar_end, previous_rule_end): Likewise.
11461 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
11462 * src/main.c (main): Cast bindtextdomain and textdomain calls to
11463 void, to avoid warning when NLS is disabled.
11464 * src/output.c: Include scan-skel.h.
11465 (scan_skel): Remove decl, since scan-skel.h does this.
11466 (output_skeleton):
11467 Indent calls to "error" to pacify "make maintainer-distcheck".
11468 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
11469 * src/reader.h (gram_end, gram_lineno): New decls to pacify
11470 "make maintainer-distcheck".
11471 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
11472 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
11473 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
11474 (skel_lex_destroy, scan_skel): Move these decls to...
11475 * src/scan-skel.h: New file.
11476 * src/uniqstr.c (uniqstr_assert):
11477 Indent calls to "error" to pacify "make maintainer-distcheck".
11478
11479 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
11480 not @VAR@.
11481
11482 * tests/torture.at: Revamp to avoid misuse of atoi that
11483 "make maintainer-distcheck" complained about.
11484
11485 * examples/extexi (message): Don't print a message more than once,
11486 and omit line-number decoration that makes Emacs compile think
11487 that informative messages are worth worrying about.
11488
114892005-07-22 Paul Eggert <eggert@cs.ucla.edu>
11490
11491 * configure.ac: Update version number.
11492
11493 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
11494 accidentally.
11495 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
11496 autogenerated by the maintainer.
11497 * examples/calc++/.cvsignore: Add *.yy.
11498
11499 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
11500 * lib/bitset_stats.c (bitset_stats_init): Likewise.
11501 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11502
11503 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
11504
11505 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
11506 from maintainer-distcheck about casting the argument of 'free'.
11507
11508 * NEWS: Mention recent yytname changes.
11509 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
11510
11511 * bootstrap: For translations that have not yet been upgraded to
11512 the new runtime-po domain, prime the pump by extracting the
11513 relevant strings from the obsolete translations. This code can be
11514 removed once the bison-runtime domain has been translated by each
11515 team.
11516
11517 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
11518 now that token names are already quoted.
11519
11520 Fix problem reported by Anthony Heading.
11521 * data/glr.c (YYTOKEN_TABLE): New macro.
11522 (yytname): Define if YYTOKEN_TABLE.
11523 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
11524 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
11525 (YYERROR_VERBOSE): Define the same way the other skeletons do.
11526 * src/output.c (prepare_symbols): Output token_table_flag.
11527
0ffda363
PE
115282005-07-21 Paul Eggert <eggert@cs.ucla.edu>
11529
11530 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
11531 again if the first call fails.
11532
11533 * data/glr.c (yytnamerr): New function.
11534 (yyreportSyntaxError): Use it to dequote most string literals.
11535 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
11536 with other skeletons. All uses changed.
11537 (yytnameerr_): New function.
11538 (yyreport_syntax_error): Use it to dequote most string literals.
11539 * data/yacc.c (yytnamerr): New function.
11540 (yyerrlab): Use it to decode most string literals.
11541 * doc/bison.texinfo (Decl Summary, Calling Convention):
11542 Clarify quoting convention of yytname.
11543 * src/output.c (prepare_symbols): Quote all names. This undoes
11544 the 2005-04-17 change, which is now accomplished (mostly) via
11545 changes in the parsers as described above.
11546 * tests/regression.at (Token definitions, Web2c Actions):
11547 Undo most 2005-04-17 change here, too.
11548
115492005-07-20 Paul Eggert <eggert@cs.ucla.edu>
11550
11551 Fix more problems reported by twlevo@xs4all.nl.
11552 * tests/cxx-type.at: Don't pipe output of ./types through sed to
11553 remove trailing spaces. This loses the exit status of ./types,
11554 and isn't needed since ./types shouldn't be emitting trailing
11555 spaces.
11556 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
11557 as the stack isn't valid in that case.
11558
11559 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
11560 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
11561 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
11562 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
11563 is used.
11564 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
11565 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
11566 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
11567 Likewise.
11568
11569 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
11570 overly-picky compilers that reject 'char *foo = "bar";'.
11571
11572 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
11573 to FILE * parameter, not to stderr. This fixes a typo introduced
11574 in the 2005-07-12 change.
11575
11576 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
11577 warnings from GCC 4.
11578
11579 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
11580 (yyglrShiftDefer, yysplitStack):
11581 Remove unused parameters b4_pure_formals. All uses changed.
11582 (yyglrShift): Remove unused parameters b4_user_formals.
11583 All uses changed.
11584 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
11585
6100a9aa
PE
115862005-07-18 Paul Eggert <eggert@cs.ucla.edu>
11587
258b75ca
PE
11588 Destructor cleanups and regularization among the three skeletons.
11589 * NEWS: Document the behavior changes.
11590 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
11591 stack before failing, as the cleanup code will do it for us now.
11592 * data/lalr1.cc (yyerrlab): Likewise.
11593 * data/glr.c (yyparse): Pop everything off the stack before
11594 freeing it, so that destructors get called properly.
11595 * data/lalr1.cc (yyreturn): Likewise.
11596 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
11597 This is more consistent.
11598 * doc/bison.texinfo (Destructor Decl): Mention more reasons
11599 why destructors might be called. 1.875 -> 2.1.
11600 (Destructor Decl, Decl Summary, Table of Symbols):
11601 Some English-language cleanups for %destructor.
11602 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11603 Add output line for destructor of start symbol.
11604 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
11605 because of that same extra output line.
11606
1a059451
PE
11607 * NEWS: Document minor wording changes in diagnostics of
11608 Bison-generated parsers.
11609 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
11610 Remove unused formals. All uses changed.
11611 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
11612 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
11613 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
11614 Rename yyoverflowab to yyexhaustedlab.
11615 When memory exhaustion occurs during syntax-error reporting,
11616 report it separately rather than in a single diagnostic; this
11617 eases translation.
11618 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
11619 (Memory Exhausted): Renamed from Parser Stack Overflow.
11620 Revamp wording slightly to prefer "memory exhaustion".
11621 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
11622
97460c78
PE
11623 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
11624
30757c8c
PE
11625 Add i18n support to the GLR skeleton. Partially fix the C++
11626 skeleton; a C++ expert needs to finish this. Remove debugging
11627 msgids; there's little point to having them translated, since they
11628 can be understood only by someone who can read the
11629 (English-language) source code.
11630
11631 Generate runtime-po/bison-runtime.pot automatically, so that we
11632 don't have to worry about garbage getting in that file. We'll
11633 make sure after the next official release that old msgids don't
11634 get lost. See
11635 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
11636
11637 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
11638 Now auto-generated.
11639 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
11640 Fix typos in explanations of the runtime file.
11641 * bootstrap: Change gettext keyword from YYI18N to YY_.
11642 Use standard Makefile.in.in in runtime-po, since we'll arrange
11643 for backward-compatible bison-runtime.po files in a different way.
11644 * data/glr.c (YY_): New macro, from yacc.c.
11645 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
11646 Translate messages intended for users.
11647 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
11648 the wording in the other skeletons. We don't know that the memory
11649 is virtual.
11650 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
11651 Use same method that yacc.c uses.
11652 Don't translate debugging messages.
11653 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
11654 it doesn't work (yet), and requires C++ expertise to fix.
11655 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
11656 Move defn to a more logical place, to be consistent with other
11657 skeletons.
11658 Don't translate debugging messages.
11659 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
11660 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
11661 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
11662 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
11663
ac8c5689
PE
11664 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
11665 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
11666 void, not int.
11667 * tests/glr-regression.at (Badly Collapsed GLR States):
11668 Likewise.
11669 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11670 yylex should return 0 at EOF rather than aborting.
11671
6100a9aa
PE
11672 Improve tests for stack overflow in GLR parser.
11673 Problem reported by twlevo@xs4all.nl.
11674 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
11675 All uses removed.
11676 (yyStackOverflow): Just longjmp, but with value 2 so that caller
11677 can handle the problem.
11678 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
11679 (yyparse): New local variable yyresult to record the result.
11680 Use result of setjmp to set it, rather than storing itinto
11681 struct.
11682 (yyDone): Remove label.
11683 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
11684 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
11685 if YYABORT is used).
11686 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
11687 yyparse status; put status > 1 into diagnostic.
11688 Check that status==2 works.
11689 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
11690 Use exit status 3 for failure to open (which shouldn't happen).
11691
15f40952
PE
116922005-07-17 Paul Eggert <eggert@cs.ucla.edu>
11693
67fd79c4
PE
11694 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
11695 1 on syntax error; just let yyparse do its thing.
11696 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
11697 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
11698 (Exploding the Stack Size with Alloca):
11699 (Exploding the Stack Size with Malloc):
11700 Expect exit status 2, not 1, since the parser is supposed to blow
11701 its stack. Problem reported by twlevo@xs4all.nl.
11702
15f40952
PE
11703 * data/glr.c (yyparse): Don't assume that the initial calls
11704 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
11705 Print a stack-overflow message and fail instead.
11706 Initialize the line-number information before creating the stack,
11707 so that the stack-overflow message can report line zero safely.
11708
f32c66b5
PE
117092005-07-14 Paul Eggert <eggert@cs.ucla.edu>
11710
a22ff96f 11711 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
11712 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
11713 (yyuserMerge): Provide a default case if b4_mergers is empty.
11714 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
11715 * tests/glr-regression.at
11716 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 11717 Add casts to pacify C++ compilers.
1beb0b24
PE
11718 * tests/glr-regression.at (Improper merging of GLR delayed action
11719 sets): Declare yylex before using it.
f32c66b5 11720 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
11721 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
11722 test for valgrind; valgrind is independent of g++.
11723 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
11724 for compatibility with POSIX 1003.1-2001 (if running coreutils).
11725 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
11726 Use a destructor, so that we can expand the stack. Change
11727 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 11728
d741bd1b
PE
117292005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11730
11731 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
11732 a valgrind failure. Problem reported by twlevo@xs4all.nl.
11733
0410a6e0
PE
117342005-07-13 Paul Eggert <eggert@cs.ucla.edu>
11735
11736 * PACKAGING: New file, suggested by Bruno Haible and taken from
11737 similar wording in gettext's PACKAGING file.
11738 * NEWS: Mention PACKAGING.
11739 * Makefile.am (EXTRA_DIST): Add PACKAGING.
11740
f7ab6a50
PE
117412005-07-12 Paul Eggert <eggert@cs.ucla.edu>
11742
baf785db 11743 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
11744 * bootstrap: Get runtime translations into runtime-po.
11745 Create runtime-po files automatically, if possible.
11746 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
11747 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
11748 does not infringe on the user's name space.
11749 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
11750 * doc/bison.texinfo (Internationalization): Revamp the English
11751 and Texinfo syntax a bit, to try to make it clearer.
11752 (Bison Options, Option Cross Key): Mention --print-localedir.
11753 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
11754 YYENABLE_NLS. Quote a bit more.
11755 * runtime-po/.cvsignore: New file.
11756 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
11757 * runtime-po/Rules-quot: Remove; now created by bootstrap.
11758 * runtime-po/quot.sed: Likewise.
11759 * runtime-po/boldquot.sed: Likewise.
11760 * runtime-po/en@quot.header: Likewise.
11761 * runtime-po/en@boldquot.header: Likewise.
11762 * runtime-po/insert-header.sin: Likewise.
11763 * runtime-po/remove-potcdate.sin: Likewise.
11764 * runtime-po/Makevars: Likewise.
11765 * runtime-po/LINGUAS: Likewise.
11766 * runtime-po/de.po: Likewise; we will rely on the translation project
11767 to maintain this, so "bootstrap" should get it.
0410a6e0 11768 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
11769 its value.
11770 * src/main.c (main): Bind the bison-runtime domain, too.
11771
117722005-07-12 Bruno Haible <bruno@clisp.org>
11773
11774 * data/yacc.c: Include <libintl.h> when NLS is enabled.
11775 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
11776 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
11777 * runtime-po: New directory.
11778 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
11779 $(DOMAIN).pot-update rule, so that old messages are never dropped.
11780 * runtime-po/Rules-quot: New file, copied from po/.
11781 * runtime-po/quot.sed: Likewise.
11782 * runtime-po/boldquot.sed: Likewise.
11783 * runtime-po/en@quot.header: Likewise.
11784 * runtime-po/en@boldquot.header: Likewise.
11785 * runtime-po/insert-header.sin: Likewise.
11786 * runtime-po/remove-potcdate.sin: Likewise.
11787 * runtime-po/Makevars: New file.
11788 * runtime-po/POTFILES.in: New file.
11789 * runtime-po/LINGUAS: New file.
11790 * runtime-po/bison-runtime.pot: New file.
11791 * runtime-po/de.po: New file.
11792 * m4/bison.m4: New file.
11793 * Makefile.am (SUBDIRS): Add runtime-po.
11794 (aclocaldir, aclocal_DATA): New variables.
11795 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
11796 Define aclocaldir.
11797 * src/getargs.c (usage): Document --print-localedir option.
11798 (PRINT_LOCALEDIR_OPTION): New enum item.
11799 (long_options): Add --print-localedir option.
11800 (getargs): Handle --print-localedir option.
11801 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
11802 (Internationalization): New section.
11803
22dda0f0
AD
118042005-07-12 Akim Demaille <akim@epita.fr>
11805
11806 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
11807 for consistency with the rest of the code.
11808 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
11809 Add separators.
11810
82b248ad
AD
118112005-07-12 Akim Demaille <akim@epita.fr>
11812
11813 * src/parse-gram.y: Use %printer instead of YYPRINT.
11814
fa0e9314
AD
118152005-07-12 Akim Demaille <akim@epita.fr>
11816
867a3e00
AD
11817 * src/symtab.h, src/symtab.c (symbol_print): New.
11818 * src/symlist.h, src/symlist.c (symbol_list_print): New.
11819 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
11820
118212005-07-12 Akim Demaille <akim@epita.fr>
11822
11823 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
11824 b4_at_dollar and b4_dollar_dollar.
11825
e054b190
PE
118262005-07-11 Paul Eggert <eggert@cs.ucla.edu>
11827
11828 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
11829 and Pennello's paper.
11830
34160ec4
PE
118312005-07-09 Paul Eggert <eggert@cs.ucla.edu>
11832
407d4a75
PE
11833 * data/yacc.c (yyparse): Undo previous patch. Instead,
11834 set yylsp[0] and yyvsp[0] only if the initial action
11835 sets yylloc and yylval, respectively.
11836
34160ec4
PE
11837 * data/yacc.c (yyparse): In the initial action, set
11838 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
11839 This avoids the use of undefined variables if the initial
11840 action does not set yylloc and/or yylval.
11841
c3d5a4a7
PE
118422005-07-07 Paul Eggert <eggert@cs.ucla.edu>
11843
b34d96c1
PE
11844 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
11845 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
11846 Remove from CVS. These files are automatically generated.
11847 * examples/extexi: Clarify that this file is now part of Bison,
11848 not GNU M4, and that it works with any POSIX-compatible Awk.
11849 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
11850 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
11851 so that we also get calc++-parser.yy. Geneate it.
11852 Use $(AWK), not gawk, since any conforming Awk will do.
11853 Put comment before action, since older 'make' can't handle comment
11854 in action.
11855 $(BUILT_SOURCES): List all built sources, not just some of them.
11856 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
11857 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
11858 $($(calc_sources_generated)): Remove unnecessary test for existence
11859 of target. (This had a shell syntax error anyway; a stray "x".)
11860 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
11861 calc++-parser.yy.
11862 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
11863
c3d5a4a7
PE
11864 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
11865 implied by the other modules.
11866
828c373b
AD
118672005-07-06 Akim Demaille <akim@epita.fr>
11868
11869 Bind examples/calc++ to the package.
11870 * examples/calc++/Makefile: Remove, replaced by...
11871 * examples/calc++/Makefile.am: ... this new file.
11872 * examples/calc++/test: Remove input.
11873 * examples/calc++/compile: Remove.
11874 * examples/Makefile.am: New.
11875 * configure.ac, Makefile.am: Adjust.
11876 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
11877
63cb01d6
PE
118782005-07-05 Paul Eggert <eggert@cs.ucla.edu>
11879
fd2df2ed
PE
11880 * data/glr.c (yyFail): Drastically simplify; since the format argument
11881 never had any % directives, we can simply pass it to yyerror.
11882 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
11883 be modified later, as that is the usual style in glr.c.
11884 Problems reported by Paul Hilfinger.
11885
63cb01d6
PE
11886 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
11887 and size overflow errors.
11888 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
11889 in case the user prolog sets feature-test macros like _GNU_SOURCE.
11890 (YYSIZEMAX): New macro.
11891 (yystpcpy): New function, taken from yacc.c.
11892 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
11893 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
11894 so that we don't have to maintain their signatures.
11895 (yyFail): Check for buffer overflow, by using vsnprintf rather
11896 than vsprintf. Allocate a bigger buffer if possible.
11897 Report an error if buffer allocation fails.
11898 (yyStackOverflow): New function.
11899 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
11900 the initialization was successful. It might fail if storage was
11901 exhausted.
11902 (yyexpandGLRStack): Add more checks for storage allocation failure.
11903 Use yyStackOverflow to report failures.
11904 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
11905 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
11906 Don't assume stack number fits in int.
11907 (yysplitStack): Check for storage allocation failure.
11908 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
11909 can print diagnostics on storage allocation failure. All callers
11910 changed.
11911 (yyresolveValue): Use yybool for boolean.
11912 (yyreportSyntaxError): Check for size-calculation overflow.
11913 This code is taken from yacc.c.
11914 (yyparse): Check for storage allocation errors when allocating
11915 the initial stack.
11916
1c59e0a1
AD
119172005-07-05 Akim Demaille <akim@epita.fr>
11918
11919 Extract calc++ from the documentation.
11920 * doc/bison.texinfo (Calc++): Add the extraction marks.
11921 * examples/extexi: New, from the aborted GNU Programming 2E.
11922 Separate the different paragraph of a file with empty lines.
11923 * examples/Makefile: Use it to extract the whole calc++ example.
11924
8a0adb01
AD
119252005-06-24 Akim Demaille <akim@epita.fr>
11926
11927 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
11928 class typedefs.
11929
12545799
AD
119302005-06-22 Akim Demaille <akim@epita.fr>
11931
11932 * doc/bison.texinfo (C++ Language Interface): First stab.
11933 (C++ Parsers): Remove.
11934
99be0235
AD
119352005-06-22 Akim Demaille <akim@epita.fr>
11936
11937 * data/lalr1.cc (yylex_): Honor %lex-param.
11938
0ffd4fd1
AD
119392005-06-22 Akim Demaille <akim@epita.fr>
11940
11941 Start a set of simple examples.
11942 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
11943 * examples/calc++/calc++-driver.hh,
11944 * examples/calc++/calc++-parser.yy,
11945 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
11946 * examples/calc++/compile, examples/calc++/test: New.
11947
0925ebb4
PE
119482005-06-09 Paul Eggert <eggert@cs.ucla.edu>
11949
11950 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
11951 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
11952 which stems from the 2005-05-27 patch.
11953
43d3b664
PH
119542005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11955
11956 * data/glr.c: Modify treatment of unused parameters to permit use
11957 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
11958
3062864d
PE
119592005-05-30 Paul Eggert <eggert@cs.ucla.edu>
11960
11961 Fix infringement on user name space reported by Janos Zoltan Szabo.
11962 * data/yacc.c (yyparse): strlen -> yystrlen.
11963
989b5b8e
AD
119642005-05-30 Akim Demaille <akim@epita.fr>
11965
11966 * data/lalr1.cc (_): New.
11967 Translate the various messages.
11968
bedf57f5
PE
119692005-05-27 Paul Eggert <eggert@cs.ucla.edu>
11970
11971 Fix infringement on user name space reported by Bruno Haible.
11972 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
11973 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
11974 the user's name space.
11975 (alloca): Include <stdlib.h> to get it, if it's not built in.
11976 (YYMALLOC, YYFREE): Define only if needed.
11977 (malloc, free): Declare, but only if needed, as this infringes on
11978 the user name space.
11979
4d1801f1
PE
119802005-05-25 Paul Eggert <eggert@cs.ucla.edu>
11981
11982 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
11983 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
11984 with %d format.
11985 * lib/ebitset.c (min, max): Undef before defining.
11986 * lib/vbitset.c (min, max): Likewise.
11987 * lib/subpipe.c (create_subpipe): Save local variables in case
11988 vfork clobbers them.
11989
119902005-05-24 Bruno Haible <bruno@clisp.org>
11991
11992 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
11993 error message syntax used by gcc-4.0.
11994
b94a9e1e
PE
119952005-05-23 Paul Eggert <eggert@cs.ucla.edu>
11996
85ac3861
PE
11997 * README: Mention m4 1.4.3. Remove obsolete advice about
11998 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
11999
b94a9e1e
PE
12000 * bootstrap: Remove workaround for problem I encountered with
12001 gettext 0.14.1; it seems to be fixed now.
12002
51c30d21
PE
120032005-05-22 Paul Eggert <eggert@cs.ucla.edu>
12004
009ce67d
PE
12005 * NEWS: Version 2.0a.
12006
f2a97c62
PE
12007 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
12008 the previous change.
12009
c8775f93
PE
12010 Various maintainer cleanups.
12011 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
12012 conftest*, for benefit of CVS commands run at the same time as
12013 "configure". Add build-aux, since "bootstrap" now creates it and
12014 its subfiles.
12015 * Makefile.cfg (move_if_change): Remove.
12016 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
12017 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
12018 (po_repo, do-po-update, po-update, wget_files, get-targets):
12019 (config.guess-url_prefix, config.sub-url_prefix):
12020 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
12021 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
12022 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
12023 Remove.
12024 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
12025 this is now the recommended name.
12026 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
12027 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
12028 ylwrap. These files now go into build-aux.
12029 * config/move-if-change: Remove.
12030 * config/prev-version.txt: Bump from 1.75 to 2.0.
12031
3ea5f0ec
PE
12032 * bootstrap: Add stdio-safer, unistd-safer modules.
12033 Remove m4/glibc2.m4 (introduced by latest gnulib, but
12034 we don't need it).
12035 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
12036 fopen-safer.c, stdio-safer.h, unistd-safer.h.
12037 * lib/subpipe.c: Include "unistd-safer.h".
12038 (create_subpipe): Make sure all the newly-created
12039 file descriptors are > 2, so that diagnostics don't
12040 get sent down them (which might cause Bison to hang, in theory).
12041 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
12042 * src/files.c (xfopen): Use fopen_safer, not fopen.
12043
51c30d21
PE
12044 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
12045 yesterday's yacc.c fix.
12046
cea1469d
PE
120472005-05-21 Paul Eggert <eggert@cs.ucla.edu>
12048
3ea5f0ec
PE
12049 * data/glr.c, data/lalr1.cc: Update copyright date.
12050
cea1469d
PE
12051 Fix a destructor bug reported by Wolfgang Spraul in
12052 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
12053 * data/yacc.c (yyabortlab): Don't call destructor, and
12054 don't set yychar to EMPTY.
12055 (yyoverflowlab): Don't call destructor.
12056 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
12057 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
12058 since we no longer output the message "discarding lookahead token
12059 end of input ()".
12060
5e6f62f2
PH
120612005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12062
12063 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
12064 fix a small glitch in debugging output.
12065 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
12066 after YY_SYMBOL_PRINT where needed.
12067
12068 (struct yyGLRState): Add some comments.
12069 (struct yySemanticOption): Add some comments.
12070 (union yyGLRStackItem): Add comment.
12071
12072 (yymergeOptionSets): Correct this to properly perform the union,
12073 avoiding infinite reported by Michael Rosien.
12074 Update comment.
12075
12076 * tests/glr-regression.at: Add test for GLR merging error reported
12077 by M. Rosien.
cea1469d 12078
0fb669f9
PE
120792005-05-13 Paul Eggert <eggert@cs.ucla.edu>
12080
12081 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
12082 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
12083 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
12084 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
12085 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
12086 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
12087 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
12088 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
12089 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
12090 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
12091 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
12092 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
12093 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
12094 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
12095 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
12096 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
12097 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
12098 src/derives.h, src/files.c, src/files.h, src/getargs.c,
12099 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
12100 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
12101 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
12102 src/output.h, src/parse-gram.c, src/parse-gram.h,
12103 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
12104 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
12105 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
12106 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
12107 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
12108 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
12109 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
12110 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
12111 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
12112 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
12113 tests/reduce.at, tests/regression.at, tests/sets.at,
12114 tests/synclines.at, tests/testsuite.at, tests/torture.at:
12115 Update FSF postal mail address.
12116
51f4735e
PE
121172005-05-11 Paul Eggert <eggert@cs.ucla.edu>
12118
12119 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
12120 Problem reported by Ralf Menzel.
12121
80ce3401
PE
121222005-05-01 Paul Eggert <eggert@cs.ucla.edu>
12123
12124 * tests/actions.at: Test that stack overflow invokes destructors.
12125 From Marcus Holland-Moritz.
12126 * data/yacc.c (yyerrlab): Move the code that destroys the stack
12127 from here....
12128 (yyreturn): to here. That way, destructors are called properly
12129 even if the stack overflows, or the user calls YYACCEPT or
12130 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
12131 (yyoverflowlab): Destroy the lookahead.
12132
121332005-04-24 Paul Eggert <eggert@cs.ucla.edu>
12134
12135 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
12136
72f000b0
PE
121372005-04-17 Paul Eggert <eggert@cs.ucla.edu>
12138
12139 * NEWS: Bison-generated C parsers no longer quote literal strings
12140 associated with tokens.
12141 * src/output.c (prepare_symbols): Don't escape strings,
12142 since users don't want to see C escapes.
12143 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
12144 in diagnostics.
c19683bb 12145 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
12146 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
12147
1094323f
PE
121482005-04-16 Paul Eggert <eggert@cs.ucla.edu>
12149
12150 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
12151 the data size is known to be too small and we can't increase it.
12152 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
12153
ca407bdf
PE
121542005-04-15 Paul Eggert <eggert@cs.ucla.edu>
12155
12156 * src/parse-gram.y: Include quotearg.h.
12157 (string_as_id): Quote $1 before using it as a key, since the
12158 lexer no longer quotes it for us.
12159 (string_content): Don't strip quotes, since lexer no longer
12160 quotes it for us.
12161 * src/scan-gram.l: Include quotearg.h.
12162 ("\""): Omit quote.
12163 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
12164 a key, since the rest of the lexer doesn't quote it.
12165 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
12166 * tests/regression.at (Token definitions): Check for backslashes
12167 in token strings.
12168
12169 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
12170 (YYSIZE_T): Define to unsigned long int when using an older compiler.
12171 (yyparse): Revamp code to generate long syntax error message, to
12172 make it easier to translate, and to avoid problems with arithmetic
12173 overflow. Change "virtual memory" to "memory" in diagnostic, since
12174 we don't know whether the memory is virtual.
12175
1ce59070
PE
121762005-04-13 Paul Eggert <eggert@cs.ucla.edu>
12177
12178 * NEWS: Bison-generated C parsers now use the _ macro to
12179 translate strings.
12180 * data/yacc.c (_) [!defined _]: New macro.
12181 All English strings wrapped inside this macro.
12182 * doc/bison.texinfo (Bison Parser): Document _.
12183 * po/POTFILES.in: Include src/parse-gram.c, since it now
12184 includes translateable strings that parse-gram.y doesn't.
12185
a749a695
PE
121862005-04-12 Paul Eggert <eggert@cs.ucla.edu>
12187
12188 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
12189 reverting the 2004-10-11 change to this function.
12190 (symbol_check_alias_consistency): Don't call symbol_type_set
12191 if the type name is already correct.
12192 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
12193
8fb1053b
PE
121942005-03-25 Paul Eggert <eggert@cs.ucla.edu>
12195
12196 * tests/regression.at (Token definitions): Don't use a token named
12197 c, as that generates a "#define c ..." that runs afoul of buggy
12198 stdlib.h that uses the identifier c as a member of struct
12199 drand48_data. Problem reported by Horst Wente.
12200
ff498c4a
PE
122012005-03-21 Paul Eggert <eggert@cs.ucla.edu>
12202
12203 * bootstrap: Change translation URL from
12204 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
12205 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
12206 redirection glitches. Problem reported by twlevo@xs4all.nl.
12207
65211d70
PE
122082005-03-20 Paul Eggert <eggert@cs.ucla.edu>
12209
12210 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
12211 after operands; POSIX says this isn't portable for the c99 command.
12212
9577fb1f
PE
122132005-03-18 Paul Eggert <eggert@cs.ucla.edu>
12214
12215 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
12216 immediately if a data overrun has occurred; this may help us track
12217 down what may be a spurious failure on MacOS.
12218
78b178f7
PE
122192005-03-17 Paul Eggert <eggert@cs.ucla.edu>
12220
a2599d0f
PE
12221 Respond to problems reported by twlevo@xs4all.nl.
12222
12223 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
12224
78b178f7
PE
12225 * src/vcg.h: Comment fix.
12226 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
12227 (G_CMAX): Change to -1 instead of INT_MAX.
12228
12229 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 12230
7296e729
PE
122312005-03-15 Paul Eggert <eggert@cs.ucla.edu>
12232
12233 * src/tables.c (state_number_to_vector_number): Put it inside an
12234 "#if 0", since it's not currently used. Problem reported by
12235 Roland McGrath.
12236
05ac60f3
PE
122372005-03-06 Paul Eggert <eggert@cs.ucla.edu>
12238
12239 * src/output.c (escaped_output): Renamed from
12240 escaped_file_name_output, since we now use it for symbol tags as
12241 well. All uses changed.
12242 (symbol_destructors_output, symbol_printers_output):
12243 Escape symbol tags too.
12244 Problem reported by Matyas Forstner in
12245 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
12246
12247 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
12248 not needed.
12249 * src/output.c (user_actions_output, token_definitions_output,
12250 symbol_destructors_output, symbol_printers_output): Likewise.
12251 * src/reader.c (prologue_augment): Likewise.
12252 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
12253
12254 * src/vcg.c (output_edge): Don't quote linestyle arg.
12255 Problem reported by twlevo@xs4all.nl.
12256
7eb453ac
PE
122572005-02-28 Paul Eggert <eggert@cs.ucla.edu>
12258
12259 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
12260 example, reported by Derek M Jones. Also, make the example even
12261 more outrageous, to better illustrate how bad the problem is.
12262
4c04c52a
PE
122632005-02-24 Paul Eggert <eggert@cs.ucla.edu>
12264
12265 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
12266 putsym. Typo reported by Sebastian Piping.
12267
a61e1620
PE
122682005-02-23 Paul Eggert <eggert@cs.ucla.edu>
12269
12270 * doc/bison.texinfo (Language and Grammar): some -> same
12271 (Epilogue): int he -> in the
12272 Typos reported by Sebastian Piping via Justin Pence.
12273
9ec93868
PE
122742005-02-07 Paul Eggert <eggert@cs.ucla.edu>
12275
12276 * tests/glr-regression.at (Improper handling of embedded actions
12277 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
12278 embedded actions and $-N in GLR parsers", work around an Autoconf bug
12279 with dollar signs in test names.
12280 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
12281 for a similar reason.
12282
73ce7e7e
PE
122832005-01-28 Paul Eggert <eggert@cs.ucla.edu>
12284
12285 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
12286 wants to redefine G_VIEW.
12287
2e72b98e
PE
122882005-01-27 Paul Eggert <eggert@cs.ucla.edu>
12289
12290 * src/vcg.c (get_view_str): Remove case for normal_view.
12291 Problem reported by twlevo@xs4all.nl.
12292
e0d634e5
PE
122932005-01-24 Paul Eggert <eggert@cs.ucla.edu>
12294
ccf830a4
PE
12295 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
12296 Problem reported by twlevo@xs4all.nl.
12297
e0d634e5
PE
12298 * doc/bison.texinfo: Change @dircategory from "GNU programming
12299 tools" to "Software development". Requested by Richard Stallman
12300 via Karl Berry.
12301
7bbc8cb0
PE
123022005-01-23 Paul Eggert <eggert@cs.ucla.edu>
12303
12304 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
12305 Problem reported by twlevo@xs4all.nl.
12306
08b770bc
PE
123072005-01-21 Paul Eggert <eggert@cs.ucla.edu>
12308
12309 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
12310 keyword; it's not needed with modern compilers, and it doesn't
12311 affect correctness with older compilers. Suggested by
12312 twlevo@xs4all.nl.
12313
95f22ad2
PE
123142005-01-17 Paul Eggert <eggert@cs.ucla.edu>
12315
12316 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
12317 gcc -Wswitch-default.
12318 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12319 * data/yacc.c (yyparse): Likewise.
12320
d229d15c
PE
123212005-01-12 Paul Eggert <eggert@cs.ucla.edu>
12322
12323 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
12324 already. Let config.h define any nonstandard values.
12325
ecadd90f
PE
123262005-01-10 Paul Eggert <eggert@cs.ucla.edu>
12327
12328 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
12329 for the benefit of slower hosts. Problem reported by
12330 Nelson H. F. Beebe.
12331
213744b5
PE
123322005-01-07 Paul Eggert <eggert@cs.ucla.edu>
12333
12334 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
12335 being defined and not used.
12336 * data/lalr1.cc (yyparse): Likewise.
12337 Use "if (false)" rather than "if (0)".
12338
249d3236
PE
123392005-01-05 Paul Eggert <eggert@cs.ucla.edu>
12340
12341 * TODO: Mention that we should allow NUL bytes in tokens.
12342
987cc1fb
PE
123432005-01-02 Paul Eggert <eggert@cs.ucla.edu>
12344
12345 * src/scan-skel.l (<<EOF>>): Don't close standard output.
12346 Problem reported by Hans Aberg.
12347
08fe02d9
PE
123482005-01-01 Paul Eggert <eggert@cs.ucla.edu>
12349
12350 * src/getargs.c (version): Happy new year; update overall
12351 program copyright date from 2004 to 2005.
12352
12353 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
12354 Problem reported by Hans Aberg.
12355 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
12356 (Output file names.): Add a test for the case when standard output
12357 is closed.
12358
010c0266
PE
123592004-12-26 Paul Eggert <eggert@cs.ucla.edu>
12360
12361 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
12362 to fix an oversight in the Bison 2.0 manual.
12363
da12206a
PE
123642004-12-25 Paul Eggert <eggert@cs.ucla.edu>
12365
12366 * NEWS: Version 2.0. Reformat the existing news items since
12367 1.875, so that related items are grouped together.
3a4734aa 12368 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
12369 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
12370
c935d934
PE
12371 * tests/torture.at (Exploding the Stack Size with Alloca): Set
12372 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
12373 otherwise, we're not testing alloca. Unfortunately there's no
12374 simple way to consult HAVE_ALLOCA here.
12375
da12206a
PE
12376 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
12377 for yymsg, too.
12378
12379 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
12380 hand. This avoids a warning about comparing int to size_t when
12381 GCC warnings are enabled.
12382
0a2c5137
PE
123832004-12-22 Paul Eggert <eggert@cs.ucla.edu>
12384
d7e14fc0
PE
12385 * NEWS: Bison-generated parsers no longer default to using the
12386 alloca function (when available) to extend the parser stack, due
12387 to widespread problems in unchecked stack-overflow detection.
12388 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
12389 responsibility to set it to a positive value. This lets the user
12390 specify a value that is not a preprocessor constant.
12391 * data/yacc.c (YYMAXDEPTH): Likewise.
12392 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
12393 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
12394 to be a compile-time constant. However, explain the constraints on it.
12395 Also, explain the constraints on YYINITDEPTH.
12396 (Table of Symbols): Explain that alloca is no longer the default.
12397 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
12398 to 1.
12399
0a2c5137
PE
12400 * doc/bison.texinfo (Location Default Action): Mention that n must
12401 be zero when k is zero. Suggested by Frank Heckenbach.
12402
e019c247
AD
124032004-12-22 Akim Demaille <akim@epita.fr>
12404
12405 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
12406 (parser::state_type, parser::semantic_type, parser::location_type):
12407 Private, not public.
12408 (parser::parse): Return ints, not bool.
12409 Returning a bool introduces a problem: 0 corresponds to false, and
12410 it seems weird to return false on success. Returning true changes
12411 the conventions for yyparse.
12412 Alternatively we could return void and send an exception.
12413 There is no clear consensus (yet?).
12414 (state_stack, semantic_stack, location_stack): Rename as...
12415 (state_stack_type, semantic_stack_type, location_stack_type): these.
12416 Private, not public.
12417 * tests/c++.at: New.
12418 * tests/testsuite.at, tests/Makefile.am: Adjust.
12419
72731bb7
AD
124202004-12-21 Akim Demaille <akim@epita.fr>
12421
12422 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
12423
9a0d8bec
AD
124242004-12-21 Akim Demaille <akim@epita.fr>
12425
12426 Don't impose std::string for filenames.
12427
12428 * data/lalr1.cc (b4_filename_type): New.
12429 (position::filename): Use it.
12430 (parser.hh): Move the inclusion of stack.hh and location.hh below
12431 the user code, so that needed headers for the filename type can be
12432 included first.
72731bb7
AD
12433 Forward declare them before the user code.
12434 * tests/Makefile.am (check-local, installcheck-local): Pass
12435 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 12436
99880de5
AD
124372004-12-20 Akim Demaille <akim@epita.fr>
12438
12439 Use more STL like names: my_class instead of MyClass.
12440
12441 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
12442 (SemanticStack, SemanticType, StateStack, StateType)
12443 (TokenNumberType, Stack, Slice, Traits, Parser::location)
12444 (Parser::value): Rename as...
12445 (location_stack, location_type, rhs_number_type, semantic_stack)
12446 (semantic_type, state_stack, state_type, token_number_type, stack)
12447 (slice, traits, parser::yylloc, parser::yylval): these.
12448
12449 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
12450
9bec482e
PE
124512004-12-19 Paul Eggert <eggert@cs.ucla.edu>
12452
12453 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
12454 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12455
f6fbd3da
PE
124562004-12-17 Paul Eggert <eggert@cs.ucla.edu>
12457
12458 Remove uses of 'short int' and 'unsigned short int'. This raises
12459 some arbitrary limits. It uses more memory but nowadays that's
12460 not much of an issue.
12461
12462 This change does not affect the generated parsers; that's a different
12463 task, as some users will want to conserve memory there.
12464
12465 Ideally we should use size_t to represent all object counts, and
12466 something like ptrdiff_t to represent signed differences of object
12467 counts; but that will require more code-cleanup than I have the
12468 time to do right now.
12469
12470 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
12471 Use size_t, not int or short int, to count objects.
12472 * src/closure.c (nritemset, closure): Likewise.
12473 * src/closure.h (nritemset, closure): Likewise.
12474 * src/nullable.c (nullable_compute): Likewise.
12475 * src/print.c (print_core): Likewise.
12476 * src/print_graph.c (print_core): Likewise.
12477 * src/state.c (state_compare, state_hash): Likewise.
12478 * src/state.h (struct state): Likewise.
12479 * src/tables.c (default_goto, goto_actions): Likewise.
12480
12481 * src/gram.h (rule_number, rule): Use int, not short int.
12482 * src/output.c (prepare_rules): Likewise.
12483 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
12484 errs, reductions): Likewise.
12485 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
12486 Likewise.
12487 * src/tables.c (vector_number, tally, action_number,
12488 ACTION_NUMBER_MINIMUM): Likewise.
12489 * src/output.c (muscle_insert_short_int_table): Remove.
12490
efeed023
AD
124912004-12-17 Akim Demaille <akim@epita.fr>
12492
12493 * data/lalr1.cc: Extensive Doxygenation.
12494 (error_): Rename as...
12495 (error): this, since it is visible to the user.
12496 Adjust callers.
12497 (Parser::message): Now an automatic variable from...
12498 (Parser::yyreport_syntax_error_): here.
12499 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
12500 Parser::error.
12501 * tests/input.at: Escape $.
12502
bc82c5a5
PE
125032004-12-16 Paul Eggert <eggert@cs.ucla.edu>
12504
12505 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
12506 Parenthesize rhs to avoid obscure problems with mistakes like
12507 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
12508 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12509 b4_rhs_location): Likewise.
12510 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12511 b4_rhs_location): Likewise.
12512
fd19f271
AD
125132004-12-16 Akim Demaille <akim@epita.fr>
12514
12515 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
12516 yacc.c: be sure to stay within yycheck_.
12517 * tests/actions.at: Re-enable C++ tests.
12518
10454ea4
AD
125192004-12-16 Akim Demaille <akim@epita.fr>
12520
12521 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
12522 real.
12523
c5b95ccf
AD
125242004-12-16 Akim Demaille <akim@epita.fr>
12525
12526 Use #define to handle the %name-prefix.
12527
12528 * data/glr.c, data/yacc.c: Comment changes.
12529 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
12530 so that one can refer to yylex in the parser file, and have it
12531 renamed, as is the case with other skeletons.
12532
617a8f12
AD
125332004-12-16 Akim Demaille <akim@epita.fr>
12534
12535 Move lalr1.cc internals into yy*.
12536
12537 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
12538 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
12539 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
12540 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
12541 (empty_, final_, terror_, errcode_, ntokens_)
12542 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
12543 (looka_, ilooka_, error_range_, nerrs_):
12544 Rename as...
12545 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
12546 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
12547 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
12548 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
12549 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
12550 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
12551 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
12552 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
12553 these.
12554
1e547e6e
PE
125552004-12-15 Paul Eggert <eggert@cs.ucla.edu>
12556
12557 Fix some problems reported by twlevo at xs4all.
12558 * src/symtab.c (symbol_new): Report an error if the input grammar
12559 contains too many symbols. This is better than calling abort() later.
12560 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
12561 (struct node, struct graph):
12562 Rename member expand to stretch. All uses changed.
12563 (struct graph): Remove member layoutalgorithm. All uses removed.
12564 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
12565 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
12566 All uses changed.
12567 (N_STRETCH): Rename from N_EXPAND. All uses changed.
12568
735d6bd4
AD
125692004-12-15 Akim Demaille <akim@epita.fr>
12570
12571 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
12572 Add more Doxygen comments.
12573 (symprint_, stack_print_, reduce_print_, destruct_, pop)
12574 (report_syntax_error_, translate_): Rename as...
12575 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
12576 (yypop_, yyreport_syntax_error_, yytranslate_): this.
12577
2e1f5829
AD
125782004-12-15 Akim Demaille <akim@epita.fr>
12579
12580 * data/lalr1.cc (lex_): Rename as...
12581 (yylex_): this.
12582 Move the trace here.
12583 Take the %name-prefix into account.
12584 Reported by Alexandre Duret-Lutz.
12585
a3cb6248
AD
125862004-12-15 Akim Demaille <akim@epita.fr>
12587
12588 Simplify the C++ parser constructor.
12589
12590 * data/lalr1.cc (debug_): Rename as...
12591 (yydebug_): so that the parser's internals are always in the yy*
12592 pseudo namespace.
12593 Adjust uses.
12594 (b4_parse_param_decl): Remove the leading comma as it is now only
12595 called as unique argument list.
12596 (Parser::Parser): Remove the constructor accepting a location and
12597 an initial debugging level.
12598 Remove from the other ctor the argument for the debugging level.
12599 (debug_level_type, debug_level, set_debug_level): New.
12600
12601 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
12602 constructor calls.
12603
07fed891
AD
126042004-12-15 Akim Demaille <akim@epita.fr>
12605
12606 Remove b4_root related material: failure experiment
a3cb6248 12607 (which goal was to allow to derive from a class).
07fed891
AD
12608
12609 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
12610 definitions and uses.
12611
e603eaa5
PE
126122004-12-14 Paul Eggert <eggert@cs.ucla.edu>
12613
12614 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
12615 not 2, since it's not portable to subtract 1 from the start of an
12616 array. The new item 0 is never set or used. All uses changed.
12617
12618 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
12619 the default definition of YYLLOC_DEFAULT. Problem reported
12620 by Frank Heckenbach.
12621
fafb007d
PE
126222004-12-12 Paul Eggert <eggert@cs.ucla.edu>
12623
12624 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
12625 the normal case and one for the error case. Just use the
12626 first one uniformly. Problem reported by Frank Heckenbach.
12627 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
12628 use exactly the same macro in both places.
12629 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
12630 so that the normal-case YYRHSLOC works for the error case too.
12631 All uses changed.
12632 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
12633 (YYLLOC_DEFAULT): Use the same macro as glr.c.
12634 * doc/bison.texinfo (Location Default Action): Don't claim that
12635 we have an array of locations. Use the same macro for both glr
12636 and lalr parsers. Mention YYRHSLOC. Mention what happens when
12637 the index is 0.
12638
48814dcd
PE
126392004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12640
a4e1a53b
PE
12641 * HACKING: Update email addresses to send announcements to.
12642
48814dcd
PE
12643 * configure.ac (AC_INIT): Bump version to 1.875f.
12644
337116ba
PE
126452004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12646
12647 * NEWS: Version 1.875e.
12648 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
12649
12650 * src/scan-skel.l: Include "complain.h", for "fatal".
12651
12652 * src/relation.h (relation_print, relation_digraph):
12653 Relation sizes are of type relation_node, not size_t (this is
12654 merely a doc fix, since the two types are equivalent).
12655 (relation_transpose): Relation sizes are of type relation_node,
12656 not int.
12657 * src/relation.c: Likewise.
12658 (top, infinity): Now of type relation_node, not int.
12659 (traverse, relation_transpose): Use relation_node, not int.
12660
12661 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
12662 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
12663 (yyparse): Remove unused local introduced in 2004-10-25 patch.
12664
12665 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 12666 specifying whether the test should be skipped. Use it tp
337116ba 12667 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 12668 fail on some hosts, and should be skipped.
337116ba 12669
da2a7671
PE
126702004-12-08 Paul Eggert <eggert@cs.ucla.edu>
12671
12672 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
12673 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
12674 unless otherwise specified below.
12675
12676 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
12677 to allocate kernel_base, kernel_items, kernel_size, since
12678 they needn't be initialized to 0.
12679 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
12680 * src/closure.c (new_closure): Likewise, for itemset.
12681 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
12682 * src/lalr.c (set_goto_map): Likewise, for temp_map.
12683 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
12684 (build_relations): Likewise for edge, states1, includes.
12685 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
12686 * src/reader.c (packgram): Likewise, for ritem, rules.
12687 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
12688 * src/relation.c (relation_digraph): Likewise for VERTICES.
12689 (relation_transpose): Likewise for new_R, end_R.
12690 * src/symtab.c (symbols_token_translations_init): Likewise for
12691 token_translations.
12692 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
12693 (token_actions): Likewise for yydefact, actrow, conflrow,
12694 conflict_list.
12695 (save_column): Likewise for froms[symno], tos[symno].
12696 (goto_actions): Likewise for state_count.
12697 (pack_table): Likewise for base, pos, check.
12698 (tables_generate): Likewise for width.
12699
12700 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
12701 for initial core. Just have a separate core, so we needn't worry
12702 about whether kernel_size and kernel_base are initialized.
12703
12704 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
12705 kernel_size, kernel_items): Remove unnecessary initialization.
12706 * src/conflicts.c (conflicts): Likewise.
12707 * src/derives.c (derives): Likewise.
12708 * src/muscle_tablc (muscle_insert): Likewise.
12709 * src/relation.c (relation_digraph): Likewise.
12710 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
12711 conflrow, conflict_table, conflict_list, table, check):
12712 Likewise.
12713
12714 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
12715 This is because all callers pass unsigned int.
12716 * src/closure.h (new_closure): Likewise.
12717
12718 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
12719 (build_relations): Initialize includes[i] in all cases.
12720 * src/reader.c (packgram): Always initialize rules[ruleno].prec
12721 and rules[ruleno].precsym. Initialize members in order.
12722 * src/relation.c (relation_transpose): Always initialize new_R[i]
12723 and end_R[i].
12724 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
12725
12726 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
12727 conflict_list[0] was always 0, but now it isn't initialized.
12728
12729 * src/table.c (table_grow): When conflict_table grew, the grown
12730 area wasn't cleared. Fix this.
12731
12732 * lib/.cvsignore: Add strdup.c, strdup.h.
12733 * m4/.cvsignore: Add strdup.m4.
12734
00baeeac
PE
127352004-12-07 Paul Eggert <eggert@cs.ucla.edu>
12736
12737 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
12738 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
12739 GOTO_NUMBER_MAXIMUM, since we occasionally compute
12740 ngotos + 1 without checking for overflow.
12741 (build_relations): Use END_NODE, not -1, to denote end of edges.
12742 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
12743 build_relations): Use goto_number, not int, for goto numbers.
12744 * src/tables.c (save_column, default_goto): Likewise.
12745
be3d9d42
AD
127462004-11-23 Akim Demaille <akim@epita.fr>
12747
12748 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
12749 of #defining from yystype.
12750 Don't typedef yystype, C++ does not need it.
12751 This lets it possible to forward declare it as union.
12752
78e526d5
PE
127532004-11-23 Paul Eggert <eggert@cs.ucla.edu>
12754
12755 * bootstrap (gnulib_modules): Add extensions.
12756 Problem reported by Jim Meyering.
12757
afbb696d
PE
127582004-11-22 Paul Eggert <eggert@cs.ucla.edu>
12759
12760 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
12761 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
12762 src/system.h, src/tables.c: XFREE -> free, to accommodate
12763 recent change to gnulib xalloc.h.
78e526d5 12764 Problem reported by Jim Meyering.
afbb696d 12765
c1f8f16a
AD
127662004-11-17 Akim Demaille <akim@epita.fr>
12767
12768 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
12769
db7e5eb5 127702004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
12771 Alexandre Duret-Lutz <adl@gnu.org>
12772
12773 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
12774 changes.
12775 (YYCDEBUG): Adjust.
12776 Use it instead of cdebug_.
12777 (Parser::debug_stream, Parser::set_debug_stream): New.
12778 (Parser::symprint_): Define cdebug_ for temporary backward
12779 compatibility.
12780 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
12781 debug_stream ().
12782
68e11668
AD
127832004-11-17 Akim Demaille <akim@epita.fr>
12784
12785 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
12786 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
12787 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
12788 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12789
97cbc73e
PE
127902004-10-27 Paul Eggert <eggert@cs.ucla.edu>
12791
12792 * data/glr.c (yyloc_default): Remove; not used.
12793 Problem reported by Frank Heckenbach.
12794
e342c3be
AD
127952004-10-25 Akim Demaille <akim@epita.fr>
12796
12797 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
12798 Introduce another definition to address simple location arrays.
12799 (yyGLRStack): New member: yyerror_range.
12800 (yyrecoverSyntaxError, yyparse): Update it.
12801 (yyrecoverSyntaxError): Use it when shifting the error token to
12802 have an accurate range, equivalent to the one computed by both
12803 yacc.c and lalr1.cc.
12804 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
12805 that column numbers start at column 0, as per GNU Coding
12806 Standards, the others tests, and the doc.
12807 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
12808 Adjust to the above change (first column is 0).
12809 And adjust the location of the "<error>", now covering the whole
12810 line.
12811
93602feb 128122004-10-22 Akim Demaille <akim@epita.fr>
04098407 12813 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
12814
12815 Remove some arbitrary limits on goto numbers and relations.
12816 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
12817 initial values, since they're never used.
12818 (set_goto_map): ngotos is now unsigned, so test for overflow
12819 by seeing whether it wraps around to zero.
12820 * src/lalr.h (goto_number): Now size_t, not short int.
12821 (GOTO_NUMBER_MAXIMUM): Remove.
12822 * src/relation.c (relation_print, traverse, relation_transpose):
12823 Check for END_NODE rather than looking at sign.
12824 * src/relation.h (END_NODE): New macro.
12825 (relation_node): Now size_t, not short int.
12826
dba08b04
PE
128272004-10-22 Paul Eggert <eggert@cs.ucla.edu>
12828
12829 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
12830 keyword, not an identifier. Problem reported by Baron Schwartz in
12831 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
12832
df09ef2e
AD
128332004-10-11 Akim Demaille <akim@epita.fr>
12834
12835 * src/symtab.c (symbol_check_alias_consistency): Also check
12836 type names, destructors, and printers.
12837 Reported by Alexandre Duret-Lutz.
12838 Recode the handling of associativity and precedence in terms
12839 of symbol_precedence_set.
12840 Accept no redeclaration at all, not even equal to the previous
12841 value.
12842 (redeclaration): New.
12843 Use it to factor redeclaration complaints.
12844 (symbol_make_alias): Don't set the type of the alias, let
12845 symbol_check_alias_consistency do it as for other features.
12846 * src/symtab.h (symbol): Add new member prec_location, and
12847 type_location.
12848 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
12849 * tests/input.at (Incompatible Aliases): New.
12850
146bc99d
PE
128512004-10-09 Paul Eggert <eggert@cs.ucla.edu>
12852
12853 .cvsignore fixes to accommodate gnulib changes,
12854 and the practice of naming build directories "_build".
12855 * .cvsignore: Add "_*". Sort.
12856 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
12857 * m4/.cvsignore: Add "*_gl.m4".
12858
e503aa60
AD
128592004-10-06 Akim Demaille <akim@epita.fr>
12860
12861 * src/parse-gram.y (add_param): Fix the truncation of trailing
12862 spaces.
12863
b4a20338
AD
128642004-10-05 Akim Demaille <akim@epita.fr>
12865
12866 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
12867 whether the reducion was empty or not. This leaves room to
12868 improve the use of YYLLOC_DEFAULT in such a case.
12869 lalr1.cc is still experimental, so changing this is acceptable.
12870 And finally, there are probably not many users who changed the
12871 handling of locations in GLR, so changing is admissible too.
12872
12873 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
12874 empty reduction, set @$ to an empty location ending the previously
12875 stacked symbol.
12876 Adjust uses to make sure the code is triggered on empty
12877 reductions.
12878 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
12879 expected output: empty reductions have empty locations.
12880
f85a5e6f
AD
128812004-09-29 Akim Demaille <akim@epita.fr>
12882
12883 * data/lalr1.cc: Move towards a more standard C++ coding style
12884 for templates: Class < T > -> Class<T>.
12885
b203fc2c
AD
128862004-09-29 Akim Demaille <akim@epita.fr>
12887
12888 * data/lalr1.cc: Reinstall the former ctor, for sake of
12889 compatibility, but warn it will be removed.
12890 Move towards a more standard C++ coding style (i.e., type *var ->
12891 type* var).
12892
5b7e1e73
PE
128932004-09-27 Paul Eggert <eggert@cs.ucla.edu>
12894
3fee967f
PE
12895 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
12896 since it's less likely to work if NULs are involved in the future.
5b7e1e73 12897
0dcca5c2
AD
128982004-09-27 Akim Demaille <akim@epita.fr>
12899
12900 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
12901
6dde1c82
AD
129022004-09-27 Akim Demaille <akim@epita.fr>
12903
12904 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 12905 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
12906 and argument names.
12907 (b4_cc_constructor_call): Likewise.
12908
b233d555
AD
129092004-09-24 Akim Demaille <akim@epita.fr>
12910
12911 * src/parse-gram.y (add_param): Strip the leading and trailing
12912 blanks from a formal argument declaration.
12913 (YY_LOCATION_PRINT): New.
12914
619404e3
AD
129152004-09-24 Akim Demaille <akim@epita.fr>
12916
12917 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
12918 after the location.
12919
dd8d9022
AD
129202004-09-24 Akim Demaille <akim@epita.fr>
12921
12922 * doc/bison.texinfo (Table of Symbols): Sort.
12923
0092f063
AD
129242004-09-21 Akim Demaille <akim@epita.fr>
12925
12926 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
12927 the useless parentheses.
12928 Suggested by Paul Eggert.
12929
451364ed
AD
129302004-09-20 Akim Demaille <akim@epita.fr>
12931
12932 Let the initial-action act on the look-ahead, and use it for the
12933 "initial push" (corresponding to an hypothetical beginning-of-file).
12934 And let lalr1.cc honor %initial-action.
12935
12936 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
12937 example.
12938 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
12939 (Parser::Parser): Remove the ctor that used to initialize it.
12940 (Parser::parse): Like in the other skeletons, issue the "starting
12941 parse" message before any action.
12942 Honor %initial-action.
12943 Initialize the stacks with the lookahead.
12944 * data/yacc.c: Let $$ and @$ in %initial-action designate the
12945 look-ahead.
12946 Push them in the stacks.
12947 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
12948
18d192f0
AD
129492004-09-20 Akim Demaille <akim@epita.fr>
12950
12951 * doc/bison.texinfo (Initial Action Decl): New.
12952
b8458aa5
AD
129532004-09-20 Akim Demaille <akim@epita.fr>
12954
12955 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
12956 clearer criterion to define it.
12957 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
12958 When reducing on an empty RHS, use the latest stacked location as
12959 location.
12960 yylloc is not always available.
12961 * data/glr.c: Likewise.
12962 Also, honor initial-actions.
12963
3fc16193
AD
129642004-09-20 Akim Demaille <akim@epita.fr>
12965
12966 * data/yacc.c (YY_LOCATION_PRINT): New.
12967 Define when we know YYLTYPE's structure, i.e., when the default
12968 YYLLOC_DEFAULT is used.
12969 * data/c.m4 (b4_yysymprint_generate): Use it.
12970 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
12971 value of the result.
12972 (error_start_): Replace with...
12973 (error_range_): this location array.
12974 This allows to replace code relying on the implementation of
12975 locations by portable code.
12976 * data/yacc.c (yylerrsp): Replace with...
12977 (yyerror_range): this.
12978 Every time a token is popped, update yyerror_range[0], to have an
12979 accurate location for the error token.
12980 * data/glr.c (YY_LOCATION_PRINT): New.
12981 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
12982 deference a pointer.
12983 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
12984 report the location in %printers.
12985
12986 * src/scan-skel.l: Instead of abort, report error messages to ease
12987 understanding skeleton scanning failures.
12988
ecfe33e7
AD
129892004-09-16 Akim Demaille <akim@epita.fr>
12990
12991 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
12992 (iterator, const_iterator): these, to be more in the C++ spirit.
12993 Also, return reverse iterators so that when displaying the stack
12994 we display its bottom first.
12995 (Parser::stack_print_, Parser::reduce_print_): Match the messages
12996 from yacc.c.
12997 We should probably use vector here though.
12998
1576d44d
AD
129992004-09-16 Akim Demaille <akim@epita.fr>
13000
13001 Have more complete shift traces.
13002
13003 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
13004 to report Shifts instead of ad hoc YYDPRINTF invocations,
13005 including for the error token.
13006 * data/lalr1.cc (symprint_): Output the location.
13007 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
13008 output the location within the %printer.
13009 Activate GLR tests, at least to make sure they compile properly.
13010 They still don't pass though.
13011 * tests/calc.at: Adjust expect verbose output, since now "Entering
13012 state..." is on a different line than the "Shifting" message.
13013
9c66f418
AD
130142004-09-08 Akim Demaille <akim@epita.fr>
13015
13016 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
13017 Bison directive from the Bison file to the invocation of this
13018 macro, so that these directives are passed to
13019 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
13020 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
13021 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
13022 the extra Bison directives instead of the whole series.
13023 Change the grammar so that there are recoverable errors, and
13024 unrecoverable errors. Now we can have the parser give up before
13025 consuming the whole input. As a result we now can observe that
13026 the lookahead is freed when needed.
13027 Change the parser source to parse argv[1] instead of a hard coded
13028 string.
13029 Simplify yylex, and give a value and location to EOF.
13030 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
13031 passed directives already coded in the file.
13032 Add some tests to check the location of "error".
13033 For some tests, the C++ parser is correct, and not yacc.c.
13034 For other tests, they provide different, but unsatisfying, values,
13035 so keep the C++ value so that at least one parser is "correct"
13036 according to the test suite.
13037 (Actions after errors): Remove, this is subsumed by the
13038 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
13039
52d5733f
AD
130402004-09-06 Akim Demaille <akim@epita.fr>
13041
13042 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 13043 (Parser::pop): New.
52d5733f
AD
13044 Use it.
13045
a0e68930
AD
130462004-09-06 Akim Demaille <akim@epita.fr>
13047
13048 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
13049 argument, an informative message.
13050 Call YY_SYMBOL_PRINT.
13051 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
13052 * data/lalr1.cc (destruct_): Likewise.
13053 In addition, no longer depend on b4_yysymprint_generate and
13054 b4_yydestruct_generate to generate these functions, do it "by
13055 hand".
13056
e757bb10
AD
130572004-09-03 Akim Demaille <akim@epita.fr>
13058
13059 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
13060 invoked, yydestruct the lookahead.
13061 * tests/calc.at (Calculator $1): Update the expected lengths of
13062 traces: there is an added line for the discarded lookahead.
13063 * doc/bison.texinfo (Destructor Decl): Some rewording.
13064 Define "discarded" symbols.
13065
0fe1f06d
AD
130662004-09-02 Akim Demaille <akim@epita.fr>
13067
13068 * data/lalr1.cc (translate_, destruct_): No reason to be static.
13069
284acc8b
AD
130702004-09-02 Akim Demaille <akim@epita.fr>
13071
13072 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
13073 (YYDSYMPRINTF): Rename as...
13074 (YY_SYMBOL_PRINT): this.
13075 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
13076 two.
13077 Use it instead of direct symprint_ calls.
13078 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
13079 one.
13080
a5eb1ed2
AD
130812004-09-02 Akim Demaille <akim@epita.fr>
13082
b7c72fe1
AD
13083 * data/lalr1.cc (b4_yysymprint_generate): New.
13084 (symprint_): New member function, defined when YYDEBUG.
13085 Use it consistently instead of token/nterm debugging output by
13086 hand.
a5eb1ed2
AD
13087 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
13088 %printer calls to use cdebug_ when using lalr1.cc.
13089
417141dd
AD
130902004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
13091
13092 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
13093 with #ifdef YYDEBUG.
13094
2fa09258
AD
130952004-08-26 Akim Demaille <akim@epita.fr>
13096
13097 * doc/bison.texinfo (Implementing Loops): Rename as...
13098 (Implementing Gotos/Loops): this.
13099
9378b508
PE
131002004-08-13 Paul Eggert <eggert@cs.ucla.edu>
13101
13102 Adjust to latest gnulib.
13103 * bootstrap (gnulib_modules): Add xalloc-die.
13104 Set LC_ALL=C so that file names sort consistently.
13105 Prefer the gnulib copies of gettext.m4, glibc21.m4,
13106 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
13107 uintmax_t.m4, ulonglong.m4.
13108 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
13109 po.m4 since we are now using _gl.m4 instead.
13110
87a8ad5c
PE
131112004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
13112
13113 * src/scan-action.l: Remove. Scanning of semantic actions is
13114 handled in scan-gram.l.
13115
dca81a78
PE
131162004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
13117
13118 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
13119
13120 * src/location.h (struct): The file member is a uniqstr.
13121 (equal_boundaries): Use UNIQSTR_EQ for comparison.
13122
c9cbf7c5
PE
131232004-07-22 Paul Eggert <eggert@cs.ucla.edu>
13124
13125 Fix bug with non-%union parsers that have printers or destructors,
13126 which led to a Bison core dump. Reported by Peter Fales in
13127 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 13128
c9cbf7c5
PE
13129 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
13130 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
13131 not to our own type.
13132 * src/output.c (symbol_destructors_output, symbol_printers_output):
13133 Don't assume %union.
13134 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
13135 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
13136 UNION-FLAG. All callers changed.
13137 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
13138 Use type char, not unsigned int, when declaring an array of char;
13139 this lets us remove a cast.
13140 (Printers and Destructors): Add non-%union test cases.
13141
fa7e68c3
PE
131422004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13143
13144 * doc/bison.texinfo: Minor editorial changes, mostly to the new
13145 GLR writeups. E.g., avoid frenchspacing and the future tense,
13146 change "lookahead" to "look-ahead", and change "wrt" to "with
13147 respect to".
2fa09258 13148
fa7e68c3
PE
131492004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13150
13151 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
13152 New sections, split off from the GLR Parsers section. Put the new
13153 Simple GLR Parser near the start of the GLR section, for clarity.
13154 Rewrite connective text.
13155
99a9344e
PE
131562004-06-21 Frank Heckenbach <frank@g-n-u.de>
13157
13158 * doc/bison.texinfo (Simple GLR Parsers): New section.
13159
8dd162d3
PE
131602004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13161
13162 * NEWS, TODO, doc/bison.texinfo:
13163 Use "look-ahead" instead of "lookahead", to be consistent.
13164 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
13165 while we're fixing "look-ahead".
13166 * src/conflicts.c (shift_set): Renamed from shiftset.
13167 (look_ahead_set): Renamed from lookaheadset.
13168 * src/print.c: Likewise.
13169 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
13170 name for "lookahead".
13171 (report_types, usage): Likewise.
13172 * src/getargs.h (report_look_ahead_tokens): Renamed from
13173 report_lookaheads.
13174 * src/lalr.c (compute_look_ahead_tokens): Renamed from
13175 compute_lookaheads.
13176 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
13177 (look_ahead_tokens_print): Renamed from lookaheads_print.
13178 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
13179 state_rule_lookaheads_print.
13180 * src/state.h: Likewise.
13181 (reductions.look_ahead_tokens): Renamed from lookaheads.
13182 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
13183 AT_DATA_LOOKAHEADS_GRAMMAR.
13184
57a90331
PE
131852004-06-03 Paul Eggert <eggert@cs.ucla.edu>
13186
13187 * README: Update location of patched M4 distribution.
13188
8ed3234a
PE
131892004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
13190
13191 Don't assume the C++ compiler takes the same arguments as the C compiler
13192 (trivial change).
13193 * configure.ac (O0CXXFLAGS): New var.
13194 * tests/atlocal.in (CXXFLAGS): Use it.
13195
07971983
PE
131962004-05-29 Paul Eggert <eggert@cs.ucla.edu>
13197
13198 Fix some "make check" problems with C++ reported by
13199 Albert Chin-A-Young for Tru64 C++ in this thread:
13200 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
13201
13202 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
13203 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13204 Output to a .cc file for C++, not to a .c file.
13205 * tests/calc.at (AT_CHECK_CALC): Likewise.
13206 * tests/regression.at (AT_CHECK_DANCER): Likewise.
13207 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
13208
29058652
PE
132092004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
13210
13211 * tests/calc.at, tests/actions.at: Workaround for SGI
13212 C++ compiler. (trivial change)
13213
62cb8a99
PE
132142004-05-27 Paul Eggert <eggert@cs.ucla.edu>
13215
fd418816
PE
13216 Spent a few hours checking out which prerequisite versions the
13217 current sources actually require. I went all the way back to
13218 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
13219 a seemingly endless set of combinations of versions more recent
13220 than that. The bottom line is that the current sources require
13221 fairly recent versions of the build tools, and it'll be some work
13222 to change this.
13223 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
13224 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
13225 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
13226 Add comments explaining why those particular versions are
13227 currently needed.
2fa09258 13228
62cb8a99
PE
13229 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
13230 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 13231 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
13232
13233 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
13234 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
13235
caa52c10
PE
132362004-05-26 Paul Eggert <eggert@cs.ucla.edu>
13237
13238 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
13239 0.11.5. Suggested by Bruno Haible.
13240 * bootstrap: Remove gettext version checking.
13241
13242 * doc/bison.texinfo (Decl Summary): Also mention that %union
13243 can depend on prerequisite types. Problem reported by Tim
13244 Van Holder.
13245
4bfd5e4e
PE
132462004-05-25 Paul Eggert <eggert@cs.ucla.edu>
13247
2cef3017
PE
13248 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
13249 * README-alpha: Don't tell people not to package this.
13250
b9c85d5c
PE
13251 * bootstrap: Don't assume $(...) works; use `...` instead.
13252 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
13253 gettext better.
13254
4bfd5e4e
PE
13255 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
13256 put into the -d output file, and mention what to do if YYSTYPE is
13257 defined as a macro.
13258
6a36ff94
PE
132592004-05-24 Paul Eggert <eggert@cs.ucla.edu>
13260
6712933e
PE
13261 Undo change made earlier today: it caused autopoint to not bring
13262 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
13263 autopoint's.
13264
13265 * bootstrap: Check that gettext version matches what's in
13266 configure.ac. Warn users to ignore robots.txt ERROR 404.
13267 * bootstrap: Undo today's earlier change (logged below).
13268 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 13269
6a36ff94
PE
13270 The gettext version checking is causing more trouble than it's
13271 curing; remove it. Problem reported by Paul Hilfinger.
13272
13273 * bootstrap: Issue a warning that one can expect a message
13274 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
13275 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
13276
209ea708
PE
132772004-05-23 Paul Eggert <eggert@cs.ucla.edu>
13278
13279 Ensure that the C++ compiler used for testing actually works on a
13280 simple test program; if not, skip the C++-related tests. Problem
13281 reported by Vin Shelton in:
161a71f3 13282 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
13283
13284 * m4/cxx.m4: New file.
13285 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
13286 * tests/atlocal.in (BISON_CXX_WORKS): Add.
13287 * tests/local.at (AT_COMPILE_CXX): Use it.
13288
41ca2549
PE
132892004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13290
383e69dc
PE
13291 * data/glr.c (yylloc): Output this macro even if locations are not
13292 being generated, as the GLR parser needs it even in that case.
13293 Problem reported by Troy A. Johnson
13294 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
13295
41ca2549
PE
13296 * configure.ac (AC_INIT): Update to 1.875e.
13297
e476c87d
PE
132982004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13299
13300 * NEWS: Version 1.875d.
13301 * configure.ac (AC_INIT): Likewise.
13302 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
13303
13304 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
13305 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
13306 lalr1.cc runs afoul of the first, and the last two are no longer
13307 supported by GCC 3.4.0.
13308 * README: Mention GNU m4 1.4 or later; mention m4 patches.
13309 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
13310
233a88ad
PE
133112004-05-06 Paul Eggert <eggert@cs.ucla.edu>
13312
13313 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
13314 unsigned int, for compatibility with latest gnulib hash module.
13315 * src/state.c (state_hash, state_hasher): Likewise.
13316 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
13317 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 13318
12ffdd28
PE
133192004-05-03 Paul Eggert <eggert@cs.ucla.edu>
13320
13321 * NEWS: Unescaped newlines are no longer allowed in char & strings.
13322
13323 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
13324 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
13325 character and string literals.
13326 (unexpected_end): New function.
13327 (unexpected_eof): Use it.
13328 (unexpected_newline): New function.
13329 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
13330 actions.
e476c87d 13331
12ffdd28
PE
13332 * NEWS: Document %expect-rr.
13333
13334 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
13335 Fix typo by replacing $1 with $option.
13336 Remove more 'intl'-related files.
9668e2be 13337 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
13338
13339 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
13340 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
13341 strtoul.c.
13342 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
13343 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
13344 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
13345 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
13346 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
13347 * src/.cvsignore: Add *.output.
13348
13349 * src/parse-gram.y: Put copyright notice inside %{ %} so it
13350 gets copied to the output file.
e476c87d 13351
1f65350a
PE
133522004-04-28 Paul Eggert <eggert@twinsun.com>
13353
13354 Get files from the gnulib and po repositories, instead of relying
13355 on them being in our CVS. Upgrade to latest versions of gnulib
13356 and Automake.
13357
13358 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
13359 * bootstrap: Bootstrap from gnulib and po repositories.
13360 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
13361 * README-cvs: Document these changes. Remove version numbers from
13362 mentions of build tools, since they change so often. Mention Flex.
13363
13364 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
13365 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
13366 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
13367 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 13368 does this for us.
12ffdd28
PE
13369 (AC_ISC_POSIX): Remove; we no longer support this
13370 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
13371 (AC_HEADER_STDC): Remove: we now assume C89 or better.
13372 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
13373 Do not check for C89 headers, except for locale.h which is used
13374 by the Yacc library and must port to K&R hosts.
13375 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
13376 Do not check for C89 functions, except for setlocale which is
13377 used by the Yacc library.
13378 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
13379 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
13380 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
13381 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
13382 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
13383 AM_GNU_GETTEXT): Remove; now done by:
13384 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
13385 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
13386 for us.
13387
13388 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
13389 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
13390 Define to empty, as gnulib.mk will do the rest for us.
13391 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
13392 for us.
13393 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
13394 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
13395
13396 * src/files.c: Include gnulib's xstrndup.h.
13397
13398 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
13399 (REALLOC): Use xnrealloc, for likewise.
13400 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
13401 (strnlen, memrchr): Remove decls; functions no longer used.
13402 Include <stpcpy.h>.
13403
13404 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
13405 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
13406 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
13407 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
13408 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
13409 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
13410 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
13411 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
13412 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
13413 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
13414 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
13415 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13416 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
13417 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
13418 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
13419 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
13420 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
13421 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
13422 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
13423 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
13424 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
13425 Remove, as these files are now generated automatically
13426 by bootstrap or automake.
13427
13428 * po/ChangeLog: Remove: all but one entry was a duplicate
13429 of this file, and I moved that 2000-11-02 entry here.
13430
13431 * config/.cvsignore: Add Makefile, depcomp, install-sh.
13432 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
13433 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
13434 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
13435 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
13436 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
13437 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
13438 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
13439 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
13440 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
13441 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
13442 xstrndup.h.
13443 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
13444 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
13445 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
13446 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
13447 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
13448 * src/.cvsignore: Remove *_.c.
13449
13450
13451 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
13452 support it. (The latest stable gzip doesn't.)
13453
134542004-04-27 Paul Eggert <eggert@twinsun.com>
13455
13456 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
13457 case, as stos_ is now used by destructors due to the 2004-02-09
13458 change.
13459
13460 Remove more K&R C support.
13461 * lib/libiberty.y (PARAMS): Remove. All uses removed.
13462 * lib/subpipe.c (errno): Remove decl.
13463 Include <stdlib.h> unconditionally.
13464 (EXIT_FAILURE): Remove macro.
13465 * src/complain.c (vfprintf, strerror): Remove.
13466 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
13467 unconditionally.
13468 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
13469 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
13470 (strchr, strspn, memchr): Remove decls.
13471 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
13472 unconditionally. Do not declare perror.
13473 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
13474 unconditionally.
13475
13476 * src/complain.c (_): Remove useless defn, as system.h defines this.
13477
13478 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
13479 with latest obstack.h.
13480 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
13481 to procedure types, as obstack.h now does that for us.
13482 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
13483
13484 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
13485 so that this include file can stand alone.
13486 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
13487 does this now. Include subpipe.h first after config.h, to
13488 test whether it can stand alone.
13489
13490 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
13491 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
13492 unused declaration.
13493
13494 * tests/synclines.at (%union synch line): Put a dummy member in
13495 the union, because empty unions aren't allowed in C. Caught
13496 by GCC 3.4.0.
13497
4f16766c
PE
134982004-04-13 Jim Meyering <jim@meyering.net>
13499
13500 * src/conflicts.c (conflicts_print): Correct format string typo:
13501 use `%%' to produce literal `%'. (trivial change)
13502
779e7ceb
PE
135032004-03-30 Paul Eggert <eggert@twinsun.com>
13504
13505 * src/getargs.c (version): Update copyright year to 2004.
13506
13507 * data/c.m4 (b4_int_type): Use 'short int' rather than
13508 'short', and similarly for 'long', 'unsigned', etc.
13509 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
13510 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
13511 yy_yypstack, yydumpstack): Likewise.
13512 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
13513 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
13514 Likewise.
13515 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
13516 yy_stack_print, yyparse): Likewise.
13517 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
13518 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
13519 * lib/bitset.c (bitset_print): Likewise.
13520 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
13521 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13522 * lib/bitsetv.c (bitsetv_dump): Likewise.
13523 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
13524 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
13525 Likewise.
13526 * src/LR0.c (allocate_itemsets): Likewise.
13527 * src/gram.h (rule_number, rule): Likewise.
13528 * src/lalr.h (goto_number): Likewise.
13529 * src/nullable.c (nullable_compute): Likewise.
13530 * src/output.c (prepare_rules): Likewise.
13531 * src/relation.c (relation_print, relation_digraph): Likewise.
13532 * src/relation.h (relation_node): Likewise.
13533 * src/state.h (state_number, transitions, errs, reductions,
13534 struct state): Likewise.
13535 * src/symtab.h (symbol_number, struct symbol): Likewise.
13536 * src/tables.c (vector_number, tally, action_number,
13537 default_goto, goto_actions): Likewise.
13538 * tests/existing.at (GNU Cim Grammar): Likewise.
13539 * tests/regression.at (Web2c Actions): Likewise.
13540
13541 * src/output.c (muscle_insert_short_int_table): Renamed from
13542 muscle_insert_short_table. All uses changed.
13543
d6328241
PH
135442004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
13545
13546 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
13547 (declaration): Replace expected_conflicts with expected_sr_conflicts.
13548 Add %expect-rr rule.
4f16766c 13549
d6328241
PH
13550 * src/scan-gram.l: Recognize %expect-rr.
13551
4f16766c 13552 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 13553 expected_conflicts.
4f16766c 13554 (expected_rr_conflicts): Declare.
d6328241
PH
13555
13556 * src/conflicts.c (expected_sr_conflicts): Rename from
13557 expected_conflicts.
13558 (expected_rr_conflicts): Define.
13559 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
13560 for GLR parsers.
13561 Use expected_sr_conflicts in place of expected_conflicts.
13562 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 13563
d6328241 13564 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 13565
1452af69
PE
135662004-03-08 Paul Eggert <eggert@gnu.org>
13567
13568 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 13569 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
13570
13571 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
13572 in lalr1.cc.
13573 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
13574 * src/scan-gram.l (scan_integer): New function.
13575 ({int}): Use it.
13576 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
13577 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
13578 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
13579 Say "long int", not "long", for uniformity with GNU style.
13580
006d217d
PE
135812004-02-25 Paul Eggert <eggert@twinsun.com>
13582
13583 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
13584 compilers. This fixes a problem with Intel's C++ compiler being
13585 chatty, reported by Guido Trentalancia in
161a71f3 13586 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 13587
c2729758
ADL
135882004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
13589
13590 Support %destructor and merge error locations in lalr1.cc.
13591
13592 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
13593 (Parser::stos_): Define unconditionally.
13594 (Parser::destruct_): New method. Generate its body with
13595 b4_yydestruct_generate.
13596 (Parser::error_start_): New attribute.
13597 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
13598 token which are discarded.
13599 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
13600 error_start_ when erroneous token are discarded.
13601 (Parser::parse) <yyerrlab1>: Compute the location of the error
13602 token so that it covers all the discarded tokens.
13603 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
13604 it can be called with `%skeleton "lalr1.cc"', and do that.
13605
dd0e0635
PE
136062004-02-02 Paul Eggert <eggert@twinsun.com>
13607
13608 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
13609 $(top_srcdir)/lib and ../lib. This fixes a bug reported
13610 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
13611 There's no need to mention top_builddir since Automake does that
13612 for us.
13613 (INCLUDES): Remove, as Automake says it's obsolescent.
13614 Contents migrated into AM_CPPFLAGS as described above.
13615 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
13616
136172004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13618
13619 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
13620 (yyreportSyntaxError): Handle case where lookahead token is
13621 YYEMPTY.
13622
be16239b
PH
136232004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13624
13625 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
13626 resulting parsers are compilable with C++.
13627
5fa90832
PE
136282003-12-23 Paul Eggert <eggert@twinsun.com>
13629
13630 * config/depcomp, config/install-sh: Sync with Automake 1.8.
13631 * src/output.c (output_skeleton): Rename local var.
13632 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
13633 Bison tokens, as this runs afoul of the 2003-10-07 change that
13634 disallowed NUL bytes in character constants or string literals.
13635
13636 * tests/local.at: Require Autoconf 2.59's Autotest.
13637 * tests/testsuite.at: Don't include local.at, since we now assume
13638 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
13639 including it.
13640 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
13641 multiple inclusion warnings.
dd0e0635 13642
b165c324
AD
136432003-12-02 Akim Demaille <akim@epita.fr>
13644
13645 * doc/bison.texinfo (How Can I Reset the Parser): More about start
13646 conditions.
13647 From Bruno Haible.
13648
26e06a21
ADL
136492003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
13650
13651 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
13652
92ac3705
PE
136532003-10-07 Paul Eggert <eggert@twinsun.com>
13654
6a5ecb38
PE
13655 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
13656 if testsuite doesn't exist.
13657
92ac3705
PE
13658 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
13659 literals, unfortunately.
13660 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
13661 Complain about NUL bytes in character constants or string literals.
13662
91d2c560
PE
136632003-10-05 Paul Eggert <eggert@twinsun.com>
13664
13665 * NEWS: Don't document %no-default-prec, as it's still
13666 too experimental.
13667 * doc/bison.texinfo: Document %no-default-prec only if
13668 the defaultprec flag is set. Normally it's not.
13669
0cc3da3a
PE
136702003-10-04 Paul Eggert <eggert@twinsun.com>
13671
13672 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
13673 non-modifiable lvalue, instead of a modifiable one.
13674 * doc/bison.texinfo (Actions): Document that $$ can
13675 be assigned to. Do not claim that $$ and $N are
13676 array element references: user code should not rely on this.
13677
22fccf95
PE
136782003-10-01 Paul Eggert <eggert@twinsun.com>
13679
13680 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
13681 (grammar_declaration): Use it.
13682 * src/scan-gram.l: New token %no-default-prec.
13683 * tests/conflicts.at: Revamp tests to use %no-default-prec.
13684 * NEWS, doc/bison.texinfo: Document the above.
13685
fc8f2965
AD
136862003-10-01 Akim Demaille <akim@epita.fr>
13687
13688 VCG no longer supports long_straight_phase.
13689
13690 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
13691 * src/print_graph.c (print_graph): Adjust.
13692
39a06c25
PE
136932003-09-30 Frank Heckenbach <frank@g-n-u.de>
13694 and Paul Eggert <eggert@twinsun.com>
13695
13696 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
13697 Table of Symbols): Document %default-prec.
13698 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
13699 (grammar_declaration): Set default_prec on %default-prec.
13700 * src/scan-gram.l (%default-prec): New token.
13701 * src/reader.h (default_prec): New flag.
13702 * src/reader.c: Likewise.
13703 (packgram): Handle it.
13704 * tests/conflicts.at (%default-prec without %prec,
13705 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 13706
39a06c25
PE
137072003-09-30 Paul Eggert <eggert@twinsun.com>
13708
13709 * tests/testsuite.at: Include local.at, not input.at, fixing
13710 a typo in the 2003-08-25 patch.
13711
62b6aef9
AD
137122003-08-27 Akim Demaille <akim@epita.fr>
13713
13714 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
13715 GCC warnings.
13716
89e1cc61
AD
137172003-08-26 Akim Demaille <akim@epita.fr>
13718
13719 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
13720 "<\#" to avoid magic from Gnus when posting parts of this script.
13721
a08460b0
AD
137222003-08-26 Akim Demaille <akim@epita.fr>
13723
13724 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
13725 (Parser::parse): here.
13726 Adjust: nerrs and errstatus is now replaced by...
13727 (Parser::nerrs_, Parser::errstatus_): New.
13728
603f1cfd
AD
137292003-08-25 Akim Demaille <akim@epita.fr>
13730
13731 * config/announce-gen, Makefile.cfg: New.
13732 * Makefile.am: Adjust.
13733 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
13734 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
13735
cd3684cf
AD
137362003-08-25 Akim Demaille <akim@epita.fr>
13737
13738 When reducing initial empty rules, Bison parser read an initial
13739 location that is not defined. This results in garbage, and that
13740 affects Bison's own parser. Therefore we need (i) to extend Bison
13741 to support a means to initialize this location, and (ii) to use
13742 this CVS Bison to fix CVS Bison's parser.
13743
13744 * src/reader.h, reader.c (epilogue_augment): Remove, replace
13745 with...
13746 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
13747 * src/parse-gram.y: Adjust.
13748 (%initial-action): New.
13749 (%error-verbose): Since we require CVS Bison, there is no reason
13750 not to use it.
13751 * src/scan-gram.l: Adjust.
13752 * src/Makefile.am (YACC): New, to make sure we use our own parser.
13753 * data/yacc.c (yyparse): Use b4_initial_action.
13754
4e03e201
AD
137552003-08-25 Akim Demaille <akim@epita.fr>
13756
13757 * doc/bison.texinfo: Don't promote stdout for error messages.
13758
8c182d05
AD
137592003-08-25 Akim Demaille <akim@epita.fr>
13760
13761 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
13762 From Alexandre Duret-Lutz.
13763
6a60c4cf
PE
137642003-08-25 Akim Demaille <akim@epita.fr>
13765
13766 Version 1.875c.
13767
25f66e1a
AD
137682003-08-25 Akim Demaille <akim@epita.fr>
13769
13770 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
13771 Use them.
13772
5348bfbe
AD
137732003-08-25 Akim Demaille <akim@epita.fr>
13774
13775 * data/lalr1.cc (Parser::reduce_print_): New.
13776 Use it.
13777
47301314
AD
137782003-08-25 Akim Demaille <akim@epita.fr>
13779
13780 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
13781 error recovery loops. This patch is based on
161a71f3 13782 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
13783 Also, augment the similarity between lalr1.cc and yacc.c.
13784 Note: the locations of error recovery rules are not correct yet.
13785
13786 * data/lalr1.cc: Comment changes to augment the similarity between
13787 lalr1.cc and yacc.c.
13788 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
13789 (yyerrlab1): Remove, but where it used to be (now the bottom part of
13790 yyerrlab), when hitting EOF, pop the whole stack here instead of
13791 merely falling thru the default error handling mechanism.
13792 (yyerrorlab): New label, with the old contents of YYERROR,
13793 plus the following change: pop the stack of rhs corresponding
13794 to the production that invoked YYERROR. That is how Yacc
13795 behaves (required by POSIX).
13796 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
13797 fail.
13798
1f7a61ff
AD
137992003-08-25 Akim Demaille <akim@epita.fr>
13800
13801 Tune local.at so that people can "autom4te -l autotest calc.at -o
13802 calc" for instance, to extract a sub test suite.
13803
13804 * tests/testsuite.at: Move the initialization, Autotest version
13805 requirement, and AT_TESTED invocation into...
13806 * tests/local.at: here.
13807 * tests/testsuite.at: Include it for compatibility with Autoconf
13808 2.57.
13809 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
13810 be ignore.
13811
327b5b56
PE
138122003-08-04 Paul Eggert <eggert@twinsun.com>
13813
13814 Rework code slightly to avoid gcc -Wtraditional warnings.
13815 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
13816 The returned value is now stored in *YY0. All callers changed.
13817 * src/output.c (merge_output): Adjust to the above change.
13818
0051e3ed
PE
138192003-07-26 Paul Eggert <eggert@twinsun.com>
13820
13821 * data/glr.c (YYASSERT): New macro.
13822 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
13823 yyresolveStates, yyprocessOneStack):
13824 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
13825 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 13826
137437c6
PE
138272003-07-25 Paul Eggert <eggert@twinsun.com>
13828
5b620e06
PE
13829 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
13830 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 13831 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
13832 by Frank Heckenbach, though I have omitted the structure-initialization
13833 part of his glr-knr.diff patch since I recall that the Portable
13834 C Compiler didn't require that change.
13835
137437c6
PE
13836 Let the user specify how to allocate and free memory.
13837 Derived from a suggestion by Frank Heckenbach in
161a71f3 13838 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
13839 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
13840 All uses of free, malloc, realloc changed to use these macros,
13841 and unnecessary casts removed.
13842 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
13843
ddb85ca5
PE
138442003-07-06 Matthias Mann <MatthiasMann@gmx.de>
13845
13846 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
13847 use s.empty() rather than s == "" to test for empty string; see
161a71f3 13848 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
13849 (trivial change)
13850
39910e09
AD
138512003-06-25 Akim Demaille <akim@epita.fr>
13852
13853 * config/depcomp, config/install-sh: Update from masters.
13854
0ae99356
PE
138552003-06-20 Paul Eggert <eggert@twinsun.com>
13856
13857 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
13858 and return properly parenthesized result.
13859 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
13860 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
13861 Remove unnecessary parentheses from uses.
13862 * doc/bison.texinfo (Location Default Action): Describe the
13863 conventions for parentheses.
13864
cd05d13c
PE
138652003-06-19 Paul Eggert <eggert@twinsun.com>
13866
81fd08ca
PE
13867 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
13868 yyreportTree): Do not assume that size_t is the same width as int,
13869 when printing sizes. Print sizes using an unsigned format.
13870 Problem reported by Frank Heckenbach in
161a71f3 13871 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 13872
cd05d13c
PE
13873 Port to Forte Developer 7 C compiler.
13874 * data/glr.c (struct YYLTYPE): If locations are not being used,
13875 declare a single dummy member, as empty structs do not conform
13876 to the C standard.
13877 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
13878 the Forte Developer 7 C compiler complains that end-of-loop
13879 code is not reached.
13880
4dcf140b
PE
138812003-06-17 Paul Eggert <eggert@twinsun.com>
13882
13883 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
13884 avoid warnings from picky compilers about redefinition of PARAMS.
13885
8dd76bee
PE
138862003-06-17 Paul Eggert <eggert@twinsun.com>
13887
13888 Version 1.875b.
13889
13890 * NEWS: Document 1.875b.
13891
13892 * lib/bbitset.h: Do not include config.h; that's the includer's job.
13893 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
13894 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
13895 Don't use 'index' in comments, as it's a builtin fn on some hosts.
13896 * lib/bitset_stats.c: Include gettext.h unconditionally, as
13897 per recent gettext manual's suggestion.
13898 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
13899 Use prototypes, not old-style definitions.
13900 * lib/lbitset.c (lbitset_unused_clear): Likewise.
13901 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
13902 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
13903 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
13904 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
13905 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
13906 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
13907 vbitset_or_and_cmp, vbitset_copy): Likewise.
13908
13909 * lib/libiberty.h: Do not include config.h; that's the includer's job.
13910 Do not include <stdlib.h>.
13911 (PARAMS): Define unconditionally for C89.
13912 (ATTRIBUTE_NORETURN): Remove.
13913 (ATTRIBUTE_UNUSED): Define unconditionally.
13914
13915 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 13916 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
13917 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
13918 * lib/vbitset.c, lib/vbitset.h: New files.
13919 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13920 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
13921 from libbitset.
13922
13923 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
13924 `How Can I Reset @code{yyparse}', since texinfo does not allow
13925 arbitrary @ in node names.
13926
13927 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
13928 shouldn't be needed according to the gettext 0.12.1 documentation
13929 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 13930 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 13931 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 13932 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 13933
8dd76bee
PE
13934 * lib/.cvsignore: Add stdbool.h.
13935 * m4/.cvsignore: Add nls.m4, po.m4.
13936
13937 Upgrade to CVS gnulib.
13938 * stdbool_.h: File renamed from stdbool.h.in.
13939 * configure.ac (AM_STDBOOL_H): Invoke this instead of
13940 AC_HEADER_STDBOOL.
13941 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
13942 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
13943 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
13944 (MOSTLYCLEANFILES): New var.
13945 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
13946 (stdbool.h): New rule.
13947 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
13948 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
13949 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
13950 m4/quote.m4: Upgrade to today's gnulib.
13951
13952 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
13953 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
13954 the tests right now.
13955 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
13956 yyerror are declared before use; C99 requires this.
13957
25005f6a
PH
139582003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13959
13960 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
13961 first.
13962 (yyrecoverSyntaxError): Correct the logic for setting and testing
13963 yyerrState.
13964 Correct comment on handling EOF.
13965 Allow states with only a default reduction, rather than failing
8dd76bee 13966 (I can't quite reconstruct why these were not allowed before).
25005f6a 13967
137437c6 13968 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 13969 buffer overruns, corrupting state.
8dd76bee
PE
13970
13971 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
13972 definition.
13973 * src/reader.h (max_left_semantic_context): New variable declaration.
13974 * src/scan-gram.l (max_left_semantic_context): Define.
13975 (handle_action_dollar): Update max_left_semantic_context.
13976 * data/glr.c (YYMAXLEFT): New definition.
13977 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
13978 (yyresolveAction): Ditto.
13979
13980 Fixes to problems with location handling in GLR parsers reported by
13981 Frank Heckenbach (2003/06/05).
13982
13983 * data/glr.c (YYLTYPE): Make trivial if locations not used.
13984 (YYRHSLOC): Add parentheses, and define only if locations used.
13985 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
13986 locations not used.
13987 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
13988 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 13989
25005f6a
PH
13990 * tests/cxx-type.at: Exercise location information; update tests
13991 to differentiate output with and without locations.
8dd76bee 13992 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
13993 because default YYLTYPE not yet defined.
13994 Change semantic actions to compute strings, rather than printing
13995 them directly (to test proper passing of semantics values). Change
13996 output to prefix notation and update test data and expected results.
13997 (yylex): Track locations.
13998 (stmtMerge): Return value rather than printing, and include arguments
13999 in value.
8dd76bee 14000
711f40b7
PE
140012003-06-03 Paul Eggert <eggert@twinsun.com>
14002
14003 Avoid warnings generated by GCC 2.95.4 when Bison is
14004 configured with --enable-gcc-warnings.
14005 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
14006 yy::]b4_parser_class_name[::translate_,
14007 yy::Stack::operator[] (unsigned),
14008 yy::Stack::operator[] (unsigned) const,
14009 yy::Slice::operator[] (unsigned),
14010 yy::Slice::operator[] (unsigned) const):
14011 Rename local vars to avoid warnings.
14012 * tests/glr-regression.at (Improper handling of embedded actions
14013 and $-N in GLR parsers): Remove unused local variable from yylex.
14014 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
14015 (void) as arg when not pure, since we now assume C89 when building
14016 Bison. Pacify GCC by using parameter.
14017
ac695f7d
PE
140182003-06-02 Paul Eggert <eggert@twinsun.com>
14019
14020 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
14021 yy::Location::lines, yy::Location::columns): Rename arguments
14022 to avoid shadowing; this removes a warning generated by GCC 3.3.
14023
26ec81e0
PE
140242003-06-01 Paul Eggert <eggert@twinsun.com>
14025
14026 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
14027 to g++, as GCC 3.3 complains if you do it.
14028 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
14029 everything that WARNING_CFLAGS has, except omit warnings
14030 not suitable for C++.
14031 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
14032 * tests/atlocal.in (CXXFLAGS): New var.
14033 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
14034
14035 Fix a GLR parser bug I reported in February; see
161a71f3 14036 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
14037 The problem was that GLR parsers did not conform to the C standard,
14038 because actions like { $1 = $2 + $3; } expanded to expressions
14039 that invoked YYFILL in separate subexpressions, and YYFILL assigned
14040 to a local variable. The C standard says that expressions
14041 like (var = f ()) + (var = f ()) have undefined behavior.
14042 Another problem was that GCC sometimes issues warnings that
14043 yyfill and its parameters are unused.
14044
14045 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
14046 as possibly unused.
14047 (yyfill): New function.
14048 (YYFILL): Use it.
14049 (yyuserAction): Change type of yynormal to bool, so that it matches
14050 the new yyfill signature. Mark it as possibly unused.
14051
14052
14053 Follow up on a bug I reported in February, where a Bison-generated
14054 parser can loop. Provide a test case and a fix for yacc.c. I
14055 don't have a fix for lalr1.cc or for glr.c, unfortunately.
14056 The original bug report is in:
161a71f3 14057 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
14058
14059 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
14060 macro's size was becoming unwieldy.
14061 (yyerrlab): Do not discard an empty lookahead symbol, as this
14062 might destroy garbage.
14063 (yyerrorlab): New label, with the old contents of YYERROR,
14064 plus the following change: pop the stack of rhs corresponding
14065 to the production that invoked YYERROR. That is how Yacc
14066 behaves, and POSIX requires this behavior.
14067 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
14068 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
14069 Define 'alarm' to do nothing if unistd.h is not available.
14070 Add a new rule "exp: '-' error;" to test the above change to
14071 data/yacc.c. Use 'alarm' to abort any test taking longer than
14072 10 seconds, as it's probably looping.
14073 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
14074 Also, the new yacc.c generates two fewer diagnostics for an
14075 existing test.
14076
d0829076
PE
140772003-05-24 Paul Eggert <eggert@twinsun.com>
14078
c6ae27df
PE
14079 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
14080 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
14081 This fixes a problem reported by John Bowman when the Compaq/HP
14082 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
14083 -ansi -Wall -gall).
14084 * data/yacc.c (union yyalloc): Likewise.
14085 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 14086
d0829076
PE
14087 Switch from 'int' to 'bool' where that makes sense.
14088
14089 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
14090 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
14091 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
14092 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
14093 Return or accept bool, not int. All callers changed.
14094 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
14095 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
14096 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
14097 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
14098 bitset_or_and_cmp_): Likewise.
14099 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
14100 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
14101 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
14102 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
14103 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
14104 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
14105 bitset_stats_or_and_cmp): Likewise.
14106 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
14107 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
14108 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
14109 ebitset_xor_cmp): Likewise.
14110 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
14111 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
14112 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
14113 lbitset_xor_cmp): Likewise.
14114 * lib/bbitset.h: Include <stdbool.h>.
14115 (struct bitset_vtable): The following members now return bool, not
14116 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
14117 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
14118 or_and_cmp).
14119 * src/conflicts.c (count_rr_conflicts): Likewise.
14120 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
14121 All uses changed.
14122 * lib/ebitset.c (ebitset_obstack_init): Likewise.
14123 * lib/lbitset.c (lbitset_obstack_init): Likewise.
14124 * src/getargs.c (debug_flag, defines_flag, locations_flag,
14125 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14126 graph_flag): Likewise.
14127 * src/getargs.h (debug_flag, defines_flag, locations_flag,
14128 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14129 graph_flag): Likewise.
14130 * src/output.c (error_verbose): Likewise.
14131 * src/output.h (error_verbose): Likewise.
14132 * src/reader.c (start_flag, typed): Likewise.
14133 * src/reader.h (typed): Likewise.
14134 * src/getargs.c (LOCATIONS_OPTION): New constant.
14135 (long_options, getargs): Use it.
14136 * src/lalr.c (build_relations): Use bool, not int.
14137 * src/nullable.c (nullable_compute): Likewise.
14138 * src/print.c (print_reductions): Likewise.
14139 * src/tables.c (action_row, pack_vector): Likewise.
14140 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
14141 * src/output.c (prepare): Use it.
14142 * src/output.c (token_definitions_output,
14143 symbol_destructors_output, symbol_destructors_output): Use string,
14144 not boolean integer, to keep track of whether to output separator.
14145 * src/print_graph.c (print_core): Likewise.
14146 * src/state.c (state_rule_lookaheads_print): Likewise.
14147
14148 * config/install-sh: Sync from automake 1.7.5.
14149
6b2584b7
PE
141502003-05-14 Paul Eggert <eggert@twinsun.com>
14151
14152 * src/parse-gram.y (rules_or_grammar_declaration): Require a
14153 semicolon after a grammar declaration, in the interest of possible
14154 future changes to the Bison input language.
14155 Do not allow a stray semicolon at the start of the grammar.
14156 (rhses.1): Allow one or more semicolons after any rule, including
14157 just before "|" as required by POSIX.
14158 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
14159 grammar.
14160
caf37a36
ADL
141612003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
14162
14163 %parse-param support for lalr1.cc.
14164
14165 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
14166 b4_cc_constructor_calls, b4_cc_constructor_call,
14167 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
14168 definitions.
14169 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
14170 parse-param arguments.
14171 (yy::b4_parser_class_name): Declare instance variables to
14172 hold parse-param arguments.
14173 * tests/calc.at: s/value/semantic_value/ because value clashes
14174 with a member of yy::b4_parser_class_name. Adjust C++ code
14175 to handle %parse-param. Enable %parse-param test in C++.
14176
3ab37077
PE
141772003-05-12 Paul Eggert <eggert@twinsun.com>
14178
14179 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
14180 English a bit. Fix fclose typo. Change "const char" to "char
14181 const", and use ANSI C rather than K&R for "main". Suggest
14182 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
14183 and suggest yy_switch_to_buffer.
14184
141852003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
14186
14187 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
14188 C89. This avoids a diagnostic on compilers that define __STDC__
14189 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 14190 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 14191
e743727f
PE
141922003-05-03 Paul Eggert <eggert@twinsun.com>
14193
14194 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
14195 Do not overrun array bounds.
14196 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 14197 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 14198
916708d5
AD
141992003-04-29 Akim Demaille <akim@epita.fr>
14200
14201 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
14202 * src/getargs.c, src/getargs.h: here, as bool, not int.
14203 (nondeterministic_parser): New.
14204 * src/parse-gram.y, src/scan-gram.l: Support
14205 %nondeterministic-parser.
14206 * src/output.c (prepare): Use nondeterministic_parser instead
14207 of glr_parser where appropriate.
14208 * src/tables.c (conflict_row, action_row, save_row)
14209 (token_actions, token_actions, pack_vector): Ditto.
14210
a06ea4aa
AD
142112003-04-29 Akim Demaille <akim@epita.fr>
14212
14213 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
14214
211074ca
AD
142152003-04-29 Akim Demaille <akim@epita.fr>
14216
14217 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
14218 with %pure-parser and %locations to exercise the patch from Yakov
14219 Markovitch below.
14220
6175ffe3
PE
142212003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
14222
14223 * data/yacc.c: (b4_lex_param): Corrected for the case where
14224 %lex-param is provided and %pure-parser isn't.
14225
b1e95857
PE
142262003-04-27 Paul Eggert <eggert@twinsun.com>
14227
14228 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 14229 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
14230 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
14231 if it is not defined.
14232 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
14233
acda9df6
PE
142342003-04-26 Paul Eggert <eggert@twinsun.com>
14235
3470c57b
PE
14236 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
14237 Declare to be of type suitable for the ninf value itself, not of
14238 type suitable for the corresponding table, since the latter might
14239 be unsigned but the ninf value might be negative. This fixes a
14240 bug reported by Alexandre Duret-Lutz in
161a71f3 14241 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 14242
acda9df6
PE
14243 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
14244 invokes it. We shouldn't invoke it twice because it will attempt
14245 to put error.o in the archive twice. This fixes a glitch reported
14246 by Martin Mokrejs in
161a71f3 14247 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 14248
b5250f26
PE
142492003-04-21 Paul Eggert <eggert@twinsun.com>
14250
14251 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
14252 to gnulib.
14253
089ac0f1
PE
142542003-04-21 Yakov Markovitch <Markovitch@iso.ru>
14255
14256 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
14257 Fix obvious typo that results in uncompilable GLR parsers
14258 when both %pure-parser and %locations are used. (trivial change)
14259
5ededac6
PE
142602003-04-17 Paul Eggert <eggert@twinsun.com>
14261
1b8f2fff
PE
14262 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
14263 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
14264 Do not insert the expected token via unput, as this runs afoul
14265 of a POSIX-compatibility bug in flex 2.5.31.
14266 All uses changed to BEGIN the parent state,
14267 since we no longer insert the expected token via unput.
14268 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
14269 that is no longer emitted after the above change.
14270
5ededac6
PE
14271 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
14272 the first one. This change is from Paul Hilfinger, and it fixes
14273 regression reported by Werner Lemberg in
161a71f3 14274 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
14275
14276 (resolve_sr_conflict): Don't invoke state_errs_set
14277 unless one or more tokens have been explicitly made errors.
14278 Otherwise, the above change causes Bison to abort.
14279
14280 * tests/existing.at (GNU pic Grammar): New test case, taken from
14281 Lemberg's email.
14282
b8be9132
AD
142832003-03-31 Akim Demaille <akim@epita.fr>
14284
14285 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
14286
d423d460
AD
142872003-03-31 Akim Demaille <akim@epita.fr>
14288
14289 * src/output.c (prepare_symbols): Avoid trailing spaces in the
14290 output.
14291
c7e441b4
AD
142922003-03-31 Akim Demaille <akim@epita.fr>
14293
14294 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
14295 From Paul Hilfinger.
14296
231897ad
AD
142972003-03-29 Akim Demaille <akim@epita.fr>
14298
14299 * m4/error.m4: Do not put under dynamic conditions some code which
14300 expansion is under static control.
14301
5b066063
AD
143022003-03-29 Akim Demaille <akim@epita.fr>
14303
14304 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
14305
22a74fec
AD
143062003-03-29 Akim Demaille <akim@epita.fr>
14307
14308 * doc/bison.texinfo (Strings are Destroyed): New.
14309
0eee27e7
PE
143102003-03-13 Paul Eggert <eggert@twinsun.com>
14311
14312 * .cvsignore: Add configure.lineno.
14313 * src/.cvsignore: Add yacc.
14314 * tests/.cvsignore: Add testsuite.log.
14315 * doc/fdl.texi: Sync with latest FSF version.
14316
f61aad93
PE
143172003-03-12 Paul Eggert <eggert@twinsun.com>
14318
537636c7
PE
14319 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
14320 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
14321 cursor, instead of leaving it undefined. This fixes a bug
14322 reported by Tim Van Holder in
161a71f3 14323 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
14324 * tests/input.at (Torturing the Scanner): Test the scanner on
14325 an empty input file, which was Tim Van Holder's test case.
14326
14327 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
14328 <sys/resource.h> can be included, include sys/time.h and
14329 sys/times.h first, if available. This works around the SunOS
14330 4.1.4 porting bug reported by Bruce Becker in
161a71f3 14331 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
14332
14333 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
14334 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
14335 AC_HEADER_SYS_WAIT.
14336
f61aad93
PE
14337 Merge changes from gnulib. This was prompted because the CVS
14338 snapshot didn't build on Solaris 7 due to strnlen problems.
14339
14340 These changes need to be merged back into gnulib:
14341 * lib/hash.c: Include <stdbool.h> unconditionally.
14342 * m4/onceonly.m4 (m4_quote): New macro.
14343 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
14344 Quote AC_FOREACH variable-expansions properly.
14345 The 2003-01-03 obstack.h change also needs merging.
14346 {end of changes requiring merging}
5b066063 14347
f61aad93
PE
14348 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
14349 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
14350 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
14351 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
14352 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
14353 New files, imported from gnulib.
14354 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
14355 above.
14356
14357 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
14358 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
14359 gnulib sources.
14360
14361 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
14362 Add.
14363 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
14364 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
14365 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
14366 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
14367 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
14368 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
14369 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
14370 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
14371 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
14372 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
14373 (jm_PREREQ_ARGMATCH): Remove.
14374 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
14375 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
14376
14377 * src/system.h: Include <stdbool.h> unconditionally.
14378
14379 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
14380 assuming at least C89 in the bitset code for some time now.
14381
d2ffe116
AD
143822003-03-03 Akim Demaille <akim@epita.fr>
14383
14384 * ro.po: New.
14385
052826fd
AD
143862003-03-02 Akim Demaille <akim@epita.fr>
14387
14388 * doc/bison.texinfo (Table of Symbols): Reactivate the
14389 documentation for %lex-param, and %parse-param.
14390
c4749565
AD
143912003-03-02 Akim Demaille <akim@epita.fr>
14392
14393 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
14394 generate verbose error messages.
14395 Use the number of tokens as an upper bound in yytname, as it
14396 cannot be a non terminal.
14397
d5286af1
AD
143982003-03-02 Akim Demaille <akim@epita.fr>
14399
14400 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
14401 message.
14402
22e304a6
AD
144032003-03-02 Akim Demaille <akim@epita.fr>
14404
22e304a6
AD
14405 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
14406 Use them to exercise yycheck overrun.
14407 Based on Andrew Suffield's grammar.
14408
67a25fed
AD
144092003-03-02 Akim Demaille <akim@epita.fr>
14410
14411 Create tests/local.at for Bison generic testing macros.
14412
14413 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
14414 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
14415 This new file.
14416 * tests/calc.at (AT_CHECK_CALC): Adjust.
14417 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
14418 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
14419 * tests/local.at: here.
14420 (AT_COMPILE_CXX): Tags the tests using it as c++.
14421 Ignore the test if CXX is not functional.
14422
9c2b381f
PE
144232003-03-01 Paul Eggert <eggert@twinsun.com>
14424
14425 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
14426 not loc->end, since loc->end might contain garbage and this leads
14427 to undefined behavior on some platforms.
14428 (id_loc, token_start): Use (IF_LINTed) initial values that do not
14429 depend on *loc, so that the reader doesn't give the the false
14430 impression that *loc is initialized.
14431 (<INITIAL>"%%"): Do not bother setting code_start, since its value
14432 does not survive the return.
14433
0433ba88
AD
144342003-03-01 Akim Demaille <akim@epita.fr>
14435
14436 * src/scan-gram.l (code_start): Always initialize it when entering
14437 into yylex, as SC_EPILOGUE is activated *before* the corresponding
14438 yylex invocation. An alternative would be making it static, but
14439 then it starts with the second %%'s beginning, instead of its end.
14440
b305ea69
PE
144412003-02-28 Paul Eggert <eggert@twinsun.com>
14442
14443 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
14444 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 14445 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 14446
c3d25e01
PE
144472003-02-26 Paul Eggert <eggert@twinsun.com>
14448
14449 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
14450 Remove Sequent/Pyramid discussion (nobody uses them any more).
14451 Merge VMS and MS-DOS discussion; these ports may well be dead
14452 but let's keep mentioning them for now. Put <> around email
14453 addresses. Add copyright notice.
14454
c267ffbc
PE
144552003-02-24 Paul Eggert <eggert@twinsun.com>
14456
14457 * data/glr.c (yy_reduce_print): yylineno -> yylno,
14458 to avoid collision with flex use of yylineno.
14459 Problem reported by Bruce Lilly in
161a71f3 14460 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
14461 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
14462 * data/yacc.c (yy_reduce_print): Likewise.
14463
14464 * config/depcomp: Sync with Automake 1.7.3.
14465
f939fc12
AD
144662003-02-21 Akim Demaille <akim@epita.fr>
14467
14468 * data/lalr1.cc: Use temporary variables instead of casts to
14469 change integer types.
14470 Suggested by Paul Eggert.
14471
95923bd6
AD
144722003-02-21 Akim Demaille <akim@epita.fr>
14473
14474 * doc/bison.texinfo: Use "location" consistently to refer to @n,
14475 to avoid confusions with lalr1.cc's notion of Position.
14476 Suggested by Paul Eggert.
14477
2cdc240e
AD
144782003-02-20 Akim Demaille <akim@epita.fr>
14479
14480 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
14481 before initial_columns.
14482 (location.hh): Use consistent variable names when defining the
14483 operator<<.
14484 Use "last" so that we subtract from Positions, not from unsigned.
14485
5d003116
AD
144862003-02-20 Akim Demaille <akim@epita.fr>
14487
14488 * data/lalr1.cc (position.hh): New subfile, including the extended
14489 and Doxygen'ed documentation of class Position.
14490 (location.hh): Use it.
14491 Document a` la Doxygen.
ba1ecc07 14492 With the help of Benoit Perrot.
5d003116 14493
d02b25f9
AD
144942003-02-20 Akim Demaille <akim@epita.fr>
14495
14496 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
14497 AT_YACC_IF.
14498 Redefine AT_YYERROR_SEES_LOC_IF using it.
14499 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
14500 not defined.
14501 Don't use the location in yy::Parser::error_ and
14502 yy::Parser::print_ when not %locations.
14503 Activate more lalr1.cc tests.
14504
0d1c3a04
AD
145052003-02-19 Akim Demaille <akim@epita.fr>
14506
14507 * data/lalr1.cc: When displaying a line number, be sure to make it
14508 an int.
14509
60a777aa
AD
145102003-02-19 Akim Demaille <akim@epita.fr>
14511
14512 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
14513 Remove, useless.
14514 (YYABORT, YYACCEPT, YYERROR): New.
14515 * tests/calc.at: Renable the lalr1.cc test.
14516
0b86fc41
AD
145172003-02-19 Akim Demaille <akim@epita.fr>
14518
14519 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
14520 error recovery, mixing with/without pops and discarding of the
14521 lookahead.
14522 Exercise YYERROR.
14523 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
14524
da99a5dc
PE
145252003-02-17 Paul Eggert <eggert@twinsun.com>
14526
14527 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
14528 * tests/testsuite.at (AT_COMPILE): Use them.
14529 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 14530 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 14531
93b8c255
PE
145322003-02-12 Paul Eggert <eggert@twinsun.com>
14533
14534 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
14535 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 14536 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
14537 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
14538 Check for malloc failure, for consistency with yacc.c.
14539 (yytname_size): Remove, for consistency with yacc.c.
14540
14541 The bug still remains in data/lalr1.cc, as I didn't have time
14542 to fix it there.
14543
7548fed2
AD
145442003-02-06 Akim Demaille <akim@epita.fr>
14545
14546 * configure.ac (GXX): Rename as...
14547 (CXX): this, to keep the original Autoconf semantics.
14548 Require 2.57.
14549 * data/lalr1.cc: Fix b4_copyright invocations.
14550 If YYDEBUG is not defined, don't depend upon name_ being defined.
14551 (location.hh): Include string and iostream.
14552 (Position::filename): New member.
14553 (Position::Position ()): New.
14554 (operator<< (Position)): New.
14555 (operator- (Position, int)): New.
14556 (Location::first, Location::last): Rename as...
14557 (Location::begin, Location::end): these, to mock the conventional
14558 iterator names.
14559 (operator<< (Location)): New.
14560 * tests/atlocal.in (CXX): New.
14561 * tests/testsuite.at (AT_COMPILE_CXX): New.
14562 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
14563 locations in a more synthetic way.
14564 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
14565 lalr1.cc is used.
14566 Adjust the C locations to match those from Emacs: first column is
14567 column 0.
14568 Change all the expected results.
14569 Conform to the GCS: simplify the locations when applicable.
14570 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
14571 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
14572 these CPP macros with the m4 macros new defined by...
14573 (AT_CHECK_PUSHDEFS): this, i.e.:
14574 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 14575 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
14576 New macros.
14577 (AT_CHECK_POPDEFS): Undefine them.
14578 (AT_CHECK_CALC_LALR1_CC): New.
14579 Use it for the first lalr1.cc test.
14580
43a176ef
AD
145812003-02-04 Akim Demaille <akim@epita.fr>
14582
14583 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
14584 Location as is defined.
14585
fc049e9c
AD
145862003-02-04 Akim Demaille <akim@epita.fr>
14587
14588 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
14589 name_ being defined.
14590
a737b216
PE
145912003-02-03 Paul Eggert <eggert@twinsun.com>
14592
14593 * src/gram.h (start_symbol): Remove unused decl.
14594
14595 Use more-consistent naming conventions for local vars.
14596
14597 * src/derives.c (derives_compute): Change type of local var from
14598 int to rule_number.
14599 * src/gram.c (grammar_rules_partial_print): Likewise.
14600 * src/print.c (print_core): Likewise.
14601 * src/reduce.c (reduce_grammar_tables): Likewise.
14602
14603 * src/gram.c (grammar_dump): Change name of item_number *
14604 local var from r to rp.
14605 * src/nullable.c (nullable_compute): Likewise.
14606
14607 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
14608
14609 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
14610 for symbol or symbol_number var.
14611 * src/reader.c (grammar_start_symbol_set): Likewise.
14612 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
14613 Likewise.
14614 * src/state.c (transitions_to): Likewise.
14615 * src/state.h: Likewise.
14616 * src/tables.c (symbol_number_to_vector_number): Likewise.
14617
14618 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
14619 char * var.
14620
14621 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
14622 var.
14623
14624 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
14625 var.
14626
14627 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
14628 Use str, not s, for char * var. Use ch, not c, for character var.
14629 Use size for size var.
14630
14631 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
14632 char * var.
14633 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
14634 uniqstr var.
14635 * src/uniqstr.h: Likewise.
14636
14637 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14638 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14639 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
14640 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
14641 param to have same name as that of enum, so that we don't use
14642 "s" to stand for a non-state.
14643
68e93ad5
AD
146442003-02-02 Akim Demaille <akim@epita.fr>
14645
14646 * src/scan-skel.l: Scan more than one inert character per yylex
14647 invocation.
14648
92898986
PE
146492003-02-01 Paul Eggert <eggert@twinsun.com>
14650
14651 Version 1.875a.
14652
1d9d5d71
PE
14653 * po/LINGUAS: Add ms.
14654
0435d061
AD
146552003-01-30 Akim Demaille <akim@epita.fr>
14656
14657 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
14658
6029a57f
PH
146592003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14660
14661 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
14662 of $1.
0435d061
AD
14663
14664 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 14665 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 14666 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 14667
6029a57f
PH
14668 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
14669 (b4_rhs_location): Ditto.
0435d061 14670 (yyfill): New function to copy from stack tree into array
6029a57f 14671 incrementally.
0435d061
AD
14672 (yyuserAction): Modify to allow incremental move of semantic values
14673 to rhs array when in GLR mode.
14674 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
14675 as needed.
14676 Remove dummy use of yystack, as there is now a guaranteed use.
14677 (yydoAction): Modify to allow incremental move of semantic values
14678 to rhs array when in GLR mode.
14679 (yyresolveAction): Ditto.
14680 (yyglrShiftDefer): Update comment.
0435d061 14681 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
14682 (yyglrReduce): Ditto.
14683 (yydoAction): Ditto
0435d061 14684
6029a57f
PH
14685 * tests/glr-regr1.at: Rename to ...
14686 * tests/glr-regression.at: Add new regression test for the problems
14687 described above (adapted from S. Eken).
14688 Update copyright notice.
14689 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
14690 * tests/Makefile.am: Ditto.
14691
6cee6297
PE
146922003-01-28 Paul Eggert <eggert@twinsun.com>
14693
14694 * data/lalr1.cc: Do not use @output_header_name@ unless
14695 b4_defines_flag is set. This fixes two bugs reported by
14696 Tim Van Holder in
161a71f3
PE
14697 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
14698 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 14699
b2a836b5
PE
147002003-01-21 Paul Eggert <eggert@twinsun.com>
14701
14702 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
14703 we don't need to worry about yyerrlab1 being reported as an
14704 "unused label" by non-GCC C compilers. The downside is that if
14705 locations are used then a couple of statements are duplicated each
14706 time YYERROR is invoked, but the upside is that the warnings
14707 should vanish.
14708 (yyerrlab1): Move code to YERROR.
14709 (yyerrlab2): Remove. Change uses back to yyerrlab1.
14710 This reverts some of the 2002-12-27 change.
14711
4196b931
PE
147122003-01-17 Paul Eggert <eggert@twinsun.com>
14713
14714 * src/output.c (symbol_printers_output): Fix typo that led
14715 to core dump. Problem reported by Antonio Rus in
161a71f3 14716 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 14717
3ae831b4
AD
147182003-01-13 Akim Demaille <akim@epita.fr>,
14719 Quoc Peyrot <chojin@lrde.epita.fr>,
14720 Robert Anisko <anisko_r@lrde.epita.fr>
14721
14722 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
14723 when the stacks contain one element, as the loop would otherwise
14724 free the last state, and then use the top state (the one we just
14725 popped). This means that the initial elements will not be freed
14726 explicitly, as is the case in yacc.c; it is not a problem, as
14727 these elements have fake values.
14728
e3aa65c5
PE
147292003-01-11 Paul Eggert <eggert@twinsun.com>
14730
14731 * NEWS: %expect-violations are now just warnings, reverting
14732 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
14733 bootstrapping problem reported by Matthias Klose; see
161a71f3 14734 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
14735 * src/conflicts.c (conflicts_print): Likewise.
14736 * tests/conflicts.at (%expect not enough, %expect too much,
14737 %expect with reduce conflicts): Likewise.
14738 * doc/bison.texinfo (Expect Decl): Document this. Also mention
14739 that the warning is enabled if the number of conflicts changes
14740 (not necessarily increases).
14741
14742 * src/getargs.c (version): Update copyright year.
14743
f0057011
AD
147442003-01-09 Akim Demaille <akim@epita.fr>
14745
14746 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
14747
1ee6d2a0
PE
147482003-01-08 Paul Eggert <eggert@twinsun.com>
14749
14750 * Makefile.maint (WGETFLAGS):
14751 New macro, containing "-C off" to disable proxy caches.
14752 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
14753 (rel-check): Use $(WGET) instead of wget.
14754
d4fd77c4
PE
147552003-01-06 Paul Eggert <eggert@twinsun.com>
14756
14757 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
14758 the GLR paper of Scott, Johnstone and Hussain.
14759
464c6927
PE
147602003-01-04 Paul Eggert <eggert@twinsun.com>
14761
d600ee67
PE
14762 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
14763 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
14764 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
14765 (EXTRA_LIBRARIES): New var, for liby.a.
14766 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
14767 (EXTRA_SCRIPTS): New var, for yacc.
14768
464c6927
PE
14769 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
14770 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
14771 Problem reported by Nelson H. F. Beebe.
14772
147732003-01-03 Paul Eggert <eggert@twinsun.com>
14774
14775 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
14776 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
14777 when compiling Bison 1.875's `bitset bset = obstack_alloc
14778 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
14779
14780 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
14781 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
14782 grow to a huge size with typical invocation.
d600ee67 14783
464c6927
PE
14784 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
14785 Use the pattern recommended by Autoconf 2.57, except also protect
14786 against double-definition.
14787 * src/system.h: Likewise.
14788 Portability issues reported by Nelson H. F. Beebe.
d600ee67 14789
464c6927
PE
14790 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
14791 All uses changed. Provide a definition in both C and C++.
14792 (yytrue, yyfalse): Define even if defined (__cplusplus).
14793
14794 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
14795 Reported by Nelson H. F. Beebe.
d600ee67 14796
464c6927
PE
14797 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
14798
0f42c7d5
PE
147992003-01-02 Paul Eggert <eggert@twinsun.com>
14800
14801 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
14802 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
14803 Bug reported by Nelson H. F. Beebe.
14804
dc546b0f
PE
148052003-01-01 Paul Eggert <eggert@twinsun.com>
14806
14807 * Version 1.875.
14808
2c09b6a7
PE
148092002-12-30 Paul Eggert <eggert@twinsun.com>
14810
14811 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
14812 Moved here from...
14813 (<INITIAL>","): Here. This causes stray "," to be treated
14814 more uniformly.
14815
dc546b0f 14816 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
14817 last brace in braced code when not in Yacc mode, for compatibility
14818 with Bison 1.35. This resurrects the 2001-12-15 patch to
14819 src/reader.c.
14820
14821 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
14822 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
14823
535c0f63
PE
148242002-12-28 Paul Eggert <eggert@twinsun.com>
14825
14826 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
14827 that of SYM's type. This fixes Debian bug 168069, reported by
14828 Thomas Olsson.
d600ee67 14829
963fcc17
PE
148302002-12-28 Paul Eggert <eggert@twinsun.com>
14831
14832 Version 1.75f.
14833
14834 Switch back to the Yacc style of conflict reports, undoing some
14835 of the 2002-07-30 change.
14836 * doc/bison.texinfo (Understanding): Use Yacc style for
14837 conflict reports. Also, use new way of locating rules.
14838 * src/conflicts.c (conflict_report):
14839 Renamed from conflict_report_yacc, removing the old
14840 'conflict_report'. Translate the entire conflict report at once,
14841 so that we don't assume that "," has the same interpretation in
14842 all languages.
14843 (conflicts_output): Use Yacc-style conflict report for each state,
14844 instead of our more-complicated style.
14845 (conflicts_print): Use Yacc-style conflict report, except print
14846 the input file name when not emulating Yacc.
14847 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
14848 Conflicted Reduction, %expect not enough, %expect too much,
14849 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
14850 * tests/existing.at (GNU Cim Grammar): Likewise.
14851 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
14852
14853 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
14854 fatal): Don't invoke fflush; it's not needed and it might even be
14855 harmful for stdout, as stdout might not be open.
14856 * src/reduce.c (reduce_print): Likewise.
14857
b1efe548
PE
148582002-12-27 Paul Eggert <eggert@twinsun.com>
14859
14860 Fix a bug where error locations were not being recorded correctly.
14861 This problem was originally reported by Paul Hilfinger in
161a71f3 14862 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
14863
14864 * data/yacc.c (yyparse): New local var yylerrsp, to record the
14865 top of the location stack's error locations.
14866 (yyerrlab): Set it. When discarding a token, push its location
14867 onto yylerrsp so that we don't lose track of the error's end.
14868 (yyerrlab1): Now is only the target of YYERROR, so that we can
14869 properly record the location of the action that failed. For GCC
14870 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
14871 GCC warning about yyerrlab1 being unused if YYERROR is unused.
14872 (yyerrlab2): New label, which yyerrlab now falls through to.
14873 Compute the error's location by applying YYLLOC_DEFAULT to
14874 the locations of all the symbols that went into the error.
14875 * doc/bison.texinfo (Location Default Action): Mention that
14876 YYLLOC_DEFAULT is also invoked for syntax errors.
14877 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
14878 Error locations include the locations of all the tokens that were
14879 discarded, not just the last token.
d600ee67 14880
983c5c2c
PE
148812002-12-26 Paul Eggert <eggert@twinsun.com>
14882
b1efe548
PE
14883 * src/files.c: Include quote.h.
14884 (compute_output_file_names): Warn if we detect conflicting
14885 outputs to the same file. This should catch the misunderstanding
14886 exemplified by Debian Bug 165349, reported by Bruce Stephens..
14887
14888 * src/conflicts.c (conflicts_print): If the user specifies
14889 "%expect N", report an error if there are any reduce/reduce
14890 conflicts. This is what the manual says should happen.
14891 This fixes Debian bug 130890, reported by Anthony DeRobertis.
14892 * tests/conflicts.at (%expect with reduce conflicts): New test.
14893
983c5c2c
PE
14894 Don't use m4_include on relative file names, as it doesn't work as
14895 desired if there happens to be a file with that name under ".".
d600ee67 14896
983c5c2c
PE
14897 * m4sugar/version.m4: Remove; it was included but it wasn't used.
14898 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
14899 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
14900 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
14901 * src/output.c (output_skeleton): Use full path names when
14902 specifying a file to include; don't rely on include path, as
14903 it's unreliable when the working file contains a file with
14904 that name.
d600ee67 14905
983c5c2c
PE
149062002-12-25 Paul Eggert <eggert@twinsun.com>
14907
14908 Remove obsolete references to bison.simple and bison.hairy.
14909 Problem mentioned by Aubin Mahe in
161a71f3 14910 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
14911 * data/glr.c: Comment fix.
14912 * doc/bison.1: Remove references. Also, mention "yacc".
14913
14914 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
14915 with -g option.
14916
14917 * src/parse-gram.y (declaration): Use enum "report_states" rather
14918 than its numeric value 1.
14919
14920 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
14921 opening a new one. This fixes Debian bug 165349, reported by
14922 Bruce Stephens.
14923
23f2d9dc
PE
149242002-12-24 Paul Eggert <eggert@twinsun.com>
14925
14926 Version 1.75e.
14927
14928 * Makefile.maint (cvs-update): Don't assume that the shell
14929 supports $(...), as Solaris sh doesn't.
14930
14931 * src/parse-gram.y (lloc_default): Remove test for empty
14932 nonterminals at the end, since it didn't change the result.
14933
149342002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
14935
14936 If the user does not define YYSTYPE as a macro, Bison now declares it
14937 using typedef instead of defining it as a macro. POSIX requires this.
14938 For consistency, YYLTYPE is also declared instead of defined.
14939
14940 %union directives can now have a tag before the `{', e.g., the
14941 directive `%union foo {...}' now generates the C code
14942 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
14943 The default union tag is `YYSTYPE', for compatibility with Solaris 9
14944 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
14945 instead of `yyltype'.
14946
14947 `yystype' and `yyltype' are now obsolescent macros instead of being
14948 typedefs or tags; they are no longer documented and will be
14949 withdrawn in a future release.
14950
14951 * data/glr.c (b4_location_type): Remove.
14952 (YYSTYPE): Renamed from yystype.
14953 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
14954 (struct YYLTYPE): Renamed from struct yyltype.
14955 (YYLTYPE): Renamed from yyltype.
14956 (yyltype, yystype): New (and obsolescent) macros,
14957 for backward compatibility.
14958 * data/yacc.c: Likewise.
14959
14960 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
14961 does not specify a union tag. This is for compatibility with
14962 Solaris 9 yacc.
14963
14964 * src/parse-gram.y (add_param): 2nd arg is now char * not char
14965 const *, since it is now modified by stripping surrounding { }.
14966 (current_braced_code): Remove.
14967 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
14968 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
14969 trailing " {...}". Now of type <chars>.
14970 (grammar_declaration): Adjust to bundled tokens.
14971 (code_content): Remove; stripping is now done by add_param.
14972 (print_token_value): Print contents of bundled tokens.
14973 (token_name): New function.
14974
14975 * src/reader.h (braced_code, current_braced_code): Remove.
14976 (token_name): New decl.
14977
14978 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
14979 token_type, not braced_code code_kind. All uses changed.
14980 (SC_PRE_CODE): New state, for scanning after a keyword that
14981 has (or usually has) an immediately-following braced code.
14982 (token_type): New local var, to keep track of which token type
14983 to return when scanning braced code.
14984 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 14985 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
14986 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
14987 instead of returning a token type immediately.
14988 (<INITIAL>"{"): Set token type.
14989 (<SC_BRACED_CODE>"}"): Use it.
14990 (handle_action_dollar, handle_action_at): Now returns bool
14991 indicating success. Fail if ! current_rule; this prevents a core dump.
14992 (handle_symbol_code_dollar, handle_symbol_code_at):
14993 Remove; merge body into caller.
14994 (handle_dollar, handle_at): Complain in invalid contexts.
14995
14996 * NEWS, doc/bison.texinfo: Document the above.
14997 * NEWS: Fix years and program names in copyright notice.
14998
879ca4f8
PE
149992002-12-17 Paul Eggert <eggert@twinsun.com>
15000
15001 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
15002 Reporting, Table of Symbols): Omit mentions of %lex-param and
15003 %parse-param from the documentation for now.
15004
1c5fe69d
PE
150052002-12-15 Paul Eggert <eggert@twinsun.com>
15006
15007 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
15008 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
15009 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
15010 disagreed with the Bison documentation. Bug
15011 reported by Andrew Walrond.
d600ee67 15012
1c5fe69d
PE
15013 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
15014 as the caller now does that.
15015 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
15016 (YYEMPTY): Parenthesize right hand side, since others use it.
15017 (yyparse): Don't assume that our generated code is the only code
15018 that sets yychar.
15019
d1de5372
PE
150202002-12-13 Paul Eggert <eggert@twinsun.com>
15021
15022 Version 1.75d.
15023
15024 POSIX requires a "yacc" command.
15025 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
15026 (MOSTLYCLEANFILES): Add yacc.
15027 (yacc): New rule.
1c5fe69d 15028 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
15029 as an alias for bison y.
15030
15031 * po/LINGUAS: Add da.
d600ee67 15032
d1de5372
PE
15033 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
15034 problem with latest <getopt.h>.
15035 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
15036
15037 * doc/fdl.texi: Upgrade to 1.2.
15038 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
15039 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
15040 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
15041 gnulib.
15042 * config/install-sh: Sync with autotools.
15043
15044 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 15045 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
15046 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
15047 locations are requested.
15048 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
15049 locations are requested.
15050
d0f3fe23
PE
150512002-12-12 Paul Eggert <eggert@twinsun.com>
15052
15053 Remove unportable casts and storage allocation tricks.
15054 While we're at it, remove almost all casts, since they
15055 usually aren't needed and are a sign of trouble.
15056
15057 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
15058
15059 * src/derives.c (derives_compute): Do not subtract NTOKENS from
15060 the pointer DSET returned by malloc; this isn't portable.
15061 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
15062 Similarly for DERIVES.
15063 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
15064 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
15065 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
15066
15067 * src/derives.c (derives_compute): Do not bother invoking
15068 int_of_rule_number, since rule numbers are integers.
15069
15070 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
15071 rather than XMALLOC (char, N).
15072
15073 * src/files.c (filename_split): Rewrite to avoid cast.
15074
15075 * src/gram.h (symbol_number_as_item_number,
15076 item_number_as_symbol_number, rule_number_as_item_number,
15077 item_number_as_rule_number):
15078 Now inline functions rather than macros, to avoid casts.
15079 * src/state.h (state_number_as_int): Likewise.
15080 * src/tables.c (state_number_to_vector_number,
15081 symbol_number_to_vector_number): Likewise.
15082
15083 * src/gram.h (int_of_rule_number): Remove; no longer used.
15084
15085 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
15086 since the resulting storage is always stored into.
15087
15088 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
15089 where it's needed.
15090
15091 * src/muscle_tab.c (muscle_m4_output):
15092 Now inline. Return bool, not int.
15093 * src/state.c (state_compare): Likewise.
15094 * src/symtab.c (symbol_check_defined,
15095 symbol_check_alias_consistency, symbol_pack, symbol_translation,
15096 hash_compare_symbol, hash_symbol):
15097 Likewise.
15098 * src/uniqstr.c (uniqstr_print): Likewise.
15099 * src/muscle_tab.c (muscle_m4_output_processor):
15100 New function, to avoid casts.
15101 * src/state.c (state_comparator, stage_hasher): Likewise.
15102 * src/symtab.c (symbol_check_defined_processor,
15103 symbol_check_alias_consistency_processor, symbol_pack_processor,
15104 symbol_translation_processor, hash_symbol_comparator,
15105 hash_symbol_hasher): Likewise.
15106 * src/uniqstr.c (uniqstr_print_processor): Likewise.
15107 * src/muscle_tab.c (muscles_m4_output):
15108 Use new functions instead of casting old functions unportably.
15109 * src/state.c (state_hash_new): Likewise.
15110 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
15111 symbols_token_translations_init):
15112 Likewise.
15113 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
15114
15115 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
15116 var instead of casting to long, to avoid casts.
15117 (prepare_states): Use MALLOC rather than alloca, so that we don't
15118 have to worry about alloca.
15119 * src/state.c (state_hash_lookup): Likewise.
15120
15121 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
15122 local var instead of casting to unsigned char, to avoid casts.
15123
15124 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
15125 STATE_ALLOC): Remove.
15126 (transitions_new, errs_new, reductions_new, state_new): Use malloc
15127 rather than calloc, and use offsetof to avoid allocating slightly
15128 too much storage.
15129 (state_new): Initialize all members.
15130
15131 * src/state.c (state_hash): Use unsigned accumulator, not signed.
15132
15133 * src/symtab.c (symbol_free): Remove; unused.
15134 (symbol_get): Remove cast in lhs of assignment.
15135 (symbols_do): Now static. Accept generic arguments, not
15136 hashing-related ones.
15137
15138 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
15139 (symbol_processor): Remove.
15140 (symbols_do): Remove decl; now static.
15141
15142 * src/system.h (alloca): Remove; decl no longer needed.
15143 (<stddef.h>): Include, for offsetof.
15144 (<inttypes.>, <stdint.h>): Include if available.
15145 (uintptr_t): New type, if system lacks it.
15146 (CALLOC, MALLOC, REALLOC): New macros.
15147 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
15148 new macros.
15149
15150 * src/tables.c (table_size): Now int, to pacify GCC.
15151 (table_grow, table_ninf_remap): Use signed table size.
15152 (save_row): Don't bother initializing locals when not needed.
15153 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
15154 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
15155
15156 * src/vcg.h: Correct misspellings.
15157
15158 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
15159
15160
15161 * src/getargs.c (getargs): Don't assume EOF == -1.
15162
26b4a969
PE
151632002-12-09 Paul Eggert <eggert@twinsun.com>
15164
15165 Change identifier spellings to avoid collisions with names
15166 that are reserved by POSIX.
15167
15168 Don't use names ending in _t, since POSIX reserves them.
15169 For consistency, remove _e and _s endings -- they're weren't
15170 needed to remove ambiguity. All uses changed.
15171 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
15172 turn was just renamed from struniq_t.
15173 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
15174 which in turn was just renamed from struniq_processor_t.
15175 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
15176 in turn was renamed from hash_compare_struniq_t.
15177 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
15178 (state_list): Renamed from state_list_t.
15179 * src/assoc.h (assoc): Renamed from assoc_t.
15180 * src/conflicts.c (enum conflict_resolution): Renamed from
15181 enum conflict_resolution_e.
15182 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
15183 (rule_list): Renamed from rule_list_t.
15184 * src/getargs.h (enum trace): Renamed from enum trace_e.
15185 (enum report): Renamed from enum report_e.
15186 * src/gram.h (item_number): Renamed from item_number_t.
15187 (rule_number): Renamed from rule_number_t.
15188 (struct rule_s): Remove the "rule_s" part; not used.
15189 (rule): Renamed from rule_t.
15190 (rule_filter): Renamed from rule_filter_t.
15191 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
15192 (goto_list): Renamed from goto_list_t.
15193 * src/lalr.h (goto_number): Renamed from goto_number_t.
15194 * src/location.h (location): Renamed from location_t.
15195 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
15196 and moved here from:
15197 * src/muscle_tab.h (muscle_entry_t): here.
15198 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
15199 (rule_list): Renamed from rule_list_t.
15200 * src/print_graph.c (static_graph): Renamed from graph.
15201 * src/reader.h (braced_code): Renamed from braced_code_t.
15202 Remove brace_code_e tag.
15203 * src/relation.h (relation_node): Renamed from relation_node_t.
15204 (relation_nodes): Renamed from relation_nodes_t.
15205 (relation): Renamed from relation_t.
15206 * src/state.h (state_number): Renamed from state_number_t.
15207 (struct state): Renamed from struct state_s.
15208 (state): Renamed from state_t.
15209 (transitions): Renamed from transitions_t. Unused (and
15210 misspelled) transtion_s tag removed.
15211 (errs): Renamed from errs_t. Unused errs_s tag removed.
15212 (reductions): Renamed from reductions_t. Unused tag
15213 reductions_s removed.
15214 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
15215 (struct symbol_list): Renamed from struct symbol_list_s.
15216 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
15217 (struct symbol): Renamed from struct symbol_s.
15218 (symbol): Renamed from symbol_t.
15219 * src/tables.c (vector_number): Renamed from vector_number_t.
15220 (action_number): Renamed from action_t.
15221 * src/tables.h (base_number): Renamed from base_t.
15222 * src/vcg.h (enum color): Renamed from enum color_e.
15223 (enum textmode): Renamed from enum textmode_e.
15224 (enum shape): Renamed from enum shape_e.
15225 (struct colorentry): Renamed from struct colorentry_s.
15226 (struct classname): Renamed from struct classname_s.
15227 (struct infoname): Renamed from struct infoname_s.
15228 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
15229 (enum decision): Renamed from enum decision_e.
15230 (enum orientation): Renamed from enum orientation_e.
15231 (enum alignment): Renamed from enum alignment_e.
15232 (enum arrow_mode): Renamed from enum arrow_mode_e.
15233 (enum crossing_type): Renamed from enum crossing_type_e.
15234 (enum view): Renamed from enum view_e.
15235 (struct node): Renamed from struct node_s.
15236 (node): Renamed from node_t.
15237 (enum linestyle): Renamed from enum linestyle_e.
15238 (enum arrowstyle): Renamed from enum arrowstyle_e.
15239 (struct edge): Renamed from struct edge.
15240 (edge): Renamed from edge_t.
15241 (struct graph): Renamed from struct graph_s.
15242 (graph): Renamed from graph_t.
15243 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
15244 Rename value_t -> value.
15245 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
15246 value_t_as_yystype -> value_as_yystype.
15247
15248 Don't include <errno.h> in the mainstream code, since it
15249 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
15250 * lib/get-errno.c, lib/get-errno.h: New files.
15251 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
15252 get-errno.c.
15253 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
15254 * src/output.c (output_skeleton): Likewise.
15255 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
15256 instead of errno.
15257 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
15258 Likewise.
15259 (handle_action_dollar, handle_action_at): Likewise.
15260 * src/system.h: Do not include <errno.h>.
15261 (TAB_EXT): Renamed from EXT_TAB.
15262 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
15263
15264 Avoid str[a-z]*, since <string.h> reserves that name space.
15265 Change all instances of "struniq" in names to "uniqstr", and
15266 likewise for "STRUNIQ" and "UNIQSTR".
15267 * src/uniqstr.c: Renamed from src/struniq.c.
15268 * src/uniqstr.h: Renamed from src/struniq.h.
15269 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
15270 * src/files.c (strsuffix): Remove; unused.
15271 (concat2): Renamed from stringappend. Now static.
15272 * src/files.h (strsuffix, stringappend): Remove; unused.
15273 * src/parse-gram.y (<chars>): Renamed from <string>.
15274 (<uniqstr>): Renamed from <struniq>.
15275 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
15276 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
15277 (struct graph_s.expand): Renamed from struct graph_s.stretch.
15278 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
15279 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
15280 (N_EXPAND): Renamed from N_STRETCH.
15281
15282 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
15283 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
15284 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
15285 Remove; unused.
15286 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
15287 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
15288 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
15289 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
15290 (BASE_MAXIMUM): Renamed from BASE_MAX.
15291 (BASE_MINIMUM): Renamed from BASE_MIN.
15292 (ACTION_MAX): Remove; unused.
15293 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
15294 Unnecessary casts removed from above defines.
15295
15296
15297 Fix misspelling in names.
15298 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
15299 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
15300 G_NODE_ALIGNEMENT.
15301
15302
15303 * lib/timevar.c (timevar_report): Renamed from time_report,
15304 for consistency with other names.
15305 * lib/timevar.h (timevar_report): New decl.
15306 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
15307
15308
15309 Sort include-file uses.
15310
15311 Reorder all include files under src to be in the order "system.h".
15312 then the ../lib include files in angle brackets (alphabetized),
15313 then the . include files in double-quotes (alphabetized). Fix
15314 dependency breakages encountered in this process, as follows:
15315 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
15316 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
15317 * src/state.h: Include "symtab.h".
15318
996b1c7e
PE
153192002-12-08 Paul Eggert <eggert@twinsun.com>
15320
15321 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
15322 since this causes problems when __file__ contains character
15323 sequences like "@" that are treated specially by src/scan-skel.l.
15324 Instead, just use the file's basename. This fixes the bug
15325 reported by Martin Mokrejs in
161a71f3 15326 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 15327
e19c4e5d
PE
153282002-12-06 Paul Eggert <eggert@twinsun.com>
15329
15330 Add support for rules that do not have trailing semicolons, as
15331 POSIX requires. Improve the quality of locations in Bison
15332 diagnostics.
26b4a969 15333
e19c4e5d
PE
15334 * src/location.c: Include <quotearg.h>.
15335 (empty_location): Now const.
15336 (location_print): New function. Follow the recommendation of the
15337 GNU Coding Standards for locations that span file boundaries.
15338 * src/location.h: Do not include <quotearg.h>; no longer needed.
15339 (boundary): New type.
15340 (location_t): Use it. This allows locations to span file boundaries.
15341 All member uses changed: file -> start.file or end.file (as needed),
15342 first_line -> start.line, first_column -> start.column,
15343 last_line -> end.line, last_column -> end.column.
15344 (equal_boundaries): New function.
15345 (LOCATION_RESET, LOCATION_STEP): Remove.
15346 (LOCATION_PRINT): Remove. All callers changed to use location_print.
15347 (empty_location): Now const.
15348 (location_print): New decl.
15349 * src/parse-gram.y (lloc_default): New function, which handles
15350 empty locations more accurately.
15351 (YYLLOC_DEFAULT): Use it.
15352 (%token COLON): Remove.
15353 (%token ID_COLON): New token.
26b4a969 15354 (rules): Use it.
e19c4e5d
PE
15355 (declarations, rules): Remove trailing semicolon.
15356 (declaration, rules_or_grammar_declaration):
15357 Allow empty (";") declaration.
15358 (symbol_def): Remove empty actions; no longer needed.
15359 (rules_or_grammar_declaration): Remove trailing semicolon.
15360 (semi_colon.opt): Remove.
15361 * src/reader.h: Include location.h.
15362 (scanner_cursor): New decl.
15363 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
15364 rolling our own.
15365 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
15366 of *loc.
15367 (STEP): Remove. No longer needed, now that adjust_location does
15368 the work. All uses removed.
15369 (scanner_cursor): New var.
15370 (adjust_location): Renamed from extend_location. It now sets
15371 *loc and adjusts the scanner cursor. All uses changed.
15372 Don't bother testing for CR.
15373 (handle_syncline): Remove location arg; now updates scanner cursor.
15374 All callers changed.
15375 (unexpected_end_of_file): Now accepts start boundary of token or
15376 comment, not location. All callers changed. Update scanner cursor,
15377 not the location.
15378 (SC_AFTER_IDENTIFIER): New state.
15379 (context_state): Renamed from c_context. All uses changed.
15380 (id_loc, code_start, token_start): New local vars.
15381 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
15382 processing of Yacc white space and equivalents here.
15383 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
15384 instead of returning ID immediately, since we need to search for
15385 a subsequent colon.
15386 (<INITIAL>"'", "\""): Save token_start.
15387 (<INITIAL>"%{", "{", "%%"): Save code_start.
15388 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
15389 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
15390 BEGIN context_state at end, not INITIAL.
15391 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
15392 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
15393 Return correct token start.
15394 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
15395 the start of a character, string or multiline comment is found.
15396 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
15397 Reduction): Adjust reported locations to match the more-precise
15398 results now expected.
15399 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
15400 * tests/reduce.at (Useless Rules, Reduced Automaton,
15401 Underivable Rules): Likewise.
15402 * tests/regression.at (Invalid inputs): No longer `expecting ";"
15403 or "|"' now that so many other tokens are allowed by the new grammar.
15404
15405 * src/complain.h (current_file): Remove duplicate decl;
15406 current_file is now owned by files.h.
15407 * src/complain.c, src/scan-gram.l: Include files.h.
15408
154092002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 15410
e19c4e5d
PE
15411 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
15412 promotes to int; it might be unsigned int.
15413 * data/yacc.c (yy_reduce_print): Likewise.
15414
15415 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
15416 be #defined in the prologue, not in the Bison declarations.
15417 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 15418
b64755e3
PE
154192002-12-02 Paul Eggert <eggert@twinsun.com>
15420
15421 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
15422 * lib/strtoul.c: New file, from gnulib.
15423 This fixes a porting bug reported by Peter Klein in
161a71f3 15424 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 15425
6e746484
PE
154262002-11-30 Paul Eggert <eggert@twinsun.com>
15427
b64755e3
PE
15428 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
15429 and put only a forward declaration in the prologue. This is for
15430 consistency with the other scanner helper functions.
15431
6ba55592
PE
15432 Type clashes now generate warnings, not errors, since it
15433 appears that POSIX may allow some grammars with type clashes.
15434 * src/reader.c (grammar_current_rule_check): Warn about
15435 type clashes instead of complaining.
15436 * tests/input.at (Type Clashes): Expect warnings, not complaints.
15437
6e746484
PE
15438 Add Yacc library, since POSIX requires it.
15439 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
15440 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
15441 * lib/main.c, lib/yyerror.c: New files.
15442
15443 gram_error can be static; it need not be extern.
15444 * src/reader.h (gram_error): Remove decl.
15445 * src/parse-gram.y (gram_error): Now static. Add static decl.
15446 (print_token_value): Omit parameter names from forward decl,
15447 for consistency.
15448
88510f9c
PE
154492002-11-29 Paul Eggert <eggert@twinsun.com>
15450
6e746484
PE
15451 * doc/bison.texinfo: Emphasize that yylex and yyerror must
15452 be declared before being used. E.g., one should typically
15453 declare them in the prologue. Use GNU coding style in examples.
15454 Put "const" consistently after the type it modifies. Mention
15455 that C99 supports "inline". Mention that yyerror traditionally
15456 returns "int".
15457
88510f9c
PE
15458 %parse-param and %lex-param now take just one argument, the
15459 declaration; the argument name is deduced from the declaration.
15460
15461 * doc/bison.texinfo (Parser Function, Pure Calling, Error
15462 Reporting, Table of Symbols): Document this.
15463 * src/parse-gram.y (add_param): New function.
15464 (COMMA): Remove.
15465 (declaration): Implement new rule for %parse-param and %lex-param.
15466 * src/scan-gram.l: "," now elicits a warning, rather than being
15467 a token; this is more compatible with byacc.
15468 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
15469
bb92250c
PE
154702002-11-27 Paul Eggert <eggert@twinsun.com>
15471
15472 Rename identifiers to avoid real and potential collisions.
15473
15474 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
15475 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 15476 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
15477 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
15478 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
15479 * src/parse-gram.y (print_token_value): Renamed from yyprint.
15480 All uses changed.
15481 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
15482 The name "yycontrol" violates the name space rules, and this stuff
15483 wasn't being used anyway.
15484 (input): Remove action; this stuff wasn't being used.
15485 (gram_error): Rename local variable yylloc -> loc.
15486 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
15487 (YY_DECL): Don't use "yy" at start of local variables.
15488 All uses changed, e.g., yylloc -> loc.
15489 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
15490 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
15491 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
15492 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
15493
15494 * src/parse-gram.y (gram_error): loc is now const *.
15495 * src/reader.h (gram_error): Likewise.
15496
3af4feb2
PE
154972002-11-24 Paul Eggert <eggert@twinsun.com>
15498
15499 Version 1.75c.
15500
15501 * tests/actions.at (Actions after errors): Use an output format
15502 more similar to that of the Printers and Destructors test.
15503 Test the position of the ';' token too.
15504 (Printers and Destructors): Likewise.
15505 (Printers and Destructors: %glr-parser): Remove for now, to avoid
15506 unnecessarily alarming people when the test fails.
15507
15508 * data/yacc.c (yyerrlab1): Move this label down, so that the
15509 parser does not discard the lookahead token if the user code
15510 invokes YYERROR. This change is required for POSIX conformance.
15511
15512 * lib/error.c: Sync with gnulib.
15513
155142002-11-22 Paul Eggert <eggert@twinsun.com>
15515
15516 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
15517 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
15518 * lib/xmalloc.c: Likewise.
26b4a969 15519
58004308
PE
155202002-11-20 Paul Eggert <eggert@twinsun.com>
15521
15522 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
15523
155242002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 15525
58004308
PE
15526 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
15527 should use `if (! x) abort ();' rather than `assert (x);', and
15528 anyway it's one less thing to worry about configuring.
15529
15530 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
15531 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
15532 and replace all instances of assert with abort.
15533 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
15534 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
15535
15536 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
15537 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
15538 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
15539 hash_find_entry, hash_rehash, hash_insert): Likewise.
15540 * src/conflicts.c (resolve_sr_conflict): Likewise.
15541 * src/lalr.c (set_goto_map, map_goto): Likewise.
15542 * src/nullable.c (nullable_compute): Likewise.
15543 * src/output.c (prepare_rules, token_definitions_output): Likewise.
15544 * src/reader.c (packgram, reader): Likewise.
15545 * src/state.c (state_new, state_free, state_transitions_set,
15546 state_reduction_find): Likewise.
15547 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
15548 symbol_pack): Likewise.
15549 * src/tables.c (conflict_row, pack_vector): Likewise.
15550 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
15551 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
15552 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
15553 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
15554
15555 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
15556 (ARGMATCH_CONSTRAINT): New macro.
15557 (ARGMATCH_ASSERT): Use it.
15558
15559 * src/system.h (verify): New macro.
15560 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
15561 rather than assert.
15562 * src/tables.c (tables_generate): Likewise.
15563
15564 * src/struniq.c (struniq_assert): Now returns void, and aborts
15565 if the assertion is false.
15566 (struniq_assert_p): Remove.
15567 * src/struniq.h: Likewise.
15568
76ae8198
PE
155692002-11-18 Paul Eggert <eggert@twinsun.com>
15570
15571 * data/glr.c (yygetLRActions): Replace `yyindex' with
15572 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
15573 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 15574 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 15575
d3c4e709
AD
155762002-11-18 Akim Demaille <akim@epita.fr>
15577
15578 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
15579 space.
15580 From Tim Van Holder.
15581
8d8a7238
PE
155822002-11-17 Paul Eggert <eggert@twinsun.com>
15583
15584 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
15585 to "SyntaxError" for consistency with my 2002-11-15 change.
15586
15587 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
15588 not define to {}, since this breaks the common use of `YYDPRINTF
15589 ((...));' if a single statement is desired (e.g. before `else').
15590 Work around GCC warnings by surrounding corresponding calls with
15591 {} if needed.
15592 (yyhasResolvedValue): Remove unused function.
15593 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
15594 loop body.
15595 (yyreportSyntaxError): Renamed from yyreportParseError.
15596 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
15597 All uses changed.
15598 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
15599 extern when possible. Remove unused initializations.
15600
b0937b22
AD
156012002-11-16 Akim Demaille <akim@epita.fr>
15602
15603 Augment the similarity between GLR and LALR traces.
15604
15605 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
15606 (YY_REDUCE_PRINT): New.
15607 (yyparse): Use them.
15608 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
15609 YYDPRINT here.
15610 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
15611 state reached after the reduction/recovery, since...
15612 (yyparse, yyprocessOneStack): Report the state we are entering in.
15613
c5e3e510
AD
156142002-11-16 Akim Demaille <akim@epita.fr>
15615
15616 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
15617 Add support for --trace=skeleton.
15618 * src/scan-skel.l: %option debug.
15619 Scan strings of non-@ or \n instead of character by character.
15620 (scan_skel): Handle trace_skeleton.
15621 (QPUTS): New.
15622 (@output_parser_name@, @output_header_name@): ``Restore'' their
15623 support (used to be M4 macros).
15624 * data/yacc.c: Quote larger chunks, a la glr.c.
15625 * data/lalr1.cc: Likewise.
15626 The header guards are no longer available, so use some other
15627 string than `YYLSP_NEEDED'.
15628
4c6cc1db
AD
156292002-11-16 Akim Demaille <akim@epita.fr>
15630
15631 Make the ``Printers and Destructors'' test more verbose, taking
15632 `yacc.c''s behavior as (possibly wrong) reference.
15633
15634 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
15635 instead of fprint on stdout.
15636 Set and report the last_line of the symbols.
15637 Consistently display values and locations.
15638
6d9e8019
PE
156392002-11-16 Paul Eggert <eggert@twinsun.com>
15640
15641 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
15642
6e649e65
PE
156432002-11-15 Paul Eggert <eggert@twinsun.com>
15644
b25d88f6
PE
15645 * tests/actions.at (Actions after errors): New test case.
15646
6e649e65
PE
15647 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
15648 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
15649 tests/action.at, tests/calc.at, tests/conflicts.at,
15650 tests/cxx-type.at, tests/regression.at:
15651 "parse error" -> "syntax error" for POSIX compatibility.
15652 "parsing stack overflow..." -> "parser stack overflow" so
15653 that code matches Bison documentation.
15654
0f39aab9
AD
156552002-11-15 Akim Demaille <akim@epita.fr>
15656
15657 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
15658 take two BRACED_CODE, not two string_content.
15659 Free the scanner's obstack when we are done.
15660 (code_content): New.
15661 * tests/calc.at: Adjust.
15662 * doc/bison.texinfo: Adjust.
15663 Also, make sure to include the `,' for these declarations.
15664
761c1926
AD
156652002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
15666
15667 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
15668 definition; avoids potential autoreconf problems.
15669
b0f98b10
AD
156702002-11-15 Akim Demaille <akim@epita.fr>
15671
15672 Always check the value returned by yyparse.
15673
15674 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
15675 returned by yyparse.
15676 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
15677 Adjust calls.
15678 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
15679 returned by yyparse.
15680
970785f1
PH
156812002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15682
15683 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
15684 on input.at test.
15685
8fcc7db1
PE
156862002-11-14 Paul Eggert <eggert@twinsun.com>
15687
7ec1b48e
PE
15688 * src/output.c (output_skeleton): Call xfopen instead of
15689 duplicating xfopen's body.
15690
cfff7583 15691 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 15692 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 15693
8fcc7db1
PE
15694 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
15695 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
15696 Group compiler. Instead, use "$CC -E bar.c". Include the .h
15697 file twice in the grammar, as an extra check.
15698
15699 * tests/input.at (Torturing the Scanner): Surround the
15700 backslash-newline tests with "#if 0", to make it less likely that
15701 we'll run into compiler bugs. Bring back solitary \ inside
15702 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 15703 test backslash-newline in C character constant.
8fcc7db1 15704
4e8d992c
AD
157052002-11-14 Akim Demaille <akim@epita.fr>
15706
15707 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
15708 status of the compiler.
f32b346d 15709 Calling `exit 1' is no longer needed.
4e8d992c
AD
15710 Reported by Nelson H. F. Beebe.
15711
9501dc6e
AD
157122002-11-14 Akim Demaille <akim@epita.fr>
15713
15714 * tests/atlocal.in (CPPFLAGS): We have config.h.
15715 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
15716 New.
15717 * tests/actions.at, tests/calc.at, tests/conflicts.at,
15718 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
15719 * tests/regression.at, tests/torture.at: Use them for all the
15720 grammars that are to be compiled.
15721 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
15722 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
15723 * doc/bison.texinfo (GLR Parsers): Document `inline'.
15724
18b519c0
AD
157252002-11-14 Akim Demaille <akim@epita.fr>
15726
15727 * doc/bison.texinfo: Various formatting changes (alignments in
15728 samples, additional @group/@end group, GCS in samples.
15729 Use @deffn instead of simple @table to define the directives,
15730 macros, variables etc.
15731
9a86cdb9
PE
157322002-11-13 Paul Eggert <eggert@twinsun.com>
15733
daa33def 15734 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 15735 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 15736
daa33def 15737 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 15738 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
15739 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
15740 * tests/headers.at (export YYLTYPE): Likewise.
15741
15742 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 15743 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 15744
9a86cdb9
PE
15745 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
15746 comments, since they're not portable. Use GNU coding style.
15747
9c1e26bd
AD
157482002-11-13 Akim Demaille <akim@epita.fr>
15749
15750 * data/yacc.c: Leave bigger chunks of quoted text.
15751 (YYDSYMPRINTF): New.
15752 Use it to report symbol activities.
15753 * data/glr.c (YYDSYMPRINTF): New.
15754 Use it.
15755
87f721cc
PE
157562002-11-12 Paul Eggert <eggert@twinsun.com>
15757
15758 Version 1.75b.
15759
15760 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
15761 (yyglrReduce): Return yyok, not 0.
15762 This should avoid the enumerated-type warnings reported
464c6927 15763 by Nelson H. F. Beebe in
161a71f3 15764 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
15765
15766 * lib/bbitset.h (BITSET_INLINE): Remove.
15767 * lib/bitset.h [! BITSET_INLINE]: Remove.
15768 (bitset_set, bitset_reset, bitset_test): Rename local vars
15769 to avoid shadowing warnings by GCC.
15770
15771 * data/glr.c (inline): Remove #define. It's the user's
15772 responsibility to #define it away, just like 'const'.
464c6927 15773 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 15774 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 15775
87f721cc
PE
15776 * Makefile.maint (po-check): Scan .l and .y files instead of the
15777 .c and the .h files that they generate. This fixes the bug
15778 reported by Tim Van Holder in:
161a71f3 15779 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
15780 Look for N_ as well as for _. Try to avoid matching #define for
15781 N_ and _.
15782 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
15783 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
15784 * src/scan-gram.l: Revamp regular expressions so that " and '
15785 do not confuse xgettext.
15786
15787 * src/struniq.h (struniq_new): Do not declare the return type
15788 to be 'const'; this violates the C standard.
15789 * src/struniq.c (struniq_new): Likewise.
15790
be14ade5
AD
157912002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
15792
15793 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
15794 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
15795 linker.
15796
05291fbc
AD
157972002-11-12 Akim Demaille <akim@epita.fr>
15798
15799 * Makefile.maint: Sync with Autoconf:
15800 (local_updates): New.
15801
1f5fd52e
AD
158022002-11-12 Akim Demaille <akim@epita.fr>
15803
15804 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
15805
283f1e64
AD
158062002-11-12 Akim Demaille <akim@epita.fr>
15807
15808 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
15809 locations.
15810
886b69d1
AD
158112002-11-12 Akim Demaille <akim@epita.fr>
15812
15813 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
15814 not yyvalue.
15815
3df37415
AD
158162002-11-12 Akim Demaille <akim@epita.fr>
15817
15818 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
15819 Use it to test the GLR parser.
15820
7bd6c77e
AD
158212002-11-12 Akim Demaille <akim@epita.fr>
15822
15823 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
15824 defines it.
15825 * data/glr.c (yystos): New.
15826 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
15827 (YYDSYMPRINT): New.
15828 (yyval): Don't define it, it is handled via M4.
15829 (yyrecoverParseError): Free verbosely the discarded symbols.
15830 * data/yacc.c (yysymprint): Remove, rather...
15831 (b4_yysymprint_generate): invoke.
15832 * data/c.m4 (b4_yysymprint_generate): New.
15833 Accept pointers as arguments, as opposed to the version from
15834 yacc.c.
15835 (b4_yydestruct_generate): Likewise.
15836 * tests/cations.at (Printers and Destructors): Use Bison directives
15837 instead of CPP macros.
15838 Don't rely on internal details.
15839
b0400cc6
AD
158402002-11-12 Akim Demaille <akim@epita.fr>
15841
15842 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
15843 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
15844 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
15845 it against YYEMPTY and so forth), work on yytoken (i.e., set
15846 it to YYEMPTY etc.).
15847 (yydestruct): Replace with a b4_yydestruct_generate invocation.
15848 (b4_symbol_actions): Remove.
15849 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
15850 for 0, end-of-input.
15851
72f889cc
AD
158522002-11-12 Akim Demaille <akim@epita.fr>
15853
15854 * doc/bison.texinfo (Destructor Decl): New.
15855
b1ae9233
AD
158562002-11-12 Akim Demaille <akim@epita.fr>
15857
15858 * src/tables.c (tables_generate): Use free for pointers that
15859 cannot be NULL, not XFREE.
15860 (pack_vector): Use assert, not fatal, for bound violations.
15861 * src/state.c (state_new): Likewise.
15862 * src/reader.c (reader): Likewise.
15863 * src/lalr.c (set_goto_map): Likewise.
72f889cc 15864 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
15865 the file name.
15866
7ec2d4cd
AD
158672002-11-12 Akim Demaille <akim@epita.fr>
15868
15869 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
15870 Restore.
15871 * src/scan-gram.l (last_string): Is global to the file, not to
15872 yylex.
15873 * src/parse-gram.y (input): Don't append the epilogue here,
15874 (epilogue.opt): do it here, and free the scanner's obstack.
15875 * src/reader.c (epilogue_set): Rename as...
15876 (epilogue_augment): this.
15877 * data/c.m4 (b4_epilogue): Defaults to empty.
15878
573a6cd3
AD
158792002-11-12 Akim Demaille <akim@epita.fr>
15880
15881 * src/getargs.c (long_options): Remove duplicates.
15882 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
15883 Remove.
15884 * doc/bison.rnh: Remove.
15885 * doc/bison.texinfo (VMS Invocation): Remove.
15886
95612cfa
AD
158872002-11-12 Akim Demaille <akim@epita.fr>
15888
15889 * src/struniq.h, src/struniq.c (struniq_t): Is const.
15890 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
15891
15892 Use struniq for symbols.
15893
15894 * src/symtab.h (symbol_t): The tag member is a struniq.
15895 (symbol_type_set): Adjust.
15896 * src/symtab.c (symbol_new): Takes a struniq.
15897 (symbol_free): Don't free the tag member.
15898 (hash_compare_symbol_t, hash_symbol_t): Rename as...
15899 (hash_compare_symbol, hash_symbol): these.
15900 Use the fact that tags as struniqs.
15901 (symbol_get): Use struniq_new.
15902 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
15903 Returns a strniq.
15904 * src/reader.h (merger_list, grammar_currentmerge_set): The name
15905 and type members are struniqs.
15906 * src/reader.c (get_merge_function)
15907 (grammar_current_rule_merge_set): Adjust.
15908 (TYPE, current_type): Are struniq.
15909
15910 Use struniq for file names.
15911
15912 * src/files.h, src/files.c (infile): Split into...
15913 (grammar_file, current_file): these.
15914 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
15915 * src/reduce.c (reduce_print): Likewise.
15916 * src/getargs.c (getargs): Likewise.
15917 * src/complain.h, src/complain.c: Likewise.
15918 * src/main.c (main): Call struniqs_new early enough to use it for
15919 file names.
15920 Don't free the input file name.
15921
3e6656f9
AD
159222002-11-12 Akim Demaille <akim@epita.fr>
15923
15924 * src/symtab.c (symbol_free): Remove dead deactivated code:
15925 type_name are properly removed.
15926 Don't use XFREE to free items that cannot be NULL.
15927 * src/struniq.h, src/struniq.c: New.
15928 * src/main.c (main): Initialize/free struniqs.
15929 * src/parse-gram.y (%union): Add astruniq member.
15930 (yyprint): Adjust.
15931 * src/scan-gram.l (<{tag}>): Return a struniq.
15932 Free the obstack bit that used to store it.
15933 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
15934
7672019c
PE
159352002-11-11 Paul Eggert <eggert@twinsun.com>
15936
15937 Revamp to fix many (but not all) of the C- and M4-related quoting
15938 problems. Among other things, this fixes the Bison bug reported
15939 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 15940 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
15941
15942 Use new @ escapes consistently. Represent brackets with @{ and @}
15943 rather than @<:@ and @:>@, since this works a bit better with dumb
15944 editors like vi. Represent @ with @@, since @ is now consistently
15945 an escape. Use @oline@ and @ofile@ rather than __oline__ and
15946 __ofile__, to avoid unexpected expansions. Similarly, use @output
15947 rather than #output.
15948
15949 * data/c.m4 (b4_copyright): Omit file name from comment, since
15950 the file name could contain "*/".
15951 (b4_synclines_flag): Don't quote the 2nd argument; it should already
15952 be quoted. All uses changed.
15953
15954 * data/glr.c: Use new @ escapes consistently.
15955 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
15956 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
15957 Remove, since they couldn't handle arbitrary characters in file
15958 names.
15959 * data/lalr1.cc: Likewise.
15960 * data/yacc.c: Likewise.
15961
15962 * src/files.c (output_infix): Remove; all uses removed.
15963 * src/files.h: Likewise.
15964
15965 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
15966 mishandled funny characters in file names, and anyway it isn't
15967 needed any more.
15968 * data/yacc.c: Likewise.
15969 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
15970
15971 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
15972 * data/yacc.c: Likewise.
15973
15974 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
15975 strings now.
15976 (muscle_init): Quote filename as a C string.
15977 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
15978 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
15979 * src/output.c (escaped_file_name_output): New function.
15980 (prepare_symbols): Quote tokens for M4.
15981 (prepare): Don't insert output_infix, output_prefix,
15982 output_parser_name, output_header_name; this is now down by scan-skel.
15983 Insert skeleton as a C string.
15984
15985 * src/output.c (user_actions_output, symbol_destructors_output,
15986 symbol_printers_output): Quote filenames for C and M4.
15987 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15988
15989 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
15990 escapes other than \\ and \'; this simplifies the code.
15991 (<SC_STRING>): Likewise, for \\ and \".
15992 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
15993 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
15994 Use new escapes @{ and @} for [ and ].
15995
15996 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
15997 them with auto vars.
15998 Switch to new escape scheme, where @ is the escape character uniformly.
15999 Abort if a stray escape character is found. Avoid unbounded input
16000 buffer when parsing non-escaped text.
16001
16002 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
16003 __oline__, #output, $@, and @{ do not have unintended meanings.
16004
acea4f3b
PE
160052002-11-09 Paul Eggert <eggert@twinsun.com>
16006
16007 Fix the test failure due to GCC warnings described in
161a71f3 16008 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
16009 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
16010 evaluate to 0 if it's impossible for NINF to be in the respective
16011 table.
16012 (yygetLRActions, yyrecoverParseError): Use them.
16013
16014 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
16015 counted in the token inserted at end of file. Now takes
16016 location_t *, not location_t, so that the location can be
16017 adjusted. All uses changed.
16018
16019 * tests/regression.at (Invalid inputs): Adjust wording in
16020 diagnostic to match the new behavior.
16021
16022 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
16023 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
16024 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
16025 abort ();'. This reduces the runtime of the "Many lookaheads"
16026 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
16027 GCC 3.2.
16028
20ef1ad5
PE
160292002-11-07 Paul Eggert <eggert@twinsun.com>
16030
16031 * src/parse-gram.y (CHARACTER): Remove unused token.
16032 All uses removed.
16033
16034 * src/scan-gram.l: Remove stack option. We no longer use the
16035 stack, since the stack was never deeper than 1; instead, use the
16036 new auto var c_context to record the stacked value.
16037
16038 Remove nounput option. At an unexpected end of file, we now unput
16039 the minimal input necessary to end cleanly; this simplifies the
16040 code.
16041
16042 Avoid unbounded token sizes where this is easy.
16043
16044 (unexpected_end_of_file): New function.
16045 Use it to systematize the error message on unexpected EOF.
16046 (last-string): Now auto, not static.
16047 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
16048 (scanner_last_string_free): Remove; not used.
16049 (percent_percent_count): Move decl to just before use.
16050 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
16051 not the (never otherwised-used) CHARACTER.
16052
93724f13
AD
160532002-11-07 Akim Demaille <akim@epita.fr>
16054
16055 Let yyerror always receive the msg as last argument, so that
16056 yyerror can be variadic.
16057
16058 * data/yacc.c (b4_yyerror_args): New.
16059 Use it when calling yyerror.
16060 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
16061 Use it when calling yyerror.
16062 * doc/bison.texinfo (Error Reporting): Adjust.
16063 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
16064 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
16065
6e40b4eb
AD
160662002-11-06 Akim Demaille <akim@epita.fr>
16067
16068 #line should have quoted strings.
16069 Ideally, this should be done by m4_quotearg.
16070
16071 * src/scan-skel.l: Include quotearg.h.
16072 Quote __ofile__.
16073 * src/output.c (symbol_printers_output)
16074 (symbol_destructors_output): Quote the file name.
16075
2dfbfc12
AD
160762002-11-06 Akim Demaille <akim@epita.fr>
16077
16078 * tests/regression.at (Invalid inputs): Adjust to the recent
16079 messages.
16080
437c2d80
AD
160812002-11-06 Akim Demaille <akim@epita.fr>
16082
16083 Restore --no-lines.
16084 Reported by Jim Kent.
16085
16086 * data/c.m4 (b4_syncline): New.
16087 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
16088 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
16089 * src/output.c (user_actions_output): Likewise.
16090 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 16091 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 16092
900c5db5
AD
160932002-11-06 Akim Demaille <akim@epita.fr>
16094
16095 * src/main.c (main): Free `infile'.
16096 * src/scan-gram.l (handle_syncline): New.
16097 Recognize `#line'.
16098 * src/output.c (user_actions_output, symbol_destructors_output)
16099 (symbol_printers_output): Use the location's file name, not
16100 infile.
16101 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16102
e183b123 161032002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 16104
e183b123 16105 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 16106 either has GLR conflict entries.
e183b123 16107
193eb6b7
PE
161082002-11-05 Paul Eggert <eggert@twinsun.com>
16109
e183b123
PE
16110 * src/scan-gram.l: Use more accurate diagnostics, e.g.
16111 "integer out of range" rather than "invalid value".
16112 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
16113 accordingly.
16114
193eb6b7
PE
16115 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
16116 Also, remove one static variable in the scanner.
16117
16118 * src/scan-gram.l (braces_level): Now auto, not static.
16119 Initialize to zero if the compiler is being picky.
16120 (INITIAL): Clear braces_level instead of incrementing it.
16121 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
16122 as POSIX 1003.1-2001 requires.
16123 * src/system.h (IF_LINT): New macro, taken from coreutils.
16124 * configure.ac: Define "lint" if --enable-gcc-warnings.
16125
29c01725
AD
161262002-11-05 Akim Demaille <akim@epita.fr>
16127
16128 * src/scan-gram.l: When it starts with `%', complain about the
16129 whole directive, not just that `invalid character: %'.
16130
8aeac3ca
AD
161312002-11-04 Akim Demaille <akim@epita.fr>
16132
16133 * Makefile.maint: Update from Autoconf.
16134 (update, cvs-update, po-update, do-po-update): New.
16135
793a58bb
AD
161362002-11-04 Akim Demaille <akim@epita.fr>
16137
16138 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
16139 and yyerror.
16140 Have yyerror `use' its arguments.
16141 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
16142 returns true when location & yacc & pure & parse-param.
16143 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
16144
c4d720cd
AD
161452002-11-04 Akim Demaille <akim@epita.fr>
16146
16147 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
16148 clashes.
16149 * src/scan-gram.l: Use [\'] instead of ['] to pacify
16150 font-lock-mode.
16151 Use complain_at.
16152 Use quote, not quote_n since LOCATION_PRINT no longer uses the
16153 slot 0.
16154
613a0dc5
PE
161552002-11-03 Paul Eggert <eggert@twinsun.com>
16156
16157 * src/reader.c (get_merge_function, grammar_current_rule_check):
16158 Use consistent diagnostics for reporting type name clashes.
16159 Quote the types with <>, for consistency with Yacc.
16160 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
16161
2a8d363a
AD
161622002-11-03 Akim Demaille <akim@epita.fr>
16163
16164 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
16165 New.
16166 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
16167 (b4_parse_param): Remove.
16168 Use b4_identification.
16169 Propagate b4_pure_args where needed to pass them to yyerror.
16170 * data/glr.m4 (b4_parse_param): Remove.
16171 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
16172 (b4_lpure_formals): New.
16173 Use b4_identification.
16174 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
16175 b4_user_formals and b4_user_args.
16176 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
16177 (yyreportAmbiguity): When using a pure parser, also need
16178 the location, and the parse-params.
16179 Adjust callers.
16180 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
16181 When using a pure parser, also need the parse-params.
16182 Adjust callers.
16183 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
16184 (%pure-parser + %parse-param) LALR and GLR parsers.
16185 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
16186 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
16187 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
16188 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
16189 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
16190 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
16191 * doc/bison.texinfo: Untabify the whole file.
16192 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
16193 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
16194 (Error Reporting): Adjust to these new directives.
16195 Document %error-verbose, deprecate YYERROR_VERBOSE.
16196
9e32add8
AD
161972002-11-03 Akim Demaille <akim@epita.fr>
16198
16199 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
16200 AT_CHECK_CALC_GLR invocations to use % directives, instead of
16201 command line options.
16202 * tests/cxx-type.at: Formatting changes.
16203
b02d90a5
PE
162042002-11-03 Paul Eggert <eggert@twinsun.com>
16205
16206 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
16207 to count columns correctly, and to check for invalid inputs.
9e32add8 16208
b02d90a5
PE
16209 Use mbsnwidth to count columns correctly. Account for tabs, too.
16210 Include mbswidth.h.
16211 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
16212 (extend_location): New function.
16213 (YY_LINES): Remove.
16214
16215 Handle CRLF in C code rather than in Lex code.
16216 (YY_INPUT): New macro.
16217 (no_cr_read): New function.
16218
16219 Scan UCNs, even though we don't fully handle them yet.
16220 (convert_ucn_to_byte): New function.
16221
16222 Handle backslash-newline correctly in C code.
16223 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
16224 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
16225 all uses changed.
16226 (tag, splice): New EREs. Do not allow NUL or newline in tags.
16227 Use {splice} wherever C allows backslash-newline.
16228 YY_STEP after space, newline, vertical-tab.
16229 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 16230
b02d90a5
PE
16231 (letter, id): Don't assume ASCII; e.g., spell out a-z.
16232
16233 ({int}, handle_action_dollar, handle_action_at): Check for integer
16234 overflow.
9e32add8 16235
b02d90a5
PE
16236 (YY_STEP): Omit trailing semicolon, so that it's more like C.
16237
16238 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
16239 as well as \000. Check for UCHAR_MAX, not 255.
16240 Allow \x with an arbitrary positive number of digits, as in C.
16241 Check for overflow here.
16242 Allow \? and UCNs, for compatibility with C.
16243
16244 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
16245 with quote slot used by complain_at.
16246
16247 * tests/input.at: Add tests for backslash-newline, m4 quotes
16248 in symbols, long literals, and funny escapes in strings.
16249
16250 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
16251 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
16252 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
16253 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
16254 * m4/mbswidth.m4: New file, from GNU coreutils.
16255
16256 * doc/bison.texinfo (Grammar Outline): Document // comments.
16257 (Symbols): Document that trigraphs have no special meaning in Bison,
16258 nor is backslash-newline allowed.
16259 (Actions): Document that trigraphs have no special meaning.
16260
16261 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
16262 no longer used.
16263
162642002-11-02 Paul Eggert <eggert@twinsun.com>
16265
16266 * src/reader.c: Don't include quote.h; not needed.
16267 (get_merge_function): Reword warning to be consistent with
16268 type clash diagnostic in grammar_current_rule_check.
16269
16270 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
16271 bug in trigraph handling.
16272
16273 * src/output.c (prepare_symbols): When printing token names,
16274 escape "[" as "@<:@" and likewise for "]".
16275
16276 * src/system.h (errno): Remove declaration, as we are now
16277 assuming C89 or better, and C89 guarantees errno.
16278
762b212b
PE
162792002-10-30 Paul Eggert <eggert@twinsun.com>
16280
16281 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
16282 Check for close failures.
16283 * src/files.h (xfclose): Return void, not int, since it always
16284 returned zero.
16285 * src/files.c (xfclose): Likewise. Report I/O error if ferror
16286 indicates one.
16287 * src/output.c (output_skeleton): Use xfclose rather than fclose
16288 and ferror. xfclose now checks ferror.
16289
16290 * data/glr.c (YYLEFTMOST_STATE): Remove.
16291 (yyreportTree): Use a stack-based leftmost state. This avoids
16292 our continuing battles with bogus warnings about initializers.
16293
56100c60
AD
162942002-10-30 Akim Demaille <akim@epita.fr>
16295
16296 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
16297 #if.
16298
51b4a04c
PH
162992002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16300
16301 * tests/glr-regr1.at: New test for reported regressions.
16302 * tests/testsuite.at: Add glr-regr1.at test.
16303 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 16304
bf1ebda2
PE
163052002-10-24 Paul Eggert <eggert@twinsun.com>
16306
5c16c6b1
PE
16307 Version 1.75a.
16308
bf1ebda2
PE
16309 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
16310 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
16311 we use malloc. Don't assume 'A' through 'Z' are contiguous.
16312 Don't assume strdup exists; POSIX says its an XSI extension.
16313 Check for buffer overflow on input.
16314
b526ee61
AD
163152002-10-24 Akim Demaille <akim@epita.fr>
16316
16317 * src/output.c (output_skeleton): Don't disable M4sugar comments
16318 too soon: it results in comments being expanded.
16319 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
16320 first output.
16321
f1886bb2
AD
163222002-10-24 Akim Demaille <akim@epita.fr>
16323
16324 * data/yacc.c (m4_int_type): New.
16325 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
16326 char' as only yacc.c wants K&R portability.
16327 * data/glr.c (yysigned_char): Remove.
16328 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
16329 Reported by Quoc Peyrot.
16330
c5576256
PE
163312002-10-23 Paul Eggert <eggert@twinsun.com>
16332
16333 * src/main.c (main): With --trace=time, report times even if a
16334 non-fatal error occurs. Formerly, the times were reported in some
16335 such cases but not in others.
16336 * src/reader.c (reader): Just return if a complaint has been issued,
16337 instead of exiting, so that 'main' can report times.
16338
27b0ffea
AD
163392002-10-22 Akim Demaille <akim@epita.fr>
16340
16341 * src/system.h: Include sys/types.
16342 Reported by Bert Deknuydt.
16343
223a7883
PE
163442002-10-23 Paul Eggert <eggert@twinsun.com>
16345
16346 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
16347 Suggested by Art Haas.
16348
163492002-10-22 Paul Eggert <eggert@twinsun.com>
16350
16351 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
16352 decl; not needed any more.
16353 * src/main.c (main): Use return to exit, undoing yesterday's change.
16354 The last OS that we could find where this wouldn't work is
16355 SunOS 3.5, and that's too old to worry about now.
16356
16357 * data/glr.c (struct yyltype): Define members even when not
16358 doing locations. This is more consistent with yacc.c, and it
16359 works around the following bug reports:
161a71f3
PE
16360 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
16361 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 16362
223a7883
PE
16363 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
16364 @acronym consistently. Standardize on "Yacc" instead of "YACC",
16365 "Algol" instead of "ALGOL". Give a bit more history about BNF.
16366
8b76775a
AD
163672002-10-22 Akim Demaille <akim@epita.fr>
16368
16369 * data/README: New.
16370
6db10d14
PE
163712002-10-21 Paul Eggert <eggert@twinsun.com>
16372
16373 Be consistent about 'bool'; the old code used an enum in one
16374 module and an int in another, and this violates the C standard.
16375 * m4/stdbool.m4: New file, from coreutils 4.5.3.
16376 * configure.ac (AC_HEADER_STDBOOL): Add.
16377 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
16378 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
16379 * src/symtab.c (hash_compare_symbol_t): Likewise.
16380 * src/system.h (bool, false, true): Use a definition consistent
16381 with ../lib/hash.c. All uses changed.
16382
16383 * src/complain.c (warning_issued): Renamed from warn_message_count,
16384 so that we needn't worry about integer overflow (!).
16385 Now of type bool. All uses changed.
16386 (complaint_issued): Renamed from complain_message_count; likewise.
16387
16388 * src/main.c (main): Use exit to exit with failure.
27b0ffea 16389
6db10d14
PE
16390 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
16391 rather than 1 and 0.
16392 * src/main.c (main): Likewise.
16393 * src/getargs.c (getargs): Likewise.
16394 * src/reader.c (reader): Likewise.
16395
16396 * src/getarg.c (getargs): Remove duplicate code for
16397 "Try `bison --help'".
16398
16399 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
16400 What was that "2" for?
16401
16402 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
16403 * src/getargs.c (usage): Likewise.
16404
16405 * src/getargs.c (getargs): When there are too few operands, report
16406 the last one. When there are too many, report the first extra
16407 one. This is how diffutils does it.
16408
92a060fd
PE
164092002-10-20 Paul Eggert <eggert@twinsun.com>
16410
16411 Remove K&R vestiges.
16412 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
16413 * src/complain.c (VA_START): Remove. Assume prototypes.
16414 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
16415 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
16416 fatal): Assume prototypes.
16417 * src/complain.h: Assume prototypes.
16418 * src/system.h (PARAMS): Remove.
16419 Include <limits.h> unconditionally, since it's guaranteeed even
16420 for a freestanding C89 compiler.
16421 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
16422 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 16423
e7cb57c0
AD
164242002-10-20 Akim Demaille <akim@epita.fr>
16425
16426 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
16427 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
16428 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
16429 (yyresolveStates, yyresolveAction, yyresolveStack)
16430 (yyprocessOneStack): Use them.
16431 (yy_reduce_print): New.
16432 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
16433
0245f82d
AD
164342002-10-20 Akim Demaille <akim@epita.fr>
16435
16436 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
16437 arguments and output `void'.
16438 (b4_c_function): Rename as...
16439 (b4_c_function_def): this.
16440 (b4_c_function_decl, b4_c_ansi_function_def)
16441 (b4_c_ansi_function_decl): New.
16442 Change the interpretation of the arguments: before `int, foo', now
16443 `int foo, foo'.
16444 * data/yacc.c (yyparse): Prototype and define thanks to these.
16445 Adjust b4_c_function_def uses.
16446 * data/glr.c (yyparse): Likewise, but ANSI only.
16447
39912f52
AD
164482002-10-20 Akim Demaille <akim@epita.fr>
16449
16450 * src/output.c (prepare): Move the definition of `tokens_number',
16451 `nterms_number', `undef_token_number', `user_token_number_max'
16452 to...
16453 (prepare_tokens): Here.
16454 (prepare_tokens): Rename as...
16455 (prepare_symbols): this.
16456 (prepare): Move the definition of `rules_number' to...
16457 (prepare_rules): here.
16458 (prepare): Move the definition of `last', `final_state_number',
16459 `states_number' to...
16460 (prepare_states): here.
16461 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
16462
20c1e2ad
AD
164632002-10-20 Akim Demaille <akim@epita.fr>
16464
16465 * src/tables.h, src/tables.c, src/output.c: Comment changes.
16466
21964f43
AD
164672002-10-20 Akim Demaille <akim@epita.fr>
16468
16469 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
16470 * data/c.m4: here.
16471
66d30cd4
AD
164722002-10-20 Akim Demaille <akim@epita.fr>
16473
16474 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
16475 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
16476 `pair'.
16477 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
16478 `name' to...
16479 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
16480 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
16481 These.
16482
95f2c9fe
PE
164832002-10-19 Paul Eggert <eggert@twinsun.com>
16484
16485 Do not create a temporary file, as that involves security and
16486 cleanup headaches. Instead, use a pair of pipes.
16487 Derived from a suggestion by Florian Krohm.
16488 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
16489 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
16490 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
16491 (BISON_PREREQ_SUBPIPE): Add.
16492 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
16493 Add subpipe.h, subpipe.c.
16494 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
16495 * po/POTFILES.in: Add lib/subpipe.c.
16496 * src/output.c: Include "subpipe.h".
16497 (m4_invoke): Remove decl.
16498 (scan_skel): New decl.
16499 (output_skeleton): Use pipe rather than temporary file for m4 input.
16500 Check that m4sugar.m4 is readable, to avoid deadlock.
16501 Check for pipe I/O error.
16502 * src/scan-skel.l (readpipe): Remove decl.
16503 (scan_skel): New function, to be used in place of m4_invoke.
16504 Read from stream rather than file.
66d30cd4 16505
95f2c9fe
PE
16506 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
16507 float, as this generates a warning on Solaris 8 + GCC 3.2 with
16508 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
16509 this generates a more-accurate value anyway.
16510
16511 * lib/timevar.c (timervar_accumulate): Rename locals to
16512 avoid confusion with similarly-named more-global.
16513 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
16514
16515 * src/output.c (prepare): Use xstrdup to convert char const *
16516 to char *, to avoid GCC warning.
16517
c19988b7
AD
165182002-10-19 Akim Demaille <akim@epita.fr>
16519
16520 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
16521 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
16522 Use them to have `calc.y' ready for %pure-parser.
16523 * data/yacc.c (YYLEX): Pass a yylex return type to
16524 b4_c_function_call.
16525
ae7453f2
AD
165262002-10-19 Akim Demaille <akim@epita.fr>
16527
16528 Prototype support of %lex-param and %parse-param.
16529
16530 * src/parse-gram.y: Add the definition of the %lex-param and
16531 %parse-param tokens, plus their rules.
16532 Drop the `_' version of %glr-parser.
16533 Add the "," token.
16534 * src/scan-gram.l (INITIAL): Scan them.
16535 * src/muscle_tab.c: Comment changes.
16536 (muscle_insert, muscle_find): Rename `pair' as `probe'.
16537 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
16538 (muscle_entry_s): The `value' member is no longer const.
16539 Adjust all dependencies.
16540 * src/muscle_tab.c (muscle_init): Adjust: use
16541 MUSCLE_INSERT_STRING.
16542 Initialize the obstack earlier.
16543 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
16544 (muscle_pair_list_grow): New.
16545 * data/c.m4 (b4_c_function_call, b4_c_args): New.
16546 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
16547 * tests/calc.at: Use %locations, not --locations.
16548 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
16549
0e575721
AD
165502002-10-19 Akim Demaille <akim@epita.fr>
16551
16552 * src/getargs.c (usage): Take status as argument and exit
16553 accordingly.
16554 Report the traditional `Try ... --help' message when status != 0.
16555 (usage, version): Don't take a FILE * as arg, it is pointless.
16556 (getargs): When there is an incorrect number of arguments, make it
16557 an error, and report it GNUlically thanks to `usage ()'.
16558
724ce7f5
PE
165592002-10-18 Paul Eggert <eggert@twinsun.com>
16560
3a781eb2
PE
16561 * data/glr.c (yyreportParseError): Don't assume that sprintf
16562 yields the length of the printed string, as this is not true
16563 on SunOS 4.1.4. Reported by Peter Klein.
16564
724ce7f5
PE
16565 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
16566 * tests/conflicts.at (%nonassoc and eof): Likewise.
16567 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
16568
473d0a75
AD
165692002-10-17 Akim Demaille <akim@epita.fr>
16570
16571 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
16572 * src/getargs.c (trace_types, trace_args): Adjust.
16573 * src/reader.c (grammar_current_rule_prec_set)
16574 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
16575 Standardize error messages.
16576 And s/@prec/%prec/!
16577 (reader): Use trace_flag to enable scanner/parser debugging,
16578 instead of an adhoc scheme.
16579 * src/scan-gram.l: Remove trailing debugging code.
16580
e76d2469
PE
165812002-10-16 Paul Eggert <eggert@twinsun.com>
16582
93e2236a
PE
16583 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
16584 MUSCLE_TAB_H.
16585
e76d2469
PE
16586 * NEWS: Officially drop support for building Bison with K&R C,
16587 since it didn't work anyway and it's not worth worrying about.
16588 * Makefile.maint (wget_files): Remove ansi2knr.c.
16589 (ansi2knr.c-url_prefix): Remove.
16590 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
16591 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16592 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16593
5bd1c419
PE
165942002-10-15 Paul Eggert <eggert@twinsun.com>
16595
16596 Stop using the "enum_" trick for K&R-style function definitions;
16597 it confused me, and I was the author! Instead, assume that people
16598 who want to use K&R C compilers (when using these modules in GCC,
16599 perhaps?) will run ansi2knr.
16600
16601 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
16602 All uses of "enum_" changed to "enum ".
16603 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16604 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 16605
5bd1c419
PE
16606 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
16607 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
16608 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
16609 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
16610 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
16611 abitset_not, abitset_ones, abitset_or, abitset_or_and,
16612 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
16613 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
16614 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
16615 Use function prototypes; this removes the need for declaring
16616 static functions simply to provide their prototypes.
16617 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
16618 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
16619 bitset_count_, bitset_create, bitset_dump, bitset_first,
16620 bitset_free, bitset_init, bitset_last, bitset_next,
16621 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
16622 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
16623 bitset_print, bitset_release_memory, bitset_toggle_,
16624 bitset_type_choose, bitset_type_get, bitset_type_name_get,
16625 debug_bitset): Likewise.
16626 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
16627 * lib/bitset_stats.c (bitset_log_histogram_print,
16628 bitset_percent_histogram_print, bitset_stats_and,
16629 bitset_stats_and_cmp, bitset_stats_and_or,
16630 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
16631 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
16632 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
16633 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
16634 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
16635 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
16636 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
16637 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
16638 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
16639 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
16640 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
16641 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
16642 bitset_stats_zero): Likewise.
16643 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16644 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16645 bitsetv_dump, debug_bitsetv): Likewise.
16646 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
16647 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
16648 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
16649 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
16650 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
16651 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
16652 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
16653 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
16654 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
16655 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
16656 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
16657 Likewise.
16658 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
16659 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
16660 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
16661 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
16662 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
16663 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
16664 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
16665 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
16666 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
16667 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
16668 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 16669
ae26e1f0
AD
166702002-10-14 Akim Demaille <akim@epita.fr>
16671
16672 Version 1.75.
16673
d43baf71
AD
166742002-10-14 Akim Demaille <akim@epita.fr>
16675
16676 * tests/Makefile.am (maintainer-check-posix): New.
16677
7ebc83e3
AD
166782002-10-14 Akim Demaille <akim@epita.fr>
16679
16680 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
16681 member.
16682
05846dae
AD
166832002-10-14 Akim Demaille <akim@epita.fr>
16684
16685 * src/tables.c (table_ninf_remap): base -> tab.
16686 Reported by Matt Rosing.
16687
1318e37d
PE
166882002-10-14 Paul Eggert <eggert@twinsun.com>
16689
447fbb17
PE
16690 * tests/action.at, tests/calc.at, tests/conflicts.at,
16691 tests/cxx-type.at, tests/headers.at, tests/input.at,
16692 tests/regression.at, tests/synclines.at, tests/torture.at:
16693 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
16694 so that the tests still work even if POSIXLY_CORRECT is set.
16695 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 16696
1318e37d
PE
16697 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
16698 for portability to K&R hosts. Fix typo: signed char is guaranteed
16699 only to 127, not to 128.
16700 * data/glr.c (yysigned_char): New type.
16701 * data/yacc.c (yysigned_char): Likewise.
16702 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
16703
cc0f0794
PE
167042002-10-13 Paul Eggert <eggert@twinsun.com>
16705
5038f418
PE
16706 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
16707 true due to limited range of data type" warning from GCC.
16708
cc0f0794
PE
16709 * data/c.m4 (b4_token_defines): Protect against double-inclusion
16710 by wrapping enum yytokentype's definition inside #ifndef
16711 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
16712
6fed0802
AD
167132002-10-13 Akim Demaille <akim@epita.fr>
16714
16715 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
16716 Un yy- yyrhs to avoid the name clash with the global YYRHS.
16717
32f0598d
AD
167182002-10-13 Akim Demaille <akim@epita.fr>
16719
16720 * Makefile.maint: Update from Autoconf 2.54.
16721 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
16722
7ea9a33f
AD
167232002-10-13 Akim Demaille <akim@epita.fr>
16724
16725 * src/print.c (print_state): Separate the list of solved conflicts
16726 from the other items.
16727 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
16728
ea99527d
AD
167292002-10-13 Akim Demaille <akim@epita.fr>
16730
16731 Let nondeterministic skeletons be usable with deterministic
16732 tables.
16733
16734 With the patch, GAWK compiled by GCC without -O2 passes its test
16735 suite using a GLR parser driven by LALR tables. It fails with -O2
16736 because `struct stat' gives two different answers on my machine:
16737 88 (definition of an auto var) and later 96 (memset on this var).
16738 Hence the stack is badly corrumpted. The headers inclusion is to
16739 blame: if I move the awk.h inclusion before GLR's system header
16740 inclusion, the two struct stat have the same size.
16741
16742 * src/tables.c (pack_table): Always create conflict_table.
16743 (token_actions): Always create conflict_list.
16744 * data/glr.c (YYFLAG): Remove, unused.
16745
f377f69f
AD
167462002-10-13 Akim Demaille <akim@epita.fr>
16747
16748 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
16749 (O0FLAGS): New.
16750 (VALGRIND, GXX): New.
16751 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
16752 * tests/bison.in: Run $PREBISON a pre-command.
16753 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
16754 (maintainer-check-g++): New.
16755 * Makefile.am (maintainer-check): New.
16756
2a1fe6ed
AD
167572002-10-13 Akim Demaille <akim@epita.fr>
16758
16759 * data/glr.c: Formatting changes.
16760 Tweak some trace messages to match yacc.c's.
16761
f50adbbd
AD
167622002-10-13 Akim Demaille <akim@epita.fr>
16763
16764 GLR parsers sometimes raise parse errors instead of performing the
16765 default reduction.
16766 Reported by Charles-Henry de Boysson.
16767
16768 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 16769 check the length of the traces when %glr.
f50adbbd
AD
16770 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
16771 GLR's traces.
16772 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
16773 Test GLR parsers.
16774 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
16775 (yyltype): Remove the yy prefix from the member names.
16776 (yytable): Complete its comment.
16777 (yygetLRActions): Map error action number from YYTABLE from
16778 YYTABLE_NINF to 0.
16779 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
16780 (which was a bug: it should have been YYTABEL_NINF, and yet it was
16781 not satisfying as we could compare an YYACTION computed from
16782 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
16783 only value for error actions.
16784 (yyreportParseError): In verbose parse error messages, don't issue
16785 `error' in the list of expected tokens.
16786 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
16787 next action to perform to match glr.c's decoding.
16788 (yytable): Complete its comment.
16789
bcbad5b9
PE
167902002-10-13 Paul Eggert <eggert@twinsun.com>
16791
16792 Fix problem reported by Henrik Grubbstroem in
161a71f3 16793 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
16794 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
16795 because the Bison parser reads the second action before reducing
16796 the first one.
16797 * src/scan-gram.l (rule_length): New static var.
16798 Use it to keep track of the rule length in the scanner, since
16799 we can't expect the parser to be in lock-step sync with the scanner.
16800 (handle_action_dollar, handle_action_at): Use this var.
16801 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 16802
14904b89
PE
168032002-10-12 Paul Eggert <eggert@twinsun.com>
16804
1fe611e5
PE
16805 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
16806 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
16807 Include <sys/time.h> when checking for clock_t and struct tms.
16808 Use same include order as source.
16809 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 16810 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 16811
1fe611e5
PE
16812 * lib/timevar.c: Update copyright date and clarify comments.
16813 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 16814
1fe611e5
PE
16815 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
16816 GCC version as of today, then merge Bison's changes.
16817 Change "GCC" to "Bison" in copyright notice. timevar.def's
16818 author is Akim, so change that too.
16819
98194095
PE
16820 * src/reader.c (grammar_current_rule_check):
16821 Don't worry about the default action if $$ is untyped.
16822 Prevents bogus warnings reported by Jim Gifford in
161a71f3 16823 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 16824
14904b89
PE
16825 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
16826 * data/glr.c, data/lalr1.cc, data/yacc.c:
16827 Output token definitions before the first part of user declarations.
16828 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 16829 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 16830
ff6dca18
PE
168312002-10-11 Paul Eggert <eggert@twinsun.com>
16832
16833 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
16834 (yyparse): here. This undoes some of the 2002-07-25 change.
16835 Compatibility problem reported by Ralf S. Engelschall with
16836 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
16837
eb714592
AD
168382002-10-11 Akim Demaille <akim@epita.fr>
16839
16840 * tests/regression.at Characters Escapes): New.
16841 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
16842 characters.
16843 Reported by Jan Nieuwenhuizen.
16844
b7195100
AD
168452002-10-11 Akim Demaille <akim@epita.fr>
16846
16847 * po/id.po: New.
16848
f28a0f2d
PE
168492002-10-10 Paul Eggert <eggert@twinsun.com>
16850
16851 Portability fixes for bitsets; this also avoids several GCC
16852 warnings.
16853
16854 * lib/abitset.c: Include <stddef.h>, for offsetof.
16855 * lib/lbitset.c: Likewise.
16856
16857 * lib/abitset.c (abitset_bytes): Return a size that is aligned
16858 properly for vectors of objects. Do not assume that adding a
16859 header size to a multiple of a word size yields a value that is
16860 properly aligned for the whole union.
16861 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16862
16863 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
16864 unique names for structures.
16865 * lib/ebitset.c (ebitset_bytes): Likewise.
16866 * lib/lbitset.c (lbitset_bytes): Likewise.
16867
16868 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
16869 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
16870 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
16871 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
16872 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
16873 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
16874 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
16875 to improve the type-checking that GCC can do.
16876 * lib/bitset.c (bitset_op4_cmp): Likewise.
16877 * lib/bitset_stats.c (bitset_stats_count,
16878 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
16879 bitset_stats_copy, bitset_stats_disjoint_p,
16880 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
16881 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
16882 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
16883 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
16884 bitset_stats_and_or_cmp, bitset_stats_andn_or,
16885 bitset_stats_andn_or_cmp, bitset_stats_or_and,
16886 bitset_stats_or_and_cmp): Likewise.
16887 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
16888 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
16889 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
16890 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
16891
16892 * lib/abitset.h: Include bitset.h, not bbitset.h.
16893 * lib/ebitset.h: Likewise.
16894 * lib/lbitset.h: Likewise.
16895
16896 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
16897 All instances of parameters of type enum bitset_opts are now of
16898 type enum_bitset_opts, to conform to the C Standard, and similarly
16899 for enum_bitset_type.
16900 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16901 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
16902
16903 Do not use "struct bitset_struct" to mean different things in
16904 different modules. Not only is this confusing, it violates
16905 the C Standard, which requires that structure types in different
16906 modules must be compatible if one is to be passed to the other.
16907 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
16908 All instances of "struct bitset_struct *" replaced with "bitset".
16909 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
16910 (union bitset_union, struct abitset_struct, struct ebitset_struct,
16911 struct lbitset_struct, struct bitset_stats_struct): New types.
16912 All uses of struct bitset_struct changed to union bitset_union,
16913 etc.
ba0fe3c7 16914 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
16915 struct bitset_struct): Remove.
16916 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
16917 struct bitset_struct): Remove.
16918 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
16919 bitset_struct): Remove.
16920 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
16921 Likewise.
16922
16923 Do not call a function of type T using a call that assumes the
16924 function is of a different type U. Standard C requires that a
16925 function must be called with a type that is compatible with its
16926 definition.
16927 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16928 New decls.
16929 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16930 New functions.
16931 * lib/ebitset.c (PFV): Remove.
16932 * lib/lbitset.c (PFV): Likewise.
16933 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
16934 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
16935 decls.
16936 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
16937 (ebitset_vtable): Use them.
16938 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
16939 lbitset_xor): New functions.
16940 (lbitset_vtable): Use them.
16941
16942 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
16943 Declare.
16944
16945 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
16946 GCC warning.
16947 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
16948 Use offsetof, for simplicity.
16949
6fbe4984
PE
169502002-10-06 Paul Eggert <eggert@twinsun.com>
16951
16952 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
16953 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 16954 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
16955 which was inadvertently undone by the 2002-09-30 patch.
16956 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
16957 the same width as int.
16958
420f93c8
PE
169592002-10-04 Paul Eggert <eggert@twinsun.com>
16960
16961 Version 1.50.
16962
16963 * configure.ac (AC_INIT), NEWS: Increment version number.
16964
16965 * doc/bison.texinfo: Minor spelling, grammar, and white space
16966 fixes.
16967 (Symbols): Mention that any negative value returned from yylex
16968 signifies end-of-input. Warn about negative chars. Mention
16969 the portable Standard C character set.
16970
16971 The GNU coding standard says CFLAGS and YFLAGS are reserved
16972 for the installer to set.
16973 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
16974 * src/Makefile.am (AM_CFLAGS): Likewise.
16975 (AM_YFLAGS): Renamed from YFLAGS.
16976
16977 Fix some MAX and MIN problems.
16978 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
16979 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
16980 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
16981 * src/reader.c (reader): Use it.
16982
16983 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
16984 POSIX 1003.1-2001 has removed fgrep.
16985
169862002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
16987
16988 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
16989 interpreted as signed.
16990 * lib/ebitset.c (ebitset_list): Fix bug.
16991
ff68026d
PE
169922002-10-01 Paul Eggert <eggert@twinsun.com>
16993
16994 More fixes for 64-bit hosts and large bitsets.
16995
16996 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
16997 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
16998 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
16999 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
17000 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
17001 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
17002 bitset_count_): Likewise.
17003 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
17004 bitset_first, bitset_last): Likewise.
17005 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
17006 bitset_stats_list_reverse, bitset_stats_size,
17007 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
17008 Likewise.
17009 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17010 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
17011 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
17012 bitsetv_reflexive_transitive_closure): Likewise.
17013 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
17014 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
17015 Likewise.
17016 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
17017 Likewise.
420f93c8 17018
ff68026d
PE
17019 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
17020 Use size_t, not unsigned int, to count bytes.
17021 * lib/abitset.h (abitset_bytes): Likewise.
17022 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
17023 Likewise.
17024 * lib/bitset.h (bitset_bytes): Likewise.
17025 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
17026 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
17027 * lib/bitsetv.c (bitsetv_alloc): Likewise.
17028 * lib/ebitset.c (ebitset_bytes): Likewise.
17029 * lib/ebitset.h (ebitset_bytes): Likewise.
17030 * lib/lbitset.c (lbitset_bytes): Likewise.
17031 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 17032
ff68026d
PE
17033 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
17034 abitset_subset_p, abitset_disjoint_p, abitset_and,
17035 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
17036 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
17037 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
17038 abitset_or_and, abitset_or_and_cmp):
17039 Use bitset_windex instead of unsigned int.
17040 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17041 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
17042 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
17043 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
17044 Likewise.
17045 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 17046
ff68026d
PE
17047 * lib/bitset.c (bitset_print):
17048 Use proper printf formats for widths of integer types.
17049 * lib/bitset_stats.c (bitset_percent_histogram_print,
17050 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
17051 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17052 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17053 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 17054
ff68026d
PE
17055 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
17056 BITSET_SIZE_MAX): New macros.
17057 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
17058 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
17059 to BITSET_WINDEX_MAX.
17060
17061 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
17062 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
17063 since we now return the bitset_bindex type (not int).
17064
17065 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
17066 when computing sizes.
17067 * lib/ebitset.c (ebitset_elts_grow): Likewise.
17068
17069 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
17070 and avoid cast to unsigned.
17071
6aa452a6
AD
170722002-09-30 Akim Demaille <akim@epita.fr>
17073
17074 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
17075 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
17076 Updates from Michael Hayes.
17077
927f7817
AD
170782002-09-30 Art Haas <ahaas@neosoft.com>
17079
17080 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
17081 invocations.
17082 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
17083 defined.
17084
9738f41e
AD
170852002-09-27 Akim Demaille <akim@epita.fr>
17086
17087 Version 1.49c.
17088
a5c75d7f
AD
170892002-09-27 Akim Demaille <akim@epita.fr>
17090
17091 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
17092 (Because of AC_LIBSOURCE).
17093
8280e179
AD
170942002-09-27 Akim Demaille <akim@epita.fr>
17095
17096 Playing with Autoscan.
17097
17098 * configure.ac: Remove the old LIBOBJ tweaks.
17099 (AC_REPLACE_FUNCS): Add strrchr and strtol.
17100 * lib/strrchr.c: New.
17101 * lib/strtol.c: New, from the Coreutils 4.5.1.
17102
ae64af35
AD
171032002-09-27 Akim Demaille <akim@epita.fr>
17104
17105 Playing with Autoscan.
17106
17107 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
17108 * lib/Makefile.am (libbison_a_SOURCES): No longer include
17109 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
17110 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
17111 Coreutils 4.5.1.
17112
d1a1114f
AD
171132002-09-24 Akim Demaille <akim@epita.fr>
17114
17115 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
17116 (Frequently Asked Questions, Parser Stack Overflow): New.
17117
b906441c
AD
171182002-09-13 Akim Demaille <akim@epita.fr>
17119
17120 Playing with autoscan.
17121
17122 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
17123 * src/files.c (skeleton_find): Remove, unused.
17124 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
17125 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
17126
bd701811
AD
171272002-09-13 Akim Demaille <akim@epita.fr>
17128
17129 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
17130 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
17131
e0a13e7b
AD
171322002-09-13 Akim Demaille <akim@epita.fr>
17133
17134 * configure.ac: Require 2.54.
17135 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
17136 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
17137 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
17138 Remove, provided by Autoconf macros.
17139
c97011bf
AD
171402002-09-12 Akim Demaille <akim@epita.fr>
17141
17142 * m4/prereq.m4: Update, from Coreutils 4.5.1.
17143
d862b1be
AD
171442002-09-12 Akim Demaille <akim@epita.fr>
17145
17146 * m4/prereq.m4: Update, from Fileutils 4.1.5.
17147 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
17148 Reported by Martin Mokrejs.
17149
3d38c03a
AD
171502002-09-10 Akim Demaille <akim@epita.fr>
17151
17152 * src/parse-gram.y: Associate a human readable string to each
17153 token type.
17154 * tests/regression.at (Invalid inputs): Adjust.
17155
b6347355
AD
171562002-09-10 Gary V. Vaughan <gary@gnu.org>
17157
17158 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
17159 with an Autoconf-2.5x style configure.ac.
17160
09ba4ab2
PE
171612002-09-06 Paul Eggert <eggert@twinsun.com>
17162
17163 * doc/bison.texinfo (Conditions): Make explicit that the GPL
17164 exception applies only to yacc.c. This is a modification of a
17165 patch originally suggested by Akim Demaille.
17166
21846f69
AD
171672002-09-06 Akim Demaille <akim@epita.fr>
17168
09ba4ab2
PE
17169 * data/c.m4 (b4_copyright): Move the GPL exception comment from
17170 here to...
17171 * data/yacc.c: here.
17172
21846f69
AD
17173 * data/lalr1.cc (struct yyltype): Don't define it, since we use
17174 LocationType.
17175 (b4_ltype): Default to yy::Location from location.hh.
17176
c0ad8bf3
AD
171772002-09-04 Jim Meyering <jim@meyering.net>
17178
17179 * data/yacc.c: Guard the declaration of yytoknum also with
17180 `#ifdef YYPRINT', so it is declared only when used.
17181
3a93251e
AD
171822002-09-04 Akim Demaille <akim@epita.fr>
17183
17184 * configure.in: Rename as...
17185 * configure.ac: this.
17186 Bump to 1.49c.
17187
427c0dda
AD
171882002-09-04 Akim Demaille <akim@epita.fr>
17189
17190 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
17191 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
17192 translate maintainer only messages.
17193
6a254321
PE
171942002-08-12 Paul Eggert <eggert@twinsun.com>
17195
645e30d1
PE
17196 Version 1.49b.
17197
6a254321
PE
17198 * Makefile.am (SUBDIRS): Remove intl.
17199 (DISTCLEANFILES): Remove.
17200 * NEWS: Mention that GNU M4 is now required. Clarify what is
17201 meant by "larger grammars". Mention the pt_BR translation.
17202 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
17203 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
17204 Bump version from 0.11.2 to 0.11.5.
17205 (BISON_PREREQ_STAGE): Remove.
17206 (AM_GNU_GETTEXT): Use external gettext.
17207 (AC_OUTPUT): Remove intl/Makefile.
17208
17209 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
17210
17211 * data/glr.c: Include string.h, for strlen.
17212 (yyreportParseError): Use size_t for yysize.
17213 (yy_yypstack): No longer nested inside yypstates, as nested
17214 functions are not portable. Do not assume size_t is the
17215 same width as int.
17216 (yypstates): Do not assume that ptrdiff_t is the same width
17217 as int, and similarly for yyposn and YYINDEX.
17218
17219 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
17220
17221 * lib/Makefile.am (INCLUDES): Do not include from the intl
17222 directory, which has been removed.
17223 * src/Makefile.am (INCLUDES): Likewise.
17224
17225 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
17226 (bitsets_sources, additional_bitsets_sources, timevars_sources):
17227 New vars.
17228
17229 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
17230 * tests/Makefile.am (EXTRA_DIST): Likewise.
17231
17232 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
17233 Do not assume that bitset_windex is the same width as unsigned.
17234
17235 * lib/abitset.c (abitset_unused_clear): Do not assume that
17236 bitset_word is the same width as int.
17237 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
17238 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
17239 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
17240 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
17241 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
17242
17243 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
17244 portability to one's complement hosts!).
17245 * lib/ebitset.c (ebitset_op1): Likewise.
17246 * lib/lbitset.c (lbitset_op1): Likewise.
17247
17248 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
17249 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
17250 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
17251 Sync with fileutils.
17252 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
17253 lib/gettext.h: Sync with diffutils.
17254
17255 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
17256 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
17257
17258 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
17259 PROTOTYPES to check for prototypes, and "defined __STDC__" to
17260 check for void *.
17261
17262 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
17263 size_t; the old version tried to do this but casted improperly.
17264 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
17265 (bitset_test): Now returns int, not unsigned long.
17266
17267 * lib/bitset_stats.c: Include "gettext.h".
17268 (_): New macro.
17269 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
17270 name locals "index", as it generates unnecessary warnings on some
17271 hosts that have an "index" function.
17272
17273 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
17274 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
17275 they need translation.
17276 * src/LR0.c (state_list_append, new_itemsets, get_state,
17277 append_states, generate_states): Likewise.
17278 * src/assoc.c (assoc_to_string): Likewise.
17279 * src/closure.c (print_closure, set_firsts, closure): Likewise.
17280 * src/gram.c (grammar_dump): Likewise.
17281 * src/injections.c (injections_compute): Likewise.
17282 * src/lalr.c (lookaheads_print): Likewise.
17283 * src/relation.c (relation_transpose): Likewise.
17284 * src/scan-gram.l: Likewise.
17285 * src/tables.c (table_grow, pack_vector): Likewise.
17286
17287 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
17288 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
17289 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
17290 * m4/mbstate_t.m4: Sync with fileutils.
17291 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
17292
17293 * po/LINGUAS: Add pt_BR.
17294 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
17295 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
17296 lib/timevar.c.
17297 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
17298 manual recommends.
17299 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
17300
17301 * src/complain.c (strerror_r): Remove decl; not needed.
17302 (strerror): Use same pattern as ../lib/error.c.
17303
17304 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
17305
17306 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
17307
17308 * src/main.c (main): Cast result of bindtextdomain and textdomain
17309 to void, to avoid a GCC warning when --disable-nls is in effect.
17310
17311 * src/scan-gram.l: Use strings rather than escapes when possible,
17312 to minimize the number of warnings from xgettext.
17313 (handle_action_dollar, handle_action_at): Don't use isdigit,
17314 as it mishandles negative chars and it may not work as expected
17315 outside the C locale.
17316
17317 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
17318 this is a GCC extension and is not portable to other compilers.
17319
17320 * src/system.h (alloca): Use same pattern as ../lib/error.c.
17321 Do not include <ctype.h>; no longer needed.
17322 Do not include <malloc.h>; no longer needed (and generates
17323 warnings on OpenBSD 3.0).
17324
17325 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
17326 it's not portable.
17327
17328 * tests/regression.at: Do not use 'cc -c input.c -o input';
17329 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
17330
17331 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
17332 exit status as failure, not just exit status 1. Sun C exits
17333 with status 2 sometimes.
17334
17335 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
17336 Use it for the two large tests.
17337
c8f002c7
AD
173382002-08-02 Akim Demaille <akim@epita.fr>
17339
17340 * src/conflicts.c (conflicts_output): Don't output rules never
17341 reduced here, since anyway that computation doesn't work.
17342 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
17343 (rule_useless_p, rule_never_reduced_p): New.
17344 (grammar_rules_partial_print): Use a filter instead of a range.
17345 Display the title only if needed.
17346 (grammar_rules_print): Adjust.
17347 (grammar_rules_never_reduced_report): New.
17348 * src/tables.c (action_row): Move the computation of rules never
17349 reduced to...
17350 (token_actions): here.
17351 * src/main.c (main): Make the parser before making the report, so
17352 that rules never reduced are computed.
17353 Call grammar_rules_never_reduced_report.
17354 * src/print.c (print_results): Report rules never reduced.
17355 * tests/conflicts.at, tests/reduce.at: Adjust.
17356
cd08e51e
AD
173572002-08-01 Akim Demaille <akim@epita.fr>
17358
17359 Instead of attaching lookaheads and duplicating the rules being
17360 reduced by a state, attach the lookaheads to the reductions.
17361
17362 * src/state.h (state_t): Remove the `lookaheads',
17363 `lookaheads_rule' member.
17364 (reductions_t): Add a `lookaheads' member.
17365 Use a regular array for the `rules'.
17366 * src/state.c (reductions_new): Initialize the lookaheads member
17367 to 0.
17368 (state_rule_lookaheads_print): Adjust.
17369 * src/state.h, src/state.c (state_reductions_find): New.
17370 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
17371 (count_rr_conflicts): Adjust.
17372 * src/lalr.c (LArule): Remove.
17373 (add_lookback_edge): Adjust.
17374 (state_lookaheads_count): New.
17375 (states_lookaheads_initialize): Merge into...
17376 (initialize_LA): this.
17377 (lalr_free): Adjust.
17378 * src/main.c (main): Don't free nullable and derives too early: it
17379 is used by --verbose.
17380 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
17381
bb0027a9
AD
173822002-08-01 Akim Demaille <akim@epita.fr>
17383
17384 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
17385 `rule_number_t**'.
17386 (set_derives, free_derives): Rename as...
17387 (derives_compute, derives_free): this.
17388 Adjust all dependencies.
17389 * src/nullable.c (set_nullable, free_nullable): Rename as...
17390 (nullable_compute, nullable_free): these.
17391 (rule_list_t): Store rule_t *, not rule_number_t.
17392 * src/state.c (state_rule_lookaheads_print): Directly compare rule
17393 pointers, instead of their numbers.
17394 * src/main.c (main): Call nullable_free, and derives_free earlier,
17395 as they were lo longer used.
17396
3325ddc4
AD
173972002-08-01 Akim Demaille <akim@epita.fr>
17398
17399 * lib/timevar.c (get_time): Include children time.
17400 * src/lalr.h (LA, LArule): Don't export them: used with the
17401 state_t.
17402 * src/lalr.c (LA, LArule): Static.
17403 * src/lalr.h, src/lalr.c (lalr_free): New.
17404 * src/main.c (main): Call it.
17405 * src/tables.c (pack_vector): Check whether loc is >= to the
17406 table_size, not >.
17407 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
17408 (tables_generate): do it, since that's also it which allocates
17409 them.
17410 Don't free LA and LArule, main does.
17411
c6f1a33c
AD
174122002-07-31 Akim Demaille <akim@epita.fr>
17413
17414 Separate parser tables computation and output.
17415
17416 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
17417 (conflict_list, conflict_list_cnt, table, check, table_ninf)
17418 (yydefgoto, yydefact, high): Move to...
17419 * src/tables.h, src/tables.c: here.
17420 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17421 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17422 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
17423 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
17424 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
17425 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
17426 (action_row, save_row, token_actions, save_column, default_goto)
17427 (goto_actions, sort_actions, matching_state, pack_vector)
17428 (table_ninf_remap, pack_table, prepare_actions): Move to...
17429 * src/tables.c: here.
17430 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
17431 * src/output.c (token_actions, output_base, output_conflicts)
17432 (output_check): Merge into...
17433 (prepare_actions): this.
17434 (actions_output): Rename as...
17435 (user_actions_output): this.
17436 * src/main.c (main): Call tables_generate and tables_free.
17437
1509d42f
AD
174382002-07-31 Akim Demaille <akim@epita.fr>
17439
17440 Steal GCC's --time-report support.
17441
17442 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
17443 stolen/adjusted from GCC.
17444 * m4/stage.m4: Remove time related checks.
17445 * m4/timevar.m4: New.
17446 * configure.in: Adjust.
17447 * src/system.h: Adjust to using timevar.h.
17448 * src/getargs.h, src/getargs.c: Support trace_time for
17449 --trace=time.
17450 * src/main.c (stage): Remove.
17451 (main): Replace `stage' invocations with timevar calls.
17452 * src/output.c: Insert pertinent timevar calls.
17453
273a74fa
AD
174542002-07-31 Akim Demaille <akim@epita.fr>
17455
17456 Let --trace have arguments.
17457
17458 * src/getargs.h (enum trace_e): New.
17459 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
17460 (long_options, short_options): --trace/-T takes an optional
17461 argument.
17462 Change all the uses of trace_flag to reflect the new flags.
17463 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
17464
17465 Strengthen `stage' portability.
17466
17467 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
17468 * configure.in: Use it.
17469 Don't check for malloc.h and sys/times.h.
17470 * src/system.h: Include them when appropriate.
17471 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
17472 times and struct tms are available.
17473
217598da
AD
174742002-07-30 Akim Demaille <akim@epita.fr>
17475
17476 In verbose parse error message, don't report `error' as an
17477 expected token.
17478 * tests/actions.at (Printers and Destructors): Adjust.
17479 * tests/calc.at (Calculator $1): Adjust.
17480 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
17481 error message, do not report the parser accepts the error token in
17482 that state.
17483
52489d44
AD
174842002-07-30 Akim Demaille <akim@epita.fr>
17485
17486 Normalize conflict related messages.
17487
17488 * src/complain.h, src/complain.c (warn, complain): New.
17489 * src/conflicts.c (conflicts_print): Use them.
17490 (conflict_report_yacc): New, extracted from...
17491 (conflicts_print): here.
17492 * tests/conflicts.at, tests/existing.at: Adjust.
17493
e8832397
AD
174942002-07-30 Akim Demaille <akim@epita.fr>
17495
17496 Report rules which are never reduced by the parser: those hidden
17497 by conflicts.
17498
17499 * src/LR0.c (save_reductions): Don't make the final state too
17500 different: save its reduction (accept) instead of having a state
17501 without any action (no shift or goto, no reduce).
17502 Note: the final state is now a ``regular'' state, i.e., the
17503 parsers now contain `reduce 0' as default reduction.
17504 Nevertheless, since they decide to `accept' when yystate =
17505 final_state, they still will not reduce rule 0.
17506 * src/print.c (print_actions, print_reduction): Adjust.
17507 * src/output.c (action_row): Track reduced rules.
17508 (token_actions): Report rules never reduced.
17509 * tests/conflicts.at, tests/regression.at: Adjust.
17510
caf23d24
AD
175112002-07-30 Akim Demaille <akim@epita.fr>
17512
17513 `stage' was accidently included in a previous patch.
17514 Initiate its autoconfiscation.
17515
17516 * configure.in: Look for malloc.h and sys/times.h.
17517 * src/main.c (stage): Adjust.
17518 Report only when trace_flag.
17519
640748ee
AD
175202002-07-29 Akim Demaille <akim@epita.fr>
17521
17522 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
17523 state_number_t.
17524 (errs_t): symbol_t*, not symbol_number_t.
17525 (reductions_t): rule_t*, not rule_number_t.
17526 (FOR_EACH_SHIFT): New.
17527 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
17528 * src/print.c, src/print_graph.c: Adjust.
17529
88bce5a2
AD
175302002-07-29 Akim Demaille <akim@epita.fr>
17531
17532 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
17533
17534 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
17535 (endtoken, accept): these.
17536 * src/reader.c (reader): Set endtoken's default tag to "$end".
17537 Set undeftoken's tag to "$undefined" instead of "$undefined.".
17538 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
17539 Adjust.
17540
1bfb97db
AD
175412002-07-29 Akim Demaille <akim@epita.fr>
17542
17543 * src/reduce.c (reduce_grammar): When the language is empty,
17544 complain about the start symbol, not the axiom.
17545 Use its location.
17546 * tests/reduce.at (Empty Language): New.
17547
fc5734fe
AD
175482002-07-26 Akim Demaille <akim@epita.fr>
17549
17550 * src/reader.h, src/reader.c (gram_error): ... can't get
17551 yycontrol without making too strong assumptions on the parser
17552 itself.
17553 * src/output.c (prepare_tokens): Use the real 0th value of
17554 token_translations instead of `0'.
17555 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
17556 visible here.
17557 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
17558 for the time being: %locations ought to provide it to yyerror.
17559
3650b4b8
AD
175602002-07-25 Akim Demaille <akim@epita.fr>
17561
17562 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
17563 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
17564 * tests/regression.at (Web2c Actions): Adjust.
17565
4b3d3a8e
AD
175662002-07-25 Akim Demaille <akim@epita.fr>
17567
17568 Stop storing rules from 1 to nrules + 1.
17569
17570 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
17571 * src/nullable.c, src/output.c, src/print.c, src/reader.c
17572 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
17573 Iterate from 0 to nrules.
17574 Use rule_number_as_item_number and item_number_as_rule_number.
17575 Adjust to `derive' now containing possibly 0.
17576 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
17577 Handle the `- 1' part in rule numbers from/to item numbers.
17578 * src/conflicts.c (log_resolution): Fix the message which reversed
17579 shift and reduce.
17580 * src/output.c (action_row): Initialize default_rule to -1.
17581 (token_actions): Adjust.
17582 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
17583 expected output.
17584 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
17585
4a2a22f4
AD
175862002-07-25 Akim Demaille <akim@epita.fr>
17587
17588 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
17589 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
17590 (b4_c_knr_arg_decl): New.
17591 * data/yacc.c: Use it to define yysymprint, yydestruct, and
17592 yyreport_parse_error.
17593
b8df3223
AD
175942002-07-25 Akim Demaille <akim@epita.fr>
17595
17596 * data/yacc.c (yyreport_parse_error): New, extracted from...
17597 (yyparse): here.
17598 (yydestruct, yysymprint): Move above yyparse.
17599 Be K&R compliant.
17600
a762e609
AD
176012002-07-25 Akim Demaille <akim@epita.fr>
17602
17603 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
17604 replace...
17605 (b4_sint_type, b4_uint_type): these.
17606 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
17607 * tests/regression.at (Web2c Actions): Adjust.
17608
12b0043a
AD
176092002-07-25 Akim Demaille <akim@epita.fr>
17610
17611 * src/gram.h (TIEM_NUMBER_MAX): New.
17612 (item_number_of_rule_number, rule_number_of_item_number): Rename
17613 as...
17614 (rule_number_as_item_number, item_number_as_rule_number): these.
17615 Adjust dependencies.
17616 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17617 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17618 (symbol_number_to_vector_number): New.
17619 (order): Of vector_number_t* type.
17620 (base_t, BASE_MAX, BASE_MIN): New.
17621 (froms, tos, width, pos, check): Of base_t type.
17622 (action_number_t, ACTION_MIN, ACTION_MAX): New.
17623 (actrow): Of action_number_t type.
17624 (conflrow): Of unsigned int type.
17625 (table_ninf, base_ninf): New.
17626 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
17627 (muscle_insert_int_table, muscle_insert_base_table)
17628 (muscle_insert_rule_number_table): New.
17629 (prepare_tokens): Output `toknum' as int_table.
17630 (action_row): Returns a rule_number_t.
17631 Use ACTION_MIN, not SHRT_MIN.
17632 (token_actions): yydefact is rule_number_t*.
17633 (table_ninf_remap): New.
17634 (pack_table): Use it for `base' and `table'.
17635 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
17636 replaced with...
17637 (YYPACT_NINF, YYTABLE_NINF): these.
17638 (yypact, yytable): Compute their types instead of hard-coded
17639 `short'.
17640 * tests/regression.at (Web2c Actions): Adjust.
17641
5dde258a
AD
176422002-07-19 Akim Demaille <akim@epita.fr>
17643
17644 * src/scan-gram.l (id): Can start with an underscore.
17645
a945ec39
AD
176462002-07-16 Akim Demaille <akim@epita.fr>
17647
17648 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
17649 Adjust all former `associativity' dependencies.
17650 * src/symtab.c (symbol_new): Default associativity is `undef', not
17651 `right'.
17652 (symbol_check_alias_consistence): Adjust.
17653
fae437e8
AD
176542002-07-09 Akim Demaille <akim@epita.fr>
17655
17656 * doc/bison.texinfo: Properly set the ``header'' part.
17657 Use @dircategory ``GNU programming tools'' as per Texinfo's
17658 documentation.
17659 Use @copying.
17660
1a715ef2
AD
176612002-07-09 Akim Demaille <akim@epita.fr>
17662
17663 * lib/quotearg.h: Protect against multiple inclusions.
17664 * src/location.h (location_t): Add a `file' member.
17665 (LOCATION_RESET, LOCATION_PRINT): Adjust.
17666 * src/complain.c (warn_at, complain_at, fatal_at): Drop
17667 `error_one_per_line' support.
17668
a5d50994
AD
176692002-07-09 Akim Demaille <akim@epita.fr>
17670
17671 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
17672 * src/reader.c (lineno): Remove.
17673 Adjust all dependencies.
17674 (get_merge_function): Take a location and use complain_at.
17675 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
17676 * tests/regression.at (Invalid inputs, Mixing %token styles):
17677 Adjust.
17678
b275314e
AD
176792002-07-09 Akim Demaille <akim@epita.fr>
17680
17681 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
17682 recovery rule, and forbid extensions when --yacc.
17683 (gram_error): Use complain_at.
17684 * src/reader.c (reader): Exit if there were parse errors.
17685
865b9df1
AD
176862002-07-09 Akim Demaille <akim@epita.fr>
17687
17688 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
17689 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
17690 Reported by R Blake <blakers@mac.com>.
17691
c76e14da
AD
176922002-07-09 Akim Demaille <akim@epita.fr>
17693
17694 * data/yacc.c: Output the copyright notive in the header.
17695
7db2ed2d
AD
176962002-07-03 Akim Demaille <akim@epita.fr>
17697
17698 * src/output.c (froms, tos): Are state_number_t.
17699 (save_column): sp, sp1, and sp2 are state_number_t.
17700 (prepare): Rename `final' as `final_state_number', `nnts' as
17701 `nterms_number', `nrules' as `rules_number', `nstates' as
17702 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
17703 unused.
17704 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
17705 * data/lalr1.cc (nsym_): Remove, unused.
17706
e68e0410
AD
177072002-07-03 Akim Demaille <akim@epita.fr>
17708
17709 * src/lalr.h, src/lalr.c (goto_number_t): New.
17710 * src/lalr.c (goto_list_t): New.
17711 Propagate them.
17712 * src/nullable.c (rule_list_t): New.
17713 Propagate.
17714 * src/types.h: Remove.
17715
e1a4f3a4
AD
177162002-07-03 Akim Demaille <akim@epita.fr>
17717
17718 * src/closure.c (print_fderives): Use rule_rhs_print.
17719 * src/derives.c (print_derives): Use rule_rhs_print.
17720 (rule_list_t): New, replaces `shorts'.
17721 (set_derives): Add comments.
17722 * tests/sets.at (Nullable, Firsts): Adjust.
17723
536545f3
AD
177242002-07-03 Akim Demaille <akim@epita.fr>
17725
17726 * src/output.c (prepare_actions): Free `tally' and `width'.
17727 (prepare_actions): Allocate and free `order'.
17728 * src/symtab.c (symbols_free): Free `symbols'.
17729 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
17730 * src/output.c (m4_invoke): Move to...
17731 * src/scan-skel.l: here.
17732 (<<EOF>>): Close yyout, and free its name.
17733
8b752b00
AD
177342002-07-03 Akim Demaille <akim@epita.fr>
17735
17736 Fix some memory leaks, and fix a bug: state 0 was examined twice.
17737
17738 * src/LR0.c (new_state): Merge into...
17739 (state_list_append): this.
17740 (new_states): Merge into...
17741 (generate_states): here.
17742 (set_states): Don't ensure a proper `errs' state member here, do it...
17743 * src/conflicts.c (conflicts_solve): here.
17744 * src/state.h, src/state.c: Comment changes.
17745 (state_t): Rename member `shifts' as `transitions'.
17746 Adjust all dependencies.
17747 (errs_new): For consistency, also take the values as argument.
17748 (errs_dup): Remove.
17749 (state_errs_set): New.
17750 (state_reductions_set, state_transitions_set): Assert that no
17751 previous value was assigned.
17752 (state_free): New.
17753 (states_free): Use it.
17754 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
17755 temporary storage: use `errs' and `nerrs' as elsewhere.
17756 (set_conflicts): Allocate and free this `errs'.
17757
613f5e1a
AD
177582002-07-02 Akim Demaille <akim@epita.fr>
17759
17760 * lib/libiberty.h: New.
17761 * lib: Update the bitset implementation from upstream.
17762 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
17763 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
17764 * src/main.c: Adjust bitset stats calls.
17765
26e0cadc
PE
177662002-07-01 Paul Eggert <eggert@twinsun.com>
17767
17768 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
17769 char, so that negative chars don't collide with $.
17770
1154cced
AD
177712002-06-30 Akim Demaille <akim@epita.fr>
17772
17773 Have the GLR tests be `warning' checked, and fix the warnings.
17774
17775 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
17776 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
17777 (yyremoveDeletes): `yyi' and `yyj' are size_t.
17778 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
17779 (yyaddDeferredAction): static.
17780 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
17781 (yyreportParseError): yyprefix is const.
17782 yytokenp is used only when verbose.
17783 (yy__GNUC__): Replace with __GNUC__.
17784 (yypdumpstack): yyi is size_t.
17785 (yypreference): Un-yy local variables and arguments, to avoid
17786 clashes with `yyr1'. Anyway, we are not in the user name space.
17787 (yytname_size): be an int, as is compared with ints.
17788 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
17789 Use them.
17790 * tests/cxx-gram.at: Use quotation to protect $1.
17791 Use AT_COMPILE to enable warnings hunts.
17792 Prototype yylex and yyerror.
17793 `Use' argc.
17794 Include `string.h', not `strings.h'.
17795 Produce and prototype stmtMerge only when used.
17796 yylex takes a location.
17797
97650f4e
AD
177982002-06-30 Akim Demaille <akim@epita.fr>
17799
17800 We spend a lot of time in quotearg, in particular when --verbose.
17801
17802 * src/symtab.c (symbol_get): Store a quoted version of the key.
17803 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
17804 Adjust all callers.
17805
d2576365
AD
178062002-06-30 Akim Demaille <akim@epita.fr>
17807
17808 * src/state.h (reductions_t): Rename member `nreds' as num.
17809 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
17810 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
17811
ccaf65bc
AD
178122002-06-30 Akim Demaille <akim@epita.fr>
17813
17814 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
17815 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
17816 (shifts_to): Rename as...
17817 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
17818 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
17819 (TRANSITION_IS_DISABLED, transitions_to): these.
17820
87675353
AD
178212002-06-30 Akim Demaille <akim@epita.fr>
17822
17823 * src/print.c (print_shifts, print_gotos): Merge into...
17824 (print_transitions): this.
17825 (print_transitions, print_errs, print_reductions): Align the
17826 lookaheads columns.
17827 (print_core, print_transitions, print_errs, print_state,
17828 print_grammar): Output empty lines separator before, not after.
17829 (state_default_rule_compute): Rename as...
17830 (state_default_rule): this.
17831 * tests/conflicts.at (Defaulted Conflicted Reduction),
17832 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
17833 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
17834
ce4ccb4b
AD
178352002-06-30 Akim Demaille <akim@epita.fr>
17836
17837 Display items as we display rules.
17838
17839 * src/gram.h, src/gram.c (rule_lhs_print): New.
17840 * src/gram.c (grammar_rules_partial_print): Use it.
17841 * src/print.c (print_core): Likewise.
17842 * tests/conflicts.at (Defaulted Conflicted Reduction),
17843 (Unresolved SR Conflicts): Adjust.
17844 (Unresolved SR Conflicts): Adjust and rename as...
17845 (Resolved SR Conflicts): this, as was meant.
17846 * tests/regression.at (Web2c Report): Adjust.
17847
bc933ef1
AD
178482002-06-30 Akim Demaille <akim@epita.fr>
17849
17850 * src/print.c (state_default_rule_compute): New, extracted from...
17851 (print_reductions): here.
17852 Pessimize, but clarify the code.
17853 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
17854
53d4308d
AD
178552002-06-30 Akim Demaille <akim@epita.fr>
17856
17857 * src/output.c (action_row): Let default_rule be always a rule
17858 number.
17859
574fb2d5
AD
178602002-06-30 Akim Demaille <akim@epita.fr>
17861
17862 * src/closure.c (print_firsts, print_fderives, closure):
17863 Use BITSET_EXECUTE.
17864 * src/lalr.c (lookaheads_print): Likewise.
17865 * src/state.c (state_rule_lookaheads_print): Likewise.
17866 * src/print_graph.c (print_core): Likewise.
17867 * src/print.c (print_reductions): Likewise.
17868 * src/output.c (action_row): Likewise.
17869 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
17870
05811fd7
AD
178712002-06-30 Akim Demaille <akim@epita.fr>
17872
17873 * src/print_graph.c: Use report_flag.
17874
0e4d5753
AD
178752002-06-30 Akim Demaille <akim@epita.fr>
17876
17877 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
17878 to...
17879 * src/relation.h, src/relation.c (traverse, relation_digraph)
17880 (relation_print, relation_transpose): New.
17881
24c7d800
AD
178822002-06-30 Akim Demaille <akim@epita.fr>
17883
17884 * src/state.h, src/state.c (shifts_to): New.
17885 * src/lalr.c (build_relations): Use it.
17886
9222837b
AD
178872002-06-30 Akim Demaille <akim@epita.fr>
17888
17889 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
17890 (item_number_of_rule_number, rule_number_of_item_number): New.
17891 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
17892 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17893 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
17894 Propagate their use.
17895 Much remains to be done, in particular wrt `shorts' from types.h.
17896
260008e5
AD
178972002-06-30 Akim Demaille <akim@epita.fr>
17898
17899 * src/symtab.c (symbol_new): Initialize the `printer' member.
17900
8a731ca8
AD
179012002-06-30 Akim Demaille <akim@epita.fr>
17902
17903 * src/LR0.c (save_reductions): Remove, replaced by...
17904 * src/state.h, src/state.c (state_reductions_set): New.
17905 (reductions, errs): Rename as...
17906 (reductions_t, errs_t): these.
17907 Adjust all dependencies.
17908
32e1e0a4
AD
179092002-06-30 Akim Demaille <akim@epita.fr>
17910
17911 * src/LR0.c (state_list_t, state_list_append): New.
17912 (first_state, last_state): Now symbol_list_t.
17913 (this_state): Remove.
17914 (new_itemsets, append_states, save_reductions): Take a state_t as
17915 argument.
17916 (set_states, generate_states): Adjust.
17917 (save_shifts): Remove, replaced by...
17918 * src/state.h, src/state.c (state_shifts_set): New.
17919 (shifts): Rename as...
17920 (shifts_t): this.
17921 Adjust all dependencies.
17922 * src/state.h (state_t): Remove the `next' member.
17923
e5fb6710
AD
179242002-06-30 Akim Demaille <akim@epita.fr>
17925
17926 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
17927 escaped in slot 0.
17928
c7ca99d4
AD
179292002-06-30 Akim Demaille <akim@epita.fr>
17930
17931 Use hash.h for the state hash table.
17932
17933 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
17934 (allocate_storage): Use state_hash_new.
17935 (free_storage): Use state_hash_free.
17936 (new_state, get_state): Adjust.
17937 * src/lalr.h, src/lalr.c (states): Move to...
17938 * src/states.h (state_t): Remove the `link' member, no longer
17939 used.
17940 * src/states.h, src/states.c: here.
17941 (state_hash_new, state_hash_free, state_hash_lookup)
17942 (state_hash_insert, states_free): New.
17943 * src/states.c (state_table, state_compare, state_hash): New.
17944 * src/output.c (output_actions): Do not free states now, since we
17945 still need to know the final_state number in `prepare', called
17946 afterwards. Do it...
17947 * src/main.c (main): here: call states_free after `output'.
17948
df0e7316
AD
179492002-06-30 Akim Demaille <akim@epita.fr>
17950
17951 * src/state.h, src/state.c (state_new): New, extracted from...
17952 * src/LR0.c (new_state): here.
17953 * src/state.h (STATE_ALLOC): Move to...
17954 * src/state.c: here.
17955 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
17956 * src/state.h, src/state.c: here.
17957
39f41916
AD
179582002-06-30 Akim Demaille <akim@epita.fr>
17959
17960 * src/reader.c (gensym): Rename as...
17961 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
17962 (getsym): Rename as...
17963 (symbol_get): this.
17964
d57650a5
AD
179652002-06-30 Akim Demaille <akim@epita.fr>
17966
17967 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
17968 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
17969 * src/output.c, src/print.c, src/print_graph.c: Propagate.
17970 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
17971
5a08f1ce
AD
179722002-06-30 Akim Demaille <akim@epita.fr>
17973
17974 Make the test suite pass with warnings checked.
17975
17976 * tests/actions.at (Printers and Destructors): Improve.
17977 Avoid unsigned vs. signed issues.
17978 * tests/calc.at: Don't exercise the scanner here, do it...
17979 * tests/input.at (Torturing the Scanner): here.
17980
720623af
PH
179812002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17982
88e7e941 17983 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
17984 reorganize first lines parallel to yacc.c.
17985
fb8135fa
AD
179862002-06-28 Akim Demaille <akim@epita.fr>
17987
17988 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
17989 (b4_token_enum, b4_token_defines): New, factored from...
17990 * data/lalr1.cc, data/yacc.c, glr.c: here.
17991
41442480
AD
179922002-06-28 Akim Demaille <akim@epita.fr>
17993
17994 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
17995 unused variables.
17996 * src/output.c (merger_output): static.
17997
e0e5bf84
AD
179982002-06-28 Akim Demaille <akim@epita.fr>
17999
ba0fe3c7 18000 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
18001 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
18002 pacify GCC.
18003 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 18004
676385e2
PH
180052002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18006
18007 Accumulated changelog for new GLR parsing features.
18008
6a254321 18009 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
18010 conflicts_total_count.
18011 * src/conflicts.h: Ditto.
18012 * src/output.c (token_actions): Use the new name.
18013 (output_conflicts): Change conflp => conflict_list_heads, and
18014 confl => conflict_list for better readability.
18015 * data/glr.c: Use the new names.
18016 * NEWS: Add self to GLR announcement.
e0e5bf84 18017
676385e2
PH
18018 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
18019
18020 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
18021 Akim Demaille.
18022
18023 * data/bison.glr: Change name to glr.c
18024 * data/glr.c: Renamed from bison.glr.
18025 * data/Makefile.am: Add glr.c
e0e5bf84
AD
18026
18027 * src/getargs.c:
18028
676385e2 18029 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 18030 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 18031
676385e2
PH
18032 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18033
18034 * data/bison.glr: Be sure to restore the
18035 current #line when returning to the skeleton contents after having
18036 exposed the input file's #line.
18037
18038 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18039
18040 * data/bison.glr: Bring up to date with changes to bison.simple.
18041
18042 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18043
18044 * data/bison.glr: Correct definitions that use b4_prefix.
18045 Various reformatting.
18046 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
18047 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
18048 yytokenp argument; now part of stack.
18049 (yychar): Define to behave as documented.
18050 (yyclearin): Ditto.
e0e5bf84 18051
676385e2
PH
18052 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18053
18054 * src/reader.h: Add declaration for free_merger_functions.
18055
18056 * src/reader.c (merge_functions): New variable.
18057 (get_merge_function): New function.
18058 (free_merger_functions): New function.
18059 (readgram): Check for %prec that is not followed by a symbol.
18060 Handle %dprec and %merge declarations.
18061 (packgram): Initialize dprec and merger fields in rules array.
18062
18063 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
18064 conflict_list_cnt, conflict_list_free): New variables.
18065 (table_grow): Also grow conflict_table.
e0e5bf84 18066 (prepare_rules): Output dprec and merger tables.
676385e2 18067 (conflict_row): New function.
e0e5bf84 18068 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
18069 default reduction in conflicted states for GLR parser so that there
18070 are spaces for the conflict lists.
18071 (save_row): Also save conflict information.
18072 (token_actions): Allocate conflict list.
18073 (merger_output): New function.
18074 (pack_vector): Pack conflict table, too.
18075 (output_conflicts): New function to output yyconflp and yyconfl.
18076 (output_check): Allocate conflict_tos.
18077 (output_actions): Output conflict tables, also.
18078 (output_skeleton): Output b4_mergers definition.
18079 (prepare): Output b4_max_rhs_length definition.
18080 Use 'bison.glr' as default skeleton for GLR parsers.
18081
18082 * src/gram.c (glr_parser): New flag.
18083 (grammar_free): Call free_merger_functions.
18084
18085 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
18086 all pairs of conflicting reductions, rather than just all tokens
18087 causing conflicts. Needed to size conflict tables.
e0e5bf84 18088 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
18089 interface.
18090 (conflicts_print): Ditto.
18091 (count_total_conflicts): New function.
18092
18093 * src/reader.h (merger_list): New type.
18094 (merge_functions): New variable.
18095
18096 * src/lex.h (tok_dprec, tok_merge): New token types.
18097
18098 * src/gram.h (rule_s): Add dprec and merger fields.
18099 (glr_parser): New flag.
18100
18101 * src/conflicts.h (count_total_conflicts): New function.
18102
18103 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
18104
18105 * doc/bison.texinfo (Generalized LR Parsing): New section.
18106 (GLR Parsers): New section.
18107 (Language and Grammar): Mention GLR parsing.
18108 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
18109 Correct typo ("tge" -> "the").
18110
18111 * data/bison.glr: New skeleton for GLR parsing.
18112
18113 * tests/cxx-gram.at: New tests for GLR parsing.
18114
18115 * tests/testsuite.at: Include cxx-gram.at.
18116
18117 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 18118
676385e2
PH
18119 * src/parse-gram.y:
18120
18121 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
18122
18123 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 18124
b5480d74 181252002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
18126
18127 * src/options.h, src/options.c: Remove.
18128 * src/getargs.c (short_options, long_options): New.
18129
60491a94
AD
181302002-06-27 Akim Demaille <akim@epita.fr>
18131
18132 * data/bison.simple, data/bison.c++: Rename as...
18133 * data/yacc.c, data/lalr1.cc: these.
18134 * doc/bison.texinfo (Environment Variables): Remove.
18135
9be0c25b
AD
181362002-06-25 Raja R Harinath <harinath@cs.umn.edu>
18137
18138 * src/getargs.c (report_argmatch): Initialize strtok().
18139
1ae72863
AD
181402002-06-20 Akim Demaille <akim@epita.fr>
18141
18142 * data/bison.simple (b4_symbol_actions): New, replaces...
18143 (b4_symbol_destructor, b4_symbol_printer): these.
18144 (yysymprint): Be sure to call YYPRINT only for tokens, and using
18145 user token numbers.
18146
87542d29
AD
181472002-06-20 Akim Demaille <akim@epita.fr>
18148
18149 * data/bison.simple (yydestructor): Rename as...
18150 (yydestruct): this.
18151
1a31ed21
AD
181522002-06-20 Akim Demaille <akim@epita.fr>
18153
18154 * src/symtab.h, src/symtab.c (symbol_type_set)
18155 (symbol_destructor_set, symbol_precedence_set): The location is
18156 the last argument.
18157 Adjust all callers.
18158
e776192e
AD
181592002-06-20 Akim Demaille <akim@epita.fr>
18160
18161 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
18162 internals.
18163 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
18164 Takes a location.
18165 * src/symtab.h, src/symtab.c (symbol_class_set)
18166 (symbol_user_token_number_set): Likewise.
18167 Adjust all callers.
18168 Promote complain_at.
18169 * tests/input.at (Type Clashes): Adjust.
18170
5c1180b3
AD
181712002-06-20 Akim Demaille <akim@epita.fr>
18172
18173 * data/bison.simple (YYLEX): Fix the declaration when
18174 %pure-parser.
18175
e3170060
AD
181762002-06-20 Akim Demaille <akim@epita.fr>
18177
18178 * data/bison.simple (yysymprint): Don't print the token number,
18179 just its name.
18180 * tests/actions.at (Destructors): Rename as...
18181 (Printers and Destructors): this.
18182 Also exercise %printer.
18183
253862fd
AD
181842002-06-20 Akim Demaille <akim@epita.fr>
18185
18186 * data/bison.simple (YYDSYMPRINT): New.
18187 Use it to remove many of the #if YYDEBUG/if (yydebug).
18188
366eea36
AD
181892002-06-20 Akim Demaille <akim@epita.fr>
18190
18191 * src/symtab.h, src/symtab.c (symbol_t): printer and
18192 printer_location are new members.
18193 (symbol_printer_set): New.
18194 * src/parse-gram.y (PERCENT_PRINTER): New token.
18195 Handle its associated rule.
18196 * src/scan-gram.l: Adjust.
18197 (handle_destructor_at, handle_destructor_dollar): Rename as...
18198 (handle_symbol_code_at, handle_symbol_code_dollar): these.
18199 * src/output.c (symbol_printers_output): New.
18200 (output_skeleton): Call it.
18201 * data/bison.simple (yysymprint): New. Cannot be named yyprint
18202 since there are already many grammar files with a user `yyprint'.
18203 Replace the calls to YYPRINT to calls to yysymprint.
18204 * tests/calc.at: Adjust.
18205 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
18206 taking advantage of parser very internal details (stack size!).
18207
4f25ebb0
AD
182082002-06-20 Akim Demaille <akim@epita.fr>
18209
18210 * src/scan-gram.l: Complete the scanner with the missing patterns
18211 to pacify Flex.
18212 Use `quote' and `symbol_tag_get' where appropriate.
18213
93b68a0e
AD
182142002-06-19 Akim Demaille <akim@epita.fr>
18215
18216 * tests/actions.at (Destructors): Augment to test locations.
18217 * data/bison.simple (yydestructor): Pass it the current location
18218 if locations are enabled.
18219 Prototype only when __STDC__ or C++.
18220 Change the argument names to move into the yy name space: there is
18221 user code here.
18222
58612f1d
AD
182232002-06-19 Akim Demaille <akim@epita.fr>
18224
74310291
AD
18225 * data/bison.simple (b4_pure_if): New.
18226 Use it instead of #ifdef YYPURE.
18227
182282002-06-19 Akim Demaille <akim@epita.fr>
18229
18230 * data/bison.simple (b4_location_if): New.
58612f1d
AD
18231 Use it instead of #ifdef YYLSP_NEEDED.
18232
f25bfb75
AD
182332002-06-19 Akim Demaille <akim@epita.fr>
18234
18235 Prepare @$ in %destructor, but currently don't bind it in the
18236 skeleton, as %location use is not cleaned up yet.
18237
18238 * src/scan-gram.l (handle_dollar, handle_destructor_at)
18239 (handle_action_at): New.
18240 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
18241 a braced_code_t and a location as additional arguments.
18242 (handle_destructor_dollar): Instead of requiring `b4_eval', just
18243 unquote one when outputting `b4_dollar_dollar'.
18244 Adjust callers.
18245 * data/bison.simple (b4_eval): Remove.
18246 (b4_symbol_destructor): Adjust.
18247 * tests/input.at (Invalid @n): Adjust.
18248
c732d2c6
AD
182492002-06-19 Zack Weinberg <zack@codesourcery.com>
18250
18251 * doc/bison.texinfo: Document ability to have multiple
18252 prologue sections.
18253
8c165d89
AD
182542002-06-18 Akim Demaille <akim@epita.fr>
18255
18256 * src/files.c (compute_base_names): When computing the output file
18257 names from the input file name, strip the directory part.
18258
ca98bf57
AD
182592002-06-18 Akim Demaille <akim@epita.fr>
18260
18261 * data/bison.simple.new: Comment changes.
18262 Reported by Andreas Schwab.
18263
0bfb02ff
AD
182642002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
18265
18266 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
18267 there are no `label `yyoverflowlab' defined but not used' warnings
18268 when yyoverflow is defined.
18269
24c0aad7
AD
182702002-06-18 Akim Demaille <akim@epita.fr>
18271
18272 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
18273 new member.
18274 (symbol_destructor_set): Adjust.
18275 * src/output.c (symbol_destructors_output): Output the destructor
18276 locations.
18277 Output the symbol name.
18278 * data/bison.simple (b4_symbol_destructor): Adjust.
18279
5719c109
AD
182802002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
18281 and Akim Demaille <akim@epita.fr>
18282
18283 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
18284 what's left on the stack when the error recovery hits EOF.
18285 * tests/actions.at (Destructors): Complete to exercise this case.
18286
9280d3ef
AD
182872002-06-17 Akim Demaille <akim@epita.fr>
18288
18289 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
18290 arguments is really empty, not only equal to `[]'.
18291 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
18292 member.
18293 (symbol_destructor_set): New.
18294 * src/output.c (symbol_destructors_output): New.
18295 * src/reader.h (brace_code_t, current_braced_code): New.
18296 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
18297 (handle_dollar): Rename as...
18298 (handle_action_dollar): this.
18299 (handle_destructor_dollar): New.
18300 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
18301 (grammar_declaration): Use it.
18302 * data/bison.simple (yystos): Is always defined.
18303 (yydestructor): New.
18304 * tests/actions.at (Destructors): New.
18305 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
18306
dafdc66f
AD
183072002-06-17 Akim Demaille <akim@epita.fr>
18308
18309 * src/symlist.h, src/symlist.c (symbol_list_length): New.
18310 * src/scan-gram.l (handle_dollar, handle_at): Compute the
18311 rule_length only when needed.
18312 * src/output.c (actions_output, token_definitions_output): Output
18313 the full M4 block.
18314 * src/symtab.c: Don't access directly to the symbol tag, use
18315 symbol_tag_get.
18316 * src/parse-gram.y: Use symbol_list_free.
18317
56c47203
AD
183182002-06-17 Akim Demaille <akim@epita.fr>
18319
18320 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
18321 (symbol_list_prepend, get_type_name): Move to...
18322 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
18323 (symbol_list_prepend, symbol_list_n_type_name_get): here.
18324 Adjust all callers.
18325 (symbol_list_free): New.
18326 * src/scan-gram.l (handle_dollar): Takes a location.
18327 * tests/input.at (Invalid $n): Adjust.
18328
1e0bab92
AD
183292002-06-17 Akim Demaille <akim@epita.fr>
18330
18331 * src/reader.h, src/reader.c (symbol_list_new): Export it.
18332 (symbol_list_prepend): New.
18333 * src/parse-gram.y (%union): `list' is a new member.
18334 (symbols.1): New, replaces...
18335 (terms_to_prec.1, nterms_to_type.1): these.
18336 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
18337 Take a location as additional argument.
18338 Adjust all callers.
18339
04e60654
AD
183402002-06-15 Akim Demaille <akim@epita.fr>
18341
18342 * src/parse-gram.y: Move %token in the declaration section so that
18343 we don't depend upon CVS Bison.
18344
10e5b8bd
AD
183452002-06-15 Akim Demaille <akim@epita.fr>
18346
18347 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
18348 * src/print.c (print_core): Use it.
18349
9801d40c
AD
183502002-06-15 Akim Demaille <akim@epita.fr>
18351
18352 * src/conflicts.c (log_resolution): Accept the rule involved in
18353 the sr conflicts instead of the lookahead number that points to
18354 that rule.
18355 (flush_reduce): Accept the current lookahead vector as argument,
18356 instead of the index in LA.
18357 (resolve_sr_conflict): Accept the current number of lookahead
18358 bitset to consider for the STATE, instead of the index in LA.
18359 (set_conflicts): Adjust.
18360 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
18361
c0263492
AD
183622002-06-15 Akim Demaille <akim@epita.fr>
18363
18364 * src/state.h (state_t): Replace the `lookaheadsp' member, a
18365 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
18366 Adjust all dependencies.
18367 * src/lalr.c (initialize_lookaheads): Split into...
18368 (states_lookaheads_count, states_lookaheads_initialize): these.
18369 (lalr): Adjust.
18370
9757c359
AD
183712002-06-15 Akim Demaille <akim@epita.fr>
18372
18373 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
18374 out of...
18375 (grammar_rules_print): here.
18376 * src/reduce.c (reduce_output): Use it.
18377 * tests/reduce.at (Useless Rules, Reduced Automaton)
18378 (Underivable Rules): Adjust.
18379
6b98e4b5
AD
183802002-06-15 Akim Demaille <akim@epita.fr>
18381
18382 Copy BYacc's nice way to report the grammar.
18383
18384 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
18385 New.
18386 Don't print the rules' location, it is confusing and useless.
18387 (rule_print): Use grammar_rhs_print.
18388 * src/print.c (print_grammar): Use grammar_rules_print.
18389
6b98e4b5
AD
183902002-06-15 Akim Demaille <akim@epita.fr>
18391
18392 Complete and rationalize `useless thing' warnings.
18393
18394 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
18395 (symbol_tag_print): New.
18396 Use them everywhere in place of accessing directly the tag member.
18397 * src/gram.h, src/gram.c (rule_print): New.
18398 Use it where a rule used to be printed `by hand'.
18399 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
18400 (reduce_grammar_tables): Report the useless rules.
18401 (reduce_print): Useless things are a warning, not an error.
18402 Report it as such.
18403 * tests/reduce.at (Useless Nonterminals, Useless Rules):
18404 (Reduced Automaton, Underivable Rules): Adjust.
18405 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
18406 * tests/conflicts.at (Unresolved SR Conflicts)
18407 (Solved SR Conflicts): Adjust.
18408
ee000ba4
AD
184092002-06-15 Akim Demaille <akim@epita.fr>
18410
18411 Let symbols have a location.
18412
18413 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
18414 (getsym): Adjust.
18415 Adjust all callers.
18416 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
18417 Use location_t, not int.
18418 * src/symtab.c (symbol_check_defined): Take advantage of the
18419 location.
18420 * tests/regression.at (Invalid inputs): Adjust.
18421
8efe435c
AD
184222002-06-15 Akim Demaille <akim@epita.fr>
18423
18424 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
18425 (input): Don't try to initialize yylloc here, do it in the
18426 scanner.
18427 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
18428 * src/gram.h (rule_t): Change line and action_line into location
18429 and action_location, of location_t type.
18430 Adjust all dependencies.
18431 * src/location.h, src/location.c (empty_location): New.
18432 * src/reader.h, src/reader.c (grammar_start_symbol_set)
18433 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
18434 (grammar_current_rule_symbol_append)
18435 (grammar_current_rule_action_append): Expect a location as argument.
18436 * src/reader.c (grammar_midrule_action): Adjust to attach an
18437 action's location as dummy symbol location.
18438 * src/symtab.h, src/symtab.c (startsymbol_location): New.
18439 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
18440 the line numbers.
18441
1921f1d7
AD
184422002-06-14 Akim Demaille <akim@epita.fr>
18443
18444 Grammar declarations may be found in the grammar section.
18445
18446 * src/parse-gram.y (rules_or_grammar_declaration): New.
18447 (declarations): Each declaration may end with a semicolon, not
18448 just...
18449 (grammar_declaration): `"%union"'.
18450 (grammar): Branch to rules_or_grammar_declaration.
18451
4515534c
AD
184522002-06-14 Akim Demaille <akim@epita.fr>
18453
18454 * src/main.c (main): Invoke scanner_free.
18455
f958596b
AD
184562002-06-14 Akim Demaille <akim@epita.fr>
18457
18458 * src/output.c (m4_invoke): Extracted from...
18459 (output_skeleton): here.
18460 Free tempfile.
18461
2c569025
AD
184622002-06-14 Akim Demaille <akim@epita.fr>
18463
18464 * src/parse-gram.y (directives, directive, gram)
18465 (grammar_directives, precedence_directives, precedence_directive):
18466 Rename as...
18467 (declarations, declaration, grammar, grammar_declaration)
18468 (precedence_declaration, precedence_declarator): these.
18469 (symbol_declaration): New.
18470
592e8d4d
AD
184712002-06-14 Akim Demaille <akim@epita.fr>
18472
18473 * src/files.c (action_obstack): Remove, unused.
18474 (output_obstack): Remove it, and all its dependencies, as it is no
18475 longer needed.
18476 * src/reader.c (epilogue_set): Build the epilogue in the
18477 muscle_obstack.
18478 * src/output.h, src/output.c (muscle_obstack): Move to...
18479 * src/muscle_tab.h, src/muscle_tab.h: here.
18480 (muscle_init): Initialize muscle_obstack.
18481 (muscle_free): New.
18482 * src/main.c (main): Call it.
18483
0c15323d
AD
184842002-06-14 Akim Demaille <akim@epita.fr>
18485
18486 * src/location.h: New, extracted from...
18487 * src/reader.h: here.
18488 * src/Makefile.am (noinst_HEADERS): Merge into
18489 (bison_SOURCES): this.
18490 Add location.h.
18491 * src/parse-gram.y: Use location_t instead of Bison's.
18492 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
18493 Use location_t instead of ints.
18494
e96c9728
AD
184952002-06-14 Akim Demaille <akim@epita.fr>
18496
18497 * data/bison.simple, data/bison.c++: Be sure to restore the
18498 current #line when returning to the skeleton contents after having
18499 exposed the input file's #line.
18500
75d1fe16
AD
185012002-06-12 Akim Demaille <akim@epita.fr>
18502
18503 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
18504 eager.
18505 * tests/actions.at (Exotic Dollars): New.
18506
6c35d22c
AD
185072002-06-12 Akim Demaille <akim@epita.fr>
18508
18509 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
18510 ['"/] too eagerly.
18511 * tests/input.at (Torturing the Scanner): New.
18512
1d6412ad
AD
185132002-06-11 Akim Demaille <akim@epita.fr>
18514
18515 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
18516 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
18517 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
18518 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
18519 * src/reader.c (reader): Use it.
18520
4cdb01db
AD
185212002-06-11 Akim Demaille <akim@epita.fr>
18522
18523 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
18524 Adjust all callers.
18525 (scanner_last_string_free): New.
18526
44995b2e
AD
185272002-06-11 Akim Demaille <akim@epita.fr>
18528
18529 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
18530 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
18531 (last_string, YY_OBS_FREE): New.
18532 Use them when returning an ID.
18533
e9955c83
AD
185342002-06-11 Akim Demaille <akim@epita.fr>
18535
18536 Have Bison grammars parsed by a Bison grammar.
18537
18538 * src/reader.c, src/reader.h (prologue_augment): New.
18539 * src/reader.c (copy_definition): Remove.
18540
18541 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
18542 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
18543 (grammar_current_rule_prec_set, grammar_current_rule_check)
18544 (grammar_current_rule_symbol_append)
18545 (grammar_current_rule_action_append): Export.
18546 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
18547 (symbol_list_action_append): Remove.
18548 Hook the routines from reader.
18549 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
18550 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
18551
18552 * src/reader.c (read_declarations): Remove, unused.
18553
18554 * src/parse-gram.y: Handle the epilogue.
18555 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
18556 (grammar_start_symbol_set): this.
18557 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
18558 * src/reader.c (readgram): Remove, unused.
18559 (reader): Adjust to insert eoftoken and axiom where appropriate.
18560
18561 * src/reader.c (copy_dollar): Replace with...
18562 * src/scan-gram.h (handle_dollar): this.
18563 * src/parse-gram.y: Remove `%thong'.
18564
18565 * src/reader.c (copy_at): Replace with...
18566 * src/scan-gram.h (handle_at): this.
18567
18568 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
18569 New.
18570
18571 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
18572 time being.
18573
18574 * src/reader.h, src/reader.c (grammar_rule_end): New.
18575
18576 * src/parse.y (current_type, current_class): New.
18577 Implement `%nterm', `%token' support.
18578 Merge `%term' into `%token'.
18579 (string_as_id): New.
18580 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
18581 type name.
18582
18583 * src/parse-gram.y: Be sure to handle properly the beginning of
18584 rules.
18585
18586 * src/parse-gram.y: Handle %type.
18587 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
18588
18589 * src/parse-gram.y: More directives support.
18590 * src/options.c: No longer handle source directives.
18591
18592 * src/parse-gram.y: Fix %output.
18593
18594 * src/parse-gram.y: Handle %union.
18595 Use the prologue locations.
18596 * src/reader.c (parse_union_decl): Remove.
18597
18598 * src/reader.h, src/reader.c (epilogue_set): New.
18599 * src/parse-gram.y: Use it.
18600
18601 * data/bison.simple, data/bison.c++: b4_stype is now either not
18602 defined, then default to int, or to the contents of %union,
18603 without `union' itself.
18604 Adjust.
18605 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
18606
18607 * src/output.c (actions_output): Don't output braces, as they are
18608 already handled by the scanner.
18609
18610 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
18611 characters to themselves.
18612
18613 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
18614 that the epilogue has a proper #line.
18615
18616 * src/parse-gram.y: Handle precedence/associativity.
18617
18618 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
18619 a terminal.
18620 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
18621 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
18622 at all to define terminals that cannot be emitted.
18623
18624 * src/scan-gram.l: Escape M4 characters.
18625
18626 * src/scan-gram.l: Working properly with escapes in user
18627 strings/characters.
18628
18629 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
18630 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
18631 grammar.
18632 Use more modest sizes, as for the time being the parser does not
18633 release memory, and therefore the process swallows a huge amount
18634 of memory.
18635
18636 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
18637 stricter %token grammar.
18638
18639 * src/symtab.h (associativity): Add `undef_assoc'.
18640 (symbol_precedence_set): Do nothing when passed an undef_assoc.
18641 * src/symtab.c (symbol_check_alias_consistence): Adjust.
18642
18643 * tests/regression.at (Invalid %directive): Remove, as it is now
18644 meaningless.
18645 (Invalid inputs): Adjust to the new error messages.
18646 (Token definitions): The new grammar doesn't allow too many
18647 eccentricities.
18648
18649 * src/lex.h, src/lex.c: Remove.
18650 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
18651 (copy_character, copy_string2, copy_string, copy_identifier)
18652 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
18653 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
18654 (parse_action): Remove.
18655 * po/POTFILES.in: Adjust.
18656
2e047461
AD
186572002-06-11 Akim Demaille <akim@epita.fr>
18658
cd05d13c 18659 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
18660 rule's action member: return the action as a string.
18661 Don't require `rule_length' as an argument: compute it.
18662 (grammar_current_rule_symbol_append)
18663 (grammar_current_rule_action_append): New, eved out from
18664 (readgram): here.
18665 Remove `action_flag', `rulelength', unused now.
18666
9af3fbce
AD
186672002-06-11 Akim Demaille <akim@epita.fr>
18668
18669 * src/reader.c (grammar_current_rule_prec_set).
18670 (grammar_current_rule_check): New, eved out from...
18671 (readgram): here.
18672 Remove `xaction', `first_rhs': useless.
18673 * tests/input.at (Type clashes): New.
18674 * tests/existing.at (GNU Cim Grammar): Adjust.
18675
1485e106
AD
186762002-06-11 Akim Demaille <akim@epita.fr>
18677
18678 * src/reader.c (grammar_midrule_action): New, Eved out from
18679 (readgram): here.
18680
da4160c3
AD
186812002-06-11 Akim Demaille <akim@epita.fr>
18682
18683 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
18684 New.
18685 (readgram): Use them as replacement of inlined code, crule and
18686 crule1.
18687
f6d0f937
AD
186882002-06-11 Akim Demaille <akim@epita.fr>
18689
18690 * src/reader.c (grammar_end, grammar_symbol_append): New.
18691 (readgram): Use them.
18692 Make the use of `p' as local as possible.
18693
69078d4b
AD
186942002-06-10 Akim Demaille <akim@epita.fr>
18695
18696 GCJ's parser requires the tokens to be defined before the prologue.
18697
18698 * data/bison.simple: Output the token definition before the user's
18699 prologue.
18700 * tests/regression.at (Braces parsing, Duplicate string)
18701 (Mixing %token styles): Check the output from bison.
18702 (Early token definitions): New.
18703
5e424082
AD
187042002-06-10 Akim Demaille <akim@epita.fr>
18705
18706 * src/symtab.c (symbol_user_token_number_set): Don't complain when
18707 assigning twice the same user number to a token, so that we can
18708 use it in...
18709 * src/lex.c (lex): here.
18710 Also use `symbol_class_set' instead of hand written code.
18711 * src/reader.c (parse_assoc_decl): Likewise.
18712
44536b35
AD
187132002-06-10 Akim Demaille <akim@epita.fr>
18714
18715 * src/symtab.c, src/symtab.c (symbol_class_set)
18716 (symbol_user_token_number_set): New.
18717 * src/reader.c (parse_token_decl): Use them.
18718 Use a switch instead of ifs.
18719 Use a single argument.
18720
8b9f2372
AD
187212002-06-10 Akim Demaille <akim@epita.fr>
18722
18723 Remove `%thong' support as it is undocumented, unused, duplicates
18724 `%token's job, and creates useless e-mail traffic with people who
18725 want to know what it is, why it is undocumented, unused, and
18726 duplicates `%token's job.
18727
18728 * src/reader.c (parse_thong_decl): Remove.
18729 * src/options.c (option_table): Remove "thong".
18730 * src/lex.h (tok_thong): Remove.
18731
3ae2b51f
AD
187322002-06-10 Akim Demaille <akim@epita.fr>
18733
18734 * src/symtab.c, src/symtab.c (symbol_type_set)
18735 (symbol_precedence_set): New.
18736 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
18737 (value_components_used): Remove, unused.
18738
2f1afb73
AD
187392002-06-09 Akim Demaille <akim@epita.fr>
18740
18741 Move symbols handling code out of the reader.
18742
18743 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
18744 (axiom): Move to...
18745 * src/symtab.h, src/symtab.c: here.
18746
18747 * src/gram.c (start_symbol): Remove: use startsymbol->number.
18748 * src/reader.c (startval): Rename as...
18749 * src/symtab.h, src/symtab.c (startsymbol): this.
18750 * src/reader.c: Adjust.
18751
18752 * src/reader.c (symbol_check_defined, symbol_make_alias)
18753 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18754 (token_translations_init)
18755 Move to...
18756 * src/symtab.c: here.
18757 * src/reader.c (packsymbols): Move to...
18758 * src/symtab.h, src/symtab.c (symbols_pack): here.
18759 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
18760 argument.
18761
e9bca3ad
AD
187622002-06-03 Akim Demaille <akim@epita.fr>
18763
18764 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
18765 then statements.
18766
86eff183
AD
187672002-06-03 Akim Demaille <akim@epita.fr>
18768
18769 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
18770 structs with non literals.
18771 * src/scan-skel.l: never-interactive.
18772 * src/conflicts.c (enum conflict_resolution_e): No trailing
18773 comma.
18774 * src/getargs.c (usage): Split long literal strings.
18775 Reported by Hans Aberg.
18776
717be197
AD
187772002-05-28 Akim Demaille <akim@epita.fr>
18778
18779 * data/bison.c++: Use C++ ostreams.
18780 (cdebug_): New member.
18781
670ddffd
AD
187822002-05-28 Akim Demaille <akim@epita.fr>
18783
18784 * src/output.c (output_skeleton): Be sure to allocate enough room
18785 for `/' _and_ for `\0' in full_skeleton.
18786
769b430f
AD
187872002-05-28 Akim Demaille <akim@epita.fr>
18788
18789 * data/bison.c++: Catch up with bison.simple:
18790 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18791 and Paul Eggert <eggert@twinsun.com>: `error' handing.
18792 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
18793 and popping traces.
18794
7067cb36
PH
187952002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18796
18797 * src/output.c (output_skeleton): Put an explicit path in front of
18798 the skeleton file name, rather than relying on the -I directory,
18799 to partially alleviate effects of having a skeleton file lying around
18800 in the current directory.
769b430f 18801
4a713ec2
PH
188022002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18803
769b430f 18804 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
18805 obstack_printf should be obstack_fgrow1.
18806
b408954b
AD
188072002-05-26 Akim Demaille <akim@epita.fr>
18808
18809 * src/state.h (state_t): `solved_conflicts' is a new member.
18810 * src/LR0.c (new_state): Set it to 0.
18811 * src/conflicts.h, src/conflicts.c (print_conflicts)
18812 (free_conflicts, solve_conflicts): Rename as...
18813 (conflicts_print, conflicts_free, conflicts_solve): these.
18814 Adjust callers.
18815 * src/conflicts.c (enum conflict_resolution_e)
18816 (solved_conflicts_obstack): New, used by...
18817 (log_resolution): this.
18818 Adjust to attach the conflict resolution to each state.
18819 Complete the description with the precedence/associativity
18820 information.
18821 (resolve_sr_conflict): Adjust.
18822 * src/print.c (print_state): Output its solved_conflicts.
18823 * tests/conflicts.at (Unresolved SR Conflicts)
18824 (Solved SR Conflicts): Exercise --report=all.
18825
a49aecd5
AD
188262002-05-26 Akim Demaille <akim@epita.fr>
18827
18828 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18829 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18830 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
18831 (token_number_t, item_number_as_token_number)
18832 (token_number_as_item_number, muscle_insert_token_number_table):
18833 Rename as...
18834 (symbol_number_t, item_number_as_symbol_number)
18835 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
18836 these, since it is more appropriate.
18837
5504898e
AD
188382002-05-26 Akim Demaille <akim@epita.fr>
18839
18840 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
18841 `Error:' lines.
18842 * data/bison.simple (yystos) [YYDEBUG]: New.
18843 (yyparse) [YYDEBUG]: Display the symbols which are popped during
18844 error recovery.
18845 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
18846
ec3bc396
AD
188472002-05-25 Akim Demaille <akim@epita.fr>
18848
18849 * doc/bison.texinfo (Debugging): Split into...
18850 (Tracing): this new section, its former contents, and...
18851 (Understanding): this new section.
18852 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
18853 by...
18854 (report_flag): this.
18855 Adjust all dependencies.
18856 (report_args, report_types, report_argmatch): New.
18857 (usage, getargs): Report/support -r, --report.
18858 * src/options.h
18859 (struct option_table_struct): Rename as..,
18860 (struct option_table_s): this.
18861 Rename the `set_flag' member to `flag' to match with getopt_long's
18862 struct.
18863 * src/options.c (option_table): Split verbose into an entry for
18864 %verbose, and another for --verbose.
18865 Support --report/-r, so remove -r from the obsolete --raw.
18866 * src/print.c: Attach full item sets and lookaheads reports to
18867 report_flag instead of trace_flag.
18868 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
18869
78df8250
PE
188702002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18871 and Paul Eggert <eggert@twinsun.com>
769b430f 18872
78df8250
PE
18873 * data/bison.simple (yyparse): Correct error handling to conform to
18874 POSIX and yacc. Specifically, after syntax error is discovered,
18875 do not reduce further before shifting the error token.
18876 Clean up the code a bit by removing the labels yyerrdefault,
18877 yyerrhandle, yyerrpop.
18878 * NEWS: Document the above.
18879
c0c9ea05
PH
188802002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18881
18882 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
18883 type; it isn't always big enough, since it doesn't necessarily
18884 include non-terminals.
769b430f 18885 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
18886 the latter can be removed.
18887 (yy_token_number_type): Remove, only one use.
18888 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
18889 don't use TokenNumberType as element type.
769b430f 18890
c0c9ea05
PH
18891 * tests/regression.at: Modify expected output to agree with change
18892 to yyr1 and yytranslate.
769b430f 18893
6390a83f
FK
188942002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
18895
18896 * src/reader.c (parse_action): Use copy_character instead of
18897 obstack_1grow.
18898
db7c8e9a
AD
188992002-05-13 Akim Demaille <akim@epita.fr>
18900
18901 * tests/regression.at (Token definitions): Prototype yylex and
18902 yyerror.
18903
fcc61800
PH
189042002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18905
158c687b 18906 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
18907 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
18908 32-bit arithmetic.
18909 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
18910
5683e9b2
AD
189112002-05-07 Akim Demaille <akim@epita.fr>
18912
18913 * tests/synclines.at: Be sure to prototype yylex and yyerror to
18914 avoid GCC warnings.
18915
0c2d3f4c
AD
189162002-05-07 Akim Demaille <akim@epita.fr>
18917
18918 Kill GCC warnings.
18919
18920 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
18921 over the RHS of each rule.
18922 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
18923 * src/state.h (state_t): Member `nitems' is unsigned short.
18924 * src/LR0.c (get_state): Adjust.
18925 * src/reader.c (packgram): Likewise.
18926 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
18927 `Type'.
18928 (muscle_insert_int_table): Remove, unused.
18929 (prepare_rules): Remove `max'.
18930
1565b720
AD
189312002-05-06 Akim Demaille <akim@epita.fr>
18932
18933 * src/closure.c (print_firsts): Display of the symbol tags.
18934 (bitmatrix_print): Move to...
18935 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
18936 here.
18937 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
18938
cfaee611
AD
189392002-05-06 Akim Demaille <akim@epita.fr>
18940
18941 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
18942 hash_do_for_each.
18943
458be8e0
AD
189442002-05-06 Akim Demaille <akim@epita.fr>
18945
18946 * src/LR0.c (new_state, get_state): Instead of using the global
18947 `kernel_size' and `kernel_base', have two new arguments:
18948 `core_size' and `core'.
18949 Adjust callers.
18950
a900a624
AD
189512002-05-06 Akim Demaille <akim@epita.fr>
18952
18953 * src/reader.c (packgram): No longer end `ritem' with a 0
18954 sentinel: it is not used.
18955
d4e7d3a1
AD
189562002-05-05 Akim Demaille <akim@epita.fr>
18957
18958 New experimental feature: display the lookaheads in the report and
18959 graph.
18960
18961 * src/print (print_core): When --trace-flag, display the rules
18962 lookaheads.
18963 * src/print_graph.c (print_core): Likewise.
18964 Swap the arguments.
18965 Adjust caller.
18966
39ceb25b
AD
189672002-05-05 Akim Demaille <akim@epita.fr>
18968
18969 * tests/torture.at (Many lookaheads): New test.
18970
5372019f
AD
189712002-05-05 Akim Demaille <akim@epita.fr>
18972
18973 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
18974 (GENERATE_MUSCLE_INSERT_TABLE): this.
18975 (output_int_table, output_unsigned_int_table, output_short_table)
18976 (output_token_number_table, output_item_number_table): Replace with...
18977 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
18978 (muscle_insert_short_table, muscle_insert_token_number_table)
18979 (muscle_insert_item_number_table): these.
18980 Adjust all callers.
18981 (prepare_tokens): Don't free `translations', since...
18982 * src/reader.h, src/reader.c (grammar_free): do it.
18983 Move to...
18984 * src/gram.h, src/gram.c (grammar_free): here.
18985 * data/bison.simple, data/bison.c++: b4_token_number_max is now
18986 b4_translate_max.
18987
5df5f6d5
AD
189882002-05-05 Akim Demaille <akim@epita.fr>
18989
18990 * src/output.c (output_unsigned_int_table): New.
18991 (prepare_rules): `i' is unsigned.
18992 `prhs', `rline', `r2' are unsigned int.
18993 Rename muscle `rhs_number_max' as `rhs_max'.
18994 Output muscles `prhs_max', `rline_max', and `r2_max'.
18995 Free rline and r1.
18996 * data/bison.simple, data/bison.c++: Adjust to use these muscles
18997 to compute types instead of constant types.
18998 * tests/regression.at (Web2c Actions): Adjust.
18999
b87f8b21
AD
190002002-05-04 Akim Demaille <akim@epita.fr>
19001
19002 * src/symtab.h (SALIAS, SUNDEF): Rename as...
19003 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
19004 Adjust dependencies.
19005 * src/output.c (token_definitions_output): Be sure not to output a
19006 `#define 'a'' when fed with `%token 'a' "a"'.
19007 * tests/regression.at (Token definitions): New.
19008
8bb936e4
PE
190092002-05-03 Paul Eggert <eggert@twinsun.com>
19010
19011 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
19012 for K&R C.
19013
190142002-05-03 gettextize <bug-gnu-gettext@gnu.org>
19015
19016 * Makefile.am (SUBDIRS): Remove intl.
19017 (EXTRA_DIST): Add config/config.rpath.
19018
53c71a12
AD
190192002-05-03 Akim Demaille <akim@epita.fr>
19020
19021 * data/bison.simple (m4_if): Don't output empty enums.
19022 And actually, output valid enum definitions :(.
19023
289dd0cf
AD
190242002-05-03 Akim Demaille <akim@epita.fr>
19025
19026 * configure.bat: Remove, completely obsolete.
19027 * Makefile.am (EXTRA_DIST): Adjust.
19028 Don't distribute config.rpath...
19029 * config/Makefile.am (EXTRA_DIST): Do it.
19030
db85e524
AD
190312002-05-03 Akim Demaille <akim@epita.fr>
19032
19033 * configure.in (GETTEXT_VERSION): New.
19034 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
19035
83ccf991
AD
190362002-05-03 Akim Demaille <akim@epita.fr>
19037
19038 * data/bison.simple (b4_token_enum): New.
19039 (b4_token_defines): Use it to output tokens both as #define and
19040 enums.
19041 Suggested by Paul Eggert.
19042 * src/output.c (token_definitions_output): Don't output spurious
19043 white spaces.
19044
1f418995
AD
190452002-05-03 Akim Demaille <akim@epita.fr>
19046
19047 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19048
45119f04
RA
190492002-05-02 Robert Anisko <robert@lrde.epita.fr>
19050
19051 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
19052 Update the stack class, give a try to deque as the default container.
19053
b2d52318
AD
190542002-05-02 Akim Demaille <akim@epita.fr>
19055
19056 * data/bison.simple (yyparse): Do not implement @$ = @1.
19057 (YYLLOC_DEFAULT): Adjust to do it.
19058 * doc/bison.texinfo (Location Default Action): Fix.
19059
3a8b4109
AD
190602002-05-02 Akim Demaille <akim@epita.fr>
19061
19062 * src/reader.c (parse_braces): Merge into...
19063 (parse_action): this.
19064
84614e13
AD
190652002-05-02 Akim Demaille <akim@epita.fr>
19066
19067 * configure.in (ALL_LINGUAS): Remove.
19068 * po/LINGUAS, hr.po: New.
19069
fdbcd8e2
AD
190702002-05-02 Akim Demaille <akim@epita.fr>
19071
19072 Remove the so called hairy (semantic) parsers.
19073
19074 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
19075 * src/gram.h, src/gram.c (semantic_parser): Remove.
19076 (rule_t): Remove the guard and guard_line members.
19077 * src/lex.h (token_t): remove tok_guard.
19078 * src/options.c (option_table): Remove %guard and %semantic_parser
19079 support.
19080 * src/output.c, src/output.h (guards_output): Remove.
19081 (prepare): Adjust.
19082 (token_definitions_output): Don't output the `T'
19083 tokens (???).
19084 (output_skeleton): Don't output the guards.
19085 * src/files.c, src/files.c (attrsfile): Remove.
19086 * src/reader.c (symbol_list): Remove the guard and guard_line
19087 members.
19088 Adjust dependencies.
19089 (parse_guard): Remove.
19090 * data/bison.hairy: Remove.
19091 * doc/bison.texinfo (Environment Variables): Remove occurrences of
19092 BISON_HAIRY.
19093
82b6cb3f
AD
190942002-05-02 Akim Demaille <akim@epita.fr>
19095
19096 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
19097 (parse_guard): Rename the formal argument `stack_offset' as
19098 `rule_length', which is more readable.
19099 Adjust callers.
19100 (copy_at, copy_dollar): Instead of outputting the hard coded
19101 values of $$, $n and so forth, output invocation to b4_lhs_value,
19102 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
19103 Note: this patch partially drops `semantic-parser' support: it
19104 always does `rule_length - n', where semantic parsers ought to
19105 always use `-n'.
82b6cb3f
AD
19106 * data/bison.simple, data/bison.c++ (b4_lhs_value)
19107 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
19108
6cbfbcc5
AD
191092002-05-02 Akim Demaille <akim@epita.fr>
19110
19111 * configure.in (AC_INIT): Bump to 1.49b.
19112 (AM_INIT_AUTOMAKE): Short invocation.
19113
b8548114
AD
191142002-05-02 Akim Demaille <akim@epita.fr>
19115
19116 Version 1.49a.
19117
c20cd1fa
AD
191182002-05-01 Akim Demaille <akim@epita.fr>
19119
19120 * src/skeleton.h: Remove.
19121
8a9566d4
AD
191222002-05-01 Akim Demaille <akim@epita.fr>
19123
19124 * src/skeleton.h: Fix the #endif.
19125 Reported by Magnus Fromreide.
19126
8c6d399a
PE
191272002-04-26 Paul Eggert <eggert@twinsun.com>
19128
19129 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
19130 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 19131 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 19132
2b7ed18a
RA
191332002-04-25 Robert Anisko <robert@lrde.epita.fr>
19134
19135 * src/scan-skel.l: Postprocess quadrigraphs.
19136
19137 * src/reader.c (copy_character): New function, used to output
19138 single characters while replacing `[' and `]' with quadrigraphs, to
19139 avoid troubles with M4 quotes.
19140 (copy_comment): Output characters with copy_character.
19141 (read_additionnal_code): Likewise.
19142 (copy_string2): Likewise.
19143 (copy_definition): Likewise.
19144
19145 * tests/calc.at: Exercise M4 quoting.
19146
34a89c50
AD
191472002-04-25 Akim Demaille <akim@epita.fr>
19148
19149 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
19150 between `!' and the command.
19151 Reported by Paul Eggert.
19152
0dd1580a
RA
191532002-04-24 Robert Anisko <robert@lrde.epita.fr>
19154
19155 * tests/calc.at: Exercise prologue splitting.
19156
19157 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
19158 `b4_post_prologue' instead of `b4_prologue'.
19159
19160 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
19161 muscles.
19162 (output): Free pre_prologue_obstack and post_prologue_obstack.
19163 * src/files.h, src/files.c (attrs_obstack): Remove.
19164 (pre_prologue_obstack, post_prologue_obstack): New.
19165 * src/reader.c (copy_definition): Add a parameter to specify the
19166 obstack to fill, instead of using attrs_obstack unconditionally.
19167 (read_declarations): Pass pre_prologue_obstack to copy_definition if
19168 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
19169
83c1796f
PE
191702002-04-23 Paul Eggert <eggert@twinsun.com>
19171
19172 * data/bison.simple: Remove unnecessary commentary and white
19173 space differences from 1_29-branch.
19174 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
19175
19176 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
19177 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
19178 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
19179 constructors or destructors.
19180
19181 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
19182
1207eeac
AD
191832002-04-23 Akim Demaille <akim@epita.fr>
19184
19185 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
19186 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
19187 location with columns.
19188 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
19189 All reported by Paul Eggert.
19190
78ab8f67
AD
191912002-04-22 Akim Demaille <akim@epita.fr>
19192
19193 * src/reduce.c (dump_grammar): Move to...
19194 * src/gram.h, src/gram.c (grammar_dump): here.
19195 Be sure to separate long item numbers.
19196 Don't read the members of a rule's prec if its nil.
19197
133c20e2
AD
191982002-04-22 Akim Demaille <akim@epita.fr>
19199
19200 * src/output.c (table_size, table_grow): New.
19201 (MAXTABLE): Remove, replace uses with table_size.
19202 (pack_vector): Instead of dying when the table is too big, grow it.
19203
9515e8a7
AD
192042002-04-22 Akim Demaille <akim@epita.fr>
19205
19206 * data/bison.simple (yyr1): Its type is that of a token number.
19207 * data/bison.c++ (r1_): Likewise.
19208 * tests/regression.at (Web2c Actions): Adjust.
19209
23c5a174
AD
192102002-04-22 Akim Demaille <akim@epita.fr>
19211
19212 * src/reader.c (token_translations_init): 256 is now the default
19213 value for the error token, i.e., it will be assigned another
19214 number if the user assigned 256 to one of her tokens.
19215 (reader): Don't force 256 to error.
19216 * doc/bison.texinfo (Symbols): Adjust.
19217 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
19218 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
19219 etc. instead of 10, 20, 30 (which was used to `jump' over error
19220 (256) and undefined (2)).
19221
5fbb0954
AD
192222002-04-22 Akim Demaille <akim@epita.fr>
19223
19224 Propagate more token_number_t.
19225
19226 * src/gram.h (token_number_as_item_number)
19227 (item_number_as_token_number): New.
19228 * src/output.c (GENERATE_OUTPUT_TABLE): New.
19229 Use it to create output_item_number_table and
19230 output_token_number_table.
19231 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
19232 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
19233 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
19234 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
19235
4f940944
AD
192362002-04-22 Akim Demaille <akim@epita.fr>
19237
19238 * src/output.h, src/output.c (get_lines_number): Remove.
19239
3ded9a63
AD
192402002-04-19 Akim Demaille <akim@epita.fr>
19241
19242 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
19243 as Lex/Flex'.
19244 (Debugging): More details about enabling the debugging features.
19245 (Table of Symbols): Describe $$, $n, @$, and @n.
19246 Suggested by Tim Josling.
19247
e0c471a9
AD
192482002-04-19 Akim Demaille <akim@epita.fr>
19249
19250 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
19251
fecc10cd
AD
192522002-04-10 Akim Demaille <akim@epita.fr>
19253
19254 * src/system.h: Rely on HAVE_LIMITS_H.
19255 Suggested by Paul Eggert.
19256
51dec47b
AD
192572002-04-09 Akim Demaille <akim@epita.fr>
19258
19259 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
19260 full stderr, and strip it according to the bison options, instead
19261 of composing the error message from different bits.
19262 This makes it easier to check for several error messages.
19263 Adjust all the invocations.
19264 Add an invocation exercising the error token.
19265 Add an invocation demonstrating a stupid error message.
19266 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
19267 Adjust the tests.
19268 Error message are for stderr, not stdout.
19269
007a50a4
AD
192702002-04-09 Akim Demaille <akim@epita.fr>
19271
19272 * src/gram.h, src/gram.c (error_token_number): Remove, use
19273 errtoken->number.
19274 * src/reader.c (reader): Don't specify the user token number (2)
19275 for $undefined, as it uselessly prevents using it.
19276 * src/gram.h (token_number_t): Move to...
19277 * src/symtab.h: here.
19278 (state_t.number): Is a token_number_t.
19279 * src/print.c, src/reader.c: Use undeftoken->number instead of
19280 hard coded 2.
19281 (Even though this 2 is not the same as above: the number of the
19282 undeftoken remains being 2, it is its user token number which
19283 might not be 2).
19284 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
19285 `user_token_number_max'.
19286 Output `undef_token_number'.
19287 * data/bison.simple, data/bison.c++: Use them.
19288 Be sure to map invalid yylex return values to
19289 `undef_token_number'. This saves us from gratuitous SEGV.
19290
19291 * tests/conflicts.at (Solved SR Conflicts)
19292 (Unresolved SR Conflicts): Adjust.
19293 * tests/regression.at (Web2c Actions): Adjust.
19294
06446ccf
AD
192952002-04-08 Akim Demaille <akim@epita.fr>
19296
19297 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
19298 Adding #line.
19299 Remove the duplicate `typedefs'.
19300 (RhsNumberType): Fix the declaration and various other typos.
19301 Use __ofile__.
19302 * data/bison.simple: Use __ofile__.
19303 * src/scan-skel.l: Handle __ofile__.
19304
62a3e4f0
AD
193052002-04-08 Akim Demaille <akim@epita.fr>
19306
19307 * src/gram.h (item_number_t): New, the type of item numbers in
19308 RITEM. Note that it must be able to code symbol numbers as
19309 positive number, and the negation of rule numbers as negative
19310 numbers.
19311 Adjust all dependencies (pretty many).
19312 * src/reduce.c (rule): Remove this `short *' pointer: use
19313 item_number_t.
19314 * src/system.h (MINSHORT, MAXSHORT): Remove.
19315 Include `limits.h'.
19316 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
19317 (shortcpy): Remove.
19318 (MAXTABLE): Move to...
19319 * src/output.c (MAXTABLE): here.
19320 (prepare_rules): Use output_int_table to output rhs.
19321 * data/bison.simple, data/bison.c++: Adjust.
19322 * tests/torture.at (Big triangle): Move the limit from 254 to
19323 500.
19324 * tests/regression.at (Web2c Actions): Ajust.
19325
19326 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
19327 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
19328 passes, but produces negative #line number, once fixed, GCC is
19329 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
19330 C), it passes.
19331 * src/state.h (state_h): Code input lines on ints, not shorts.
19332
bb88b0fc
AD
193332002-04-08 Akim Demaille <akim@epita.fr>
19334
19335 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
19336 and then the grammar.
19337
9a636f47
AD
193382002-04-08 Akim Demaille <akim@epita.fr>
19339
19340 * src/system.h: No longer using strndup.
19341
680e8701
AD
193422002-04-07 Akim Demaille <akim@epita.fr>
19343
19344 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
19345 * src/output.c (output_table_data): Return the longest number.
19346 (prepare_tokens): Output `token_number_max').
19347 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
19348 New.
19349 Use them to define yy_token_number_type/TokenNumberType.
19350 Use this type for yytranslate.
19351 * tests/torture.at (Big triangle): Push the limit from 124 to
19352 253.
19353 * tests/regression.at (Web2c Actions): Adjust.
19354
817e9f41
AD
193552002-04-07 Akim Demaille <akim@epita.fr>
19356
19357 * tests/torture.at (Big triangle): New.
19358 (GNU AWK Grammar, GNU Cim Grammar): Move to...
19359 * tests/existing.at: here.
19360
5123689b
AD
193612002-04-07 Akim Demaille <akim@epita.fr>
19362
19363 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
19364 nritems.
19365 Adjust dependencies.
19366
f3849179
AD
193672002-04-07 Akim Demaille <akim@epita.fr>
19368
19369 * src/reader.c: Normalize increments to prefix form.
19370
bd02036a
AD
193712002-04-07 Akim Demaille <akim@epita.fr>
19372
19373 * src/reader.c, symtab.c: Remove debugging code.
19374
db8837cb
AD
193752002-04-07 Akim Demaille <akim@epita.fr>
19376
19377 Rename all the `bucket's as `symbol_t'.
19378
19379 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
19380 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
19381 * src/symtab.c, src/symtab.h (bucket): Rename as...
19382 (symbol_t): this.
19383 (symbol_list_new, bucket_check_defined, bucket_make_alias)
19384 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
19385 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19386 (buckets_new, buckets_free, buckets_do): Rename as...
19387 (symbol_list_new, symbol_check_defined, symbol_make_alias)
19388 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
19389 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
19390 (symbols_new, symbols_free, symbols_do): these.
19391
72a23c97
AD
193922002-04-07 Akim Demaille <akim@epita.fr>
19393
19394 Use lib/hash for the symbol table.
19395
19396 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
19397 EOF.
19398 * src/lex.c (lex): Set the `number' member of new terminals.
19399 * src/reader.c (bucket_check_defined, bucket_make_alias)
19400 (bucket_check_alias_consistence, bucket_translation): New.
19401 (reader, grammar_free, readgram, token_translations_init)
19402 (packsymbols): Adjust.
19403 (reader): Number the predefined tokens.
19404 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
19405 for predefined tokens.
19406 * src/symtab.h (bucket): Remove all the hash table related
19407 members.
19408 * src/symtab.c (symtab): Replace by...
19409 (bucket_table): this.
19410 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19411 (buckets_new, buckets_do): New.
19412
280a38c3
AD
194132002-04-07 Akim Demaille <akim@epita.fr>
19414
19415 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
19416 (start_symbol, max_user_token_number, semantic_parser)
19417 (error_token_number): Initialize.
19418 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
19419 Initialize.
19420 (reader): Don't.
19421 (errtoken, eoftoken, undeftoken, axiom): Extern.
19422
03b31c0c
AD
194232002-04-07 Akim Demaille <akim@epita.fr>
19424
19425 * src/gram.h (rule_s): prec and precsym are now pointers
19426 to the bucket giving the priority/associativity.
19427 Member `associativity' removed: useless.
19428 * src/reduce.c, src/conflicts.c: Adjust.
19429
8b3df748
AD
194302002-04-07 Akim Demaille <akim@epita.fr>
19431
19432 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
19433 Properly escape the symbols' TAG when outputting them.
19434
e601aa1d
AD
194352002-04-07 Akim Demaille <akim@epita.fr>
19436
19437 * src/lalr.h (LA): Is a bitsetv, not bitset*.
19438
b0299a2e
AD
194392002-04-07 Akim Demaille <akim@epita.fr>
19440
19441 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
19442 (LArule): this, which is an array to rule_t*.
19443 * src/print.c, src/conflicts.c: Adjust.
19444
d7e1f00c
AD
194452002-04-07 Akim Demaille <akim@epita.fr>
19446
19447 * src/gram.h (rule_t): Rename `number' as `user_number'.
19448 `number' is a new member.
19449 Adjust dependencies.
19450 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
19451
cc9305dd
AD
194522002-04-07 Akim Demaille <akim@epita.fr>
19453
19454 As a result of the previous patch, it is no longer needed
19455 to reorder ritem itself.
19456
19457 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
19458
b0940840
AD
194592002-04-07 Akim Demaille <akim@epita.fr>
19460
19461 Be sure never to walk through RITEMS, but use only data related to
19462 the rules themselves. RITEMS should be banished.
19463
19464 * src/output.c (output_token_translations): Rename as...
19465 (prepare_tokens): this.
19466 In addition to `translate', prepare the muscles `tname' and
19467 `toknum', which were handled by...
19468 (output_rule_data): this.
19469 Remove, and move the remainder of its outputs into...
19470 (prepare_rules): this new routines, which also merges content from
19471 (output_gram): this.
19472 (prepare_rules): Be sure never to walk through RITEMS.
19473 (output_stos): Rename as...
19474 (prepare_stos): this.
19475 (output): Always invoke prepare_states, after all, just don't use it
19476 in the output if you don't need it.
19477
643a5994
AD
194782002-04-07 Akim Demaille <akim@epita.fr>
19479
19480 * src/LR0.c (new_state): Display `nstates' as the name of the
19481 newly created state.
19482 Adjust to initialize first_state and last_state if needed.
19483 Be sure to distinguish the initial from the final state.
19484 (new_states): Create the itemset of the initial state, and use
19485 new_state.
19486 * src/closure.c (closure): Now that the initial state has its
19487 items properly set, there is no need for a special case when
19488 creating `ruleset'.
19489
19490 As a result, now the rule 0, reducing to $axiom, is visible in the
19491 outputs. Adjust the test suite.
19492
19493 * tests/conflicts.at (Solved SR Conflicts)
19494 (Unresolved SR Conflicts): Adjust.
19495 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
19496 * tests/conflicts.at (S/R in initial): New.
19497
b4c4ccc2
AD
194982002-04-07 Akim Demaille <akim@epita.fr>
19499
19500 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
19501 the RHS of the rules.
19502 * src/output.c (output_gram): Likewise.
19503
bba97eb2
AD
195042002-04-07 Akim Demaille <akim@epita.fr>
19505
19506 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
19507 bucket.
19508 Adjust all dependencies.
19509 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
19510 `number' of the buckets too.
19511 * src/gram.h: Include `symtab.h'.
19512 (associativity): Move to...
19513 * src/symtab.h: here.
19514 No longer include `gram.h'.
19515
c3b407f4
AD
195162002-04-07 Akim Demaille <akim@epita.fr>
19517
19518 * src/gram.h, src/gram.c (rules_rhs_length): New.
19519 (ritem_longest_rhs): Use it.
19520 * src/gram.h (rule_t): `number' is a new member.
19521 * src/reader.c (packgram): Set it.
19522 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
19523 the end of `rules', and count them out of `nrules'.
19524 (reduce_output, dump_grammar): Adjust.
19525 * src/print.c (print_grammar): It is no longer needed to check for
19526 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
19527 * tests/reduce.at (Reduced Automaton): New test.
19528
11652ab3
AD
195292002-04-07 Akim Demaille <akim@epita.fr>
19530
19531 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
19532 lacking `+ 1' to nrules, Bison reported as useless a token if it
19533 was used solely to set the precedence of the last rule...
19534
26b23c1a
AD
195352002-04-07 Akim Demaille <akim@epita.fr>
19536
19537 * data/bison.c++, data/bison.simple: Don't output the current file
19538 name in #line, to avoid useless diffs between two identical
19539 outputs under different names.
19540
18bcecb0
AD
195412002-04-07 Akim Demaille <akim@epita.fr>
19542
19543 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
19544 Normalize loops to using `< nrules + 1', not `<= nrules'.
19545
fa770c86
AD
195462002-04-07 Akim Demaille <akim@epita.fr>
19547
19548 * TODO: Update.
19549
d9b739c3
AD
195502002-04-07 Akim Demaille <akim@epita.fr>
19551
19552 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
19553 bucket.value as bucket.number.
19554
99013900
AD
195552002-04-07 Akim Demaille <akim@epita.fr>
19556
19557 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
19558 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19559 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
19560 RHS, instead of being an index in RITEMS.
19561
e966383b
PE
195622002-04-04 Paul Eggert <eggert@twinsun.com>
19563
19564 * doc/bison.texinfo: Update copyright date.
19565 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
19566 (Symbols): Warn about running Bison in one character set,
19567 but compiling and/or running in an incompatible one.
19568 Warn about character code 256, too.
19569
195702002-04-03 Paul Eggert <eggert@twinsun.com>
19571
19572 * src/bison.data (YYSTACK_ALLOC): Depend on whether
19573 YYERROR_VERBOSE is nonzero, not whether it is defined.
19574
19575 Merge changes from bison-1_29-branch.
c307773e 19576
8d6c48b9
PE
195772002-03-20 Paul Eggert <eggert@twinsun.com>
19578
19579 Merge fixes from Debian bison_1.34-1.diff.
19580
19581 * configure.in (AC_PREREQ): 2.53.
19582
e53c6322
AD
195832002-03-20 Akim Demaille <akim@epita.fr>
19584
19585 * src/conflicts.c (log_resolution): Argument `resolution' is const.
19586
9ffbeca7
PE
195872002-03-19 Paul Eggert <eggert@twinsun.com>
19588
21db0b2a
PE
19589 * src/bison.simple (YYCOPY): New macro.
19590 (YYSTACK_RELOCATE): Use it.
19591 Remove Type arg; no longer needed. All callers changed.
19592 (yymemcpy): Remove; no longer needed.
19593
9ffbeca7
PE
19594 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
19595 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
19596
642cb8f8
AD
195972002-03-19 Akim Demaille <akim@epita.fr>
19598
19599 Test and fix the #line outputs.
19600
19601 * tests/atlocal.at (GCC): New.
19602 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 19603 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
19604 (Action synch line, Epilogue synch line): New tests.
19605 * src/reader.c (parse_union_decl): Define the muscle stype_line.
19606 * data/bison.simple, data/bison.c++: Use it.
19607
3c31a486
AD
196082002-03-19 Akim Demaille <akim@epita.fr>
19609
19610 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
19611 (Solved SR Conflicts, %expect not enough, %expect right)
19612 (%expect too much): Move to...
19613 * tests/conflicts.at: this new file.
19614
0d8bed56
AD
196152002-03-19 Akim Demaille <akim@epita.fr>
19616
19617 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19618 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
19619 that we can move to enums for instance.
19620 * src/output.c (token_definitions_output): Output a list of
19621 `token-name, token-number' instead of the #define.
19622 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
19623
9208d17f
AD
196242002-03-14 Akim Demaille <akim@epita.fr>
19625
19626 Use Gettext 0.11.1.
19627
af27eacb
RA
196282002-03-09 Robert Anisko <robert@lrde.epita.fr>
19629
19630 * data/bison.c++: Make the user able to add members to the generated
19631 parser by subclassing.
19632
9101a310
RA
196332002-03-05 Robert Anisko <robert@lrde.epita.fr>
19634
19635 * src/reader.c (read_additionnal_code): `c' should be an integer, not
19636 a character.
19637 Reported by Nicolas Tisserand and Nicolas Burrus.
19638
fff9bf0b
RA
196392002-03-04 Robert Anisko <robert@lrde.epita.fr>
19640
19641 * src/reader.c: Warn about lacking semi-colons, do not complain.
19642
64dba31e
RA
196432002-03-04 Robert Anisko <robert@lrde.epita.fr>
19644
19645 * data/bison.c++: Remove a debug line.
19646
374f5a14
RA
196472002-03-04 Robert Anisko <robert@lrde.epita.fr>
19648
19649 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
19650 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
19651 provide a default implementation.
19652
bfcf1f3a
AD
196532002-03-04 Akim Demaille <akim@epita.fr>
19654
19655 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
19656 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
19657 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
19658 * tests/semantic.at (Parsing Guards): Similarly.
19659 * src/reader.at (readgram): Complain if the last rule is not ended
19660 with a semi-colon.
19661
65ccf9fc
AD
196622002-03-04 Akim Demaille <akim@epita.fr>
19663
19664 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
19665 * src/closure.c: here.
19666 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
19667 RTC.
19668 * src/warshall.h, src/warshall.c: Remove.
19669 * tests/sets.at (Broken Closure): Adjust.
19670
d0039cbc
AD
196712002-03-04 Akim Demaille <akim@epita.fr>
19672
19673 * src/output.c (output_skeleton): tempdir is const.
19674 bytes_read is unused.
19675
345cea78
AD
196762002-03-04 Akim Demaille <akim@epita.fr>
19677
19678 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19679 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
19680 Update.
19681 From Michael Hayes.
19682
564801f7
AD
196832002-03-04 Akim Demaille <akim@epita.fr>
19684
19685 * src/closure.c (closure): `r' is unused.
19686
e5352bc7
AD
196872002-03-04 Akim Demaille <akim@epita.fr>
19688
19689 * tests/sets.at (Broken Closure): Add the ending `;'.
19690 * src/reader.at (readgram): Complain if a rule is not ended with a
19691 semi-colon.
19692
914feea9
AD
196932002-03-04 Akim Demaille <akim@epita.fr>
19694
19695 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
19696 (count_sr_conflicts): Use bitset_count.
19697 * src/reduce.c (inaccessable_symbols): Ditto.
19698 (bits_size): Remove.
19699 * src/warshall.h, src/warshall.c: Convert to bitsetv.
19700
f0250de6
AD
197012002-03-04 Akim Demaille <akim@epita.fr>
19702
19703 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
19704 * src/reduce.c: Remove the `bitset_zero's following the
19705 `bitset_create's, as now it is performed by the latter.
19706
ef017502
AD
197072002-03-04 Akim Demaille <akim@epita.fr>
19708
19709 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
19710 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
19711 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
19712 latest sources from Michael.
19713
76514394
AD
197142002-03-04 Akim Demaille <akim@epita.fr>
19715
19716 * src/output.c (output): Don't free the grammar.
19717 * src/reader.c (grammar_free): New.
19718 * src/main.c (main): Call it and don't free symtab here.
19719
55024580
AD
197202002-03-04 Akim Demaille <akim@epita.fr>
19721
19722 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
19723 before returning.
19724 Reported by Benoit Perrot.
19725
f9abaa2c
AD
197262002-03-04 Akim Demaille <akim@epita.fr>
19727
19728 Use bitset operations when possible, not loops over bits.
19729
19730 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
19731 bitset_or.
19732 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
19733 * src/reduce.c (useless_nonterminals): Formatting changes.
19734 * src/warshall.c (TC): Use bitset_or.
19735
0e721e75
AD
197362002-03-04 Akim Demaille <akim@epita.fr>
19737
19738 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
19739 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
19740 Ditto.
19741
0fb1ffb1
AD
197422002-03-04 Akim Demaille <akim@epita.fr>
19743
19744 * src/lalr.c (F): Now a bitset*.
19745 Adjust all dependencies.
19746
b86796bf
AD
197472002-03-04 Akim Demaille <akim@epita.fr>
19748
19749 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
19750 Adjust all dependencies.
19751
602bbf31
AD
197522002-03-04 Akim Demaille <akim@epita.fr>
19753
19754 * src/L0.c, src/LR0.h (nstates): Be size_t.
19755 Adjust comparisons (signed vs unsigned).
19756 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
19757 bitset*.
19758 Adjust all dependencies.
19759
d8a0245c
AD
197602002-03-04 Akim Demaille <akim@epita.fr>
19761
19762 * src/closure.c (firsts): Now, also a bitset.
19763 Adjust all dependencies.
19764 (varsetsize): Remove, now unused.
19765 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
19766
34ba9743
AD
197672002-03-04 Akim Demaille <akim@epita.fr>
19768
19769 * src/print.c: Convert to use bitset.h, not hand coded iterations
19770 over ints.
19771
ed86e78c
AD
197722002-03-04 Akim Demaille <akim@epita.fr>
19773
19774 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
19775
dfdb1797
AD
197762002-03-04 Akim Demaille <akim@epita.fr>
19777
19778 * src/closure.c (ruleset): Be a bitset.
19779 (rulesetsize): Remove.
19780
7086e707
AD
197812002-03-04 Akim Demaille <akim@epita.fr>
19782
19783 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19784 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
19785 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
19786 * src/closure.c (fderives): Be an array of bitsets.
19787
98254360
RA
197882002-02-28 Robert Anisko <robert@lrde.epita.fr>
19789
19790 * data/bison.c++: Merge the two generated headers. Insert a copyright
19791 notice in each output file.
19792
a75c057f
AD
197932002-02-28 Akim Demaille <akim@epita.fr>
19794
19795 * data/bison.c++: Copy the prologue of bison.simple to fetch
19796 useful M4 definitions, such as b4_header_guard.
19797
06b00abc
AD
197982002-02-25 Akim Demaille <akim@epita.fr>
19799
19800 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
19801 translator friendly scheme for the bgr
19802 copyright notice.
06b00abc 19803
70e7d534
AD
198042002-02-25 Akim Demaille <akim@epita.fr>
19805
19806 * src/output.c (header_output): Remove, now handled completely via
19807 M4.
19808
abe017f6
AD
198092002-02-25 Akim Demaille <akim@epita.fr>
19810
19811 * m4/m4.m4: New, from CVS Autoconf.
19812 * configure.in: Invoke it.
19813 * src/output.c (output_skeleton): Use its result instead of the
19814 hard coded name.
19815
381fb12e
AD
198162002-02-25 Akim Demaille <akim@epita.fr>
19817
19818 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
19819 Fileutils 4.1.5.
19820 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
19821 * src/output.c (output_skeleton): Use mkstemp to create a real
19822 temporary file.
19823 Move the filling of `skeleton' and its muscle to...
19824 (prepare): here.
19825 (output): Move the definition of the prologue muscle to...
19826 (prepare): here.
19827 * src/system.h (DEFAULT_TMPDIR): New.
19828
6f38107f
PE
198292002-02-14 Paul Eggert <eggert@twinsun.com>
19830
19831 Remove the support for C++ namespace cleanliness; it was
19832 causing more problems than it was curing, since it didn't work
19833 properly on some nonstandard C++ compilers. This can wait
19834 for a proper C++ parser.
19835
19836 * NEWS: Document this.
19837 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
19838 of C++, as it's treated like C now.
19839 * src/bison.simple (YYSTD): Remove.
19840 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
19841 Treat C++ just like Standard C instead of trying to support
19842 namespace cleanliness.
19843
80cce3da
AD
198442002-02-14 Akim Demaille <akim@epita.fr>
19845
19846 * tests/regression.at (else): Adjust to Andreas' change.
19847
842e8679
AD
198482002-02-14 Akim Demaille <akim@epita.fr>
19849
19850 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
19851
4bda3f10
AD
198522002-02-13 Andreas Schwab <schwab@suse.de>
19853
19854 * src/output.c (output_rule_data): Don't output NULL, it might
19855 not be defined yet.
19856
4162fa07 198572002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 19858
4162fa07
RA
19859 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
19860 (Copyright notice): Update.
b418ecd8 19861
bd16a5dc
AD
198622002-02-11 Akim Demaille <akim@epita.fr>
19863
19864 * tests/regression.at (%nonassoc and eof): Don't include
19865 nonportable headers.
19866
8d69a1a3
RA
198672002-02-08 Robert Anisko <robert@lrde.epita.fr>
19868
19869 * data/bison.c++: Correct error recovery. Make the user able to
19870 initialize the starting location.
19871
9b2d0677
AD
198722002-02-07 Akim Demaille <akim@epita.fr>
19873
19874 * tests/input.at: New.
19875
69e2658b
RA
198762002-02-07 Robert Anisko <robert@lrde.epita.fr>
19877
19878 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 19879 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
19880 directives around tables only needed for debugging.
19881
4aacc3a7
RA
198822002-02-07 Robert Anisko <robert@lrde.epita.fr>
19883
19884 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
19885 C++ parsers.
19886 (yy::b4_name::parse): Use print_.
19887
762a801e
RA
198882002-02-07 Robert Anisko <robert@lrde.epita.fr>
19889
19890 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
19891
4bb2bc3f
RA
198922002-02-07 Robert Anisko <robert@lrde.epita.fr>
19893
19894 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
19895 C++ parsers.
19896 (yy::b4_name::parse): Build verbose error messages, and use error_.
19897
6b45a3ca
RA
198982002-02-06 Robert Anisko <robert@lrde.epita.fr>
19899
19900 * data/bison.c++: Fix m4 quoting in comments.
19901
50997c6e
RA
199022002-02-06 Robert Anisko <robert@lrde.epita.fr>
19903
19904 * data/bison.c++: Adjust the parser code. Fix some muscles that were
19905 not expanded by m4.
19906
3f3eed27
AD
199072002-02-05 Akim Demaille <akim@epita.fr>
19908
19909 * data/bison.c++: Adjust to the M4 back end.
19910 More is certainly needed.
19911
be2a1a68
AD
199122002-02-05 Akim Demaille <akim@epita.fr>
19913
19914 Give a try to M4 as a back end.
19915
19916 * lib/readpipe.c: New, from wdiff.
19917 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
19918 BISON_HAIRY.
19919 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
19920 specific values. Now it is m4 that performs the lookup.
19921 * src/parse-skel.y: Remove.
19922 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
19923 * src/output.c (actions_output, guards_output)
19924 (token_definitions_output): No longer keeps track of the output
19925 line number, hence remove the second argument.
19926 (guards_output): Check against the guard member of a rule, not the
19927 action member.
19928 Adjust callers.
19929 (output_skeleton): Don't look for the skeleton location, let m4 do
19930 that.
19931 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
19932 file will be used.
19933 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
19934 (prepare): Given that for the time being changesyntax is not
19935 usable in M4, rename the muscles using `-' to `_'.
19936 Define `defines_flag', `output_parser_name' and `output_header_name'.
19937 * src/output.h (actions_output, guards_output)
19938 (token_definitions_output): Adjust prototypes.
19939 * src/scan-skel.l: Instead of scanning the skeletons, it now
19940 processes the output of m4: `__oline__' and `#output'.
19941 * data/bison.simple: Adjust to be used by M4(sugar).
19942 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
19943 to date.
19944 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
19945 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
19946 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
19947 shamelessly stolen from CVS Autoconf.
19948
beda758b
AD
199492002-02-05 Akim Demaille <akim@epita.fr>
19950
19951 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
19952 * configure.in: Check for the declarations of free and malloc.
19953 * src/muscle_tab.c: Adjust.
19954
5ece6d43
AD
199552002-02-05 Akim Demaille <akim@epita.fr>
19956
19957 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
19958 which have no values.
19959
5bb18f9a
AD
199602002-02-05 Akim Demaille <akim@epita.fr>
19961
19962 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
19963 * data/: here.
19964
894dd62e
PE
199652002-01-29 Paul Eggert <eggert@twinsun.com>
19966
19967 * src/bison.simple (YYSIZE_T): Do not define merely because
19968 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
19969 On some platforms, <alloca.h> does not declare YYSTD (size_t).
19970
82841af7
AD
199712002-01-27 Akim Demaille <akim@epita.fr>
19972
19973 Fix `%nonassoc and eof'.
19974
19975 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
19976 which were not properly copied! Replace
19977 memcpy (res->errs, src->errs, src->nerrs);
19978 with
19979 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
19980 !!!
19981 * tests/regression.at (%nonassoc and eof): Adjust to newest
19982 Autotest: `.' is not in the PATH.
19983
318b76e9
AD
199842002-01-27 Akim Demaille <akim@epita.fr>
19985
19986 * tests/sets.at (AT_EXTRACT_SETS): New.
19987 (Nullable): Use it.
19988 (Firsts): New.
19989
30d2f3d5
AD
199902002-01-26 Akim Demaille <akim@epita.fr>
19991
19992 * tests/actions.at, tests/calc.at, tests/headers.at,
19993 * tests/torture.at: Adjust to the newest Autotest which no longer
19994 forces `.' in the PATH.
19995
30f8c395
AD
199962002-01-25 Akim Demaille <akim@epita.fr>
19997
19998 * tests/regression.at (%nonassoc and eof): New.
19999 Suggested by Robert Anisko.
20000
29ae55f1
AD
200012002-01-24 Akim Demaille <akim@epita.fr>
20002
20003 Bison dumps core when trying to complain about broken input files.
20004 Reported by Cris van Pelt.
20005
20006 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
20007 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
20008 into...
20009 (Invalid inputs): Strengthen: exercise parse_percent_token.
20010
2b548aa6
RA
200112002-01-24 Robert Anisko <robert.anisko@epita.fr>
20012
20013 * src/Makefile.am: Add bison.c++.
20014 * src/bison.c++: New skeleton.
20015
bb0146c2
AD
200162002-01-21 Paolo Bonzini <bonzini@gnu.org>
20017
20018 * po/it.po: New.
20019
bec30531
AD
200202002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
20021
20022 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
20023
fc6edc45
MA
200242002-01-20 Marc Autret <marc@gnu.org>
20025
20026 * src/files.c (compute_output_file_names): Fix
20027
5e5d5415
MA
200282002-01-20 Marc Autret <marc@gnu.org>
20029
20030 * tests/output.at: New test.
20031 * src/files.c (compute_base_names): Don't map extensions when
20032 the YACC flag is set, use defaults.
20033 Reported by Evgeny Stambulchik.
20034
44ea3fbd
MA
200352002-01-20 Marc Autret <marc@gnu.org>
20036
ba0fe3c7
PE
20037 * src/system.h: Need to define __attribute__ away for non-GCC
20038 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
20039 Suggested by Albert Chin-A-Young.
20040
338963d1
TVH
200412002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
20042
20043 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
20044 canonical definition.
20045 * src/system.h: Use the canonical definition for PARAMS (avoids
20046 a conflict with the macro from lib/hash.h).
20047
c57b2479
AD
200482002-01-11 Akim Demaille <akim@epita.fr>
20049
20050 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 20051 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 20052
b85810ae
AD
200532002-01-09 Akim Demaille <akim@epita.fr>
20054
20055 * src/files.c, src/files.h (output_infix): New.
20056 (tab_extension): Remove.
20057 (compute_base_names): Compute the former, drop the latter.
20058 * src/output.c (prepare): Insert the muscles `output-infix', and
20059 `output-suffix'.
20060 * src/parse-skel.y (string, string.1): New.
20061 (section.header): Use it.
20062 (section.yacc): Remove.
20063 (prefix): Remove too.
20064 * src/scan-skel.l: Adjust.
20065 * src/bison.simple, src/bison.hairy: Adjust.
20066
cae60122
AD
200672002-01-09 Akim Demaille <akim@epita.fr>
20068
20069 * configure.in (WERROR_CFLAGS): Compute it.
20070 * src/Makefile.am (CFLAGS): Pass it.
20071 * tests/atlocal.in (CFLAGS): Idem.
20072 * src/files.c: Fix a few warnings.
20073 (get_extension_index): Remove, unused.
20074
ae404801
AD
200752002-01-08 Akim Demaille <akim@epita.fr>
20076
20077 * src/getargs.c (AS_FILE_NAME): New.
20078 (getargs): Use it to convert DOSish file names.
20079 * src/files.c (base_name): Rename as full_base_name to avoid
20080 clashes with `base_name ()'.
20081 (filename_split): New.
20082 (compute_base_names): N-th rewrite, using filename_split.
20083
22312b71
AD
200842002-01-08 Akim Demaille <akim@epita.fr>
20085
20086 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
20087 New, stolen from the Fileutils 4.1.
20088 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20089 * configure.in: Check for the presence of memrchr, and of its
20090 prototype.
20091
a67cef01
TVH
200922002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
20093
20094 * lib/hash.h (__P): Added definition for this macro.
20095 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
20096 BUILT_SOURCES, to ensure they are generated first.
20097 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
20098 %error-verbose to allow bootstrapping with bison 1.30x.
20099
2b25d624
AD
201002002-01-06 Akim Demaille <akim@epita.fr>
20101
20102 * src/reader.c (parse_braces): Don't fetch the next char, the
20103 convention is to fetch on entry.
20104 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
20105 'switch' without a following semicolon.
20106 * tests/regression.at (braces parsing): New.
20107
3460813b
AD
201082002-01-06 Akim Demaille <akim@epita.fr>
20109
20110 Bison is dead wrong in its RR conflict reports.
20111
20112 * tests/torture.at (GNU Cim Grammar): New.
20113 * src/conflicts.c (count_rr_conflicts): Fix.
20114
73784c64
AD
201152002-01-06 Akim Demaille <akim@epita.fr>
20116
20117 Creating package.m4 from configure.ac causes too many problems.
20118
20119 * tests/Makefile.am (package.m4): Create it by hand,
20120 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
20121
25d81090
AD
201222002-01-06 Akim Demaille <akim@epita.fr>
20123
20124 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
20125 skeleton.h.
20126
a9b8959e
PE
201272002-01-04 Paul Eggert <eggert@twinsun.com>
20128
20129 * doc/bison.texinfo (Debugging):
20130 Remove YYSTDERR; it's no longer defined or used.
20131 Also, s/cstdio.h/cstdio/.
20132
25d81090
AD
201332002-01-03 Akim Demaille <akim@epita.fr>
20134
20135 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
20136
1109455c
AD
201372002-01-03 Akim Demaille <akim@epita.fr>
20138
20139 * src/parse-skel.y (process_skeleton): Don't bind the parser's
20140 tracing code to --trace, wait for a better --trace option, with
20141 args.
20142
7ea5e977
AD
201432002-01-03 Akim Demaille <akim@epita.fr>
20144
20145 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
20146 The ISO C++ standard is extremely clear about it: stderr is
20147 considered a macro, not a regular symbol (see table 94 `Header
20148 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
20149 Therefore std:: does not apply to it. It still does with fprintf.
20150 Also, s/cstdio.h/cstdio/.
20151
fab5b110
AD
201522002-01-03 Akim Demaille <akim@epita.fr>
20153
20154 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
20155 for non system headers.
20156
aed7fd9b
AD
201572002-01-02 Akim Demaille <akim@epita.fr>
20158
20159 Equip the skeleton chain with location tracking, runtime trace,
20160 pure parser and scanner.
20161
20162 * src/parse-skel.y: Request a pure parser, locations, and prefix
20163 renaming.
20164 (%union): Having several members with the same type does not help
20165 type mismatches, simplify.
20166 (YYPRINT, yyprint): New.
20167 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
20168 (skel_error): this.
20169 Handle locations.
20170 * src/scan-skel.l: Adjust to these changes.
20171 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
20172 (LOCATION_PRINT, skel_control_t): New.
20173
24fad99e
AD
201742001-12-30 Akim Demaille <akim@epita.fr>
20175
20176 * src/parse-skel.y: Get rid of the shift/reduce conflict:
20177 replace `gb' with BLANKS.
20178 * src/scan-skel.l: Adjust.
20179
a4b36db4
AD
201802001-12-30 Akim Demaille <akim@epita.fr>
20181
20182 * src/system.h: We don't need nor want bcopy.
20183 Throw away MS-DOS crap: we don't need getpid.
20184 * configure.in: We don't need strndup. It was even causing
20185 problems: because Flex includes the headers *before* us,
20186 _GNU_SOURCE is not defined by config.h, and therefore strndup was
20187 not visible.
20188 * lib/xstrndup.c: New.
20189 * src/scan-skel.l: Use it.
20190 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
20191 * src/parse-skel.y: Use %directives instead of #defines.
20192
1239777d
AD
201932001-12-30 Akim Demaille <akim@epita.fr>
20194
20195 * src/skeleton.h: New.
20196 * src/output.c (output_parser, output_master_parser): Remove, dead
20197 code.
20198 * src/output.h (get_lines_number, actions_output, guards_output)
20199 (token_definitions_output): Prototype them.
20200 * src/parse-skel.y: Add the license notice.
20201 Include output.h and skeleton.h.
20202 (process_skeleton): Returns void, and takes a single parameter.
20203 * src/scan-skel.l: Add the license notice.
20204 Include skeleton.h.
20205 Don't use %option yylineno: it seems that then Flex imagines
20206 REJECT has been used, and therefore it won't reallocate its
20207 buffers (which makes no other sense to me than a bug). It results
20208 in warnings for `unused: yy_flex_realloc'.
20209
9b3add5b
RA
202102001-12-30 Robert Anisko <robert.anisko@epita.fr>
20211
20212 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20213 (MUSCLE_INSERT_PREFIX): ...to there.
20214 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20215 (MUSCLE_INSERT_PREFIX): Move from here...
20216
20217 * src/bison.hairy: Add a section directive. Put braces around muscle
20218 names. This parser skeleton is still broken, but Bison should not
20219 choke on a bad muscle 'syntax'.
20220 * src/bison.simple: Add a section directive. Put braces around muscle
20221 names.
20222
20223 * src/files.h (strsuffix, stringappend): Add declarations.
20224 (tab_extension): Add declaration.
20225 (short_base_name): Add declaration.
20226
20227 * src/files.c (strsuffix, stringappend): No longer static. These
20228 functions are used in the skeleton parser.
20229 (tab_extension): New.
20230 (compute_base_names): Use the computations done in this function
fab5b110 20231 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
20232 names.
20233 (short_base_name): No longer static.
20234
20235 * src/output.c (output_skeleton): New.
20236 (output): Disable call to output_master_parser, and give a try to
20237 a new skeleton handling system.
20238 (guards_output, actions_output): No longer static.
20239 (token_definitions_output, get_lines_number): No longer static.
20240
20241 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
20242
fab5b110 20243 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
20244 parse-skel.y.
20245
20246 * src/parse-skel.y: New file.
20247 * src/scan-skel.l: New file.
20248
b5b61c61
AD
202492001-12-29 Akim Demaille <akim@epita.fr>
20250
20251 %name-prefix is broken.
20252
20253 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
20254 Adjust all dependencies.
20255 * tests/headers.at (export YYLTYPE): Strengthen this test: use
20256 %name-prefix.
20257
20258 Renaming yylval but not yylloc is not consistent. Now we do.
20259
20260 * src/bison.simple: Prefix yylloc if used.
20261 * doc/bison.texinfo (Decl Summary): Document that.
20262
8c9a50be
AD
202632001-12-29 Akim Demaille <akim@epita.fr>
20264
20265 * doc/bison.texinfo: Promote `%long-directive' over
20266 `%long_directive'.
20267 Remove all references to fixed-output-files, yacc is enough.
20268
d99361e6
AD
202692001-12-29 Akim Demaille <akim@epita.fr>
20270
20271 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
20272 user prologue. These are defaults.
20273 * tests/actions.at (Mid-rule actions): Make sure the user can
20274 define YYDEBUG and YYERROR_VERBOSE.
20275
b9cecb91
AD
202762001-12-29 Akim Demaille <akim@epita.fr>
20277
20278 * src/output.c (header_output): Don't forget to export YYLTYPE and
20279 yylloc.
20280 * tests/headers.at (export YYLTYPE): New, make sure it does.
20281 * tests/regression.at (%union and --defines, Invalid CPP headers):
20282 Move to...
20283 * tests/headers.at: here.
20284
aea13e97
AD
202852001-12-29 Akim Demaille <akim@epita.fr>
20286
20287 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
20288
931394cb
AD
202892001-12-29 Akim Demaille <akim@epita.fr>
20290
20291 * tests/actions.at (Mid-rule actions): Output on a single line
20292 instead of several.
20293
704a47c4
AD
202942001-12-29 Akim Demaille <akim@epita.fr>
20295
20296 * doc/bison.texinfo: Formatting changes.
20297
091e20bb
AD
202982001-12-29 Akim Demaille <akim@epita.fr>
20299
20300 Don't store the token defs in a muscle, just be ready to output it
20301 on command. Now possible via `symbols'. Fixes a memory leak.
20302
20303 * src/output.c (token_definitions_output): New.
20304 (output_parser, header_output): Use it.
20305 * src/reader.c (symbols_save): Remove.
20306
cce71710
AD
203072001-12-29 Akim Demaille <akim@epita.fr>
20308
20309 * src/bison.simple: Do not provide a default for YYSTYPE and
20310 YYLTYPE before the user's prologue. Otherwise it's hardly... a
20311 default.
20312
82c035a8
AD
203132001-12-29 Akim Demaille <akim@epita.fr>
20314
20315 Mid-rule actions are simply... ignored!
20316
20317 * src/reader.c (readgram): Be sure to attach mid-rule actions to
20318 the empty-rule associated to the dummy symbol, not to the host
20319 rule.
20320 * tests/actions.at (Mid-rule actions): New.
20321
8419d367
AD
203222001-12-29 Akim Demaille <akim@epita.fr>
20323
20324 Memory leak.
20325
20326 * src/reader.c (reader): Free grammar.
20327
375d5806
AD
203282001-12-29 Akim Demaille <akim@epita.fr>
20329
20330 Memory leak.
20331
20332 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
20333 since it allocates it for each state, although only one is needed.
20334 (allocate_storage): Do it here.
20335
f51cb8ff
AD
203362001-12-29 Akim Demaille <akim@epita.fr>
20337
20338 * src/options.h, src/options.c (create_long_option_table): Rename
20339 as...
20340 (long_option_table_new): this, with a clearer prototype.
20341 (percent_table): Remove, unused,
20342 * src/getargs.c (getargs): Adjust.
20343
29e88316
AD
203442001-12-29 Akim Demaille <akim@epita.fr>
20345
20346 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
20347 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
20348 as states.
20349
b9f71f19
AD
203502001-12-29 Akim Demaille <akim@epita.fr>
20351
20352 * src/lalr.c (build_relations): Rename `states' as `states1'.
20353 Sorry, I don't understand exactly what it is, no better name...
20354
1a2b5d37
AD
203552001-12-29 Akim Demaille <akim@epita.fr>
20356
20357 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
20358 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
20359 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
20360 as rules.
20361
1cca533e
AD
203622001-12-29 Akim Demaille <akim@epita.fr>
20363
20364 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
20365 ago.
20366
c03ae966
AD
203672001-12-29 Akim Demaille <akim@epita.fr>
20368
20369 * src/reader.c, src/reader.h (user_toknums): Remove.
20370 Adjust all users to use symbols[i]->user_token_number.
20371
5a670b1e
AD
203722001-12-29 Akim Demaille <akim@epita.fr>
20373
20374 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
20375 Adjust all users to use symbols[i]->prec or ->assoc.
20376
ad949da9
AD
203772001-12-29 Akim Demaille <akim@epita.fr>
20378
20379 * src/reader.c, src/reader.h (tags): Remove.
20380 Adjust all users to use symbols[i]->tag.
20381
0e78e603
AD
203822001-12-29 Akim Demaille <akim@epita.fr>
20383
20384 * src/gram.h, src/gram.c (symbols): New, similar to state_table
20385 and rule_table.
20386 * src/reader.c (packsymbols): Fill this table.
20387 Drop sprec.
20388 * src/conflicts.c (resolve_sr_conflict): Adjust.
20389 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
20390 single table.
20391 Use symbols[i]->tag instead of tags[i].
20392
213e640e
AD
203932001-12-29 Akim Demaille <akim@epita.fr>
20394
20395 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
20396 In addition, put a comment in there, to replace...
20397 * tests/regression.at (%union and C comments): Remove.
20398
e7b8bef1
AD
203992001-12-29 Akim Demaille <akim@epita.fr>
20400
20401 * tests/regression.at (Web2c Actions): Blindly move the actual
20402 output as expected output. The contents *seem* right to me, but I
20403 can't pretend reading perfectly parser tables... Nonetheless, all
20404 the other tests pass correctly, the table look OK, even though the
20405 presence of `$axiom' is to be noted: AFAICS it is useless (but
20406 harmless).
20407
b68e7744
AD
204082001-12-29 Akim Demaille <akim@epita.fr>
20409
20410 * src/reader.c (readgram): Don't add the rule 0 if there were no
20411 rules read. In other words, add it _after_ having performed
20412 grammar sanity checks.
20413 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
20414
78d5bae9
AD
204152001-12-29 Akim Demaille <akim@epita.fr>
20416
20417 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
20418 visible, and some states have now a different number.
20419
ff442794
AD
204202001-12-29 Akim Demaille <akim@epita.fr>
20421
20422 * src/reader.c (readgram): Bind the initial rule's lineno to that
20423 of the first rule.
20424 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
20425 (Solved SR Conflicts): Adjust rule 0's line number.
20426
610ab194
AD
204272001-12-29 Akim Demaille <akim@epita.fr>
20428
20429 Fix the `GAWK Grammar' failure.
20430
20431 * src/LR0.c (final_state): Initialize to -1 so that we do compute
20432 the reductions of the first state which was mistakenly confused
20433 with the final state because precisely final_state was initialized
20434 to 0.
20435 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
20436 now noticed by Bison.
20437 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
20438 have a reduction on $default.
20439
29d29c8f
AD
204402001-12-29 Akim Demaille <akim@epita.fr>
20441
20442 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
20443 rule line numbers.
20444 * src/closure.c (print_closure): Likewise.
20445 * src/derives.c (print_derives): Likewise.
20446 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
20447 now.
20448
7c6b64d0
AD
204492001-12-29 Akim Demaille <akim@epita.fr>
20450
20451 * src/lalr.c (lookaheads_print): New.
20452 (lalr): Call it when --trace-flag.
20453 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
20454 are dumped.
20455
3d4daee3
AD
204562001-12-29 Akim Demaille <akim@epita.fr>
20457
20458 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
20459 when walking through ritem, even via rule->rhs.
20460 * src/reduce.c (dump_grammar, useful_production, reduce_output)
20461 (useful_production, useless_nonterminals): Likewise.
20462 (reduce_grammar_tables): Likewise, plus update nritems.
20463 * src/nullable.c (set_nullable): Likewise.
20464 * src/lalr.c (build_relations): Likewise.
20465 * tests/sets.at (Nullable): Adjust.
20466 Fortunately, now, the $axiom is no longer nullable.
20467
9e7f6bbd
AD
204682001-12-29 Akim Demaille <akim@epita.fr>
20469
20470 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
20471 the 0-sentinel.
20472 * src/gram.c (ritem_longest_rhs): Likewise.
20473 * src/reduce.c (nonterminals_reduce): Likewise.
20474 * src/print_graph.c (print_graph): Likewise.
20475 * src/output.c (output_rule_data): Likewise.
20476 * src/nullable.c (set_nullable): Likewise.
20477
255ef638
AD
204782001-12-29 Akim Demaille <akim@epita.fr>
20479
20480 * src/output.c: Comment changes.
20481
0d8a7363
AD
204822001-12-27 Paul Eggert <eggert@twinsun.com>
20483
20484 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
20485 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
20486 Sparc, as they were causing more porting problems than the
20487 (minor) performance improvement was worth.
20488
20489 Also, catch up with 1.31's YYSTD.
20490
3db472b9
AD
204912001-12-27 Akim Demaille <akim@epita.fr>
20492
20493 * src/output.c (output_gram): Rely on nritems, not the
20494 0-sentinel. See below.
20495 Use -1 as separator, not 0.
20496 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
20497 Rely on -1 as separator in yyrhs, instead of 0.
20498 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
20499 twice `Now at end of input', therefore there are two lines less to
20500 expect.
20501
b365aa05
AD
205022001-12-27 Akim Demaille <akim@epita.fr>
20503
20504 * tests/regression.at (Unresolved SR Conflicts):
20505 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
20506 below.
20507
30171f79
AD
205082001-12-27 Akim Demaille <akim@epita.fr>
20509
20510 * src/LR0.c (new_state): Recognize the final state by the fact it
20511 is reached by eoftoken.
20512 (insert_start_shifting_state, insert_eof_shifting_state)
20513 (insert_accepting_state, augment_automaton): Remove, since now
20514 these states are automatically computed from the initial state.
20515 (generate_states): Adjust.
20516 * src/print.c: When reporting a rule number to the user, substract
20517 1, so that the axiom rule is rule 0, and the first user rule is 1.
20518 * src/reduce.c: Likewise.
20519 * src/print_graph.c (print_core): For the time being, just as for
20520 the report, depend upon --trace-flags to dump the full set of
20521 items.
20522 * src/reader.c (readgram): Once the grammar read, insert the rule
20523 0: `$axiom: START-SYMBOL $'.
20524 * tests/set.at: Adjust: rule 0 is now displayed, and since the
20525 number of the states has changed (the final state is no longer
20526 necessarily the last), catch up.
20527
75142d45
AD
205282001-12-27 Akim Demaille <akim@epita.fr>
20529
20530 Try to make the use of the eoftoken valid. Given that its value
20531 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
20532 is used instead of > 0 where appropriate, (ii), depend upon nritems
20533 instead of the 0-sentinel.
20534
20535 * src/gram.h, src/gram.c (nritems): New.
20536 Expected to be duplication of nitems, but for the time being...
20537 * src/reader.c (packgram): Assert nritems and nitems are equal.
20538 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
20539 * src/closure.c (print_closure, print_fderives): Likewise.
20540 * src/gram.c (ritem_print): Likewise.
20541 * src/print.c (print_core, print_grammar): Likewise.
20542 * src/print_graph.c: Likewise.
20543
b7c49edf
AD
205442001-12-27 Akim Demaille <akim@epita.fr>
20545
20546 * src/main.c (main): If there are complains after grammar
20547 reductions, then output the report anyway if requested, then die.
20548 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
20549 * src/reader.c (eoftoken): New.
20550 (parse_token_decl): If the token being defined has value `0', it
20551 is the eoftoken.
20552 (packsymbols): No longer hack `tags' to insert `$' by hand.
20553 Be sure to preserve the value of the eoftoken.
20554 (reader): Make sure eoftoken is defined.
20555 Initialize nsyms to 0: now eoftoken is created just like the others.
20556 * src/print.c (print_grammar): Don't special case the eof token.
20557 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
20558 lie anyway, albeit pleasant.
20559 * tests/calc.at: Exercise error messages with eoftoken.
20560 Change the grammar so that empty input is invalid.
20561 Adjust expectations.
20562 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
20563
ec2da99f
AD
205642001-12-27 Akim Demaille <akim@epita.fr>
20565
20566 * configure.in: Check the protos of strchr ans strspn.
20567 Replace strchr if needed.
20568 * src/system.h: Provide the protos of strchr, strspn and memchr if
20569 missing.
20570 * lib/strchr.c: New.
20571 * src/reader.c (symbols_save): Use strchr.
20572
8adfa272
AD
205732001-12-27 Akim Demaille <akim@epita.fr>
20574
20575 * src/print.c, src/print_graph.c (escape): New.
20576 Use it to quote the TAGS outputs.
20577 * src/print_graph.c (print_state): Now errors are in red, and
20578 reductions in green.
20579 Prefer high to wide: output the state number on a line of its own.
20580
80dac38c
AD
205812001-12-27 Akim Demaille <akim@epita.fr>
20582
20583 * src/state.h, src/state.c (reductions_new): New.
20584 * src/LR0.c (set_state_table): Let all the states have a
20585 `reductions', even if reduced to 0.
20586 (save_reductions): Adjust.
20587 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
20588 * src/print.c (print_reductions, print_actions): Adjust.
20589 * src/output.c (action_row): Adjust.
20590
2cec70b9
AD
205912001-12-27 Akim Demaille <akim@epita.fr>
20592
20593 * src/state.h, src/state.c (errs_new, errs_dup): New.
20594 * src/LR0.c (set_state_table): Let all the states have an errs,
20595 even if reduced to 0.
20596 * src/print.c (print_errs, print_reductions): Adjust.
20597 * src/output.c (output_actions, action_row): Adjust.
20598 * src/conflicts.c (resolve_sr_conflict): Adjust.
20599
13ca549a
AD
206002001-12-27 Akim Demaille <akim@epita.fr>
20601
20602 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
20603
5092aba5
AD
206042001-12-27 Akim Demaille <akim@epita.fr>
20605
20606 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
20607 * src/print.c: here.
20608 (lookaheadset, shiftset): New, used as additional storage by
20609 print_reductions.
20610 (print_results): Adjust.
20611 (print_shifts, print_gotos, print_errs): New, extracted from...
20612 (print_actions): here.
20613 * src/print_graph.c (print_actions): Remove dead code.
20614
11e2beca
AD
206152001-12-27 Akim Demaille <akim@epita.fr>
20616
20617 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
20618 `$n' and `@n'.
20619
dac3c910
AD
206202001-12-27 Akim Demaille <akim@epita.fr>
20621
20622 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
20623 (build_relations): Adjust.
20624
d0b0fefa
AD
206252001-12-27 Akim Demaille <akim@epita.fr>
20626
20627 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
20628 duplication.
20629
adc8c848
AD
206302001-12-27 Akim Demaille <akim@epita.fr>
20631
20632 * src/reader.c (packgram): Catch nitems overflows.
20633
14d293ac
AD
206342001-12-27 Akim Demaille <akim@epita.fr>
20635
20636 * src/files.c, src/files.h (guard_obstack): Remove.
20637 * src/output.c (output): Adjust.
20638 * src/reader.c (parse_braces): New, factoring...
20639 (copy_action, copy_guard): these two which are renamed as...
20640 (parse_action, parse_guard): these.
20641 As a voluntary consequence, using braces around guards is now
20642 mandatory.
20643
f499b062
AD
206442001-12-27 Akim Demaille <akim@epita.fr>
20645
20646 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
20647 * src/reader.c (symbol_list): `guard' and `guard_line' are new
20648 members.
20649 (symbol_list_new): Adjust.
20650 (copy_action): action_line is the first line, not the last.
20651 (copy_guard): Just as for actions, store the `action' only, not
20652 the switch/case/break flesh.
20653 Don't parse the user action that might follow the guard, let...
20654 (readgram): do it, i.e., now, there can be an action after a
20655 guard.
20656 In other words the guard is just explicitly optional.
20657 (packgram): Adjust.
20658 * src/output.c (guards_output): New.
20659 (output_parser): Call it when needed.
20660 (output): Also free the guard and attrs obstacks.
20661 * src/files.c, src/files.h (obstack_save): Remove.
20662 (output_files): Remove.
20663 As a result, if one needs the former `.act' file, using an
20664 appropriate skeleton which requires actions and guards is now
20665 required.
20666 * src/main.c (main): Adjust.
20667 * tests/semantic.at: New.
20668 * tests/regression.at: Use `input.y' as input file name.
20669 Avoid 8+3 problems by requiring input.c when the test needs the
20670 parser.
20671
d945f5cd
AD
206722001-12-27 Akim Demaille <akim@epita.fr>
20673
20674 * src/reader.c (symbol_list_new): Be sure to initialize all the
20675 fields.
20676
d200e455
AD
206772001-12-27 Akim Demaille <akim@epita.fr>
20678
20679 All the hacks using a final pseudo state are now useless.
20680
20681 * src/LR0.c (set_state_table): state_table holds exactly nstates.
20682 * src/lalr.c (nLA): New.
20683 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
20684 instead of lookaheadsp from the pseudo state (nstate + 1).
20685
f9507c28
AD
206862001-12-27 Akim Demaille <akim@epita.fr>
20687
20688 * src/output.c (action_row, token_actions): Use a state_t instead
20689 of a integer, and nlookaheads instead of the following state's
20690 lookaheadsp.
20691
065fbd27
AD
206922001-12-27 Akim Demaille <akim@epita.fr>
20693
20694 * src/conflicts.c (log_resolution, flush_shift)
20695 (resolve_sr_conflict, set_conflicts, solve_conflicts)
20696 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
20697 (conflicts_print, print_reductions): Use a state_t instead of an
20698 integer when referring to a state.
20699 As much as possible, depend upon nlookaheads, instead of the
20700 `lookaheadsp' member of the following state (since lookaheads of
20701 successive states are successive, the difference between state n + 1
20702 and n served as the number of lookaheads for state n).
20703 * src/lalr.c (add_lookback_edge): Likewise.
20704 * src/print.c (print_core, print_actions, print_state)
20705 (print_results): Likewise.
20706 * src/print_graph.c (print_core, print_actions, print_state)
20707 (print_graph): Likewise.
20708 * src/conflicts.h: Adjust.
20709
1b177bd7
AD
207102001-12-27 Akim Demaille <akim@epita.fr>
20711
20712 * src/bison.hairy: Formatting/comment changes.
20713 ANSIfy.
20714 Remove `register' indications.
20715 Add plenty of `static'.
20716
7742ddeb
AD
207172001-12-27 Akim Demaille <akim@epita.fr>
20718
20719 * src/output.c (prepare): Drop the muscle `ntbase' which
20720 duplicates ntokens.
20721 * src/bison.simple: Formatting/comment changes.
20722 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
20723 is an undocumented synonym.
20724
1fa14068
AD
207252001-12-22 Akim Demaille <akim@epita.fr>
20726
20727 * src/output.c (output_table_data): Change the prototype to use
20728 `int' for array ranges: some invocations do pass an int, not a
20729 short.
20730 Reported by Wayne Green.
20731
b9752825
AD
207322001-12-22 Akim Demaille <akim@epita.fr>
20733
20734 Some actions of web2c.y are improperly triggered.
20735 Reported by Mike Castle.
20736
20737 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
20738 * tests/regression.at (Web2c): Rename as...
20739 (Web2c Report): this.
20740 (Web2c Actions): New.
20741
776209d6
AD
207422001-12-22 Akim Demaille <akim@epita.fr>
20743
20744 Reductions in web2c.y are improperly reported.
20745 Reported by Mike Castle.
20746
20747 * src/conflicts.c (print_reductions): Fix.
20748 * tests/regression.at (Web2c): New.
20749
275fc3ad
AD
207502001-12-18 Akim Demaille <akim@epita.fr>
20751
20752 Some host fail on `assert (!"foo")', which expands to
20753 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
20754 Reported by Nelson Beebee.
20755
20756 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
20757 `#define it_succeeded 0' and `assert (it_succeeded)'.
20758
897668ee
MA
207592001-12-17 Marc Autret <autret_m@epita.fr>
20760
20761 * src/bison.simple: Don't hard code the skeleton line and filename.
20762 * src/output.c (output_parser): Rename 'line' as 'output_line'.
20763 New line counter 'skeleton_line' (skeleton-line muscle).
20764
ab3399e0
PE
207652001-12-17 Paul Eggert <eggert@twinsun.com>
20766
20767 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
20768 YYDEBUG must be defined to a nonzero value.
20769
20770 * src/bison.simple (yytname): Do not assume that the user defines
20771 YYDEBUG to a properly parenthesized expression.
20772
3877f72b
AD
207732001-12-17 Akim Demaille <akim@epita.fr>
20774
20775 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
20776 nlookaheads is a new member.
20777 Adjust all users.
20778 * src/lalr.h (nlookaheads): Remove this orphan declaration.
20779 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
20780 state.
776209d6 20781
331dbc1b
AD
207822001-12-17 Akim Demaille <akim@epita.fr>
20783
20784 * src/files.h, src/files.c (open_files, close_files): Remove.
20785 * src/main.c (main): Don't open/close files, nor invoke lex_free,
20786 let...
20787 * src/reader.c (reader): Do it.
776209d6 20788
be750e4c
AD
207892001-12-17 Akim Demaille <akim@epita.fr>
20790
20791 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 20792
709ae8c6
AD
207932001-12-17 Akim Demaille <akim@epita.fr>
20794
20795 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
20796 (flush_reduce): New.
20797 (resolve_sr_conflict): Adjust.
776209d6 20798
f87685c3
AD
207992001-12-17 Akim Demaille <akim@epita.fr>
20800
20801 * src/output.c (output_obstack): Be static and rename as...
20802 (format_obstack): this, to avoid any confusion with files.c's
20803 output_obstack.
20804 * src/reader.h (muscle_obstack): Move to...
20805 * src/output.h: here, since it's defined in output.c.
20806
837491d8
AD
208072001-12-17 Akim Demaille <akim@epita.fr>
20808
20809 * src/output.c (action_row, save_column, default_goto)
20810 (sort_actions, matching_state, pack_vector): Better variable
20811 locality.
20812
796d61fb
AD
208132001-12-17 Akim Demaille <akim@epita.fr>
20814
20815 * src/output.c: Various formatting changes.
776209d6 20816
64d15509
AD
208172001-12-17 Akim Demaille <akim@epita.fr>
20818
20819 * src/files.c (output_files): Free the output_obstack.
20820 * src/main.c (main): Call print and print_graph conditionally.
20821 * src/print.c (print): Work unconditionally.
20822 * src/print_graph.c (print_graph): Work unconditionally.
20823 * src/conflicts.c (log_resolution): Output only if verbose_flag.
20824
fbc8ecb7
MA
208252001-12-16 Marc Autret <autret_m@epita.fr>
20826
20827 * src/output.c (actions_output): Fix. When we use %no-lines,
20828 there is one less line per action.
20829
f0440388
MA
208302001-12-16 Marc Autret <autret_m@epita.fr>
20831
20832 * src/bison.simple: Remove a useless #line directive.
20833 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
20834 * src/output.c (get_lines_number): New.
776209d6 20835 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
20836 output muscles.
20837 Fix line numbering.
20838 (actions_output): Computes the number of lines taken by actions.
20839 (output_master_parser): Insert new skeleton which is the name of
20840 the output parser file name.
20841
a79986b8
MA
208422001-12-15 Marc Autret <autret_m@epita.fr>
20843
20844 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
20845
4ec8e00f
MA
208462001-12-15 Marc Autret <autret_m@epita.fr>
20847
20848 * src/output.c (output_gram): Keep track of the hairy one.
20849
1a4648ff
AD
208502001-12-15 Akim Demaille <akim@epita.fr>
20851
20852 Make `make distcheck' work.
20853
20854 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
20855 system.h which uses libgettext.h.
20856
9c2c67e6
AD
208572001-12-15 Akim Demaille <akim@epita.fr>
20858
20859 * src/nullable.c (set_nullable): Useless rules must be skipped,
20860 otherwise, since we range over their symbols, we might look at a
20861 nonterminal which no longer ``exists'', i.e., it is not counted in
20862 `nvars', hence we overflow our arrays.
20863
93ede233
AD
208642001-12-15 Akim Demaille <akim@epita.fr>
20865
20866 The header can also be produced directly, without any obstack!
20867 Yahoo!
20868
20869 * src/files.c, src/files.h (defines_obstack): Remove.
20870 (compute_header_macro): Global.
20871 (defines_obstack_save): Remove.
20872 * src/reader.c (parse_union_decl): No longer output to
20873 defines_obstack: its content can be found in the `stype' muscle
20874 anyway.
20875 (output_token_translations): Merge into...
20876 (symbols_output): this.
20877 Rename as...
20878 (symbols_save): this.
20879 (reader): Adjust.
20880 * src/output.c (header_output): New.
20881 (output): Call it.
20882
2666f928
AD
208832001-12-15 Akim Demaille <akim@epita.fr>
20884
20885 * src/reader.c (parse_union_decl): Instead of handling two obstack
20886 simultaneously, use one to define the `stype' muscle, and use the
20887 value of the latter to fill defines_obstack.
20888 (copy_comment): Remove.
20889 (copy_comment2): Work for a single obstack.
20890 Rename as...
20891 (copy_comment): this.
20892
428046f8
AD
208932001-12-15 Akim Demaille <akim@epita.fr>
20894
20895 * src/lex.c, src/lex.h (xgetc): No longer static.
20896 * src/reader.c (parse_union_decl): Revamp.
20897
ea52d706
AD
208982001-12-15 Akim Demaille <akim@epita.fr>
20899
20900 Still making progress in separating Bison into (i) input, (ii)
20901 process, (iii) output: now we can directly output the parser file
20902 without using table_obstack at all.
20903
20904 * src/files.c, src/files.h (table_obstack): Bye bye.
20905 (parser_file_name): New.
20906 * src/files.c (compute_output_file_names): Compute it.
20907 * src/output.c (actions_output, output_parser)
20908 (output_master_parser): To a file instead of an obstack.
20909
3f96f4dc
AD
209102001-12-15 Akim Demaille <akim@epita.fr>
20911
20912 Attach actions to rules, instead of pre-outputting them to
20913 actions_obstack.
20914
20915 * src/gram.h (rule_t): action and action_line are new members.
20916 * src/reader.c (symbol_list): Likewise.
20917 (copy_action): Save the actions within the rule.
20918 (packgram): Save them in rule_table.
20919 * src/output.c (actions_output): New.
20920 (output_parser): Use it on `%%actions'.
20921 (output_rule_data): Don't free rule_table.
20922 (output): Do it.
20923 (prepare): Don't save the `action' muscle.
20924 * src/bison.simple: s/%%action/%%actions/.
20925
51576fb3
AD
209262001-12-15 Akim Demaille <akim@epita.fr>
20927
20928 * src/reader.c (copy_action): When --yacc, don't append a `;'
20929 to the user action: let it fail if lacking.
dee049eb 20930 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 20931
2648a72d
AD
209322001-12-14 Akim Demaille <akim@epita.fr>
20933
20934 * src/lex.c (literalchar): Simply return the char you decoded, non
20935 longer mess around with obstacks and int pointers.
20936 Adjust all callers.
20937
92790e5b
AD
209382001-12-14 Akim Demaille <akim@epita.fr>
20939
20940 * src/lex.c (literalchar): Don't escape the special characters,
20941 just decode them, and keep them as char (before, eol was output as
20942 the 2 char string `\n' etc.).
20943 * src/output.c (output_rule_data): Use quotearg to output the
20944 token strings.
20945
927c1557
PE
209462001-12-13 Paul Eggert <eggert@twinsun.com>
20947
20948 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
20949 Do not infringe on the global user namespace when using C++.
20950 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
20951 All uses of `fprintf' and `stderr' changed.
20952
20953 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
20954
ed8e1f68
AD
209552001-12-13 Akim Demaille <akim@epita.fr>
20956
20957 The computation of nullable is broken: it doesn't handle empty
20958 RHS's properly.
20959
20960 * tests/torture.at (GNU AWK Grammar): New.
20961 * tests/sets.at (Nullable): New.
20962 * src/nullable.c (set_nullable): Instead of blindly looping over
20963 `ritems', loop over the rules, and then over their rhs's.
20964
20965 Work around Autotest bugs.
20966
20967 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
20968 frame, because Autotest understand lines starting with a `+' as
20969 traces from the shell. Then, they are not processed properly.
20970 Admittedly an Autotest bug, but we don't have time to wait for
20971 Autotest to catch up.
20972 * tests/regression.at (Broken Closure): Adjust to the new table
20973 frames.
20974 Move to...
20975 * tests/sets.at: here.
20976
cb581495
AD
209772001-12-13 Akim Demaille <akim@epita.fr>
20978
20979 * src/closure.c (closure): Use nrules instead of playing tricks
20980 with BITS_PER_WORD.
20981
2e729273
AD
209822001-12-13 Akim Demaille <akim@epita.fr>
20983
20984 * src/print.c (print_actions): Output the handling of `$' as the
20985 traces do: shifting the token EOF. Before EOF was treated as a
20986 nonterminal.
20987 * tests/regression.at: Adjust some tests.
20988 * src/print_graph.c (print_core): Complete the set of items via
20989 closure. The next-to-final and final states are still unsatisfying,
20990 but that's to be addressed elsewhere.
20991 No longer output the rule numbers, but do output the state number.
20992 A single loop for the shifts + gotos is enough, but picked a
20993 distinct color for each.
20994 (print_graph): Initialize and finalize closure.
20995
107f7dfb
AD
209962001-12-13 Akim Demaille <akim@epita.fr>
20997
20998 * src/reader.c (readgram): Remove dead code, an strip useless
20999 braces.
21000 (get_type): Remove, unused.
21001
9b53a24f
AD
210022001-12-12 Akim Demaille <akim@epita.fr>
21003
21004 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
21005 on that of lib/error.c.
21006
dbfb6dcd
AD
210072001-12-12 Akim Demaille <akim@epita.fr>
21008
21009 Some hosts don't like `/' in includes.
21010
21011 * src/system.h: Include libgettext.h without qualifying the path.
21012 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
21013 $(top_srcdir).
21014
c25fb648
MA
210152001-12-11 Marc Autret <autret_m@epita.fr>
21016
21017 * src/output.c (output_parser): Remove useless muscle.
21018
710ddc4f
MA
210192001-12-11 Marc Autret <autret_m@epita.fr>
21020
21021 * src/bison.simple: Remove #line just before %%epilogue. It
21022 is now handled in ...
21023 * src/reader.c (read_additionnal_code): Add the output of a
21024 #line for the epilogue.
21025
e83d80b8
MA
210262001-12-10 Marc Autret <autret_m@epita.fr>
21027
927c1557 21028 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
21029 replace precedent remove.
21030 * src/bison.simple: Remove #line before %%prologue because
21031 %%input-line is wrong at this time.
21032
971d5158
MA
210332001-12-10 Marc Autret <autret_m@epita.fr>
21034
21035 * src/reader.c (symbols_output): Clean up.
927c1557 21036 * src/output.c (output_gram, output): Clean up.
971d5158 21037
5edafffd
AD
210382001-12-10 Akim Demaille <akim@epita.fr>
21039
21040 * src/lalr.c (initialize_lookaheads): New. Extracted from...
21041 * src/LR0.c (set_state_table): here.
21042 * src/lalr.c (lalr): Call it.
21043
0279f8e9
AD
210442001-12-10 Akim Demaille <akim@epita.fr>
21045
21046 * src/state.h (shifts): Remove the `number' member: shifts are
21047 attached to state, hence no longer need to be labelled with a
21048 state number.
21049
190c4f5f
AD
210502001-12-10 Akim Demaille <akim@epita.fr>
21051
21052 Now that states have a complete set of members, the linked list of
21053 shifts is useless: just fill directly the state's shifts member.
21054
21055 * src/state.h (shifts): Remove the `next' member.
21056 * src/LR0.c (first_state, last_state): Remove.
21057 Adjust the callers.
21058 (augment_automaton): Don't look for the shifts that must be added
21059 a shift on EOF: it is those of the state we looked for! But now,
21060 since shifts are attached, it is no longer needed to looking
21061 merely by its id: its number.
21062
2a73b93d
AD
210632001-12-10 Akim Demaille <akim@epita.fr>
21064
21065 * src/LR0.c (augment_automaton): Better variable locality.
21066 Remove an impossible branch: if there is a state corresponding to
21067 the start symbol being shifted, then there is shift for the start
21068 symbol from the initial state.
21069
74392f6a
AD
210702001-12-10 Akim Demaille <akim@epita.fr>
21071
21072 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
21073 only when appropriate: when insert_start_shifting_state' is not
21074 invoked.
21075 * tests/regression.at (Rule Line Numbers): Adjust.
21076
37c82725
AD
210772001-12-10 Akim Demaille <akim@epita.fr>
21078
21079 * src/LR0.c (augment_automaton): Now that all states have shifts,
21080 merge the two cases addition shifts to the initial state.
21081
6a164e0c
AD
210822001-12-10 Akim Demaille <akim@epita.fr>
21083
21084 * src/lalr.c (set_state_table): Move to...
21085 * src/LR0.c: here.
21086 * src/lalr.c (lalr): Don't call it...
21087 * src/LR0.c (generate_states): do it.
21088 * src/LR0.h (first_state): Remove, only the table is used.
21089
7215de24
AD
210902001-12-10 Akim Demaille <akim@epita.fr>
21091
21092 * src/LR0.h (first_shift, first_reduction): Remove.
21093 * src/lalr.c: Don't use first_shift: find shifts through the
21094 states.
21095
80e25d4d
AD
210962001-12-10 Akim Demaille <akim@epita.fr>
21097
21098 * src/LR0.c: Attach shifts to states as soon as they are
21099 computed.
21100 * src/lalr.c (set_state_table): Instead of assigning shifts to
21101 state, just assert that the mapping was properly done.
21102
0ab3728b
AD
211032001-12-10 Akim Demaille <akim@epita.fr>
21104
21105 * src/LR0.c (insert_start_shift): Rename as...
21106 (insert_start_shifting_state): this.
21107 (insert_eof_shifting_state, insert_accepting_state): New.
21108 (augment_automaton): Adjust.
21109 Better locality of the variables.
21110 When looking if the start_symbol is shifted from the initial
21111 state, using `while (... symbol != start_symbol ...)' sounds
21112 better than `while (... symbol < start_symbol ...)': If fail
21113 to see how the order between symbols could be relevant!
21114
78af9bbc
AD
211152001-12-10 Akim Demaille <akim@epita.fr>
21116
21117 * src/getargs.h: Don't declare `spec_name_prefix' and
21118 `spec_file_prefix', declared by src/files.h.
21119 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
21120 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
21121 * src/output.c (prepare): Adjust.
21122 * src/reader.c (symbols_output): Likewise.
21123 * src/vmsgetargs.c: Vaguely adjust, but who cares?
21124
bdef2a41
AD
211252001-12-10 Akim Demaille <akim@epita.fr>
21126
21127 * src/muscle_tab.c (muscle_init): NULL is a better default than
21128 `"0"'.
21129
3735969c
AD
211302001-12-10 Akim Demaille <akim@epita.fr>
21131
21132 * src/reader.c (reader): Calling symbols_output once is enough.
21133
49701457
AD
211342001-12-10 Akim Demaille <akim@epita.fr>
21135
21136 Now that states have a complete set of members, the linked list of
21137 reductions is useless: just fill directly the state's reductions
21138 member.
21139
21140 * src/state.h (struct reductions): Remove member `number' and
21141 `next'.
21142 * src/LR0.c (first_reduction, last_reduction): Remove.
21143 (save_reductions): Don't link the new reductions, store them in
21144 this_state.
21145 * src/lalr.c (set_state_table): No need to attach reductions to
21146 states, it's already done.
21147 * src/output.c (output_actions): No longer free the shifts, then
21148 the reductions, then the states: free all the states and their
21149 members.
21150
0edad749
AD
211512001-12-10 Akim Demaille <akim@epita.fr>
21152
21153 * src/options.c (OPTN, DRTV, BOTH): New.
21154 (option_table): Use them.
21155
0edad749
AD
21156 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
21157 the job of system.h.
21158 * src/options.c: Don't include stdio.h and xalloc.h for the same
21159 reasons.
21160
5449dd0f
AD
211612001-12-10 Akim Demaille <akim@epita.fr>
21162
21163 * src/output.c (output, prepare): Make sure the values of the
21164 muscles `action' and `prologue' are 0-terminated.
21165
a870c567
AD
211662001-12-10 Akim Demaille <akim@epita.fr>
21167
21168 Clean up GCC warnings.
21169
21170 * src/reader.c (copy_action): `buf' is not used.
21171 (parse_skel_decl): Be static.
21172 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
21173 * src/options.h (create_long_option_table): Have a real prototype.
21174 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
21175 (hash_delete_at): Return const void *.
21176 Adjust casts to preserve the const.
21177
80df8768
AD
211782001-12-10 Akim Demaille <akim@epita.fr>
21179
21180 * configure.in: Require 2.52g.
21181 M4 is not needed, but AUTOM4TE is.
21182 * m4/m4.m4: Remove.
21183 * tests/Makefile.am: Adjust.
21184
f693ad14
AD
211852001-12-10 Akim Demaille <akim@epita.fr>
21186
21187 One structure for states is enough, even though theoretically
21188 there are LR(0) states and LALR(1) states.
21189
21190 * src/lalr.h (state_t): Remove.
21191 (state_table): Be state_t **, not state_t *.
21192 * src/state.h (core, CORE_ALLOC): Rename as...
21193 (state_t, STATE_ALLOC): this.
21194 Add the LALR(1) members: shifts, reductions, errs.
21195 * src/LR0.c (state_table): Rename as...
21196 (state_hash): this, to avoid name clashes with the global
21197 `state_table'.
21198 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
21199 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
21200
74ffbcb6
AD
212012001-12-10 Akim Demaille <akim@epita.fr>
21202
21203 Bison dumps core on bash.y.
21204 Reported by Pascal Bart.
21205
21206 * src/warshall.c (bitmatrix_print): New.
21207 (TC): Use it.
ba0fe3c7 21208 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
21209 j must be the outer loop.
21210 * tests/regression.at (Broken Closure): New.
21211
07708e19
AD
212122001-12-05 Akim Demaille <akim@epita.fr>
21213
21214 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
21215 its argument.
ba1ecc07 21216 Reported by Peter Hamorsky.
07708e19 21217
92b16366
AD
212182001-12-05 Akim Demaille <akim@epita.fr>
21219
21220 * src/conflicts.c (err_table): Remove.
21221 (resolve_sr_conflict): Adjust.
21222 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
21223 Rename as...
21224 (state_t.reductions, state_t.shifts): this.
21225
076ab033
AD
212262001-12-05 Akim Demaille <akim@epita.fr>
21227
21228 * src/reduce.c (reduce_grammar_tables): No longer disable the
21229 removal of useless rules via CPP but via `if (0)', so that the
21230 compiler still check the code is valid.
21231 For instance, it should have noticed `rline' no longer exists: use
21232 the `line' member of rule_t.
21233 * src/gram.c (dummy, rline): Remove, unused.
21234
3843c413
AD
212352001-12-05 Akim Demaille <akim@epita.fr>
21236
21237 * src/output.c (pack_vector): Use assert, not berror.
21238 * src/main.c (berror): Remove, unused.
21239
43168960
AD
212402001-12-05 Akim Demaille <akim@epita.fr>
21241
21242 New experimental feature: if --verbose --trace output all the
21243 items of a state, not only its kernel.
21244
21245 * src/print.c (print_core): If `trace_flag', then invoke closure
21246 before outputting the items of the state (print_core is no longer
21247 a correct name them).
21248 (print_results): Invoke new_closure/free_closure if needed.
21249
b2872512
AD
212502001-12-05 Akim Demaille <akim@epita.fr>
21251
21252 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
21253 * src/closure.c, src/closure.h (itemsetsize): Rename as...
21254 (nitemset): for consistency with the rest of the project.
21255
23cbcc6c
AD
212562001-12-05 Akim Demaille <akim@epita.fr>
21257
21258 * src/closure.c (print_closure): Improve.
21259 (closure): Use it for printing input and output.
21260
03ec521c
AD
212612001-12-05 Akim Demaille <akim@epita.fr>
21262
21263 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
21264 indexed by nonterminals.
21265
3a7456dd
AD
212662001-12-05 Akim Demaille <akim@epita.fr>
21267
21268 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
21269 what it was!).
21270 * src/warshall.h: Remove accidental duplication of the content.
21271
1cbcf2e7
AD
212722001-12-05 Akim Demaille <akim@epita.fr>
21273
21274 * src/closure.c (set_fderives): De-obfuscate.
21275
84182270
AD
212762001-12-05 Akim Demaille <akim@epita.fr>
21277
21278 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
21279
3f6f053c
AD
212802001-12-05 Akim Demaille <akim@epita.fr>
21281
21282 * src/closure.c (set_firsts): De-obfuscate.
21283
7a5350ba
AD
212842001-12-05 Akim Demaille <akim@epita.fr>
21285
21286 * src/output.c (action_row): De-obfuscate
21287 using the good o' techniques: arrays not pointers, variable
21288 locality, BITISSET, RESETBIT etc.
21289
d954473d
AD
212902001-12-05 Akim Demaille <akim@epita.fr>
21291
21292 Pessimize the code to simplify it: from now on, all the states
21293 have a valid SHIFTS, which NSHIFTS is possibly 0.
21294
21295 * src/LR0.c (shifts_new): Be global and move to..
21296 * src/state.c, src/state.h: here.
21297 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
21298 * src/print_graph: Adjust.
21299
9839bbe5
AD
213002001-12-05 Akim Demaille <akim@epita.fr>
21301
21302 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
21303 * src/conflicts.c: Use it.
21304 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
21305 incorrectly ``simplified''.
21306
9f136c07
AD
213072001-12-05 Akim Demaille <akim@epita.fr>
21308
21309 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
21310 using the good o' techniques: arrays not pointers, variable
21311 locality, BITISSET, RESETBIT etc.
21312
b608206e
AD
213132001-12-05 Akim Demaille <akim@epita.fr>
21314
21315 * src/state.h (SHIFT_SYMBOL): New.
21316 * src/conflicts.c: Use it to deobfuscate.
21317
52afa962
AD
213182001-12-05 Akim Demaille <akim@epita.fr>
21319
21320 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
21321 (print_reductions): De-obfuscate using the good o' techniques:
21322 arrays not pointers, variable locality, BITISSET.
21323
e74dc321
AD
213242001-12-05 Akim Demaille <akim@epita.fr>
21325
21326 * src/conflicts.c (print_reductions): Arrays, not pointers.
21327 Use BITISSET.
21328
768fca83
AD
213292001-12-05 Akim Demaille <akim@epita.fr>
21330
21331 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21332
a17e599f
AD
213332001-12-05 Akim Demaille <akim@epita.fr>
21334
21335 * src/conflicts.c (print_reductions): Improve variable locality.
21336
a04bc341
AD
213372001-12-05 Akim Demaille <akim@epita.fr>
21338
21339 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21340
c8ea038e
AD
213412001-12-05 Akim Demaille <akim@epita.fr>
21342
21343 * src/conflicts.c (print_reductions): Improve variable locality.
21344
aa2aab3c
AD
213452001-12-05 Akim Demaille <akim@epita.fr>
21346
21347 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
21348 * src/lalr.c: Use them.
21349
b178c8cc
AD
213502001-12-05 Akim Demaille <akim@epita.fr>
21351
21352 * src/LR0.c (augment_automaton): Formatting changes.
21353 Better variable locality.
21354
f67d13aa
AD
213552001-12-05 Akim Demaille <akim@epita.fr>
21356
21357 * src/lalr.c (matrix_print): New.
21358 (transpose): Use it.
21359 Use arrays instead of pointers.
21360
c2713865
AD
213612001-12-05 Akim Demaille <akim@epita.fr>
21362
21363 * src/lalr.c (maxrhs): Move to...
21364 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
21365 * src/lalr.c (build_relations): Adjust.
21366
9887c18a
AD
213672001-12-05 Akim Demaille <akim@epita.fr>
21368
21369 * src/lalr.c (transpose): Free the memory allocated to the
21370 argument, as it is replaced by the results by the unique caller.
21371 (build_relations): Merely invoke transpose: it handles the memory
21372 deallocation.
21373 Improve variable locality.
21374 Avoid variables used as mere abbreviations.
21375 (compute_lookaheads): Use arrays instead of pointers.
21376
4d4f699c
AD
213772001-12-05 Akim Demaille <akim@epita.fr>
21378
21379 * src/lalr.c (initialize_F): Improve variable locality.
21380 Avoid variables used as mere abbreviations.
21381
80a69750
AD
213822001-12-05 Akim Demaille <akim@epita.fr>
21383
21384 * src/derives.c (print_derives): Display the ruleno.
21385 * src/lalr.c (initialize_F, transpose): Better variable locality
21386 to improve readability.
21387 Avoid variables used as mere abbreviations.
21388
fe961097
AD
213892001-12-05 Akim Demaille <akim@epita.fr>
21390
21391 * src/lalr.c (traverse): Use arrays instead of pointers.
21392
e3e4e814
AD
213932001-12-05 Akim Demaille <akim@epita.fr>
21394
21395 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
21396 the handling of squeue.
21397 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21398
630e182b
AD
213992001-12-05 Akim Demaille <akim@epita.fr>
21400
21401 Because useless nonterminals are now kept alive (instead of being
21402 `destroyed'), we now sometimes examine them, and store information
21403 related to them. Hence we need to know their number, and adjust
21404 memory allocations.
21405
21406 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
21407 static.
21408 * src/LR0.c (allocate_itemsets): The memory allocated to
21409 `symbol_count' was used for two different purpose: once to count
21410 the number of occurrences of each symbol, and later reassigned to
21411 `shift_symbol', containing the symbol that can be shifted from a
21412 given state.
21413 Deobfuscate, i.e., allocate, use and free `symbol_count' here
21414 only, and...
21415 (new_itemsets): Allocate `shift_symbol' here.
21416 (allocate_itemsets): symbol_count includes useless nonterminals.
21417 Make room for them.
21418 (free_storage): Use `free', not `XFREE', for pointers that cannot
21419 be null.
21420
81b51460
AD
214212001-12-05 Akim Demaille <akim@epita.fr>
21422
21423 * src/nullable.c (set_nullable): Deobfuscate the handling of
21424 ritem.
21425 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21426
3067fbef
AD
214272001-12-05 Akim Demaille <akim@epita.fr>
21428
21429 * src/gram.c, src/gram.h (ritem_print): New.
21430 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
21431 (This useless function was defined only to work around VMS linkers
21432 that can't handle compilation units with variables only).
21433 * src/reduce.c (dump_grammar): Use it to trace the construction of
21434 ritem.
21435
c2bea5f9
PE
214362001-12-04 Paul Eggert <eggert@twinsun.com>
21437
7d27c823
PE
21438 * src/bison.simple (union yyalloc): Change member names
21439 to be the same as the stack names.
21440 (yyparse): yyptr is now union yyalloc *, not char *.
21441 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
21442 and may generate better code on some machines.
c2bea5f9
PE
21443 (yystpcpy): Use prototype if __STDC__ is defined, not just
21444 if __cplusplus is defined.
35687a9d 21445
2c8a9dfa
AD
214462001-11-30 Akim Demaille <akim@epita.fr>
21447
21448 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
21449 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
21450 Gettext doesn't compile cleanly, and dies with -Werror.
21451 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
21452 Include WARNING_CFLAGS here.
21453 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
21454 before being defined.
21455
f4e421e6
AD
214562001-11-27 Paul Eggert <eggert@twinsun.com>
21457
21458 * lib/quotearg.h (quotearg_n, quotearg_n_style):
21459 First arg is int, not unsigned.
21460 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
21461 (SIZE_MAX, UINT_MAX): New macros.
21462 (quotearg_n_options): Abort if N is negative.
21463 Avoid overflow check on hosts where size_t is 64 bits and int
21464 is 32 bits, as overflow is impossible there.
21465 Fix off-by-one typo that caused unnecessary reallocation.
21466
7093d0f5
AD
214672001-11-29 Paul Eggert <eggert@twinsun.com>
21468
21469 Name space cleanup in generated parser.
21470
21471 * doc/bison.texinfo (Bison Parser): Discuss system headers
21472 and their effect on the user name space.
21473
21474 * src/bison.simple:
21475 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
21476 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
21477 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
21478
21479 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
21480 on user names when possible.
21481
21482 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
21483 Simplify test for whather <alloca.h> exists.
21484
21485 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
21486
21487 (<stdio.h>): Include if YYDEBUG.
21488
21489 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
21490 ! defined (yyoverflow) && ! defined (yymemcpy).
21491
21492 (yymemcpy, yyparse): Rename local variables as needed so that
21493 they all begin with 'yy'.
21494
21495 (yystrlen, yystpcpy): New functions.
21496
21497 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
21498 All uses changed.
21499
21500 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
21501 instead of relying on string.h functions. Use YYSTACK_ALLOC
21502 and YYSTACK_FREE instead of malloc and free.
21503
fd51e5ff
AD
215042001-11-30 Akim Demaille <akim@epita.fr>
21505
21506 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
21507 before their first uses.
21508 (YYBISON, YYPURE): Move to the top of the output.
21509
7d13ff5f
AD
215102001-11-30 Akim Demaille <akim@epita.fr>
21511
21512 * tests/reduce.at (Useless Nonterminals): Fix.
21513
892a3995
AD
215142001-11-30 Akim Demaille <akim@epita.fr>
21515
21516 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
21517 if body instead of `;' to pacify GCC's warnings.
21518
68f1e3ed
AD
215192001-11-30 Akim Demaille <akim@epita.fr>
21520
21521 Instead of mapping the LHS of unused rules to -1, keep the LHS
21522 valid, but flag the rules as invalid.
21523
21524 * src/gram.h (rule_t): `useful' is a new member.
21525 * src/print.c (print_grammar): Adjust.
21526 * src/derives.c (set_derives): Likewise.
21527 * src/reader.c (packgram, reduce_output): Likewise.
21528 * src/reduce.c (reduce_grammar_tables): Likewise.
21529 * tests/reduce.at (Underivable Rules, Useless Rules): New.
21530
d2d1b42b
AD
215312001-11-30 Akim Demaille <akim@epita.fr>
21532
21533 * src/reduce.c (reduce_output): Formatting changes.
21534 * src/print.c (print_results, print_grammar): Likewise.
21535 * tests/regression.at (Rule Line Numbers)
21536 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
21537
760b53a8
AD
215382001-11-30 Akim Demaille <akim@epita.fr>
21539
21540 * src/reduce.c (nonterminals_reduce): Instead of throwing away
21541 useless nonterminals, move them at the end of the symbol arrays.
21542 (reduce_output): Adjust.
21543 * tests/reduce.at (Useless Nonterminals): Adjust.
21544
00238958
AD
215452001-11-30 Akim Demaille <akim@epita.fr>
21546
21547 * src/reduce.c: Various comment/formatting changes.
21548 (nonterminals_reduce): New, extracted from...
21549 (reduce_grammar_tables): here.
21550 (reduce_grammar): Call nonterminals_reduce.
21551
396452de
PE
215522001-11-29 Paul Eggert <eggert@twinsun.com>
21553
21554 * src/bison.simple (YYSTACK_REALLOC): Remove.
21555 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
21556 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
21557 New macros.
21558 (union yyalloc): New type.
21559 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
21560 an arbitrary restriction on hosts where size_t is wider than int.
21561
21562 (yyparse): Don't dump core if alloca or malloc fails; instead, report
21563 a parser stack overflow. Allocate just one block of memory for all
21564 three stacks, instead of allocating three blocks; this typically is
21565 faster and reduces fragmentation.
21566
21567 Do not limit the number of items in the stack to a value that fits
21568 in 'int', as this is an arbitrary limit on hosts with 64-bit
21569 size_t and 32-bit int.
21570
147e184c
MA
215712001-11-29 Marc Autret <autret_m@epita.fr>
21572
21573 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
21574 of defining YYERROR_VERBOSE.
21575 [AT_DATA]: $4 is now out of C declarations in the prologue.
21576
426cf563
MA
215772001-11-28 Marc Autret <autret_m@epita.fr>
21578
21579 * src/reader.c (parse_dquoted_param): New.
21580 (parse_skel_decl): Use it.
21581 * src/lex.h: Add its prototype.
21582 * src/lex.c (literalchar): Become not static.
21583
c7925b99
MA
215842001-11-28 Marc Autret <autret_m@epita.fr>
21585
21586 * src/output.h: And put its extern declaration here.
21587 * src/output.c (error_verbose): Define here.
21588 (prepare): Echo name modification.
21589 * src/getargs.h: Clean its extern declaration.
21590 * src/getargs.c (error_verbose_flag): Remove.
21591 (getargs): Remove case 'e'.
21592 * src/options.c (option_table): 'error-verbose' is now seen as simple
21593 percent option.
21594 Include output.h.
21595
21596 * src/reader.c (read_declarations): Remove case tok_include.
21597 (parse_include_decl): Remove.
21598 * src/lex.h (token_t): Remove tok_include.
21599 * src/options.c (option_table): 'include' is now a simple command line
21600 option.
21601
5b5d1929
MA
216022001-11-28 Marc Autret <autret_m@epita.fr>
21603
21604 * src/bison.simple: Adjust muscle names.
21605 * src/muscle_tab.c (muscle_init): Also rename the muscles.
21606 * src/output.c (prepare): s/_/-/ for the muscles names.
21607 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
21608
8850be4b
MA
216092001-11-28 Marc Autret <autret_m@epita.fr>
21610
21611 * src/bison.simple: Fix debug.
21612 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
21613
4a38e613
AD
216142001-11-28 Akim Demaille <akim@epita.fr>
21615
21616 * src/LR0.c (shifts_new): New.
21617 (save_shifts, insert_start_shift, augment_automaton): Use it.
21618
4b35e1c1
AD
216192001-11-28 Akim Demaille <akim@epita.fr>
21620
21621 * src/closure.c (closure): `b' and `ruleno' denote the same value:
21622 keep ruleno only.
21623
d2b04478
AD
216242001-11-28 Akim Demaille <akim@epita.fr>
21625
21626 * src/closure.c (closure): Instead of looping over word in array
21627 then bits in words, loop over bits in array.
21628
2c4c30aa
AD
216292001-11-28 Akim Demaille <akim@epita.fr>
21630
21631 * src/closure.c (closure): No longer optimize the special case
21632 where all the bits of `ruleset[r]' are set to 0, to make the code
21633 clearer.
21634
576890b7
AD
216352001-11-28 Akim Demaille <akim@epita.fr>
21636
21637 * src/closure.c (closure): `r' and `c' are new variables, used to
21638 de-obfuscate accesses to RULESET and CORE.
21639
cb487d7d
AD
216402001-11-28 Akim Demaille <akim@epita.fr>
21641
21642 * src/reduce.c (reduce_print): Use ngettext.
21643 (dump_grammar): Improve the trace accuracy.
21644
6013d43f
AD
216452001-11-28 Akim Demaille <akim@epita.fr>
21646
21647 * src/reduce.c (dump_grammar): Don't translate trace messages.
21648
cb4956ee
AD
216492001-11-28 Akim Demaille <akim@epita.fr>
21650
21651 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
21652 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
21653 as all tags are free'ed afterwards.
21654 From Enrico Scholz.
21655
648185ab
PE
216562001-11-27 Paul Eggert <eggert@twinsun.com>
21657
21658 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
21659 use alloca when we didn't want to, and vice versa.
21660
68254a03
MA
216612001-11-27 Marc Autret <autret_m@epita.fr>
21662
9113b58f
AD
21663 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
21664 initialization.
68254a03
MA
21665 * src/output.c (prepare): Remove its update.
21666
04d843a2
MA
216672001-11-27 Marc Autret <autret_m@epita.fr>
21668
21669 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
21670 Use %error-verbose.
21671
d2079671 216722001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
21673
21674 * src/bison.simple: Remove YYERROR_VERBOSE using.
21675 Use %%error_verbose.
21676 (yyparse): Likewise.
21677 * src/output.c (prepare): Give its final value.
21678 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
21679 * src/getargs.h: Add its extern declaration.
21680 * src/getargs.c (error_verbose_flag): New int.
21681 (getargs): Update to catch new case.
21682 * src/options.c (option_table): 'error-verbose' is a new option.
21683 (shortopts): Update.
21684
e0327bc8
AD
216852001-11-27 Akim Demaille <akim@epita.fr>
21686
21687 * src/system.h: Use intl/libgettext.h.
21688 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
21689
000f1a3c
AD
216902001-11-27 Akim Demaille <akim@epita.fr>
21691
21692 * tests/torture.at (Exploding the Stack Size with Malloc):
21693 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
21694
26cfe0be
AD
216952001-11-27 Akim Demaille <akim@epita.fr>
21696
21697 * src/files.c: Include error.h.
21698 Reported by Hans Aberg.
21699
f6bd5427
MA
217002001-11-26 Marc Autret <autret_m@epita.fr>
21701
d2079671 21702 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
21703 (read_declarations): Add case tok_include.
21704 * src/getargs.h (include): Add its extern definition.
21705 * src/getargs.c (include): New const char *.
21706 (getargs): Add case '-I'.
21707 * src/options.c (option_table): Add include as command line and
21708 percent option.
21709 * src/lex.h (token_t): Add tok_include.
21710
2ca209c1
AD
217112001-11-26 Akim Demaille <akim@epita.fr>
21712
21713 * src/reader.c (readgram): Make sure rules for mid-rule actions
21714 have a lineno equal to that of their host rule.
21715 Reported by Hans Aberg.
21716 * tests/regression.at (Rule Line Numbers): New.
21717
0e41b407
AD
217182001-11-26 Akim Demaille <akim@epita.fr>
21719
21720 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
21721 size_ts.
21722
217232001-11-26 Akim Demaille <akim@epita.fr>
21724
21725 * src/complain.c, src/complain.h (error): Remove, provided by
21726 lib/error.[ch].
21727
e0c40012
AD
217282001-11-26 Akim Demaille <akim@epita.fr>
21729
21730 * src/reader.c (read_declarations): Don't abort on tok_illegal,
21731 issue an error message.
21732 * tests/regression.at (Invalid %directive): New.
21733 Reported by Hans Aberg.
21734
5e147124
AD
217352001-11-26 Akim Demaille <akim@epita.fr>
21736
21737 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
21738 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
21739
a034c8b8
AD
217402001-11-26 Akim Demaille <akim@epita.fr>
21741
21742 * src/conflicts.c (conflicts_print): Don't complain at all when
21743 there are no reduce/reduce conflicts, and as many shift/reduce
21744 conflicts as expected.
21745 * tests/regression.at (%expect right): Adjust.
21746
c64a20f3
AD
217472001-11-23 Akim Demaille <akim@epita.fr>
21748
21749 * lib/alloca.c: Update, from fileutils.
21750
5b0d29bb
AD
217512001-11-23 Akim Demaille <akim@epita.fr>
21752
21753 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
21754
722c4bfe
AD
217552001-11-23 Akim Demaille <akim@epita.fr>
21756
21757 * src/system.h: Include alloca.h.
21758 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
21759
6255b435
AD
217602001-11-23 Akim Demaille <akim@epita.fr>
21761
21762 * src/print_graph.c (print_actions): Remove `rule', unused.
21763 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
21764 pacify GCC's signed < unsigned warnings.
21765 * src/closure.c (itemsetsize): Likewise.
21766 * src/reader.c (symbol_list_new): Static.
21767
b29b2ed5
AD
217682001-11-23 Akim Demaille <akim@epita.fr>
21769
21770 Attaching lineno to buckets is stupid, since only one copy of each
21771 symbol is kept, only the line of the first occurrence is kept too.
21772
21773 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
21774 * src/reader.c (rline_allocated): Remove, unused.
21775 (symbol_list): Have a `line' member.
21776 (symbol_list_new): New.
21777 (readgram): Use it.
21778 * src/print.c (print_grammar): Output the rule line numbers.
21779 * tests/regression.at (Solved SR Conflicts)
21780 (Unresolved SR Conflicts): Adjust.
21781 Reported by Hans Aberg.
21782
a81b1d4a
MA
217832001-11-22 Marc Autret <autret_m@epita.fr>
21784
21785 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
21786
c1ecb3c1
MA
217872001-11-22 Marc Autret <autret_m@epita.fr>
21788
21789 * src/muscle_tab.c (muscle_init): Remove initialization of
21790 skeleton muscle.
21791 * src/output.c (output_master_parser): Do it here.
21792
fbe01355
AD
217932001-11-20 Akim Demaille <akim@epita.fr>
21794
21795 * po/sv.po: New.
21796 * configure.in (ALL_LINGUAS): Adjust.
21797 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
21798 longer contains strings to translate.
21799
81e895c0
AD
218002001-11-19 Akim Demaille <akim@epita.fr>
21801
21802 * src/conflicts.c (conflicts_print): Add a missing \n.
21803
6bb1878b
AD
218042001-11-19 Akim Demaille <akim@epita.fr>
21805
21806 * src/nullable.c (nullable_print): New.
21807 (set_nullable): Call it when tracing.
21808 Better locality of variables.
21809
d9ec2d07
AD
218102001-11-19 Akim Demaille <akim@epita.fr>
21811
21812 * src/print.c (print_actions): Better locality of variables.
21813
720e5c1b
AD
218142001-11-19 Akim Demaille <akim@epita.fr>
21815
21816 * src/derives.c (print_derives): Fix and enrich.
21817 * src/closure.c (print_fderives): Likewise.
21818
fb908786
AD
218192001-11-19 Akim Demaille <akim@epita.fr>
21820
21821 * src/closure.c (itemsetend): Remove, replaced with...
21822 (itemsetsize): new.
21823
125ecb56
AD
218242001-11-19 Akim Demaille <akim@epita.fr>
21825
21826 * src/LR0.c (kernel_end): Remove, replaced with...
21827 (kernel_size): new.
21828
d8cf039f
AD
218292001-11-19 Akim Demaille <akim@epita.fr>
21830
21831 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
21832 to clarify.
21833
7bec0760
AD
218342001-11-19 Akim Demaille <akim@epita.fr>
21835
21836 * src/closure.c (closure): Use arrays instead of pointers to clarify.
21837
c87d4863
AD
218382001-11-19 Akim Demaille <akim@epita.fr>
21839
21840 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
21841 trace messages.
21842 * src/LR0.c: Likewise.
21843 (allocate_itemsets): Use arrays instead of pointers to clarify.
21844
9bfe901c
AD
218452001-11-19 Akim Demaille <akim@epita.fr>
21846
21847 * src/getargs.c (statistics_flag): Replace with...
21848 (trace_flag): New.
21849 (longopts): Accept --trace instead of --statistics.
21850 * src/getargs.h, src/options.c: Adjust.
21851 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
21852 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
21853
97db7bd4
AD
218542001-11-19 Akim Demaille <akim@epita.fr>
21855
cc72668c 21856 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
21857 pointers to clarify the code.
21858 (save_reductions, save_shifts): Factor common parts of alternatives.
21859
2c5f66ed
AD
218602001-11-19 Akim Demaille <akim@epita.fr>
21861
21862 * src/LR0.c (new_state, get_state): Complete TRACE code.
21863 * src/closure.c: Include `reader.h' to get `tags', needed by the
21864 trace code.
21865 Rename the conditional DEBUG as TRACE.
21866 Output consistently TRACEs to stderr, not stdout.
21867 * src/derives.c: Likewise.
21868 * src/reduce.c: (inaccessable_symbols): Using if is better style
21869 than goto.
21870 Use `#if TRACE' instead of `#if 0' for tracing code.
21871
300f275f
AD
218722001-11-19 Akim Demaille <akim@epita.fr>
21873
21874 * src/system.h (LIST_FREE, shortcpy): New.
21875 * src/LR0.c: Use them.
21876 * src/output.c (free_itemsets, free_reductions, free_shifts):
21877 Remove, replaced by LIST_FREE.
21878
f59c437a
AD
218792001-11-19 Akim Demaille <akim@epita.fr>
21880
21881 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
21882 (REDUCTIONS_ALLOC): New.
21883 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
21884 allocation.
21885
6986fd9e
AD
218862001-11-19 Akim Demaille <akim@epita.fr>
21887
21888 * src/LR0.c (new_state): Complete trace code.
21889 * src/nullable.c (set_nullable): Don't translate traces.
21890
4bc30f78
AD
218912001-11-19 Akim Demaille <akim@epita.fr>
21892
21893 * src/print_graph.c (print_core): Better locality of variables.
21894 * src/print.c (print_core): Likewise.
21895
08a946e0
AD
218962001-11-19 Akim Demaille <akim@epita.fr>
21897
21898 * src/vcg.c: You do the output, so you are responsible of the
21899 handling of VCG syntax, in particular: use quotearg.
21900 * src/print_graph.c: Don't.
21901 (print_actions): Don't output the actions as part of the nodes,
21902 since that's the job of the edges.
21903 (print_state): Don't output by hand: fill the node description,
9bfe901c 21904 and ask for its output.
08a946e0 21905
f0473484
AD
219062001-11-19 Akim Demaille <akim@epita.fr>
21907
cc72668c
AD
21908 * src/bison.simple (yyparse): When verbosely reporting an error,
21909 no longer put additional quotes around token names.
f0473484
AD
21910 * tests/calc.at: Adjust.
21911
e41dc700
AD
219122001-11-19 Akim Demaille <akim@epita.fr>
21913
21914 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
21915 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
21916 * src/output.c: Adjust.
21917
652a871c
AD
219182001-11-19 Akim Demaille <akim@epita.fr>
21919
21920 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
21921 (rule_t): this.
21922 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
21923
b2ed6e58
AD
219242001-11-19 Akim Demaille <akim@epita.fr>
21925
21926 * src/gram.h (rule_t): New.
21927 (rule_table): New.
21928 (rrhs, rlhs): Remove, part of state_t.
21929 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
21930 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
21931 * src/reader.c, src/reduce.c: Adjust.
21932
edad7067
AD
219332001-11-19 Akim Demaille <akim@epita.fr>
21934
21935 * src/reader.c (symbols_output): New, extracted from...
21936 (packsymbols): Here.
21937 (reader): Call it.
21938
3feec034
AD
219392001-11-19 Akim Demaille <akim@epita.fr>
21940
21941 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
21942 (maxrhs): this new function.
21943
ddcd5fdf
AD
219442001-11-19 Akim Demaille <akim@epita.fr>
21945
cc72668c 21946 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
21947 Adjust.
21948
bb527fc2
AD
219492001-11-19 Akim Demaille <akim@epita.fr>
21950
cc72668c 21951 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
21952 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21953 * src/lalr.c: Adjust.
21954
a845a697
AD
219552001-11-19 Akim Demaille <akim@epita.fr>
21956
21957 * src/lalr.c (initialize_LA): Only initialize LA. Let...
21958 (set_state_table): handle the `lookaheads' members.
21959
f004bf6a
AD
219602001-11-19 Akim Demaille <akim@epita.fr>
21961
cc72668c
AD
21962 * src/lalr.h (lookaheads): Removed array, whose contents is now
21963 a member of...
f004bf6a
AD
21964 (state_t): this structure.
21965 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21966 Adjust.
21967
de326cc0
AD
219682001-11-19 Akim Demaille <akim@epita.fr>
21969
cc72668c
AD
21970 * src/lalr.h (consistent): Removed array, whose contents is now
21971 a member of...
de326cc0
AD
21972 (state_t): this structure.
21973 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21974 Adjust.
21975
90b4416b
AD
219762001-11-19 Akim Demaille <akim@epita.fr>
21977
cc72668c
AD
21978 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
21979 contents are now members of...
90b4416b
AD
21980 (state_t): this structure.
21981 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21982 Adjust.
21983
9703cc49
AD
219842001-11-19 Akim Demaille <akim@epita.fr>
21985
21986 * src/lalr.h (state_t): New.
21987 (state_table): Be a state_t * instead of a core **.
21988 (accessing_symbol): Remove, part of state_t.
21989 * src/lalr.c: Adjust.
21990 (set_accessing_symbol): Merge into...
21991 (set_state_table): this.
21992 * src/print_graph.c, src/conflicts.c: Adjust.
21993
d803322e
AD
219942001-11-14 Akim Demaille <akim@epita.fr>
21995
21996 * tests/calc.at, tests/output.at, tests/regression.at,
21997 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
21998 now the tests are run in private dirs, therefore AC_CLEANUP and
21999 family can be simplified to 0-ary.
22000 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
22001 use abs. path to find config.h.
22002 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
22003 stderr, there can be way too much random noise.
22004 Instead pass -Werror to GCC and rely on the exit status.
22005 Reported by Wolfram Wagner.
22006
3d76b07d
AD
220072001-11-14 Akim Demaille <akim@epita.fr>
22008
22009 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
22010 defined only if yyoverflow is defined, to avoid `warning: unused
22011 variable `yyvs1''.
22012 Reported by The Test Suite.
22013
09b503c8
AD
220142001-11-14 Akim Demaille <akim@epita.fr>
22015
22016 * src/print.c: Include reduce.h.
22017 Reported by Hans Aberg.
22018
220192001-11-14 Akim Demaille <akim@epita.fr>
22020
22021 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
22022 Revert a previous patch: these are really const.
22023 * src/conflicts.c (conflict_report): Additional useless pair of
22024 braces to pacify GCC's warnings for `if () if () {} else {}'.
22025 * src/lex.c (parse_percent_token): Replace equal_offset with
22026 arg_offset.
22027 arg is const.
22028 Be sure to strdup `arg' when used, since there is no reason for
22029 token_buffer not to change.
22030
0f37a994
AD
220312001-11-14 Akim Demaille <akim@epita.fr>
22032
22033 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
22034 definition.
22035 * src/main.c (main): Use them.
22036 Suggested by Hans Aberg.
22037
d39d93b8
AD
220382001-11-12 Akim Demaille <akim@epita.fr>
22039
22040 * src/system.h (ngettext): Now that we use ngettext, be sure to
22041 provide a default definition when NLS are not used.
22042
9edcd895
AD
220432001-11-12 Akim Demaille <akim@epita.fr>
22044
22045 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
22046 Use @kbd to denote user input.
22047 (Language and Grammar): ANSIfy the example.
22048 Adjust its layout for info/notinfo.
22049 (Location Tracking Calc): Output error messages to stderr.
22050 Output locations in a more GNUtically correct way.
22051 Fix a couple of Englishos.
22052 Adjust @group/@end group pairs.
22053
7da99ede
AD
220542001-11-12 Akim Demaille <akim@epita.fr>
22055
e3aa65c5 22056 %expect was not functioning at all.
7da99ede
AD
22057
22058 * src/conflicts.c (expected_conflicts): Set to -1.
22059 (conflict_report): Use ngettext.
22060 (conflicts_print): Check %expect and make its violation an error.
22061 * doc/bison.texinfo (Expect Decl): Adjust.
22062 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
22063 * tests/regression.at (%expect not enough, %expect right)
22064 (%expect too much): New.
22065
ba9dda1a
AD
220662001-11-12 Akim Demaille <akim@epita.fr>
22067
22068 * tests/regression.at (Conflicts): Rename as...
22069 (Unresolved SR Conflicts): this.
22070 (Solved SR Conflicts): New.
22071
337c5bd1
AD
220722001-11-12 Akim Demaille <akim@epita.fr>
22073
22074 * src/reduce.c (print_results): Rename as...
22075 (reduce_output): This.
22076 Output to OUT, passed as argument, instead of output_obstack.
22077 (dump_grammar): Likewise.
22078 (reduce_free): New.
22079 Also free V1.
22080 (reduce_grammar): No longer call reduce_output, since...
22081 * src/print.c (print_results): do it.
22082 * src/main.c (main): Call reduce_free;
22083
c73a41af
AD
220842001-11-12 Akim Demaille <akim@epita.fr>
22085
22086 * src/conflicts.c (print_reductions): Accept OUT as argument.
22087 Output to it, not to output_obstack.
22088 * src/print.c (print_actions): Adjust.
22089
0df87bb6
AD
220902001-11-12 Akim Demaille <akim@epita.fr>
22091
22092 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
22093 the result instead of using...
22094 (src_total, rrc_total, src_count, rrc_count): Remove.
22095 (any_conflicts): Remove.
22096 (print_conflicts): Split into...
22097 (conflicts_print, conflicts_output): New.
22098 * src/conflicts.h: Adjust.
22099 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 22100 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
22101 * tests/regression.at (Conflicts): New.
22102 Reported by Tom Lane.
22103
e4d3d4de
AD
221042001-11-12 Akim Demaille <akim@epita.fr>
22105
22106 * tests/regression.at (Invalid input): Remove, duplicate with
22107 ``Invalid input: 1''.
22108
6d7d248e
AD
221092001-11-12 Akim Demaille <akim@epita.fr>
22110
22111 * tests/torture.at (AT_DATA_STACK_TORTURE)
22112 (Exploding the Stack Size with Alloca)
22113 (Exploding the Stack Size with Malloc): New.
22114
e9e4c321
AD
221152001-11-12 Akim Demaille <akim@epita.fr>
22116
22117 * src/bison.simple (YYSTACK_REALLOC): New.
22118 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 22119 Reported by Per Allansson.
e9e4c321 22120
5f7e0832
AD
221212001-11-12 Pascal Bart <pascal.bart@epita.fr>
22122
22123 * src/bison.simple: Define type yystype instead of YYSTYPE, and
22124 define CPP macro, which substitute YYSTYPE by yystype.
22125 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
22126 with yyltype/YYLTYPE. This allows inclusion of the generated
22127 header within the parser if the compiler, such as GGC, accepts
22128 multiple equivalent #defines.
22129 From Akim.
22130
e3f1699f
AD
221312001-11-05 Akim Demaille <akim@epita.fr>
22132
22133 * src/reader.c (symbols_output): New, extracted from...
22134 (packsymbols): here.
22135 (reader): Adjust.
22136
65be0866
AD
221372001-11-05 Akim Demaille <akim@epita.fr>
22138
22139 * src/lex.c (parse_percent_token): s/quotearg/quote/.
22140
e4d910bf
AD
221412001-11-05 Akim Demaille <akim@epita.fr>
22142
22143 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
22144 pattern.
22145
951366c1
AD
221462001-11-05 Akim Demaille <akim@epita.fr>
22147
22148 * src/options.h (struct option_table_struct): set_flags is void*.
22149 * src/options.c (longopts): Support `--output' and `%output'.
22150 (usage): Adjust.
22151 * src/lex.h (tok_setopt): Remove, replaced with...
22152 (tok_intopt, tok_stropt): these new guys.
22153 * src/lex.c (getopt.h): Not needed.
22154 (token_buffer, unlexed_token_buffer): Not const.
22155 (percent_table): Promote `-' over `_' in directive names.
22156 Active `%name-prefix', `file-prefix', and `output'.
22157 (parse_percent_token): Accept possible arguments to directives.
22158 Promote `-' over `_' in directive names.
22159
d8988b2f
AD
221602001-11-04 Akim Demaille <akim@epita.fr>
22161
22162 * doc/bison.texinfo (Decl Summary): Split the list into
22163 `directives for grammars' and `directives for bison'.
22164 Sort'em.
22165 Add description of `%name-prefix', `file-prefix', and `output'.
22166 Promote `-' over `_' in directive names.
22167 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
22168 Simplify the description of `--name-prefix'.
22169 Promote `-' over `_' in directive names.
22170 Promote `--output' over `--output-file'.
22171 Fix the description of `--defines'.
22172 * tests/output.at: Exercise %file-prefix and %output.
22173
6468d18e
AD
221742001-11-02 Akim Demaille <akim@epita.fr>
22175
22176 * doc/refcard.tex: Update.
22177
6b7e85b9
AD
221782001-11-02 Akim Demaille <akim@epita.fr>
22179
22180 * src/symtab.h (SUNDEF): New.
22181 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
22182 stand for `uninitialized', instead of 0.
22183 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
22184 * src/lex.c (lex): Adjust.
22185
22186 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
22187 Number it 0.
22188 Let yylex return it instead of a plain 0.
22189 Reported by Dick Streefland.
22190
cd5aafcf
AD
221912001-11-02 Akim Demaille <akim@epita.fr>
22192
22193 * tests/regression.at (Mixing %token styles): New test.
22194
037ca2f1
AD
221952001-11-02 Akim Demaille <akim@epita.fr>
22196
22197 * src/reader.c (parse_thong_decl): Formatting changes.
22198 (token_translations_init): New, extracted from...
22199 (packsymbols): Here.
22200 Adjust.
22201
270a173c
AD
222022001-11-01 Akim Demaille <akim@epita.fr>
22203
22204 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
22205 Check that `9foo.y' produces correct cpp guards.
22206 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
22207 guards.
22208 Reported by Wwp.
22209
561f9a30
AD
222102001-11-01 Akim Demaille <akim@epita.fr>
22211
22212 * tests/regression.at (Invalid input: 2): New.
22213 * src/lex.c (unlexed_token_buffer): New.
22214 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
22215 too.
22216 Reported by Wwp.
22217
f987e9d2
AD
222182001-11-01 Akim Demaille <akim@epita.fr>
22219
22220 * tests/calc.at: Catch up with 1.30.
22221 * configure.in: Bump to 1.49a.
22222 Adjust to newer Autotest.
22223
0846f581
PB
222242001-10-19 Pascal Bart <pascal.bart@epita.fr>
22225
22226 * src/conflicts.c: Move global variables rrc_total and src_total ...
22227 (print_conflicts): here.
22228 * src/output.c (output): Free global variable user_toknums.
22229 * src/lex.c (token_obstack): Become static.
22230
3c1a79b3
AD
222312001-10-18 Akim Demaille <akim@epita.fr>
22232
22233 * tests/atlocal.in (GCC): Add.
22234 * tests/calc.at: s/m4_match/m4_bmatch/.
22235 s/m4_patsubst/m4_bpatsubst/.
22236 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
22237 * configure.in: AC_SUBST(GCC).
22238
5d52e7d0
MA
222392001-10-14 Marc Autret <autret_m@epita.fr>
22240
22241 * src/options.c (create_long_option_table): Fix.
22242
631aa1d3
AD
222432001-10-10 Akim Demaille <akim@epita.fr>
22244
22245 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
22246
f6ec6d13
AD
222472001-10-04 Akim Demaille <akim@epita.fr>
22248
22249 * src/reader.c (parse_union_decl): Push the caracters in
22250 union_obstack, not attrs_obstack.
22251
342b8b6e
AD
222522001-10-04 Akim Demaille <akim@epita.fr>
22253
22254 Merge in the branch 1.29.
22255
22256 * src/reader.c (packsymbols): Use a temporary obstack for
22257 `%%tokendef', since output_stack is already used elsewhere.
22258
22259 2001-10-02 Akim Demaille <akim@epita.fr>
22260
22261 Bump 1.29d.
22262
22263 2001-10-02 Akim Demaille <akim@epita.fr>
22264
22265 Version 1.29c.
22266
22267 2001-10-02 Akim Demaille <akim@epita.fr>
22268
22269 * tests/regression.at (Invalid CPP headers): New.
22270 From Alexander Belopolsky.
22271 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
22272
22273 2001-10-02 Akim Demaille <akim@epita.fr>
22274
22275 * tests/regression.at (Invalid input): New.
22276 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
22277 Reported by Shura.
22278
22279 2001-10-02 Akim Demaille <akim@epita.fr>
22280
22281 * tests/calc.at: Now that --debug works, the tests must be adjusted.
22282
22283 2001-10-02 Akim Demaille <akim@epita.fr>
22284
22285 * src/output.c (output_parser): Assert `skeleton'.
22286 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
22287 systems.
22288 From Shura.
22289
22290 2001-10-01 Marc Autret <autret_m@epita.fr>
22291
22292 * src/lex.h: Echo modifications.
22293 * src/lex.c (unlex): Parameter is now token_t.
22294 From Hans Aberg.
22295
22296 2001-10-01 Marc Autret <autret_m@epita.fr>
22297
22298 * src/main.c: Include lex.h.
22299 From Hans Aberg.
22300
22301 2001-09-29 Akim Demaille <akim@epita.fr>
22302
22303 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
22304
22305 2001-09-28 Akim Demaille <akim@epita.fr>
22306
22307 * tests/testsuite.at: Update to newer Autotest.
22308 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
22309
22310 2001-09-27 Akim Demaille <akim@epita.fr>
22311
22312 Position independent wrapper.
22313
22314 * tests/bison: Remove.
22315 * tests/bison.in: New.
22316 * configure.in: Adjust.
22317
22318 2001-09-27 Paul Eggert <eggert@twinsun.com>
22319
22320 Port quotearg fixes from tar 1.13.24.
22321
22322 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
22323 tm to be declared.
22324 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
22325 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
22326
22327 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
22328 * m4/mbrtowc.m4: New file.
22329 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
22330 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
22331
22332 2001-09-27 Akim Demaille <akim@epita.fr>
22333
22334 Bump to 1.29c.
22335
22336 2001-09-27 Akim Demaille <akim@epita.fr>
22337
22338 Version 1.29b.
22339
22340 2001-09-25 Akim Demaille <akim@epita.fr>
22341
22342 * src/system.h: Include `xalloc.h'.
22343 Remove it from the C files.
22344 * src/files.c (output_files): Free the obstacks.
22345 * src/lex.c (init_lex): Rename as...
22346 (lex_init): this.
22347 (lex_free): New.
22348 * src/main.c (main): Use it.
22349
22350 2001-09-24 Marc Autret <autret_m@epita.fr>
22351
22352 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
22353 to output informations in fout (FILE*).
22354 (open_graph, close_graph): Likewise.
22355 (output_graph, output_edge, output_node): Likewise.
22356 * src/vcg.h: Update function prototypes.
22357 * src/print_graph.c (print_graph): Open output graph file.
22358 (print_actions): Adjust.
22359 * src/files.h: Remove extern declaration.
22360 * src/files.c: Remove graph_obstack declaration.
22361 (open_files): Remove graph_obstack initialization.
22362 (output_files): Remove graph_obstack saving.
22363
22364 2001-09-24 Marc Autret <autret_m@epita.fr>
22365
22366 * src/files.c (compute_output_file_names): Fix.
22367
22368 2001-09-24 Marc Autret <autret_m@epita.fr>,
22369 Akim Demaille <akim@epita.fr>
22370
22371 * src/reader.c (reader): Remove call to free_symtab ().
22372 * src/main.c (main): Call it here.
22373 Include symtab.h.
22374 * src/conflicts.c (initialize_conflicts): Rename as...
22375 (solve_conflicts): this.
22376 * src/print.c (print_core, print_actions, print_state)
22377 (print_grammar): Dump to a file instead a `output_obstack'.
22378 (print_results): Dump `output_obstack', and then proceed with the
22379 FILE *.
22380 * src/files.c (compute_output_file_names, close_files): New.
22381 (output_files): Adjust.
22382 * src/main.c (main): Adjust.
22383
22384 2001-09-23 Marc Autret <autret_m@epita.fr>
22385
22386 * src/files.c (compute_header_macro): Computes header macro name
22387 from spec_defines_file when given.
22388
22389 2001-09-23 Marc Autret <autret_m@epita.fr>
22390
22391 * src/files.c (output_files): Add default extensions.
22392
22393 2001-09-22 Akim Demaille <akim@epita.fr>
22394
22395 * src/conflicts.c (finalize_conflicts): Rename as...
22396 (free_conflicts): this.
22397
22398 2001-09-22 Akim Demaille <akim@epita.fr>
22399
22400 * src/gram.c (gram_free): Rename back as...
22401 (dummy): this.
22402 (output_token_translations): Free `token_translations'.
22403 * src/symtab.c (free_symtab): Free the tag field.
22404
22405 2001-09-22 Akim Demaille <akim@epita.fr>
22406
22407 Remove `translations' as it is always set to true.
22408
22409 * src/gram.h: Adjust.
22410 * src/reader.c (packsymbols, parse_token_decl): Adjust
22411 * src/print.c (print_grammar): Adjust.
22412 * src/output.c (output_token_translations): Adjust.
22413 * src/lex.c (lex): Adjust.
22414 * src/gram.c: Be sure the set pointers to NULL.
22415 (dummy): Rename as...
22416 (gram_free): this.
22417
22418 2001-09-22 Akim Demaille <akim@epita.fr>
22419
22420 * configure.in: Invoke AM_LIB_DMALLOC.
22421 * src/system.h: Use dmalloc.
22422 * src/LR0.c: Be sure to have pointers initialized to NULL.
22423 (allocate_itemsets): Allocate kernel_items only if needed.
22424
22425 2001-09-22 Akim Demaille <akim@epita.fr>
22426
22427 * configure.in: Bump to 1.29b.
22428 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
22429 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
22430 need xmalloc.c in calc.y.
22431 From Pascal Bart.
22432
22433 2001-09-21 Akim Demaille <akim@epita.fr>
22434
22435 Version 1.29a.
22436 * Makefile.maint, config/config.guess, config/config.sub,
22437 * config/missing: Update from masters.
22438 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
22439 upon package.m4.
22440 * configure.in (ALL_LINGUAS): Add `tr'.
22441
22442 2001-09-21 Akim Demaille <akim@epita.fr>
22443
22444 * tests/Makefile.am (package.m4): Move to...
22445 ($(srcdir)/$(TESTSUITE)): here.
22446
22447 2001-09-20 Akim Demaille <akim@epita.fr>
22448
22449 * src/complain.c: No longer try to be standalone: use system.h.
22450 Don't assume __STDC__ is defined to 1. Just test if it is defined.
22451 * src/complain.h: Likewise.
22452 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
22453 Remove the unused variable `n'.
22454 From Albert Chin-A-Young.
22455
22456 2001-09-18 Marc Autret <autret_m@epita.fr>
22457
22458 * doc/bison.1: Update.
22459 * doc/bison.texinfo (Bison Options): Update --defines and --graph
22460 descriptions.
22461 (Option Cross Key): Update.
22462 Add --graph.
22463
22464 2001-09-18 Marc Autret <autret_m@epita.fr>
22465
22466 * tests/regression.at: New test (comment in %union).
22467
22468 2001-09-18 Marc Autret <autret_m@epita.fr>
22469
22470 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
22471 do that.
22472 Reported by Keith Browne.
22473
22474 2001-09-18 Marc Autret <autret_m@epita.fr>
22475
22476 * tests/output.at: Add tests for --defines and --graph.
22477
22478 2001-09-18 Marc Autret <autret_m@epita.fr>
22479
22480 * tests/output.at: Removes tests of %{header,src}_extension features.
22481
22482 2001-09-18 Akim Demaille <akim@epita.fr>
22483
22484 * tests/Makefile.am (package.m4): New.
22485 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
22486 (_AT_CHECK_CALC_ERROR): Likewise.
22487 Factor the `, ' part of verbose error messages.
22488
22489 2001-09-18 Marc Autret <autret_m@epita.fr>
22490
22491 * src/getargs.c (longopts): Declare --defines and --graph as options
22492 with optional arguments.
22493 * src/files.h: Add extern declarations.
22494 * src/files.c (spec_graph_file, spec_defines_file): New.
22495 (output_files): Update.
22496 Remove CPP-outed code.
22497
22498 2001-09-18 Marc Autret <autret_m@epita.fr>
22499
22500 Turn off %{source,header}_extension feature.
22501
22502 * src/files.c (compute_exts_from_gf): Update.
22503 (compute_exts_from_src): Update.
22504 (output_files): CPP-out useless code.
22505 * src/files.h: Remove {header,source}_extension extern declarations.
22506 * src/reader.c (parse_dquoted_param): CPP-out.
22507 (parse_header_extension_decl): Remove.
22508 (parse_source_extension_decl): Remove.
22509 (read_declarations): Remove cases tok_{hdrext,srcext}.
22510 * src/lex.c (percent_table): Remove {header,source}_extension entries.
22511 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
22512
22513 2001-09-10 Akim Demaille <akim@epita.fr>
22514
22515 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
22516 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
22517 (AT_CHECK_OUTPUT): this.
22518 Merely check ls' exit status, its output is useless.
22519
22520 2001-09-10 Akim Demaille <akim@epita.fr>
22521
22522 * tests/calc.at: Use m4_match.
22523 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
22524
22525 2001-09-10 Marc Autret <autret_m@epita.fr>,
22526 Akim Demaille <akim@epita.fr>
22527
22528 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
22529 enum color_e.
22530 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
22531 to `normal'.
22532 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
22533 * src/lex.h: Adjust prototype.
22534 (token_t): Add `tok_undef'.
22535 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
22536 (parse_percent_token): Now returns token_t.
22537 Add default statement in switch.
22538 (lex): Separate `c' as an input variable, from the token_t result
22539 part.
22540 (unlexed): Is a token_t.
22541
22542 2001-09-10 Akim Demaille <akim@epita.fr>
22543
22544 * configure.in: Bump to 1.29a.
22545
22546 2001-09-07 Akim Demaille <akim@epita.fr>
22547
22548 Version 1.29.
22549
22550 2001-08-30 Akim Demaille <akim@epita.fr>
22551
22552 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
22553 * m4/atconfig.m4: Remove.
22554 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
22555 * tests/bison: New.
22556 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
22557 m4_if, m4_patsubst, and m4_regexp.
22558 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
22559 `input' file instead of echo.
22560
22561 2001-08-29 Akim Demaille <akim@epita.fr>
22562
22563 Bump to 1.28e.
22564
22565 2001-08-29 Akim Demaille <akim@epita.fr>
22566
22567 Version 1.28d.
22568
22569 2001-08-29 Paul Eggert <eggert@twinsun.com>
22570
22571 * src/bison.simple (yyparse): Don't take the address of an
22572 item before the start of an array, as that doesn't conform to
22573 the C Standard.
22574
22575 2001-08-29 Robert Anisko <anisko_r@epita.fr>
22576
22577 * doc/bison.texinfo (Location Tracking Calc): New node.
22578
22579 2001-08-29 Paul Eggert <eggert@twinsun.com>
22580
22581 * src/output.c (output): Do not define const, as this now
22582 causes more problems than it cures.
22583
22584 2001-08-29 Akim Demaille <akim@epita.fr>
22585
22586 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
22587 the nodes.
22588 Be sure to tag the `detailmenu'.
22589
22590 2001-08-29 Akim Demaille <akim@epita.fr>
22591
22592 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
22593 download in a tmp dir.
22594
22595 2001-08-28 Marc Autret <autret_m@epita.fr>
22596
22597 * config/depcomp: New file.
22598
22599 2001-08-28 Marc Autret <autret_m@epita.fr>
22600
22601 * doc/bison.1 (mandoc): Adjust.
22602 From Juan Manuel Guerrero.
22603
22604 2001-08-28 Marc Autret <autret_m@epita.fr>
22605
22606 * src/print_graph.c (print_state): Fix.
22607
22608 2001-08-27 Marc Autret <autret_m@epita.fr>
22609
22610 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
22611 char * members.
22612 Echo modifications to the functions prototypes.
22613 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
22614
22615 2001-08-27 Marc Autret <autret_m@epita.fr>
22616
22617 * src/vcg.c: Include `xalloc.h'.
22618 (add_colorentry): New.
22619 (add_classname): New.
22620 (add_infoname): New.
22621 * src/vcg.h: Add new prototypes.
22622
22623 2001-08-27 Akim Demaille <akim@epita.fr>
22624
22625 * Makefile.maint: Sync. again with CVS Autoconf.
22626
22627 2001-08-27 Akim Demaille <akim@epita.fr>
22628
22629 * Makefile.maint: Formatting changes.
22630 (po-update, cvs-update, update): New targets.
22631 (AMTAR): Remove.
22632
22633 2001-08-27 Akim Demaille <akim@epita.fr>
22634
22635 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22636 * Makefile.maint: Sync. with CVS Autoconf.
22637
22638 2001-08-27 Marc Autret <autret_m@epita.fr>
22639
22640 * src/vcg.h (struct infoname_s): New.
22641 (struct colorentry_s): New.
22642 (graph_s): New fields {vertical,horizontal}_order in structure.
22643 Add `infoname' field.
22644 Add `colorentry' field;
22645 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
22646 (G_HORIZONTAL_ORDER): New.
22647 (G_INFONAME): New.
22648 (G_COLORENTRY): New.
22649 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
22650 Add output of `infoname'.
22651 Add output of `colorentry'.
22652
22653 2001-08-27 Marc Autret <autret_m@epita.fr>
22654
22655 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
22656 This one shadowed a global parameter.
22657
22658 2001-08-24 Marc Autret <autret_m@epita.fr>
22659
22660 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
22661 instead of `unsigned'.
22662 (print_state): Do not call obstack_object_size () in obstack_grow ()
22663 to avoid macro variables shadowing.
22664
22665 2001-08-23 Marc Autret <autret_m@epita.fr>
22666
22667 * src/lex.c (percent_table): Typo: s/naem/name/.
22668 Add graph option.
22669 Normalize new options declarations.
22670
22671 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
22672
22673 * tests/suite.at: Exercise %header_extension and %source_extension.
22674
22675 2001-08-16 Marc Autret <autret_m@epita.fr>
22676
22677 * src/reader.c (parse_dquoted_param): New.
22678 (parse_header_extension_decl): Use it.
22679 (parse_source_extension_decl): Likewise.
22680
22681 2001-08-16 Marc Autret <autret_m@epita.fr>
22682
22683 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
22684 (get_xxxx_str): Use assert () instead of complain ().
22685 Remove return invokations in default cases.
22686 (get_decision_str): Modify default behaviour. Remove second argument.
22687 Echo modifications on calls.
22688 (output_graph): Fix.
22689
22690 2001-08-16 Marc Autret <autret_m@epita.fr>
22691
22692 * src/getargs.c (usage): Update with ``-g, --graph''.
22693
22694 2001-08-16 Marc Autret <autret_m@epita.fr>
22695
22696 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
22697 (Option Cross Key): Likewise.
22698 * doc/bison.1: Update.
22699
1c8c2190
PB
227002001-09-25 Pascal Bart <pascal.bart@epita.fr>
22701
22702 * src/output.c (output_master_parser): Don't finish action_obstack.
22703 (output_parser): Don't care about the muscle action, here.
22704 (prepare): Copy the action_obstack in the action muscle.
22705 (output): Free action_obstack.
22706
180d45ba
PB
227072001-09-23 Pascal Bart <pascal.bart@epita.fr>
22708
22709 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
22710 will contain `%union' declaration.
22711 (parse_union_decl): Delete #line directive output.
22712 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
22713 informations about %union.
22714 (parse_union_decl): Copy the union_obstack in the muscle stype.
22715 * src/bison.simple: Add new #line directive.
22716 Add typdef %%stype YYSTYPE.
22717
c51d1a19
PB
227182001-09-23 Pascal Bart <pascal.bart@epita.fr>
22719
22720 * src/bison.simple: Add new `#line' directive.
22721
6f9344da
PB
227222001-09-22 Pascal Bart <pascal.bart@epita.fr>
22723
22724 * src/bison.simple: New `#line' directive.
22725 * src/output.c (output_parser): Support new dynamic muscle input_line.
22726
652def80
MA
227272001-09-22 Marc Autret <autret_m@epita.fr>
22728
22729 * src/output.c (output_master_parser): New.
22730 (output_parser): Be more re-entrant.
22731
25b222fa
MA
227322001-09-21 Marc Autret <autret_m@epita.fr>
22733
22734 * src/reader.c (copy_definition, parse_union_decl): Update and use
22735 `linef' muscle.
22736 (copy_action): Likewise.
22737 Use obstack_1grow ().
22738 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
22739
6bc35ae5
MA
227402001-09-21 Marc Autret <autret_m@epita.fr>
22741
22742 * src/options.c (option_table): Adjust.
22743 * src/lex.c (parse_percent_token): Fix.
22744
c0629aa1
PB
227452001-09-20 Pascal Bart <pascal.bart@epita.fr>
22746
22747 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 22748
82b6d266
PB
227492001-09-20 Pascal Bart <pascal.bart@epita.fr>
22750
22751 * src/lex.c (parse_percent_token): Change type of variable `tx', which
22752 is now an option_table_struct*.
22753 (option_strcmp): New function option_strcmp.
22754 (parse_percent_token): Call option_strcmp.
22755 * src/getargs.c (xalloc.h, options.h): Include it.
22756 (getargs): Call create_long_option_table.
22757 (getargs): Free longopts at the end of the function.
22758 (shortopts): Move in options.c.
22759 * src/options.c (create_long_option_table): New function. Convert
22760 information from option_table to option structure.
22761 * src/reader.c (options.h): Include it.
22762
22763 * src/Makefile.am: Adjust.
22764 * src/options.c (option_table): Create from longopts and percent_table.
22765 * src/getargs.c (longopts): Delete.
22766 * src/lex.c (struct percent_table_struct): Delete.
22767 (percent_table): Delete.
22768 (options.h): Include it.
22769 * src/options.c: Create.
22770 * src/options.h: Create.
22771 Declare enum opt_access_e.
22772 Define struct option_table_struct.
22773
75f5aaea
MA
227742001-09-20 Marc Autret <autret_m@epita.fr>
22775
22776 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
22777 sections of Bison.
22778
f508cb0a
PB
227792001-09-19 Pascal Bart <pascal.bart@epita.fr>
22780
22781 * src/bison.simple: s/%%filename/%%skeleton.
22782 * src/muscle_tab.c (getargs.h): Include it.
22783 (muscle_init): Insert new muscle skeleton.
22784
13105fc1
PB
227852001-09-18 Pascal Bart <pascal.bart@epita.fr>
22786
22787 * src/output.c (output_parser): Delete unused variable actions_dumped.
22788
b0c4483e
PB
227892001-09-07 Pascal Bart <pascal.bart@epita.fr>
22790
22791 * src/output.c (output): Delete call to reader_output_yylsp.
22792 * src/reader.c (reader): Likewise.
ba0fe3c7 22793 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 22794
11d82f03
MA
227952001-09-02 Marc Autret <autret_m@epita.fr>
22796
22797 * src/reader.c: Include muscle_tab.h.
22798 (parse_union_decl): Update.
22799 (parse_macro_decl): Rename parse_muscle_decl.
22800 Update to use renamed functions and variable.
22801 (read_declarations, copy_action, read_additionnal_code, : Updated
22802 with correct variables and functions names.
22803 (packsymbols, reader): Likewise.
342b8b6e 22804
11d82f03 22805 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 22806
11d82f03
MA
22807 * src/output.c: Include muscle_tab.h
22808 In all functions using macro_insert, change by using muscle_insert ().
22809 (macro_obstack): Rename muscle_obstack.
22810 Echo modifications in the whole file.
22811 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
22812 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
22813 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
22814
22815 * src/muscle_tab.h: Update double inclusion macros.
22816 (macro_entry_s): Rename muscle_entry_s.
22817 Update prototypes.
342b8b6e 22818
11d82f03
MA
22819 * src/muscle_tab.c: Include muscle_tab.h.
22820 Rename macro_tabble to muscle_table.
22821 (mhash1, mhash2, mcmp): Use muscle_entry.
22822 (macro_init): Rename muscle_init. Update.
22823 (macro_insert): Rename muscle_insert. Update.
22824 (macro_find): Rename muscle_find. Update.
22825
22826 * src/main.c: Include muscle_tab.h.
22827 (main): Call muscle_init ().
22828 * src/Makefile.am (bison_SOURCES): Echo modifications.
22829
93a37297
MA
228302001-09-02 Marc Autret <autret_m@epita.fr>
22831
f753cd62 22832 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 22833
f753cd62
MA
22834 * src/muscle_tab.c, src/muscle_tab.h: Add files.
22835
228362001-09-02 Marc Autret <autret_m@epita.fr>
22837
22838 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 22839
682d48cd
PB
228402001-09-01 Pascal Bart <pascal.bart@epita.fr>
22841
342b8b6e 22842 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
22843 filename.
22844
087c8fda
MA
228452001-09-01 Marc Autret <autret_m@epita.fr>
22846
22847 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
22848 to an explicit value to activate the feature. We do it here.
22849
dda680cb
PB
228502001-08-31 Pascal Bart <pascal.bart@epita.fr>
22851
22852 * src/output.c (prepare): Delete the `filename' muscule insertion.
22853 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
22854 (parse_union_decl): Likewise.
22855 * src/macrotab.c (macro_init): Initialize filename by infile.
22856
9e644e64
MA
228572001-08-31 Marc Autret <autret_m@epita.fr>
22858
22859 * src/bison.simple (YYLSP_NEEDED): New definition.
22860 * src/output.c (prepare): Add macro insertion of `locations_flag'
22861
17da6427
PB
228622001-08-31 Pascal Bart <pascal.bart@epita.fr>
22863
22864 * src/output.c (prepare): Delete insertion of previous muscles,
22865 and insert the `prefix' muscles.
22866 * src/macrotab.c (macro_init): Likewise.
22867 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 22868 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
22869 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
22870 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 22871 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
22872 name_prefix.
22873
e8cb70b9
PB
228742001-08-31 Pascal Bart <pascal.bart@epita.fr>
22875
22876 * src/main.c (main): Standardize.
22877 * src/output.c (output_table_data, output_parser): Likewise.
22878 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
22879
63c2d5de
MA
228802001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
22881
342b8b6e 22882 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
22883 %%epilogue.
22884 * src/output.c (output): Rename %%declarations to %%prologue.
22885 * src/bison.simple: Echo modifications.
342b8b6e 22886
d8cb5183
MA
228872001-08-31 Marc Autret <autret_m@epita.fr>
22888
22889 * src/reader.c (readgram): CleanUp.
22890 (output_token_defines): Likewise.
22891 (packsymbols): Likewise.
22892 (reader): Likewise.
22893 * src/output.c (output): CPP-out useless code.
22894
6c686258
PB
228952001-08-31 Pascal Bart <pascal.bart@epita.fr>
22896
342b8b6e 22897 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
22898 output_trailers and output_headers.
22899 * src/output.h: Remove obsolete functions prototypes of output_headers
22900 and output_trailers.
22901
8f451ef7
PB
229022001-08-30 Pascal Bart <pascal.bart@epita.fr>
22903
22904 * src/main.c: Include macrotab.h.
342b8b6e 22905 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
22906 Adjust functions prototypes.
22907 * src/macrotab.c (macro_insert): Constify key and value.
22908 (macro_find): Constify key.
22909 (macro_insert): Include 'xalloc.h'
22910 (macro_insert): Use XMALLOC.
22911 (macro_find): Constify return value.
22912 * src/output.c (output_table_data): Rename table to table_data.
22913 (output_parser): Constify macro_key, macro_value.
22914
997b6fd0 229152001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
22916
22917 * src/reader.c (parse_skel_decl): New.
342b8b6e 22918 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
22919 * src/lex.h (token_t): New token `tok_skel'.
22920 * src/lex.c (percent_table): Add skeleton option entry.
22921 Standardize.
22922
ff48177d
MA
229232001-08-29 Marc Autret <autret_m@epita.fr>
22924
22925 * src/bison.simple: Add %%user_code directive at the end.
22926 * src/reader.c (read_additionnal_code): New.
22927 (reader): Use it.
22928 * src/output.c (output_program): Remove.
22929 (output): Update.
22930
b33160bf
MA
229312001-08-28 Marc Autret <autret_m@epita.fr>
22932
22933 * src/output.c (output_actions): Clean up.
4e5caae2 22934 (output_gram): CPP-out useless code.
b33160bf
MA
22935 * src/reader.c (reader): Clean up, CPP-out useless code.
22936
d1a2daf7
PB
229372001-08-28 Pascal Bart <pascal.bart@epita.fr>
22938
342b8b6e 22939 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 22940 directive.
d1a2daf7
PB
22941 * src/bison.simple: Add `%%definitions'.
22942
2b763dfe
MA
229432001-08-28 Marc Autret <autret_m@epita.fr>
22944
22945 * config/depcomp: New file.
22946
f1a87ef6
PE
229472001-08-27 Paul Eggert <eggert@twinsun.com>
22948
22949 * src/bison.simple (yyparse): Don't take the address of an
22950 item before the start of an array, as that doesn't conform to
22951 the C Standard.
22952
82e236e2
RA
229532001-08-27 Robert Anisko <robert.anisko@epita.fr>
22954
f1a87ef6 22955 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
22956 obstack. It was done too late here.
22957
22958 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
22959 completely wrong.
22960 (reader): Initialize the macro obstack here, since we need it to grow
22961 '%define' directives.
22962
22963 * src/reader.h: Declare the macro obstack as extern.
22964
b0cfa28a
RA
229652001-08-27 Robert Anisko <robert.anisko@epita.fr>
22966
22967 * src/output.c (output_parser): Fix. Store single '%' characters in
22968 the output obstack instead of throwing them away.
22969
6fc74234
AD
229702001-08-27 Akim Demaille <akim@epita.fr>
22971
22972 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22973
9c76d118
RA
229742001-08-25 Robert Anisko <robert.anisko@epita.fr>
22975
22976 * lib/Makefile.am: Adjust.
22977
a8289c62
RA
229782001-08-25 Robert Anisko <robert.anisko@epita.fr>
22979
22980 * src/bison.simple: Update and add '%%' directives.
22981
b6610515
RA
229822001-08-25 Robert Anisko <robert.anisko@epita.fr>
22983
22984 * src/reader.c (reader): Remove calls to 'output_headers' and
22985 'output_trailers'. Remove some C output.
22986 (readgram): Disable a piece of code that was writing a default
22987 definition for 'YYSTYPE'.
22988 (reader_output_yylsp): Remove.
22989 (packsymbols): Output token defintions to a macro.
22990 (copy_definition): Disable C output.
6fc74234 22991
b6610515
RA
22992 * src/reader.c (parse_macro_decl): New function used to parse macro
22993 declarations.
22994 (copy_string2): Put the body of copy_string into this new function.
22995 Add a parameter to let the caller choose whether he wants to copy the
22996 string delimiters or not.
22997 (copy_string): Be a simple call to copy_string2 with the last argument
22998 bound to true.
22999 (read_declarations): Add case for macro definition.
23000 (copy_identifier): New.
6fc74234 23001 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
23002 rather than lex.
23003
26f609ff
RA
230042001-08-25 Robert Anisko <robert.anisko@epita.fr>
23005
23006 * src/output.c (prepare): Add prefixed names.
23007 (output_parser): Output semantic actions.
23008 (output_parser): Fix bug on '%%line' directives.
6fc74234 23009
26f609ff
RA
23010 * src/output.c (output_headers): Remove. The C code printed by this
23011 function should now be in the skeletons.
23012 (output_trailers): Remove.
23013 (output): Disable call to 'reader_output_yylsp'.
23014 (output_rule_data): Do not output tables to the table obstack.
23015
23016 * src/output.c: Remove some C dedicated output.
23017 Improve the use of macro and output obstacks.
23018 (output_defines): Remove.
6fc74234 23019
26f609ff
RA
23020 * src/output.c (output_token_translations): Associate 'translate'
23021 table with a macro. No output to the table obstack.
23022 (output_gram): Same for 'rhs' and 'prhs'.
23023 (output_stos): Same for 'stos'.
23024 (output_rule_data): Same for 'r1' and 'r2'.
23025 (token_actions): Same for 'defact'.
23026 (goto_actions): Same for 'defgoto'.
23027 (output_base): Same for 'pact' and 'pgoto'.
23028 (output_table): Same for 'table'.
23029 (output_check): Same for 'check'.
6fc74234 23030
26f609ff
RA
23031 * src/output.c (output_table_data): New function.
23032 (output_short_table): Remove.
23033 (output_short_or_char_table): Remove.
6fc74234 23034
26f609ff
RA
23035 * src/output.c (output_parser): Replace most of the skeleton copy code
23036 with something new. Skeletons are now processed character by character
23037 rather than line by line, and Bison looks for '%%' macros. This is the
23038 first step in making Bison's output process (a lot) more flexible.
23039 (output_parser): Use the macro table.
23040
6f43b113
RA
230412001-08-25 Robert Anisko <robert.anisko@epita.fr>
23042
23043 * src/main.c (main): Initialize the macro table.
23044
dd3127cf
RA
230452001-08-25 Robert Anisko <robert.anisko@epita.fr>
23046
23047 * src/lex.c (percent_table): Add tok_define.
23048 * src/lex.h: Add tok_define.
23049
aa321494
RA
230502001-08-25 Robert Anisko <robert.anisko@epita.fr>
23051
23052 * src/macrotab.c: New file.
23053 * src/macrotab.h: New file.
23054 * src/Makefile.am: Update.
23055
68bd3b6b
RA
230562001-08-25 Robert Anisko <robert.anisko@epita.fr>
23057
23058 * lib/hash.c: New file.
23059 * lib/hash.h: New file.
23060 * lib/Makefile.am: Update.
23061
45f8dd1e
AD
230622001-08-15 Akim Demaille <akim@epita.fr>
23063
23064 Version 1.28c.
23065
40a64a7a 230662001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
23067
23068 * src/reader.c (readgram): Indent output macro YYSTYPE.
23069 (packsymbols): Likewise.
23070 (output_token_defines): Likewise.
23071 * src/files.c: Standardize.
23072 (compute_header_macro): New.
23073 (defines_obstack_save): New. Use compute_header_macro.
23074 (output_files): Update. Use defines_obstack_save.
23075
f9a8293a
AD
230762001-08-15 Akim Demaille <akim@epita.fr>
23077
23078 * doc/bison.texinfo (Table of Symbols): Document
23079 YYSTACK_USE_ALLOCA.
23080
150ca7a7
AD
230812001-08-15 Akim Demaille <akim@epita.fr>
23082
23083 * missing: Update from CVS Automake.
23084 * config/config.guess, config/config.sub, config/texinfo.tex:
23085 Update from gnu.org.
23086
69b5cec4
AD
230872001-08-15 Akim Demaille <akim@epita.fr>
23088
23089 * Makefile.maint: Sync with CVS Autoconf.
23090
f2b5126e
PB
230912001-08-14 Pascal Bart <pascal.bart@epita.fr>
23092
69b5cec4 23093 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
23094 `fdl.texi'.
23095 * doc/fdl.texi: Add to package.
23096
4ecbf796
MA
230972001-08-14 Marc Autret <autret_m@epita.fr>
23098
23099 Turn on %{source,header}_extension features.
23100
69b5cec4 23101 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
23102 source_extension.
23103 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 23104 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
23105 between options.
23106
95fb5662
MA
231072001-08-14 Marc Autret <autret_m@epita.fr>
23108
23109 * src/files.c (compute_base_names): Add extensions computing when
23110 `--file-prefix' used.
23111 Standardize function calls.
23112
78d09da9
MA
231132001-08-13 Marc Autret <autret_m@epita.fr>
23114
69b5cec4 23115 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
23116 defining it (defined but null disables alloca).
23117
5a009f2c
MA
231182001-08-13 Marc Autret <autret_m@epita.fr>
23119
23120 * src/bison.simple (_yy_memcpy): CPP reformat.
23121
1e41465a
PB
231222001-08-13 Pascal Bart <pascal.bart@epita.fr>
23123
23124 * tests/atconfig.in (CPPFLAGS): Fix.
23125
c67a198d
PB
231262001-08-10 Pascal Bart <pascal.bart@epita.fr>
23127
79282c6c 23128 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
23129 `gpl.texi'.
23130 * doc/gpl.texi: Add to package.
23131
09a6de7e
MA
231322001-08-10 Marc Autret <autret_m@epita.fr>
23133
23134 * src/print_graph.h: Fix.
23135 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
23136
b77b9ee0
AD
231372001-08-10 Akim Demaille <akim@epita.fr>
23138
23139 * src/system.h: Provide default declarations for stpcpy, strndup,
23140 and strnlen.
23141
3e259915
MA
231422001-08-10 Robert Anisko <anisko_r@epita.fr>
23143
23144 * doc/bison.texinfo (Locations): Update @$ stuff.
23145
ca96bc2d
MA
231462001-08-09 Robert Anisko <anisko_r@epita.fr>
23147
23148 * src/bison.simple (YYLLOC_DEFAULT): Update.
23149 (yyparse): Adjust.
23150
fdc6758b
MA
231512001-08-08 Marc Autret <autret_m@epita.fr>
23152
b77b9ee0 23153 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
23154 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
23155 Reported by Fabrice Bauzac.
957d4dbf 23156
600cad3b
MA
231572001-08-08 Marc Autret <autret_m@epita.fr>
23158
23159 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
23160 * src/vcg.c (output_node): Fix.
23161 * src/vcg.h: Cleanup.
23162 * src/print_graph.c: Add comments.
b77b9ee0 23163 (node_output_size): New global variable. Simplify the formatting of
600cad3b 23164 the VCG graph output.
b77b9ee0 23165 (print_actions): Unused code is now used. It notifies the final state
600cad3b 23166 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 23167 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
23168 blue.
23169 Get the current node name and node_obstack by argument.
23170 (node_obstack): New variable.
23171 (print_state): Manage node_obstack.
23172 (print_core): Use node_obstack given by argument.
23173 A node is not only computed here but in print_actions also.
23174 (print_graph): CPP out useless code instead of commenting it.
23175
976e528f
AD
231762001-08-07 Pascal Bart <pascal.bart@epita.fr>
23177
23178 * tests/atconfig.in (CPPFLAGS): Fix.
23179
20e8e5ca
AD
231802001-08-07 Akim Demaille <akim@epita.fr>
23181
23182 * src/print_graph.c (quote): New.
23183 (print_core): Use it.
23184
957d4dbf 231852001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 23186
3e3da797
AD
23187 * src/vcg.c (complain.h): Include it.
23188 Unepitaize `return' invocations.
c4b66126 23189 [NDEBUG] (main): Remove.
79282c6c 23190 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
23191 * src/files.c (open_files): Initialize graph_obstack.
23192 * src/print_graph.c (print_actions): CPP out useless code.
23193 (print_core): Don't output the last `\n' in labels.
23194 Use `quote'.
23195 * src/files.c (output_files): Output the VCG file.
23196 * src/main.c (main): Invoke print_graph ();
3e3da797 23197
957d4dbf 231982001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
23199
23200 Automaton VCG graph output.
23201 Using option ``-g'' or long option ``--graph'', you can generate
23202 a gram_filename.vcg file containing a VCG description of the LALR (1)
23203 automaton of your grammar.
23204
23205 * src/main.c: Call to print_graph() function.
23206 * src/getargs.h: Update.
23207 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
23208 (graph_flag): New flag.
23209 (longopts): Update.
23210 (getargs): Add case `g'.
23211 * src/files.c (graph_obstack): New obstack struct.
23212 (open_files): Initialize new obstack.
23213 (output_files): Saves graph_obstack if required.
23214 * src/files.h (graph_obstack): New extern declaration.
23215 * src/Makefile.am: Add new source files.
23216
927c1557 232172001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
23218
23219 * src/print_graph.c, src/print_graph.h (graph): New.
23220 * src/vcg.h: New file.
23221 * src/vcg.c: New file, VCG graph handling.
23222
7333d403
AD
232232001-08-06 Marc Autret <autret_m@epita.fr>
23224
23225 Add of %source_extension and %header_extension which specify
23226 the source or/and the header output file extension.
23227
23228 * src/files.c (compute_base_names): Remove initialisation of
23229 src_extension and header_extension.
23230 (compute_exts_from_gf): Update.
23231 (compute_exts_from_src): Update.
23232 (output_files): Update.
23233 * src/reader.c (parse_header_extension_decl): New.
23234 (parse_source_extension_decl): New.
23235 (read_declarations): New case statements for the new tokens.
23236 * src/lex.c (percent_table): Add entries for %source_extension
23237 and %header_extension.
23238 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
23239
84163231
AD
232402001-08-06 Marc Autret <autret_m@epita.fr>
23241
23242 * configure.in: Bump to 1.28c.
23243 * doc/bison.texinfo: Texinfo thingies.
23244
8303fc42
AD
232452001-08-04 Pascal Bart <pascal.bart@epita.fr>
23246
23247 * tests/atconfig.in (CPPFLAGS): Add.
23248 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
23249
70a84437
AD
232502001-08-03 Akim Demaille <akim@epita.fr>
23251
23252 Version 1.28b.
23253
2ce10144
AD
232542001-08-03 Akim Demaille <akim@epita.fr>
23255
23256 * tests/Makefile.am (check-local): Ship testsuite.
23257 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
23258 Include `string.h'.
23259
1e3e4bc1
AD
232602001-08-03 Akim Demaille <akim@epita.fr>
23261
23262 * configure.in: Try using -Wformat when compiling.
23263
42b45b7f
AD
232642001-08-03 Akim Demaille <akim@epita.fr>
23265
23266 * configure.in: Bump to 1.28b.
23267
8f13fe33
AD
232682001-08-03 Akim Demaille <akim@epita.fr>
23269
23270 * src/complain.c: Adjust strerror_r portability issues.
23271
b37ba92c
AD
232722001-08-03 Akim Demaille <akim@epita.fr>
23273
23274 Version 1.28a.
23275
b0ce6046
AD
232762001-08-03 Akim Demaille <akim@epita.fr>
23277
23278 * src/getargs.c, src/getarg.h (skeleton)): Constify.
23279 * src/lex.c (literalchar): Avoid name clashes on `buf'.
23280 * src/getargs.c: Include complain.h.
23281 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
23282 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
23283
d01c415b
AD
232842001-08-03 Akim Demaille <akim@epita.fr>
23285
23286 * src/reader.c (readgram): Display hidden chars in error messages.
23287
459dd1a6
AD
232882001-08-03 Akim Demaille <akim@epita.fr>
23289
23290 Update to gettext 0.10.39.
23291
53b74c0c
AD
232922001-08-03 Akim Demaille <akim@epita.fr>
23293
23294 * lib/strspn.c: New.
23295
234a3be3
AD
232962001-08-01 Marc Autret <autret_m@epita.fr>
23297
23298 * doc/bison.texinfo: Update.
23299 * doc/bison.1 (mandoc): Update.
23300 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
23301 * src/files.c: Support output files extensions computing.
23302 (src_extension): New static variable.
23303 (header_extension): New static variable.
23304 (tr): New function.
23305 (get_extension_index): New function, gets the index of an extension
23306 filename in a string.
23307 (compute_exts_from_gf): New function, computes extensions from the
23308 grammar file extension.
23309 (compute_exts_from_src): New functions, computes extensions from the
23310 C source file extension, file given by ``-o'' option.
23311 (compute_base_names): Update.
23312 (output_files): Update.
23313
847bf1f5
AD
233142001-08-01 Robert Anisko <anisko_r@epita.fr>
23315
d995fee7 23316 * doc/bison.texi: Document @$.
847bf1f5
AD
23317 (Locations): New section.
23318
d074a105
AD
233192001-07-18 Akim Demaille <akim@epita.fr>
23320
23321 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
23322 * config/prev-version.txt, config/move-if-change: New.
23323 * Makefile.am: Adjust.
23324
3419715d
AD
233252001-07-08 Pascal Bart <pascal.bart@epita.fr>
23326
23327 * src/bison.simple (yyparse): Suppress warning `comparaison
23328 between signed and unsigned'.
23329
62ab6972
AD
233302001-07-05 Pascal Bart <pascal.bart@epita.fr>
23331
23332 * src/getargs.h (raw_flag): Remove.
23333 * src/getargs.c: Die on `-r'/`--raw'.
23334 * src/lex.c (parse_percent_token): Die on `%raw'.
23335 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
23336 * tests/calc.at: Suppress test with option `--raw'.
23337
1e24cc5b
AD
233382001-07-14 Akim Demaille <akim@epita.fr>
23339
23340 * config/: New.
23341 * configure.in: Require Autoconf 2.50.
23342 Update to gettext 0.10.38.
23343
32dfccf8
AD
233442001-03-16 Akim Demaille <akim@epita.fr>
23345
23346 * doc/bison.texinfo: ANSIfy the examples.
23347
cd5bd6ac
AD
233482001-03-16 Akim Demaille <akim@epita.fr>
23349
23350 * getargs.c (skeleton): New variable.
23351 (longopts): --skeleton is a new option.
23352 (shortopts, getargs): -S is a new option.
23353 * getargs.h: Declare skeleton.
23354 * output.c (output_parser): Use it.
23355
5141b016
AD
233562001-03-16 Akim Demaille <akim@epita.fr>
23357
23358 * m4/strerror_r.m4: New.
23359 * m4/error.m4: Run AC_FUNC_STRERROR_R.
23360 * lib/error.h, lib/error.c: Update.
23361
447992b9
AD
233622001-03-16 Akim Demaille <akim@epita.fr>
23363
23364 * src/getargs.c (longopts): Clean up.
23365
274d42ce
AD
233662001-02-21 Akim Demaille <akim@epita.fr>
23367
23368 * src/reader.c (gensym): `gensym_count' is your own.
23369 Use a static buf to create the symbol name, as token_buffer is no
23370 longer a buffer.
23371
22c821f3
AD
233722001-02-08 Akim Demaille <akim@epita.fr>
23373
23374 * src/conflicts.c (conflict_report): Be sure not to append to res
23375 between two calls, which could happen if both first sprintf were
23376 skipped, but not the first cp += strlen.
23377
18569462
AD
233782001-02-08 Akim Demaille <akim@epita.fr>
23379
23380 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
23381 New, from fileutils 4.0.37.
23382 * configure.in: Require Autoconf 2.49c. I took some time before
23383 making this decision. This is the only way out for portability
23384 issues in Bison, it would mean way too much duplicate effort to
23385 import in Bison features implemented in 2.49c since 2.13.
23386 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
23387
0d8f3c8a
AD
233882001-02-02 Akim Demaille <akim@epita.fr>
23389
23390 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 23391 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 23392
f17bcd1f
AD
233932001-01-19 Akim Demaille <akim@epita.fr>
23394
23395 Get rid of the ad hoc handling of token_buffer in the scanner: use
23396 the obstacks.
23397
23398 * src/lex.c (token_obstack): New.
23399 (init_lex): Initialize it. No longer call...
23400 (grow_token_buffer): this. Remove it.
23401 Adjust all the places which used it to use the obstack.
23402
511e79b3
AD
234032001-01-19 Akim Demaille <akim@epita.fr>
23404
23405 * src/lex.h: Rename all the tokens:
23406 s/\bENDFILE\b/tok_eof/g;
23407 s/\bIDENTIFIER\b/tok_identifier/g;
23408 etc.
23409 Let them be enums, not #define, to ease debugging.
23410 Adjust all the code.
23411
0d6508ef
AD
234122001-01-18 Akim Demaille <akim@epita.fr>
23413
23414 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
23415 * src/lex.c (maxtoken, grow_token_buffer): Static.
23416
6deb4447
AD
234172001-01-18 Akim Demaille <akim@epita.fr>
23418
23419 Since we now use obstacks, more % directives can be enabled.
23420
23421 * src/lex.c (percent_table): Also accept `%yacc',
23422 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
23423 `%debug'.
23424 Handle the actions for `%semantic_parser' and `%pure_parser' here,
23425 instead of returning a token.
23426 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
23427 * src/reader.c (read_declarations): Adjust.
23428 * src/files.c (open_files): Don't call `compute_base_names', don't
23429 compute `attrsfile' since they depend upon data which might be
23430 *in* the input file now.
23431 (output_files): Do it here.
23432 * src/output.c (output_headers): Document the fact that this patch
23433 introduces a guaranteed SEGV for semantic parsers.
23434 * doc/bison.texinfo: Document them.
23435 * tests/suite.at: Exercise these %options.
23436
ff4423cc
AD
234372000-12-20 Akim Demaille <akim@epita.fr>
23438
23439 Also handle the output file (--verbose) with obstacks.
23440
23441 * files.c (foutput): Remove.
23442 (output_obstack): New.
23443 Adjust all dependencies.
23444 * src/conflicts.c: Return a string.
23445 * src/system.h (obstack_grow_string): Rename as...
23446 (obstack_sgrow): this. Be ready to work with non literals.
23447 (obstack_fgrow4): New.
23448
956dba3a
AD
234492000-12-20 Akim Demaille <akim@epita.fr>
23450
23451 * src/files.c (open_files): Fix the computation of short_base_name
23452 in the case of `-o foo.tab.c'.
23453
337bab46
AD
234542000-12-20 Akim Demaille <akim@epita.fr>
23455
23456 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
23457 (copy_dollar): Now that everything uses obstacks, get rid of the
23458 FILE * parameters.
23459
5d3214b8
AD
234602000-12-20 Akim Demaille <akim@epita.fr>
23461
23462 * src/files.c (open_files): Actually the `.output' file is based
23463 on the short_base_name, not base_name.
23464 * tests/suite.at (Checking output file names): Adjust.
23465
29092a57
AD
234662000-12-20 Akim Demaille <akim@epita.fr>
23467
23468 * src/bison.s1: Remove, we now use directly...
23469 * src/bison.simple: this.
23470 * src/Makefile.am: Use pkgdata instead of data.
23471
ea5607fd
AD
234722000-12-20 Akim Demaille <akim@epita.fr>
23473
23474 * src/files.c (guard_obstack): New.
23475 (open_files): Initialize it.
23476 (output_files): Dump it...
23477 * src/files.h: Export it.
23478 * src/reader.c (copy_guard): Use it.
23479
27110317
AD
234802000-12-19 Akim Demaille <akim@epita.fr>
23481
23482 * src/files.c (outfile, defsfile, actfile): Removed as global
23483 vars.
23484 (open_files): Don't compute them.
23485 (output_files): Adjust.
23486 (base_name, short_base_name): Be global.
23487 Adjust dependencies.
23488
19c50364
AD
234892000-12-19 Akim Demaille <akim@epita.fr>
23490
23491 * src/files.c (strsuffix): New.
23492 (stringappend): Be just like strcat but allocate.
23493 (base_names): Eve out from open_files.
23494 Try to simplify the rather hairy computation of base_name and
23495 short_base_name.
23496 (open_files): Use it.
23497 * tests/suite.at (Checking output file names): New test.
23498
573c1d9f
AD
234992000-12-19 Akim Demaille <akim@epita.fr>
23500
23501 * src/system.h (obstack_grow_literal_string): Rename as...
23502 (obstack_grow_string): this.
23503 * src/output.c (output_parser): Recognize `%% actions' instead of
23504 `$'.
23505 * src/bison.s1: s/$/%% actions/.
23506 * src/bison.hairy: Likewise.
23507
ef7ddedd
AD
235082000-12-19 Akim Demaille <akim@epita.fr>
23509
23510 * src/output.c (output_parser): Compute the `#line' lines when
23511 there are.
23512 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
23513 Suggested by Hans Aberg.
23514
ff61dabd
AD
235152000-12-19 Akim Demaille <akim@epita.fr>
23516
23517 Let the handling of the skeleton files be local to the procedures
23518 that use it.
23519
23520 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
23521 longer static.
23522 (fparser, open_extra_files): Remove.
23523 (open_files, output_files): Don't take care of fparser.
23524 * src/files.h: Adjust.
23525 * src/output.c (output_parser): Open and close the file to the
23526 skeleton.
23527 * src/reader.c (read_declarations): When %semantic_parser, open
23528 fguard.
23529
55b96341
AD
235302000-12-19 Akim Demaille <akim@epita.fr>
23531
23532 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
23533 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
23534
358c15b7
AD
235352000-12-19 Akim Demaille <akim@epita.fr>
23536
23537 * src/files.c (open_files): Yipee! We no longer need all the code
23538 looking for `/tmp' since we have no tmp file.
23539
7de3329e
AD
235402000-12-19 Akim Demaille <akim@epita.fr>
23541
23542 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
23543 New macros.
23544 * src/files.c (open_files): Less dependency on MSDOS etc.
23545
3abcd459
AD
235462000-12-14 Akim Demaille <akim@epita.fr>
23547
23548 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
23549 Provide a default definition.
23550 Use it when executing the default @ action.
23551 * src/reader.c (reader_output_yylsp): No longer include
23552 `timestamp' and `text' in the default YYLTYPE.
23553
2a91a95e
AD
235542000-12-12 Akim Demaille <akim@epita.fr>
23555
23556 * src/reader.c (copy_definition, parse_union_decl, copy_action)
23557 (copy_guard): Quote the file names.
23558 Reported by Laurent Mascherpa.
23559
14d3eb9b
AD
235602000-12-12 Akim Demaille <akim@epita.fr>
23561
23562 * src/output.c (output_headers, output_program, output): Be sure
23563 to escape special characters when outputting filenames.
23564 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
23565 (output_headers): Don't depend on them, Use ACTSTR.
23566
d7045ec6
AD
235672000-11-17 Akim Demaille <akim@epita.fr>
23568
23569 * lib/obstack.h: Formatting changes.
23570 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
23571 prevents type checking.
23572 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
23573 cast the value to (void *): assigning a `foo *' to a `void *'
23574 variable is valid.
23575 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
23576 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
23577 append characters.
23578
6fd54b73
AD
235792000-11-17 Akim Demaille <akim@epita.fr>
23580
23581 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
23582 as...
23583 (suite.m4, regression.m4, calc.m4): these.
23584 * tests/atgeneral.m4: Update from CVS Autoconf.
23585
4c50eae6
AD
235862000-11-17 Akim Demaille <akim@epita.fr>
23587
23588 * tests/regression.m4 (%union and --defines): New test,
23589 demonstrating a current bug in the obstack implementation.
23590
a35f64ea
AD
235912000-11-17 Akim Demaille <akim@epita.fr>
23592
23593 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
23594 macros.
23595 Use them to declare the variables which are global or local to
23596 `yyparse'.
23597
7de23534
AD
235982000-11-17 Akim Demaille <akim@epita.fr>
23599
23600 * acconfig.h: Remove, no longer used.
23601
aa7815f5
AD
236022000-11-07 Akim Demaille <akim@epita.fr>
23603
23604 * src: s/Copyright (C)/Copyright/g.
23605
5af1f549
AD
236062000-11-07 Akim Demaille <akim@epita.fr>
23607
23608 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
23609 defining.
23610 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
23611
553e2b22
AD
236122000-11-07 Akim Demaille <akim@epita.fr>
23613
23614 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
23615 Merge in a single CPP if/else.
23616
8a4f41d6
AD
236172000-11-07 Akim Demaille <akim@epita.fr>
23618
23619 * src/output.c (output): Remove useless variables.
23620 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
23621 argument `data' for consistency with the prototypes.
23622 Qualify it `const'.
23623 (obstack_copy, obstack_copy0): Rename the second argument as
23624 `address' for consistency. Qualify it `const'.
23625 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
23626 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
23627 `const' their input argument (`data' or `address').
23628 Adjust the corresponding macros to include `const' in casts.
23629
095a3fb5
AD
236302000-11-03 Akim Demaille <akim@epita.fr>
23631
23632 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
23633 s/PFILE1/BISON_HAIRY/.
23634 Adjust dependencies.
23635
d1cdce7c
AD
236362000-11-03 Akim Demaille <akim@epita.fr>
23637
090c5ebf 23638 For some reason, this was not applied.
d1cdce7c
AD
23639
23640 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23641 `unlink': it's no longer used.
23642
9311529b
AD
236432000-11-03 Akim Demaille <akim@epita.fr>
23644
23645 * src/files.c (skeleton_find): New function, eved out of...
23646 (open_files, open_extra_files): here.
23647
d8880f69
AD
236482000-11-03 Akim Demaille <akim@epita.fr>
23649
23650 Don't use `atexit'.
23651
23652 * src/files.c (obstack_save): New function.
23653 (done): Rename as...
23654 (output_files): this.
23655 Use `obstack_save'.
23656 * src/main.c (main): Don't use `atexit' to register `done', since
23657 it no longer has to remove tmp files, just call `output_files'
23658 when there are no errors.
23659
0dbb648e
AD
236602000-11-02 Akim Demaille <akim@epita.fr>
23661
23662 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23663 `unlink': it's no longer used.
23664 * src/files.h: Formatting changes.
23665
896fe5c1
AD
236662000-11-02 Akim Demaille <akim@epita.fr>
23667
23668 Remove the last uses of mktemp and unlink/delete.
23669
23670 * src/files.c (fdefines, ftable): Removed.
23671 (defines_ostack, table_obstack): New.
23672 Adjust dependencies of the former into uses of the latter.
23673 * src/output.c (output_short_or_char_table, output_short_table):
23674 Convert to using obstacks.
23675 * src/reader.c (copy_comment2): Accept one FILE * and two
23676 obstacks.
23677 (output_token_defines, reader_output_yylsp): Use obstacks.
23678 * src/system.h (obstack_fgrow3): New.
1f65350a 23679 * po/POTFILES.in: Adjust.
896fe5c1 23680
dd60faec
AD
236812000-11-01 Akim Demaille <akim@epita.fr>
23682
23683 Change each use of `fattrs' into a use of `attrs_obstack'.
23684
23685 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
23686 * src/files.c (fattrs): Remove.
23687 (attrs_obstack): New.
23688 Adjust all dependencies.
23689 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
23690
8c7ebe49
AD
236912000-11-01 Akim Demaille <akim@epita.fr>
23692
23693 Introduce obstacks.
23694 Change each use of `faction' into a use of `action_obstack'.
23695
23696 * lib/obstack.h, lib/obstack.c: New files.
23697 * src/files.c (faction): Remove.
23698 (action_obstack): New.
23699 Adjust all dependencies.
23700
77aee789
AD
237012000-10-20 Akim Demaille <akim@epita.fr>
23702
23703 * lib/quote.h (PARAMS): New macro. Use it.
23704
43591cec
AD
237052000-10-16 Akim Demaille <akim@epita.fr>
23706
23707 * src/output.c (output_short_or_char_table): New function.
23708 (output_short_table, output_token_translations): Use it.
23709 (goto_actions): Use output_short_table.
23710
1e9798d5
AD
237112000-10-16 Akim Demaille <akim@epita.fr>
23712
23713 * src/symtab.c (bucket_new): New function.
23714 (getsym): Use it.
23715
23716 * src/output.c (output_short_table): New argument to display the
23717 comment associated with the table.
23718 Adjust dependencies.
23719 (output_gram): Use it.
23720 (output_rule_data): Nicer output layout for YYTNAME.
23721
f282676b
AD
237222000-10-16 Akim Demaille <akim@epita.fr>
23723
23724 * src/lex.c (read_typename): New function.
23725 (lex): Use it.
23726 * src/reader.c (copy_dollar): Likewise.
23727
550a72a3
AD
237282000-10-16 Akim Demaille <akim@epita.fr>
23729
23730 * src/reader.c (copy_comment2): Expect the input stream to be on
23731 the `/' which is suspected to open a comment, instead of being
23732 called after `//' or `/*' was read.
23733 (copy_comment, copy_definition, parse_union_decl, copy_action)
23734 (copy_guard): Adjust.
23735
131e2fef
AD
237362000-10-16 Akim Demaille <akim@epita.fr>
23737
23738 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
23739 `read_signed_integer'.
23740
79282c5a
AD
237412000-10-16 Akim Demaille <akim@epita.fr>
23742
23743 * src/reader.c (copy_dollar): New function.
23744 (copy_guard, copy_action): Use it.
23745
ff4a34be
AD
237462000-10-16 Akim Demaille <akim@epita.fr>
23747
23748 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
23749 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
23750 New files, from Fileutils 4.0.27.
23751 * src/main.c (printable_version): Remove.
23752 * src/lex.c, src/reader.c: Use `quote'.
23753
237542000-10-04 Akim Demaille <akim@epita.fr>
23755
23756 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
23757
14ded682
AD
237582000-10-04 Akim Demaille <akim@epita.fr>
23759
23760 * doc/bison.texinfo: Various typos spotted by Neil Booth.
23761
8e03724b
AD
237622000-10-04 Akim Demaille <akim@epita.fr>
23763
23764 When a literal string is used to define two different tokens,
23765 `bison -v' segfaults.
23766 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
23767
23768 * tests/regression.m4: New file.
23769 Include the core of the sample provided by Piotr Gackiewicz.
23770 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
23771 properly.
23772
a9e64249
AD
237732000-10-04 Akim Demaille <akim@epita.fr>
23774
23775 * src/reader.c (parse_expect_decl): Keep `count' within the size
23776 of `buffer'.
23777 From Neil Booth.
23778
da9abf43
AD
237792000-10-02 Paul Eggert <eggert@twinsun.com>
23780
23781 * bison.s1 (yyparse): Assign the default value
23782 unconditionally, to avoid a GCC warning and make the parser a
23783 tad smaller.
23784
c33638bb
AD
237852000-10-02 Akim Demaille <akim@epita.fr>
23786
23787 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
23788 options.
23789
444c570a
AD
237902000-10-02 Akim Demaille <akim@epita.fr>
23791
23792 * src/derives.c, src/print.c, src/reduce.c: To ease the
23793 translation, move some `\n' out of the translated strings.
23794
89cab50d
AD
237952000-10-02 Akim Demaille <akim@epita.fr>
23796
23797 The location tracking mechanism is precious for parse error
23798 messages. Nevertheless, it is enabled only when `@n' is used in
23799 the grammar, which is a different issue (you can use it in error
23800 message, but not in the grammar per se). Therefore, there should
23801 be another means to enable it.
23802
23803 * src/getargs.c (getargs): Support `--locations'.
23804 (usage): Report it.
23805 * src/getargs.h (locationsflag): Export it.
23806 * src/lex.c (percent_table): Support `%locations'.
23807 * src/reader.c (yylsp_needed): Remove this variable, now replaced
23808 with `locationsflag'.
23809 * doc/bison.texinfo: Document `--locations' and `%locations'.
23810 Sort the options.
23811 * tests/calc.m4: Test it.
23812
23813 For regularity of the names, replace each
23814 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
23815 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
23816 In addition replace each `flag' with `_flag'.
23817
d6c2cba0
AD
238182000-10-02 Akim Demaille <akim@epita.fr>
23819
23820 Also test parse error messages, including with YYERROR_VERBOSE.
23821
23822 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
23823 associative).
23824 Use it to check the computations.
23825 Use it to check `nonassoc' is honored.
23826 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
23827 `--yyerror-verbose'.
23828 (_AT_CHECK_CALC): Adjust to this option.
23829 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
23830
5a35a6cb
AD
238312000-10-02 Akim Demaille <akim@epita.fr>
23832
23833 Test also `--verbose', `--defines' and `--name-prefix'. Testing
23834 the latter demonstrates a flaw in the handling of non debugging
23835 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
23836 was used in order to simplify:
23837
23838 #if YYDEBUG
23839 if (yydebug)
23840 {
23841 ...
23842 }
23843 #endif
23844
23845 into
23846
23847 if (yydebug)
23848 {
23849 ...
23850 }
23851
23852 unfortunately this leads to a CPP conflict when
23853 `--name-prefix=foo' is used since it produces `#define yydebug
23854 foodebug'.
23855
23856 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
23857 (YYDPRINTF): New macro.
23858 Spread its use.
23859 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
23860 the bison options.
23861 Also test `--verbose', `--defines' and `--name-prefix'.
23862
71da9eea
AD
238632000-10-02 Akim Demaille <akim@epita.fr>
23864
23865 Improve the readability of the produced parsers.
23866
23867 * src/bison.s1: Formatting changes.
23868 Improve the comment related to the `$' mark.
23869 (yydefault): Don't fall through to `yyresume': `goto' there.
23870 * src/output.c (output_parser): When the `$' is met, skip the end
23871 of its line.
23872 New variable, `number_of_dollar_signs', to check there's exactly
23873 one `$' in the parser skeleton.
23874
95e36146
AD
238752000-10-02 Akim Demaille <akim@epita.fr>
23876
23877 * lib/xstrdup.c: New file, from the fileutils.
23878 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
23879 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
23880 instead of strlen + xmalloc + strcpy.
23881 * src/symtab.c (copys): Remove, use xstrdup instead.
23882
d7020c20
AD
238832000-10-02 Akim Demaille <akim@epita.fr>
23884
23885 * src/gram.h (associativity): New enum type which replaces the
23886 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
23887 `right_assoc', `left_assoc' and `non_assoc'.
23888 Adjust all dependencies.
23889 * src/reader.c: Formatting changes.
23890 (LTYPESTR): Don't define it, use it as a literal in
23891 `reader_output_yylsp'.
23892 * src/symtab.h (symbol_class): New enum type which replaces the
23893 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
23894 `sunknown', `stoken and `snterm'.
23895
1916f98e
AD
238962000-10-02 Akim Demaille <akim@epita.fr>
23897
23898 * src/getargs.c (fixed_outfiles): Rename as...
23899 (yaccflag): for consistency and accuracy.
23900 Adjust dependencies.
23901
d7913476
AD
239022000-10-02 Akim Demaille <akim@epita.fr>
23903
23904 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
23905 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
23906 difficult and introduced a lot of core dump. It turns out that
23907 Bison used an implementation of `xmalloc' based on `calloc', and
23908 at various places it does depend upon the initialization to 0. I
23909 have not tried to isolate the pertinent places, and all the former
23910 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
23911 someone should address this issue.
23912
23913 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
23914 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
23915 files.
23916 Adjust dependencies.
23917 * src/warshall.h: New file.
23918 Propagate.
23919
340ef489
AD
239202000-10-02 Akim Demaille <akim@epita.fr>
23921
23922 Various anti-`extern in *.c' changes.
23923
23924 * src/system.h: Include `assert.h'.
23925
b2ca4022
AD
239262000-10-02 Akim Demaille <akim@epita.fr>
23927
23928 * src/state.h (nstates, final_state, first_state, first_shift)
23929 (first_reduction): Move their exportation from here...
23930 * src/LR0.h: to here.
23931 Adjust dependencies.
23932 * src/getargs.c (statisticsflag): New variable.
23933 Add support for `--statistics'.
23934 Adjust dependencies.
23935
23936 Remove a lot of now useless `extern' statements in most files.
23937
403b315b
AD
239382000-10-02 Akim Demaille <akim@epita.fr>
23939
23940 * src/LR0.h: New file.
23941 Propagate its use.
23942
07a58c13
AD
239432000-10-02 Akim Demaille <akim@epita.fr>
23944
23945 * src/print.h: New file.
23946 Propagate its use.
23947 * src/print.c: Formatting and ordering changes.
23948 (verbose, terse): Replace with...
23949 (print_results): this new function.
23950 Adjust dependencies.
23951
0619caf0
AD
239522000-10-02 Akim Demaille <akim@epita.fr>
23953
23954 * src/conflicts.c (conflict_report): New function.
23955 (conflict_log, verbose_conflict_log): Replace with...
23956 (print_conflicts): this function.
23957 Adjust dependencies.
23958 * src/conflicts.h: New file.
23959 Propagate its inclusion.
23960
3519ec76
AD
239612000-10-02 Akim Demaille <akim@epita.fr>
23962
23963 * src/nullable.h: New file.
23964 Propagate its inclusion.
23965 * src/nullable.c: Formatting changes.
23966
015acc48
AD
239672000-10-02 Akim Demaille <akim@epita.fr>
23968
23969 * src/reduce.h: New file.
23970 Propagate its inclusion.
23971 * src/reduce.c: Topological sort and other formatting changes.
23972 (bool, TRUE, FALSE): Move their definition to...
23973 * src/system.h: here.
23974
8963a27b
AD
239752000-10-02 Akim Demaille <akim@epita.fr>
23976
23977 * src/files.c: Formatting changes.
23978 (tryopen, tryclose, openfiles): Rename as...
23979 (xfopen, xfclose, open_files): this.
23980 (stringappend): static.
23981 * src/files.h: Complete the list of exported symbols.
23982 Propagate its use.
23983
a70083a3
AD
239842000-10-02 Akim Demaille <akim@epita.fr>
23985
23986 * src/reader.h: New file.
23987 Propagate its use instead of tedious list of `extern' and
23988 prototypes.
23989 * src/reader.c: Formatting changes, topological sort,
23990 s/register//.
23991
abadc117
AD
239922000-10-02 Akim Demaille <akim@epita.fr>
23993
23994 * src/lex.h: Prototype `lex.c' exported functions.
23995 * src/reader.c: Adjust.
23996 * src/lex.c: Formatting changes.
23997 (safegetc): Rename as...
23998 (xgetc): this.
23999
720d742f
AD
240002000-10-02 Akim Demaille <akim@epita.fr>
24001
24002 * src/lalr.h: New file.
24003 Propagate its inclusion instead of prototypes and `extern'.
24004 * src/lalr.c: Formatting changes, topological sorting etc.
24005
f2acea59
AD
240062000-10-02 Akim Demaille <akim@epita.fr>
24007
24008 * src/output.c (token_actions): Introduce a temporary array,
24009 YYDEFACT, that makes it possible for this function to use
24010 output_short_table.
24011
d019d655
AD
240122000-10-02 Akim Demaille <akim@epita.fr>
24013
24014 `user_toknums' is output as a `short[]' in `output.c', while it is
24015 defined as a `int[]' in `reader.c'. For consistency with the
24016 other output tables, `user_toknums' is now defined as a table of
24017 shorts.
24018
24019 * src/reader.c (user_toknums): Be a short table instead of an int
24020 table.
24021 Adjust dependencies.
24022
24023 Factor the short table outputs.
24024
24025 * src/output.c (output_short_table): New function.
24026 * src/output.c (output_gram, output_stos, output_rule_data)
24027 (output_base, output_table, output_check): Use it.
24028
6c89f1c1
AD
240292000-10-02 Akim Demaille <akim@epita.fr>
24030
24031 * src/output.c (output): Topological sort of the functions, in
24032 order to get rid of the `static' prototypes.
24033 No longer use `register'.
24034 * src/output.h: New file.
24035 Propagate its inclusion in files explicitly prototyping functions
24036 from output.c.
24037
d9efd181
AD
240382000-09-21 Akim Demaille <akim@epita.fr>
24039
24040 * src/atgeneral.m4: Update from Autoconf.
24041
c29240e7 240422000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
24043
24044 * src/closure.h: New file.
24045 * src/closure.c: Formatting changes, topological sort over the
24046 functions, use of closure.h.
24047 (initialize_closure, finalize_closure): Rename as...
24048 (new_closure, free_closure): these. Adjust dependencies.
24049 * src/LR0.c: Formatting changes, topological sort, use of
24050 cloture.h.
24051 (initialize_states): Rename as...
24052 (new_states): this.
24053 * src/Makefile.am (noinst_HEADERS): Adjust.
24054
499daa50
AD
240552000-09-20 Akim Demaille <akim@epita.fr>
24056
24057 * src/acconfig.h: Don't protect config.h against multiple
24058 inclusion.
24059 Don't define PARAMS.
24060 * src/system.h: Define PARAMS.
24061 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
24062 purpose of config.h. system.h must not try to fix wrong
24063 definitions in config.h.
24064
cc84fd5d
AD
240652000-09-20 Akim Demaille <akim@epita.fr>
24066
24067 * src/derives.h: New file.
24068 * src/main.c, src/derives.h: Use it.
24069 Formatting changes.
24070 * src/Makefile.am (noinst_HEADERS): Adjust.
24071
db5b3a89
AD
240722000-09-20 Akim Demaille <akim@epita.fr>
24073
24074 * tests/atgeneral.m4: Update from Autoconf.
24075 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
24076 (AT_CHECK_CALC): New macros.
24077 Use these macros to test bison with options `', `--raw',
24078 `--debug', `--yacc', `--yacc --debug'.
24079
ceed8467
AD
240802000-09-19 Akim Demaille <akim@epita.fr>
24081
24082 * src/output.c: Formatting changes.
24083 * src/machine.h: Remove, leaving its contents in...
24084 * src/system.h: here.
24085 Include stdio.h.
24086 Adjust all dependencies on stdio.h and machine.h.
24087 * src/getargs.h: New file.
24088 Let all `extern' declarations about getargs.c be replaced with
24089 inclusion of `getargs.h'.
24090 * src/Makefile.am (noinst_HEADERS): Adjust.
24091
24092 * tests/calc.m4 (yyin): Be initialized in main, not on the global
24093 scope.
24094 (yyerror): Returns void, not int.
24095 * doc/bison.texinfo: Formatting changes.
24096
05a1d24b
AD
240972000-09-19 Akim Demaille <akim@epita.fr>
24098
24099 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
24100 portable.
24101
cbd25751
AD
241022000-09-18 Akim Demaille <akim@epita.fr>
24103
24104 * configure.in: Append WARNING_CFLAGS to CFLAGS.
24105 * src/Makefile.am (INCLUDES): Don't.
24106 Be ready to fetch headers in lib/.
24107
13863333
AD
241082000-09-18 Akim Demaille <akim@epita.fr>
24109
24110 * doc/bison.texinfo: Update the copyright.
24111 ANSIfy and GNUify the examples.
24112 Remove the old menu.
24113
0d533154
AD
241142000-09-18 Akim Demaille <akim@epita.fr>
24115
24116 First set of tests: use the `calc' example from the documentation.
24117
24118 * src/bison.s1 (yyparse): Condition the code using `yytname' which
24119 is defined only when YYDEBUG is.
24120 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
24121 * src/files.c (tryopen, tryclose): Formatting changes.
24122 Move to the top and be static.
24123 * src/reader.c (read_signed_integer): Likewise.
24124 * tests/calc.m4: New file.
24125 * Makefile.am, suite.m4: Adjust.
24126 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
24127
e79137ac
AD
241282000-09-18 Akim Demaille <akim@epita.fr>
24129
24130 Add support for an Autotest test suite for Bison.
24131
24132 * m4/m4.m4, m4/atconfig.m4: New files.
24133 * m4/Makefile.am (EXTRA_DIST): Adjust.
24134 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
24135 files.
24136 * src/getargs.c: Display a more standard --version message.
24137 * src/reader.c (reader): Formatting changes.
24138 No longer depend upon VERSION_STRING.
24139 * configure.in: No longer use `dnl'.
24140 Set up the test suite and the new directory `tests/.
24141 (VERSION_STRING): Remove.
24142
27821bff
AD
241432000-04-14 Akim Demaille <akim@epita.fr>
24144
24145 * src/reader.c (copy_comment2): New function, same as former
24146 `copy_comment', but outputs into two FILE *.
24147 (copy_comment): Use it.
24148 (parse_union_decl): Use it.
24149 (get_type, parse_start_decl): Use the same `invalid' message.
24150 (parse_start_decl, parse_union_decl): Use the same `multiple'
24151 message.
24152 (parse_union_decl, copy_guard, copy_action): Use the same
24153 `unmatched' message.
24154 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
24155
cfe5fbc0
AD
241562000-03-31 Akim Demaille <akim@epita.fr>
24157
24158 * src/files.c (tryopen, tryclose): Move to the top.
24159 Be static.
24160
cb7db13e
AD
241612000-03-31 Akim Demaille <akim@epita.fr>
24162
24163 * src/main.c (main): Don't call `done', exit does it.
24164
a0f6b076
AD
241652000-03-31 Akim Demaille <akim@epita.fr>
24166
36281465
AD
24167 * allocate.c: s/return (foo)/return foo/.
24168 * lalr.c: Likewise.
24169 * LR0.c: Likewise.
24170 * output.c: Likewise.
24171 * reader.c: Likewise.
24172 * symtab.c: Likewise.
24173 * vmsgetargs.c: Likewise.
24174
241752000-03-31 Akim Demaille <akim@epita.fr>
24176
24177 Clean up the error reporting functions.
a0f6b076
AD
24178
24179 * src/report.c: New file.
24180 * src/report.h: Likewise.
24181 * src/Makefile.am: Adjust.
24182 * m4/error.m4: New file.
24183 * m4/Makefile.am: Adjust.
24184 * configure.in (jm_PREREQ_ERROR): Call it.
24185 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
24186 Remove.
24187 (fatal, fatals): Remove. All callers use complain.c::fatal.
24188 (warn, warni, warns, warnss, warnss): Remove. All callers use
24189 complain.c::complain.
24190 (toomany): Remove, use fatal instead.
24191 * src/files.c (done): No argument, use complain_message_count.
24192 * src/main.c (main): Register `done' to `atexit'.
24193
24194 * src/getargs.c (usage): More `fputs', less `fprintf'.
24195
18539825
AD
241962000-03-28 Akim Demaille <akim@epita.fr>
24197
24198 * lib/: New directory.
24199 * Makefile.am (SUBDIRS): Adjust.
24200 * configure.in: Adjust.
24201 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
24202 useless.
24203 * src/alloca.c: Moved to lib/.
24204 * src/getopt.c: Likewise.
24205 * src/getopt1.c: Likewise.
24206 * src/getopt.h: Likewise.
24207 * src/ansi2knr.c: Likewise.
24208 * src/ansi2knr.1: Likewise.
24209 * src/Makefile.am: Adjust.
24210 * lib/Makefile.am: New file.
24211
9f306f2a
AD
242122000-03-28 Akim Demaille <akim@epita.fr>
24213
24214 * src/getargs.c (usage): Refresh the help message.
24215
0ba347b6
AD
242162000-03-17 Akim Demaille <akim@epita.fr>
24217
24218 * src/getopt1.c: Updated from textutils 2.0e
24219 * src/getopt.c: Likewise.
24220 * src/getopt.h: Likewise.
24221
dbe7f271
AD
242222000-03-17 Akim Demaille <akim@epita.fr>
24223
24224 * src/Makefile.am (bison.simple): Fix the awk program: quote only
24225 the file name, not the whole `#line LINE FILE'.
24226
75bbe78d
AD
242272000-03-17 Akim Demaille <akim@epita.fr>
24228
24229 On syntax errors, report the token on which we choked.
24230
aa5fd0ee
AD
24231 * src/bison.s1 (yyparse): In the label yyerrlab, when
24232 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 24233
7b306f52
AD
242342000-03-17 Akim Demaille <akim@epita.fr>
24235
aa5fd0ee 24236 * src/reader.c (copy_at): New function.
7b306f52
AD
24237 (copy_guard): Use it.
24238 (copy_action): Use it.
24239
e87b5700
AD
242402000-03-17 Akim Demaille <akim@epita.fr>
24241
24242 Be kind to translators, save some useless translations.
24243
aa5fd0ee 24244 * src/main.c (banner): New function.
e87b5700
AD
24245 (fatal_banner): Use it.
24246 (warn_banner): Use it.
24247
ae3c3164
AD
242482000-03-17 Akim Demaille <akim@epita.fr>
24249
aa5fd0ee
AD
24250 * src/reader.c (copy_definition): Use copy_string and
24251 copy_comment. Removed now unused `match', `ended',
24252 `cplus_comment'.
ae3c3164
AD
24253 (copy_comment, copy_string): Moved, to be visible from
24254 copy_definition.
24255
4dc58e7c
AD
242562000-03-17 Akim Demaille <akim@epita.fr>
24257
aa5fd0ee
AD
24258 * src/reader.c (copy_string): Declare `static inline'. No
24259 problems with inline, since it is checked by configure.
4dc58e7c
AD
24260 (copy_comment): Likewise.
24261
0a6384c4
AD
242622000-03-17 Akim Demaille <akim@epita.fr>
24263
aa5fd0ee 24264 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 24265
3cef001a
AD
242662000-03-17 Akim Demaille <akim@epita.fr>
24267
aa5fd0ee 24268 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
24269 (copy_action): Use it. Removed now unused `match', `ended',
24270 `cplus_comment'.
24271 (copy_guard): Likewise.
24272
ca36d2ef
AD
242732000-03-17 Akim Demaille <akim@epita.fr>
24274
aa5fd0ee 24275 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
24276 (copy_action): Use it.
24277 (copy_guard): Likewise.
24278
6666f98f
AD
242792000-03-17 Akim Demaille <akim@epita.fr>
24280
24281 Change the handling of @s so that they behave exactly like $s.
24282 There is now a pseudo variable @$ (readble and writable), location
24283 of the lhs of the rule (by default ranging from the location of
24284 the first symbol of the rhs, to the location of the last symbol,
24285 or, if the rhs is empty, YYLLOC).
24286
24287 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
24288 yyval.
24289 (yyparse): When providing a default semantic action, provide a
24290 default location action.
24291 (after the $): No longer change `*YYLSP', just stack YYLOC the
24292 same way you stack YYVAL.
24293 * src/reader.c (read_declarations): Use warns.
24294 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
24295 (copy_action, case '@'): Likewise.
24296 Use a standard error message, to save useless work from
24297 translators.
24298
41aca2e0
AD
242992000-03-17 Akim Demaille <akim@epita.fr>
24300
aa5fd0ee
AD
24301 * src/bison.s1: Formatting and cosmetics changes.
24302 * src/reader.c: Likewise.
41aca2e0
AD
24303 Update the Copyright notice.
24304
dc08c1d5
AD
243052000-03-17 Akim Demaille <akim@epita.fr>
24306
aa5fd0ee
AD
24307 * src/bison.s1 (#line): All set to `#line' only, since the
24308 Makefile now handles them.
dc08c1d5 24309
9ee3c97b
AD
243102000-03-16 Akim Demaille <akim@epita.fr>
24311
24312 * src/output.c (output_rule_data): Output the documentation of
24313 some of the tables.
24314 (Copyright notice): Update.
24315 Formatting changes.
24316
0de741ca
AD
243172000-03-16 Akim Demaille <akim@epita.fr>
24318
24319 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
24320 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
24321 One `#if YYDEBUG' remains, since it uses variables which are
24322 defined only if `YYDEBUG != 0'.
24323
bb10be54
AD
243242000-03-16 Akim Demaille <akim@epita.fr>
24325
24326 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
24327 and related variables so that the similarities are highlighted.
24328
b07b484a
AD
243292000-03-16 Akim Demaille <akim@epita.fr>
24330
24331 * src/bison.s1: Properly indent CPP directives.
24332
361f60b3
AD
243332000-03-16 Akim Demaille <akim@epita.fr>
24334
24335 * src/bison.s1: Properly indent the `alloca' CPP section.
24336
8c44d3ec
AD
243372000-03-16 Akim Demaille <akim@epita.fr>
24338
24339 Do not hard code values of directories in `configure.in'.
24340 Update the `configure' tool chain.
24341
24342 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
24343 src/makefile.am.
24344 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
24345 (AC_OUTPUT): Add m4/Makefile.
24346 Bump to bison 1.28a, 1.29 has never been released.
24347 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
24348 handled via src/Makefile.am.
24349 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
24350 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
24351 autoheader.
24352 * Makefile.am (SUBDIRS): Add m4.
24353 (ACLOCAL_AM_FLAGS): New variable.
24354 (AUTOMAKE_OPTIONS): Add check-news.
24355 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
24356 the proper line number and file name.
24357 (DEFS): Propagate the location of bison library files and of the
24358 locale files.
24359 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
24360 builddir.
24361 * acinclude.m4: Remove, replaced by the directory m4.
24362 * m4/Makefile.am (EXTRA_DIST): New variable.
24363 * m4/gettext.m4: New file, from the fileutils.
24364 * m4/lcmessage.m4: Likewise
24365 * m4/progtest.m4: Likewise.
24366 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
24367
f95997e7
AD
243682000-03-10 Akim Demaille <akim@epita.fr>
24369
24370 * src/closure.c:
24371 Formatting changes of various comments.
24372 Respect the GNU coding standards at various places.
24373 Don't use `_()' when no translation is needed.
24374
243751999-12-13 Jesse Thilo <jthilo@gnu.org>
24376
24377 * src/files.c:
24378 OS/2 honors TMPDIR environment variable.
24379
243801999-12-13 Jesse Thilo <jthilo@gnu.org>
24381
24382 * doc/bison.texinfo: Tweaked spelling and grammar.
24383 Updated ISBN.
24384 Removed reference to price of printed copy.
24385 Mention BISON_SIMPLE and BISON_HAIRY.
24386
243871999-12-13 Jesse Thilo <jthilo@gnu.org>
24388
24389 * configure.in, NEWS:
24390 Bison 1.29 released.
24391
243921999-10-27 Jesse Thilo <jthilo@gnu.org>
24393
24394 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
24395 Added reference card.
24396
243971999-07-26 Jesse Thilo <jthilo@gnu.org>
24398
24399 * po/ru.po: Added Russian translation.
24400
244011999-07-26 Jesse Thilo <jthilo@gnu.org>
24402
24403 * configure.in: Added Russian translation.
24404
244051999-07-06 Jesse Thilo <jthilo@gnu.org>
24406
24407 * configure.in, NEWS, README:
24408 Released version 1.28.
24409
244101999-06-14 Jesse Thilo <jthilo@gnu.org>
24411
24412 * src/system.h:
24413 Squashed redefinition warning on some systems.
24414
24415 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
24416 Have configure build version string instead of relying on ANSI string
24417 concatentation.
24418
244191999-06-14 Jesse Thilo <jthilo@gnu.org>
24420
24421 * po/POTFILES.in: Got rid of version.c.
24422
244231999-06-14 Jesse Thilo <jthilo@gnu.org>
24424
24425 * acconfig.h, configure.in:
24426 Have configure build version string instead of relying on ANSI string
24427 concatentation.
24428
244291999-06-08 Jesse Thilo <jthilo@gnu.org>
24430
24431 * doc/bison.1:
24432 Dropped mention of `+' for long-named options.
24433
244341999-05-30 Jesse Thilo <jthilo@gnu.org>
24435
24436 * src/files.c: Added <unistd.h> for unlink().
24437
24438 * src/Makefile.am, src/system.h:
24439 I18n fixes.
24440
244411999-05-30 Jesse Thilo <jthilo@gnu.org>
24442
24443 * README: Added a FAQ list.
24444
24445 * configure.in, acconfig.h:
24446 I18n fixes.
24447
244481999-05-30 Jesse Thilo <jthilo@gnu.org>
24449
24450 * doc/FAQ, doc/Makefile.am:
24451 Added a FAQ list.
24452
244531999-05-19 Jesse Thilo <jthilo@gnu.org>
24454
24455 * src/alloc.h, src/symtab.h, src/version.c:
24456 Protected inclusion of "config.h" with HAVE_CONFIG_H.
24457
244581999-04-18 Jesse Thilo <jthilo@gnu.org>
24459
24460 * src/.cvsignore, src/Makefile.am:
24461 Reorganized: sources in `src', documentation in `doc'.
24462
24463 * src/lex.c (literalchar):
24464 fixed the code for escaping double quotes (thanks
24465 Jonathan Czisny.)
24466
244671999-04-18 Jesse Thilo <jthilo@gnu.org>
24468
24469 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
24470 Adjusted paths to reflect directory reorganization.
24471
244721999-04-18 Jesse Thilo <jthilo@gnu.org>
24473
24474 * doc/.cvsignore, doc/Makefile.am:
24475 Reorganized: sources in `src', documentation in `doc'.
24476
244771999-04-18 Jesse Thilo <jthilo@gnu.org>
24478
24479 * configure.in:
24480 Updated AC_INIT file to reflect directory reorganization.
24481
24482 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
24483 Reorganized: sources in `src', documentation in `doc'.
24484
244851999-04-13 Jesse Thilo <jthilo@gnu.org>
24486
24487 * src/allocate.c:
24488 Don't declare calloc() and realloc() if not necessary.
24489
244901999-04-13 Jesse Thilo <jthilo@gnu.org>
24491
24492 * configure.in, acconfig.h, acinclude.m4:
24493 Don't declare calloc() and realloc() if not necessary.
24494
244951999-03-23 Jesse Thilo <jthilo@gnu.org>
24496
24497 * po/.cvsignore: Added i18n support.
24498
244991999-03-23 Jesse Thilo <jthilo@gnu.org>
24500
24501 * acconfig.h, configure.in, Makefile.am:
24502 Added i18n support.
24503
245041999-03-22 Jesse Thilo <jthilo@gnu.org>
24505
24506 * src/bison.s1: Fixed #line numbers.
24507
245081999-03-15 Jesse Thilo <jthilo@gnu.org>
24509
24510 * po/es.po, po/fr.po, po/nl.po, po/de.po:
24511 Added PO files from Translation Project.
24512
245131999-03-03 Jesse Thilo <jthilo@gnu.org>
24514
24515 * Makefile.am:
24516 Added support for non-ANSI compilers (ansi2knr).
24517
245181999-02-16 Jesse Thilo <jthilo@gnu.org>
24519
24520 * configure.in: Bumped version number to 1.27.
24521
24522 * Makefile.am:
24523 Added `bison.simple' to list of files removed by `make distclean'.
24524
245251999-02-12 Jesse Thilo <jthilo@gnu.org>
24526
24527 * src/files.c, src/files.h:
24528 Defined locations of parser files in config.h instead of Makefile.
24529
245301999-02-12 Jesse Thilo <jthilo@gnu.org>
24531
24532 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
24533 Defined locations of parser files in config.h instead of Makefile.
24534
245351999-02-09 Jesse Thilo <jthilo@gnu.org>
24536
24537 * Makefile.am:
24538 Removed inappropriate use of $< macro.
24539
245401999-02-05 Jesse Thilo <jthilo@gnu.org>
24541
24542 * po/Makefile.in.in, po/POTFILES.in:
24543 Add `po' directory skeleton.
24544
245451999-01-27 Jesse Thilo <jthilo@gnu.org>
24546
24547 * README: Document help-bison list.
24548
24549 * configure.in: Add check for mkstemp().
24550
245511999-01-20 Jesse Thilo <jthilo@gnu.org>
24552
24553 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
24554 Hush a few compiler warnings.
24555
24556 * src/files.c:
24557 Add tryclose(), which verifies that fclose was successful.
24558 Hush a couple of compiler warnings.
24559
245601999-01-20 Jesse Thilo <jthilo@gnu.org>
24561
24562 * Makefile.am, OChangeLog:
24563 ChangeLog is now automatically generated. Include the old version as
24564 OChangeLog.
24565
245661999-01-14 Jesse Thilo <jthilo@gnu.org>
24567
24568 * 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:
24569 Update FSF address.
24570
245711999-01-14 Jesse Thilo <jthilo@gnu.org>
24572
24573 * doc/bison.texinfo: Fix formatting glitch.
24574
24575 * doc/bison.texinfo: Update FSF address.
24576
245771999-01-14 Jesse Thilo <jthilo@gnu.org>
24578
24579 * acconfig.h: Update FSF address.
24580
245811999-01-08 Jesse Thilo <jthilo@gnu.org>
24582
24583 * src/system.h:
24584 Don't define PACKAGE here, since config.h defines it.
24585
245861998-12-30 Jesse Thilo <jthilo@gnu.org>
24587
24588 * src/reader.c: Update copyright date.
24589
24590 * src/main.c:
24591 Ditch sprintf to statically-sized buffers in fatal/warn functions in
24592 favor of output directly to stderr (avoids buffer overruns).
24593
24594 * src/reader.c: Some checks for premature EOF.
24595
24596 * 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:
24597 Use prototypes if the compiler understands them.
24598
24599 * src/files.c: Honor TMPDIR on Unix hosts.
24600 Use prototypes if the compiler understands them.
24601
24602 * src/reader.c:
24603 Fix a couple of buffer overrun bugs.
24604 Use prototypes if the compiler understands them.
24605
24606 * src/system.h: Include unistd.h and ctype.h.
24607 Use #ifdef instead of #if for NLS symbols.
24608
246091998-12-30 Jesse Thilo <jthilo@gnu.org>
24610
24611 * doc/bison.texinfo:
24612 Delete comment "consider using @set for edition number, etc..." since
24613 we now are doing so.
24614
246151998-12-30 Jesse Thilo <jthilo@gnu.org>
24616
24617 * configure.in:
24618 Use prototypes if the compiler understands them.
24619
24620 * NEWS: Document 1.26 highlights.
24621
24622 * Makefile.am: Require Automake 1.3 or later.
24623
24624 * acconfig.h:
24625 Use prototypes if the compiler understands them.
24626
246271998-12-29 Jesse Thilo <jthilo@gnu.org>
24628
24629 * src/version.c:
24630 Use VERSION symbol from automake for version number.
24631
246321998-12-29 Jesse Thilo <jthilo@gnu.org>
24633
24634 * acconfig.h, configure.in, version.cin:
24635 Use VERSION symbol from automake for version number.
24636
246371998-11-28 Jesse Thilo <jthilo@gnu.org>
24638
24639 * Makefile.am:
24640 Distribute original version of simple parser (bison.s1), not built
24641 version (bison.simple).
24642
246431998-11-28 Jesse Thilo <jthilo@gnu.org>
24644
24645 * doc/bison.texinfo: Add info dir entry.
24646
24647 * doc/bison.texinfo:
24648 Let automake put version number into documentation.
24649
246501998-11-26 Jesse Thilo <jthilo@gnu.org>
24651
24652 * src/bison.cld, src/build.com, src/vmshlp.mar:
24653 Add non-RCS files from /gd/gnu/bison.
24654
246551998-11-26 Jesse Thilo <jthilo@gnu.org>
24656
24657 * doc/bison.1:
24658 Document the BISON_HAIRY and BISON_SIMPLE variables.
24659
246601998-11-25 Jesse Thilo <jthilo@gnu.org>
24661
24662 * src/version.c: Build version.c automatically.
24663
24664 * src/reader.c:
24665 Fix token numbering (used to start at 258, not 257).
24666
24667 * src/system.h: Include config.h.
24668
24669 * src/getargs.c: Update bug report address.
24670
24671 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
24672 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
24673
246741998-11-25 Jesse Thilo <jthilo@gnu.org>
24675
24676 * Makefile.am:
24677 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24678
24679 * configure.in, version.cin:
24680 Build version.c automatically.
24681
24682 * AUTHORS: Add AUTHORS file.
24683
24684 * README: Update bug report address.
24685
24686 * bison.simple:
24687 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24688
24689 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
24690 Add automake stuff.
24691
246921998-11-25 Jesse Thilo <jthilo@gnu.org>
24693
24694 * doc/bison.texinfo: Clean up some formatting.
24695
246961998-05-05 Richard Stallman <rms@gnu.org>
24697
24698 * doc/bison.texinfo:
24699 Explain better why to make a pure parser.
24700
247011998-01-05 Richard Stallman <rms@gnu.org>
24702
24703 * src/files.c (openfiles):
24704 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
24705 find a temporary directory, if possible. Do not unlink files while
24706 they are open.
24707
247081997-08-25 Richard Stallman <rms@gnu.org>
24709
24710 * src/reader.c (stack_offset;):
24711 Change some warni to warns.
24712
24713 * src/lex.c (literalchar): Use warns, not warni.
24714
247151997-06-28 Richard Stallman <rms@gnu.org>
24716
24717 * src/bison.s1: Add a Bison version comment.
24718
24719 * src/main.c (fatal, warn, berror):
24720 Use program_name.
24721
247221997-06-28 Richard Stallman <rms@gnu.org>
24723
24724 * Makefile.in (bison_version): New variable.
24725 (dist): Use that variable.
24726 (bison.s1): Substitute the Bison version into bison.simple.
24727
24728 * bison.simple: Add a Bison version comment.
24729
247301997-06-18 Richard Stallman <rms@gnu.org>
24731
24732 * src/main.c (fatal, warn, berror):
24733 Make error messages standard.
24734 (toomany): Improve error message text.
24735
24736 * 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:
24737 new.h renamed to alloc.h.
24738
247391997-06-18 Richard Stallman <rms@gnu.org>
24740
24741 * Makefile.in: new.h renamed to alloc.h.
24742
247431997-05-24 Richard Stallman <rms@gnu.org>
24744
24745 * src/lex.c (literalchar):
24746 Fix the code for escaping \, " and '.
24747
24748 (lex): Avoid trouble when there are many chars
24749 to discard in a char literal with just several chars in it.
24750
247511997-05-17 Richard Stallman <rms@gnu.org>
24752
24753 * src/bison.s1:
24754 Use malloc, if using alloca is troublesome.
24755 (YYSTACK_USE_ALLOCA): New flag macro.
24756 Define it for some systems and compilers.
24757 (YYSTACK_ALLOC): New macro.
24758 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24759 If it was malloc'd, free it.
24760
247611997-05-17 Richard Stallman <rms@gnu.org>
24762
24763 * bison.simple:
24764 Use malloc, if using alloca is troublesome.
24765 (YYSTACK_USE_ALLOCA): New flag macro.
24766 Define it for some systems and compilers.
24767 (YYSTACK_ALLOC): New macro.
24768 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24769 If it was malloc'd, free it.
24770
247711997-04-23 Richard Stallman <rms@gnu.org>
24772
24773 * src/bison.s1:
24774 (alloca) [__hpux]: Always define as __builtin_alloca.
24775
247761997-04-23 Richard Stallman <rms@gnu.org>
24777
24778 * bison.simple:
24779 (alloca) [__hpux]: Always define as __builtin_alloca.
24780
247811997-04-22 Richard Stallman <rms@gnu.org>
24782
24783 * src/bison.s1:
24784 [__hpux]: Include alloca.h (right for HPUX 10)
24785 instead of declaring alloca (right for HPUX 9).
24786
24787 * src/bison.s1 (__yy_memcpy):
24788 Declare arg `count' as unsigned int.
24789 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24790
247911997-04-22 Richard Stallman <rms@gnu.org>
24792
24793 * bison.simple:
24794 [__hpux]: Include alloca.h (right for HPUX 10)
24795 instead of declaring alloca (right for HPUX 9).
24796
24797 * bison.simple (__yy_memcpy):
24798 Declare arg `count' as unsigned int.
24799 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24800
248011997-01-03 Richard Stallman <rms@gnu.org>
24802
24803 * src/allocate.c: [__STDC__ or _MSC_VER]:
24804 Declare calloc and realloc to return void *.
24805
248061997-01-02 Richard Stallman <rms@gnu.org>
24807
24808 * src/system.h:
24809 [_MSC_VER]: Include stdlib.h and process.h.
24810 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
24811
24812 * src/main.c (main): Return FAILURE as a value.
24813 (printable_version): Declare arg as int, not char.
24814
248151997-01-02 Richard Stallman <rms@gnu.org>
24816
24817 * Makefile.in (dist):
24818 Explicitly check for symlinks, and copy them.
24819
248201996-12-19 Richard Stallman <rms@gnu.org>
24821
24822 * src/files.c:
24823 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
24824
248251996-12-18 Paul Eggert <eggert@gnu.org>
24826
24827 * src/bison.s1 (yyparse):
24828 If __GNUC__ and YYPARSE_PARAM are both defined,
24829 declare yyparse to have a void * argument.
24830
248311996-12-18 Paul Eggert <eggert@gnu.org>
24832
24833 * bison.simple (yyparse):
24834 If __GNUC__ and YYPARSE_PARAM are both defined,
24835 declare yyparse to have a void * argument.
24836
248371996-12-17 Richard Stallman <rms@gnu.org>
24838
24839 * src/reduce.c (nbits): Add some casts.
24840
248411996-08-12 Richard Stallman <rms@gnu.org>
24842
24843 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
24844
248451996-08-12 Richard Stallman <rms@gnu.org>
24846
24847 * bison.simple: Test _MSDOS as well as _MSDOS_.
24848
248491996-07-31 Richard Stallman <rms@gnu.org>
24850
24851 * src/bison.s1:
24852 [__sun && __i386]: Include alloca.h.
24853
248541996-07-31 Richard Stallman <rms@gnu.org>
24855
24856 * bison.simple:
24857 [__sun && __i386]: Include alloca.h.
24858
248591996-07-30 Richard Stallman <rms@gnu.org>
24860
24861 * src/bison.s1: Comment change.
24862
24863 * src/bison.s1: Test _MSDOS_, not MSDOS.
24864
248651996-07-30 Richard Stallman <rms@gnu.org>
24866
24867 * bison.simple: Comment change.
24868
24869 * bison.simple: Test _MSDOS_, not MSDOS.
24870
248711996-06-01 Richard Stallman <rms@gnu.org>
24872
24873 * 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:
24874 Insert `_' macro around many string constants.
24875
24876 * src/main.c:
24877 Insert `_' macro around many string constants.
24878
24879 (main): Call setlocale, bindtextdomain and textdomain.
24880
24881 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
24882 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
24883 [ENABLE_NLS]: Include libintl.h.
24884 [ENABLE_NLS] (gettext): Define.
24885 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
24886 (N_, PACKAGE, LOCALEDIR): New macros.
24887
248881996-06-01 Richard Stallman <rms@gnu.org>
24889
24890 * POTFILES.in: New file.
24891
24892 * Makefile.in (allocate.o):
24893 Define target explicitly.
24894
24895 * Makefile.in (CFLAGS): Set to @CFLAGS@.
24896 (LDFLAGS): Set to @LDFLAGS@.
24897 (configure): Run autoconf only if preceding `cd' succeeds.
24898 (bison.s1): Redirect output to temporary file then move the
24899 temporary to the target, rather than redirecting directly to bison.s1.
24900 (clean): Remove config.status and config.log.
24901 (distclean): Don't remove config.status here.
24902
249031996-05-12 Richard Stallman <rms@gnu.org>
24904
24905 * src/bison.s1:
24906 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24907
249081996-05-12 Richard Stallman <rms@gnu.org>
24909
24910 * bison.simple:
24911 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24912
249131996-05-11 Richard Stallman <rms@gnu.org>
24914
24915 * src/bison.s1 (__yy_memcpy):
24916 Really reorder the args, as was supposedly done on Feb 14 1995.
24917 (yyparse): Calls changed accordingly.
24918
249191996-05-11 Richard Stallman <rms@gnu.org>
24920
24921 * Makefile.in (dist): Don't use $(srcdir).
24922
24923 * bison.simple (__yy_memcpy):
24924 Really reorder the args, as was supposedly done on Feb 14 1995.
24925 (yyparse): Calls changed accordingly.
24926
249271996-01-27 Richard Stallman <rms@gnu.org>
24928
24929 * src/output.c (output_rule_data):
24930 Test YYERROR_VERBOSE in the conditional
24931 around the definition of ttyname.
24932
249331995-12-29 Richard Stallman <rms@gnu.org>
24934
24935 * src/bison.s1:
24936 Fix line numbers in #line commands.
24937
249381995-12-29 Richard Stallman <rms@gnu.org>
24939
24940 * bison.simple:
24941 Fix line numbers in #line commands.
24942
249431995-12-27 Richard Stallman <rms@gnu.org>
24944
24945 * src/bison.s1 (YYPARSE_PARAM_DECL):
24946 In C++, make it always null.
24947 (YYPARSE_PARAM_ARG): New macro.
24948 (yyparse): Use YYPARSE_PARAM_ARG.
24949
249501995-12-27 Richard Stallman <rms@gnu.org>
24951
24952 * bison.simple (YYPARSE_PARAM_DECL):
24953 In C++, make it always null.
24954 (YYPARSE_PARAM_ARG): New macro.
24955 (yyparse): Use YYPARSE_PARAM_ARG.
24956
249571995-11-29 Richard Stallman <rms@gnu.org>
24958
24959 * doc/bison.texinfo:
24960 Describe literal string tokens, %raw, %no_lines, %token_table.
24961
249621995-11-29 Daniel Hagerty <hag@gnu.org>
24963
24964 * doc/bison.texinfo: Fixed update date
24965
249661995-10-16 Richard Stallman <rms@gnu.org>
24967
24968 * src/version.c: Version 1.25.
24969
249701995-10-16 Richard Stallman <rms@gnu.org>
24971
24972 * NEWS: *** empty log message ***
24973
249741995-10-16 Richard Stallman <rms@gnu.org>
24975
24976 * doc/bison.1, doc/bison.rnh:
24977 Add new options.
24978
249791995-10-15 Richard Stallman <rms@gnu.org>
24980
24981 * src/vmsgetargs.c, src/getargs.c:
24982 Added -n, -k, and -raw switches.
24983 (noparserflag, toknumflag, rawtoknumflag): New variables.
24984
24985 * src/symtab.h (SALIAS):
24986 New #define for adding aliases to %token.
24987 (struct bucket): Added `alias' field.
24988
24989 * src/reduce.c (reduce_grammar):
24990 Revise error message.
24991 (print_notices): Remove final `.' from error message.
24992
24993 * src/reader.c (reader_output_yylsp):
24994 New function.
24995 (readgram): Use `#if 0' around code that accepted %command
24996 inside grammar rules: The documentation doesn't allow it,
24997 and it will fail since the %command processors scan for the next %.
24998 (parse_token_decl): Extended the %token
24999 declaration to allow a multi-character symbol as an alias.
25000 (parse_thong_decl): New function.
25001 (read_declarations): Added %thong declarations.
25002 (read_declarations): Handle NOOP to deal with allowing
25003 % declarations as another means to specify the flags.
25004 (readgram): Allow %prec prior to semantics embedded in a rule.
25005 (skip_to_char, read_declarations, copy_definition)
25006 (parse_token_decl, parse_start_decl, parse_type_decl)
25007 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
25008 (get_type_name, copy_guard, copy_action, readgram)
25009 (get_type, packsymbols): Revised most error messages.
25010 Changed `fatal' to `warnxxx' to avoid aborting for error.
25011 Revised and use multiple warnxxx functions to avoid using VARARGS1.
25012 (read_declarations): Improve the error message for
25013 an invalid character. Do not abort.
25014 (read_declarations, copy_guard, copy_action): Use
25015 printable_version to avoid unprintable characters in printed output.
25016 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
25017 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
25018 Allow the type of a non-terminal can be given
25019 more than once, as long as all specifications give the same type.
25020
25021 * src/output.c:
25022 (output_headers, output_trailers, output, output_gram)
25023 (output_rule_data): Implement noparserflag variable.
25024 Implement toknumflag variable.
25025 (output): Call reader_output_yylsp to output LTYPESTR.
25026
25027 * src/main.c (main):
25028 If reader sees an error, don't process the grammar.
25029 (fatals): Updated to not use VARARGS1.
25030 (printable_version, int_to_string, warn, warni, warns, warnss)
25031 (warnsss): New error reporting functions. Avoid abort for error.
25032
25033 * src/lex.h:
25034 Added THONG and NOOP for alias processing.
25035 Added SETOPT for the new code that allows setting options with %flags.
25036
25037 * src/lex.c:
25038 Include getopt.h. Add some extern decls.
25039 (safegetc): New function to deal with EOF gracefully.
25040 (literalchar); new function to deal with reading \ escapes.
25041 (lex): Use literalchar.
25042 (lex): Implemented "..." tokens.
25043 (literalchar, lex, parse_percent_token): Made tokenbuffer
25044 always contain the token. This includes growing the token
25045 buffer while reading an integer.
25046 (parse_percent_token): Replaced if-else statement with percent_table.
25047 (parse_percent_token): Added % declarations as another
25048 way to specify the flags -n, -l, and -r. Also added hooks for
25049 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
25050 major changes to files.c.
25051 (lex) Retain in the incoming stream a character following
25052 an incorrect '/'.
25053 (skip_white_space, lex): Revised most error messages
25054 and changed fatal to warn to avoid aborting.
25055 (percent_table): Added %thong declarations.
25056
25057 * src/gram.h: Comment changes.
25058
25059 * src/files.c (openfiles, open_extra_files, done):
25060 Add faction flag
25061 and actfile file. Handle noparserflag. Both for -n switch.
25062
25063 * src/conflicts.c (resolve_sr_conflict):
25064 Remove use of alloca.
25065
250661995-06-01 Jim Meyering <meyering@gnu.org>
25067
25068 * doc/bison.texinfo: *** empty log message ***
25069
250701995-05-06 Richard Stallman <rms@gnu.org>
25071
25072 * src/bison.s1: Comment change.
25073
250741995-05-06 Richard Stallman <rms@gnu.org>
25075
25076 * bison.simple: Comment change.
25077
250781995-05-03 Richard Stallman <rms@gnu.org>
25079
25080 * src/version.c: Version now 1.24.
25081
25082 * src/bison.s1: Change distribution terms.
25083
25084 * src/version.c: Version now 1.23.
25085
250861995-05-03 Richard Stallman <rms@gnu.org>
25087
25088 * doc/bison.texinfo:
25089 Rewrite "Conditions for Using Bison".
25090 Update version to 1.24.
25091
250921995-05-03 Richard Stallman <rms@gnu.org>
25093
25094 * bison.simple: Change distribution terms.
25095
250961995-02-23 Richard Stallman <rms@gnu.org>
25097
25098 * src/files.c: Test __VMS_POSIX as well as VMS.
25099
251001995-02-14 Jim Meyering <meyering@gnu.org>
25101
25102 * src/bison.s1 (__yy_memcpy):
25103 Renamed from __yy_bcopy to avoid
25104 confusion. Reverse FROM and TO arguments to be consistent with
25105 those of memcpy.
25106
251071995-02-14 Jim Meyering <meyering@gnu.org>
25108
25109 * bison.simple (__yy_memcpy):
25110 Renamed from __yy_bcopy to avoid
25111 confusion. Reverse FROM and TO arguments to be consistent with
25112 those of memcpy.
25113
251141994-11-10 David J. MacKenzie <djm@gnu.org>
25115
25116 * NEWS: reformat
25117
25118 * NEWS: New file.
25119
25120 * Makefile.in (DISTFILES): Include NEWS.
25121
25122 * Makefile.in (DISTFILES):
25123 Include install-sh, not install.sh.
25124
25125 * configure.in: Update to Autoconf v2 macro names.
25126
251271994-10-05 David J. MacKenzie <djm@gnu.org>
25128
25129 * Makefile.in: fix typo
25130
25131 * Makefile.in (prefix, exec_prefix):
25132 Let configure set them.
25133
251341994-09-28 David J. MacKenzie <djm@gnu.org>
25135
25136 * Makefile.in: Set datadir to $(prefix)/share.
25137
251381994-09-15 Richard Stallman <rms@gnu.org>
25139
25140 * src/bison.s1:
25141 Update copyright notice and GPL version.
25142
251431994-09-15 Richard Stallman <rms@gnu.org>
25144
25145 * bison.simple:
25146 Update copyright notice and GPL version.
25147
251481994-07-12 Richard Stallman <rms@gnu.org>
25149
25150 * src/reduce.c, src/reader.c:
25151 entered into RCS
25152
251531994-05-05 David J. MacKenzie <djm@gnu.org>
25154
25155 * Makefile.in: entered into RCS
25156
251571994-03-26 Richard Stallman <rms@gnu.org>
25158
25159 * src/bison.s1: entered into RCS
25160
251611994-03-26 Richard Stallman <rms@gnu.org>
25162
25163 * bison.simple: entered into RCS
25164
251651994-03-25 Richard Stallman <rms@gnu.org>
25166
25167 * src/main.c: entered into RCS
25168
251691994-03-24 Richard Stallman <rms@gnu.org>
25170
25171 * src/conflicts.c: entered into RCS
25172
251731994-01-02 Richard Stallman <rms@gnu.org>
25174
25175 * Makefile.in: *** empty log message ***
25176
251771993-11-21 Richard Stallman <rms@gnu.org>
25178
25179 * src/bison.s1: *** empty log message ***
25180
251811993-11-21 Richard Stallman <rms@gnu.org>
25182
25183 * doc/bison.texinfo: entered into RCS
25184
25185 * doc/bison.texinfo: *** empty log message ***
25186
251871993-11-21 Richard Stallman <rms@gnu.org>
25188
25189 * bison.simple: *** empty log message ***
25190
251911993-10-25 David J. MacKenzie <djm@gnu.org>
25192
25193 * doc/bison.texinfo: *** empty log message ***
25194
251951993-10-19 Richard Stallman <rms@gnu.org>
25196
25197 * src/bison.s1: *** empty log message ***
25198
251991993-10-19 Richard Stallman <rms@gnu.org>
25200
25201 * bison.simple: *** empty log message ***
25202
252031993-10-14 Richard Stallman <rms@gnu.org>
25204
25205 * src/bison.s1: *** empty log message ***
25206
252071993-10-14 Richard Stallman <rms@gnu.org>
25208
25209 * bison.simple: *** empty log message ***
25210
252111993-09-14 David J. MacKenzie <djm@gnu.org>
25212
25213 * doc/bison.texinfo: *** empty log message ***
25214
252151993-09-13 Noah Friedman <friedman@gnu.org>
25216
25217 * Makefile.in: *** empty log message ***
25218
252191993-09-10 Richard Stallman <rms@gnu.org>
25220
25221 * src/conflicts.c: *** empty log message ***
25222
25223 * src/system.h: entered into RCS
25224
252251993-09-10 Richard Stallman <rms@gnu.org>
25226
25227 * doc/bison.1: entered into RCS
25228
252291993-09-06 Noah Friedman <friedman@gnu.org>
25230
25231 * src/version.c: entered into RCS
25232
252331993-09-06 Noah Friedman <friedman@gnu.org>
25234
25235 * Makefile.in: *** empty log message ***
25236
252371993-07-30 David J. MacKenzie <djm@gnu.org>
25238
25239 * Makefile.in: *** empty log message ***
25240
252411993-07-24 Richard Stallman <rms@gnu.org>
25242
25243 * src/bison.s1: *** empty log message ***
25244
252451993-07-24 Richard Stallman <rms@gnu.org>
25246
25247 * bison.simple: *** empty log message ***
25248
252491993-07-08 David J. MacKenzie <djm@gnu.org>
25250
25251 * Makefile.in: *** empty log message ***
25252
252531993-07-04 Richard Stallman <rms@gnu.org>
25254
25255 * src/bison.s1: *** empty log message ***
25256
252571993-07-04 Richard Stallman <rms@gnu.org>
25258
25259 * bison.simple: *** empty log message ***
25260
252611993-06-26 David J. MacKenzie <djm@gnu.org>
25262
25263 * src/getargs.c: entered into RCS
25264
252651993-06-26 David J. MacKenzie <djm@gnu.org>
25266
25267 * doc/bison.texinfo: *** empty log message ***
25268
25269 * doc/bison.1: New file.
25270
252711993-06-25 Richard Stallman <rms@gnu.org>
25272
25273 * src/getargs.c: New file.
25274
252751993-06-16 Richard Stallman <rms@gnu.org>
25276
25277 * src/bison.s1: *** empty log message ***
25278
252791993-06-16 Richard Stallman <rms@gnu.org>
25280
25281 * bison.simple: *** empty log message ***
25282
252831993-06-03 Richard Stallman <rms@gnu.org>
25284
25285 * src/bison.s1: New file.
25286
252871993-06-03 Richard Stallman <rms@gnu.org>
25288
25289 * doc/bison.texinfo: *** empty log message ***
25290
252911993-06-03 Richard Stallman <rms@gnu.org>
25292
25293 * bison.simple: New file.
25294
252951993-05-19 Richard Stallman <rms@gnu.org>
25296
25297 * doc/bison.texinfo: New file.
25298
252991993-05-07 Noah Friedman <friedman@gnu.org>
25300
25301 * Makefile.in: *** empty log message ***
25302
253031993-04-28 Noah Friedman <friedman@gnu.org>
25304
25305 * src/reader.c: *** empty log message ***
25306
253071993-04-23 Noah Friedman <friedman@gnu.org>
25308
25309 * src/alloc.h: entered into RCS
25310
253111993-04-20 David J. MacKenzie <djm@gnu.org>
25312
25313 * src/version.c: *** empty log message ***
25314
25315 * src/files.c, src/allocate.c:
25316 entered into RCS
25317
25318 * src/reader.c: *** empty log message ***
25319
25320 * src/lex.c: entered into RCS
25321
25322 * src/conflicts.c: New file.
25323
25324 * src/symtab.c: entered into RCS
25325
25326 * src/alloc.h: New file.
25327
25328 * src/LR0.c: entered into RCS
25329
253301993-04-18 Noah Friedman <friedman@gnu.org>
25331
25332 * src/reader.c: New file.
25333
25334 * src/version.c: *** empty log message ***
25335
253361993-04-18 Noah Friedman <friedman@gnu.org>
25337
25338 * Makefile.in: *** empty log message ***
25339
253401993-04-17 Noah Friedman <friedman@gnu.org>
25341
25342 * Makefile.in: *** empty log message ***
25343
253441993-04-15 Richard Stallman <rms@gnu.org>
25345
25346 * src/main.c, src/files.c:
25347 New file.
25348
253491993-04-15 Noah Friedman <friedman@gnu.org>
25350
25351 * configure.in: entered into RCS
25352
25353 * configure.in: *** empty log message ***
25354
25355 * configure.in: New file.
25356
253571993-04-14 Richard Stallman <rms@gnu.org>
25358
25359 * Makefile.in: New file.
25360
253611993-04-13 Richard Stallman <rms@gnu.org>
25362
25363 * src/version.c: New file.
25364
253651993-03-25 Richard Stallman <rms@gnu.org>
25366
25367 * src/output.c: entered into RCS
25368
253691992-09-25 Richard Stallman <rms@gnu.org>
25370
25371 * configure.bat: entered into RCS
25372
253731992-06-22 Richard Stallman <rms@gnu.org>
25374
25375 * src/vmsgetargs.c: entered into RCS
25376
253771992-06-22 Richard Stallman <rms@gnu.org>
25378
25379 * doc/bison.rnh: entered into RCS
25380
253811992-04-20 David J. MacKenzie <djm@gnu.org>
25382
25383 * README: entered into RCS
25384
253851992-01-22 Richard Stallman <rms@gnu.org>
25386
25387 * src/machine.h: entered into RCS
25388
253891991-12-21 Richard Stallman <rms@gnu.org>
25390
25391 * src/lalr.c, src/closure.c:
25392 entered into RCS
25393
253941991-12-20 Richard Stallman <rms@gnu.org>
25395
25396 * src/state.h: entered into RCS
25397
253981991-12-18 Richard Stallman <rms@gnu.org>
25399
25400 * src/print.c, src/nullable.c, src/derives.c:
25401 entered into RCS
25402
254031991-11-03 David J. MacKenzie <djm@gnu.org>
25404
25405 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
25406 entered into RCS
25407
254081988-09-09 Richard Stallman <rms@gnu.org>
25409
25410 * src/bison.hairy: entered into RCS
25411
254121987-12-16 Richard Stallman <rms@gnu.org>
25413
25414 * REFERENCES: entered into RCS
dc546b0f 25415
f294a2c2 25416
04098407 25417 -----
f294a2c2 25418
e141f4d4
JD
25419 Copyright (C) 1987-1988, 1991-2010 Free Software Foundation,
25420 Inc.
f294a2c2 25421
04098407
PE
25422 Copying and distribution of this file, with or without
25423 modification, are permitted provided the copyright notice and this
25424 notice are preserved.