]> git.saurik.com Git - bison.git/blame - ChangeLog
tests: fix for newer Sun Studio C++.
[bison.git] / ChangeLog
CommitLineData
4586c8cd
JD
12010-04-10 Joel E. Denny <joeldenny@joeldenny.org>
2
3 tests: fix for newer Sun Studio C++.
4 Reported by Dagobert Michelsen at
5 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00023.html>.
6 * THANKS (Dagobert Michelsen): Add.
7 * configure.ac (AC_PREREQ): Set to 2.64 so we get the latest
8 Autoconf macro for handling the restrict keyword.
9 * gnulib: Update to latest, which no longer overrides that macro
10 from Autoconf.
11
44c2b42d
JD
122010-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
13
14 portability: fix pointer arithmetic to conform to C standard.
15 Reported by Tys Lefering at
16 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00035.html>.
17 This fix is already implemented in glr.c and does not apply to
18 lalr1.java.
19 * data/lalr1.cc (yy::parser::parse): Increase size of
20 yyerror_range and adjust subscripting so you don't have to
21 subtract one from the beginning of the array.
22 * data/yacc.c (b4_declare_parser_state_variables,
23 yyparse, yypush_parse): Likewise.
24
218287f5
AD
252010-04-05 Akim Demaille <demaille@gostai.com>
26
27 remove useless include.
28 * src/graphviz.h: Don't include stdbool.h.
29
8176ab33
AD
302010-04-05 Akim Demaille <demaille@gostai.com>
31
32 graph: sign the output file.
33 * src/graphviz.c (start_graph): Issue comments about Bison.
34 Suggested by Tys Lefering.
35
4ad3921d
JD
362010-03-31 Joel E. Denny <jdenny@ces.clemson.edu>
37
38 portability: fix test suite for GCC 4.5's new #error message.
39 Reported by Tys Lefering at
40 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00030.html>.
41 * NEWS (2.4.3): Mention.
42 * tests/synclines.at (AT_TEST_SYNCLINE): Implement.
43
10a697de
AD
442010-03-30 Akim Demaille <demaille@gostai.com>
45
46 fix comments.
47 * src/graphviz.h: Add missing license notice.
48 Document.
49
d6b347e4
AD
502010-03-25 Akim Demaille <demaille@gostai.com>
51
52 tests: fix 250: parse.error=verbose overflow.
53 * tests/regression.at (parse.error=verbose overflow): Avoid the
54 double inclusion of stdlib.h as it triggers hard errors.
55
b8675840
JD
562010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
57
58 portability: fix for BSD make.
59 Reported by Johan van Selst at
60 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00016.html>.
61 * tests/local.mk ($(TESTSUITE)): Qualify package.m4 in
62 this dependency list as in package.m4's target rule.
63
8b9e021f
JD
642010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
65
66 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
67 Reported by Johan van Selst at
68 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
69 * NEWS (2.4.3): New.
70 * THANKS (Johan van Selst): Add.
71 * etc/prefix-gnulib-mk (prefix): Adjust regex for makefile
72 targets so that gnulib's new c++defs.h is matched.
73 * gnulib: Update to latest.
74
96a381c5
JD
752010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
76
77 maint: update for changes to gnulib's announce-gen.
78 * HACKING (Announce): RELEASE_TYPE=major must now be written
79 RELEASE_TYPE=stable.
80
e19a049c
JD
812010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
82
83 Version 2.4.2.
84 * NEWS (2.4.2): Set version and date. For the recent test suite
85 portability fixes, don't be so optimistic about their success
86 given the lack of feedback on the affected platforms.
87
890aeb28
JD
882010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
89
90 tests: fix maintainer-xml-check for recent changes.
91 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use
92 AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an
93 output file whose name conflicts with a previous output file
94 is now never generated.
95
f39ab286
JD
962010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
97
98 portability: fix several issues with M4 subprocess.
99
100 M4's output pipe was not being drained upon fatal errors during
101 scan_skel. As a result, broken-pipe messages from M4 were seen
102 on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
103 failure in the test suite. The problem was that, on platforms
104 where the default disposition for SIGPIPE is ignore instead of
105 terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
106 then reported it. However, there's some sort of race condition,
107 because the new test group occasionally succeeded.
108 Reported by Albert Chin at
109 <http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.
110
111 There were also problems with the test suite livelocking on
112 Tru64 5.1b. Reported by Didier Godefroy at
113 <http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
114 Switching to create_pipe_bidi suggested by Akim Demaille.
115
116 To attempt to solve both of these problems, switch to gnulib's
117 create_pipe_bidi and register M4 process as a slave. Along the
118 way, clean up file name conflict handling, which was affected by
119 the broken-pipe problem before the switch.
120 * NEWS (2.4.2): Document.
121 * THANKS (Didier Godefroy): Add.
122 * bootstrap.conf (gnulib_modules): Add pipe.
123 * gnulib: Update to latest to make sure we have all the latest
124 fixes.
125 * lib/local.mk (lib_libbison_a_SOURCES): Remove subpipe.h and
126 subpipe.c.
127 * po/POTFILES.in (lib/subpipe.c): Remove.
128 * src/files.c (compute_output_file_names): Update invocations
129 of output_file_name_check.
130 (output_file_name_check): In the case that the grammar file
131 would be overwritten, use complain instead of fatal, but replace
132 the output file name with /dev/null. Use the /dev/null solution
133 for the case of two conflicting output files as well because it
134 seems safer in case Bison one day tries to open both files at
135 the same time.
136 * src/files.h (output_file_name_check): Update prototype.
137 * src/output.c (output_skeleton): Use create_pipe_bidi and
138 wait_subprocess. Assert that scan_skel completely drains the
139 pipe.
140 * src/scan-skel.l (at_directive_perform): Update
141 output_file_name_check invocation.
142 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
143 grammar file actually isn't overwritten.
144 (Conflicting output files: -o foo.y): Update expected output.
145 * tests/skeletons.at (Fatal errors but M4 continues producing
146 output): New test group.
147
e32050b0
JD
1482010-02-04 Joel E. Denny <jdenny@ces.clemson.edu>
149
150 Update POTFILES.
151 * HACKING (Release Procedure): Add reminder about keeping
152 POTFILES files up-to-date.
153 * po/POTFILES.in (src/muscle-tab.c, src/scan-skel.l): Add.
154
efc4ed4a
JD
1552010-02-01 Joel E. Denny <jdenny@clemson.edu>
156
157 Code cleanup.
158 * tests/atlocal.in (abs_top_srcdir): Remove shell variable,
159 which is already defined in atconfig.
160
95611b56
JD
1612010-01-22 Joel E. Denny <jdenny@clemson.edu>
162
163 tests: fix missing include caught by g++ 4.4.1.
164 Reported by Tys Lefering.
165 * HACKING (Release checks): Add note about trying a recent GCC.
166 * tests/regression.at (_AT_DATA_DANCER_Y): For C++, include
167 cstdlib for abort.
168 (_AT_DATA_EXPECT2_Y): Likewise.
169
d6e40cba
JD
1702010-01-21 Joel E. Denny <jdenny@clemson.edu>
171
172 * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory.
173
80b70223
JD
1742010-01-21 Joel E. Denny <jdenny@clemson.edu>
175
176 maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
177 * HACKING (Release Procedure): Update notes on copyright years.
178 * Makefile.am (update-package-copyright-year): New target rule.
179 * build-aux/update-package-copyright-year: New file.
180 * cfg.mk (update-copyright): Add update-package-copyright-year
181 as a dependency.
182
3320a276
JD
1832010-01-19 Joel E. Denny <jdenny@clemson.edu>
184
185 * bootstrap: Import improvements from latest gnulib.
186
e30c0477
JD
1872010-01-19 Joel E. Denny <jdenny@clemson.edu>
188
189 build: require Automake 1.11.1 to avoid a security flaw.
190 * HACKING (Release Procedure): Don't document Automake security
191 flaw here.
192 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
193 why here.
194
a538eeb1
JD
1952010-01-19 Joel E. Denny <jdenny@clemson.edu>
196
197 gnulib: update to latest.
198
d6bdb90a
JD
1992010-01-19 Joel E. Denny <jdenny@clemson.edu>
200
201 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
202
326e5cf8
JD
2032010-01-15 Joel E. Denny <jdenny@clemson.edu>
204
205 Thank the developer of the initial push parser implementation.
206 This unfortunate oversight is several years old.
207 * THANKS (Odd Arild Olsen): Add.
208
fca9c5ef
JD
2092010-01-04 Joel E. Denny <jdenny@clemson.edu>
210
211 Fix some comments concerning LR(0) versus LALR(1).
212
213 Stop equating LR(0) with nondeterminism and LALR(1) with
214 determinism. That is, if all states are consistent, then LR(0)
215 tables are deterministic. On the other hand, LALR(1) tables
216 might be nondeterministic before conflict resolution, and GLR
217 permits LALR(1) tables to remain nondeterministic.
218 * src/LR0.c, src/LR0.h: Here.
219 * src/lalr.c, src/lalr.h: Here.
220 * src/main.c (main): Here.
221 * src/state.c, src/state.h: Here.
222
223 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
224 parser tables.
225
e141f4d4
JD
2262010-01-04 Joel E. Denny <jdenny@clemson.edu>
227
228 maint: run "make update-copyright"
229
882be728
JD
2302009-12-30 Joel E. Denny <jdenny@clemson.edu>
231
232 POSIX: complain if %prec's token was not defined.
233 * NEWS (2.5): Document.
234 * src/reader.c (grammar_rule_check): Convert warning to
235 complaint.
236 * tests/input.at (%prec's token must be defined): Update.
237
8bb3a2e7
JD
2382009-12-30 Joel E. Denny <jdenny@clemson.edu>
239
240 POSIX: warn if %prec's token was not defined.
241 Reported by Florian Krohm at
242 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
243 * NEWS (2.4.2): Document.
244 * src/reader.c (grammar_rule_check): Implement.
245 (grammar_current_rule_prec_set): Add comments explaining that we
246 here assume a %prec identifier is a token, but we still manage
247 to support POSIX.
248 * tests/input.at (%prec's token must be defined): New test
249 group.
250
505e1551
JD
2512009-12-31 Joel E. Denny <jdenny@clemson.edu>
252
253 * HACKING (Release Procedure): Recommend a secure automake.
254
b8d19cf8
JD
2552009-12-29 Joel E. Denny <jdenny@clemson.edu>
256
257 portability: `<' and `>' are not always defined on addresses.
258 Specifically, don't sort objects by their memory addresses when
259 they're not allocated in the same array or other object. Though
260 I haven't found a test case where that fails on my platform, C
261 says the behavior is undefined.
262 * src/AnnotationList.c (AnnotationList__insertInto): Remove
263 FIXME. Use new id field of InadequacyList nodes rather than
264 their memory addresses when sorting.
265 (AnnotationList__compute_from_inadequacies): Add
266 inadequacy_list_node_count argument to pass to
267 InadequacyList__new_conflict.
268 * src/AnnotationList.h
269 (AnnotationList__compute_from_inadequacies): Update prototype
270 and documentation for new argument.
271 * src/InadequacyList.c (InadequacyList__new_conflict): Add
272 node_count argument and use it to assign a unique ID.
273 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
274 (InadequacyList): Add id field.
275 (InadequacyList__new_conflict): Update prototype and
276 documentation for new argument.
277 * src/ielr.c (ielr_compute_annotation_lists): Update
278 AnnotationList__compute_from_inadequacies invocation.
279
df222dfa
JD
2802009-12-20 Joel E. Denny <jdenny@clemson.edu>
281
282 Fix handling of yychar manipulation in user semantic actions.
283 The problem was that yacc.c didn't always update the yychar
284 translation afterwards. However, other skeletons appear to be
285 fine. glr.c appears to already translate yychar before every
286 use. lalr1.cc does not define yychar and does not document its
287 replacement, yyla, for users. It does provide yyclearin, but
288 that does not manipulate yyla and thus requires no translation
289 update. In lalr1.java, yychar is out of scope during semantic
290 actions.
291 * NEWS (2.5): Document.
292 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
293 yytoken here.
294 (yyparse, yypush_parse): Instead, translate before every use of
295 yytoken, and add comments explaining this approach.
296 * tests/actions.at (Destroying lookahead assigned by semantic
297 action): New test group checking that translation happens before
298 lookahead destructor calls at parser return. Previously,
299 incorrect destructors were called.
300 * tests/conflicts.at (parse.error=verbose and consistent
301 errors): New test group checking that translation happens at
302 syntax error detection before the associated verbose error
303 message and the associated lookahead destructor calls. While
304 the destructor call is fixed by this patch, the verbose error
305 message is currently incorrect due to another bug (see
306 comments in test group), so this is an expected failure for now.
307
4395a9ff
JD
3082009-12-21 Joel E. Denny <jdenny@clemson.edu>
309
310 YYFAIL: warn about uses and remove from lalr1.java.
311 * NEWS (2.5): Document.
312 * data/lalr1.java (parser::YYStack::YYFAIL): Rename to YYERRLAB,
313 and make it private. Update all uses.
314 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
315
1625df5b
JD
3162009-12-21 Joel E. Denny <jdenny@clemson.edu>
317
318 YYFAIL: deprecate.
319 * NEWS (2.4.2): Document deprecation and the phase-out plan.
320 * data/lalr1.java (parser::YYStack::YYFAIL): Add comment about
321 deprecation.
322 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
323 YYFAIL from GCC cpp's -Wunused-macros.
324 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
325 documentation.
326 (LocalWords): Remove YYFAIL.
327
5335b65a
JD
3282009-12-20 Joel E. Denny <jdenny@clemson.edu>
329
330 tests: cleanup.
331 * tests/c++.at (Syntax error discarding no lookahead): Don't
332 ignore stderr. Instead, eliminate remaining warnings.
333
d59beda0
JD
3342009-12-18 Joel E. Denny <jdenny@clemson.edu>
335
336 lalr1.cc: don't discard non-existent lookahead on syntax error.
337 * data/lalr1.cc (parser::parse): Check yyempty first.
338 * tests/c++.at (Syntax error discarding no lookahead): New test
339 group.
340
387b4d50
JD
3412009-12-17 Joel E. Denny <jdenny@clemson.edu>
342
343 Code cleanup.
344 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
345 function, which is no longer used.
346
a603c6e0
JD
3472009-12-16 Joel E. Denny <jdenny@clemson.edu>
348
349 Add gcc's -Wundef to test suite and fix another warning from it.
350 * NEWS (2.4.2): Update description of -Wundef fix.
351 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
352 (WARN_CFLAGS_TEST): New substitution.
353 * data/glr.c: Avoid warning about __STRICT_ANSI__.
354 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
355 WARN_CFLAGS.
356 (NO_WERROR_CFLAGS): Likewise.
357 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
358
19750d31
JD
3592009-12-16 Joel E. Denny <jdenny@clemson.edu>
360
361 * data/yacc.c: Reformat m4 a little.
362
c938d650
JD
3632009-12-16 Joel E. Denny <jdenny@clemson.edu>
364
365 Document gcc -Wundef fix.
366 * NEWS (2.4.2): Here.
367 * THANKS (Jonathan Nieder): Add.
368
fcd32abd
JN
3692009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
370
371 Simplify y.tab.c when location tracking is disabled.
372 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
373 tracking is not enabled. Instead, unconditionally define
374 YY_LOCATION_PRINT as a no-op for backward compatibility.
375
ae93128c
JN
3762009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
377
378 Avoid warnings from gcc -Wundef y.tab.c.
379 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
380 defined before using them.
381 * data/lalr1.cc: Likewise.
382 * data/yacc.c: Likewise.
383
c843aaab
JD
3842009-12-15 Joel E. Denny <jdenny@clemson.edu>
385
386 autoconf: update to latest for fix of M4 detection.
387 Reported by Eric Blake.
388 * submodules/autoconf: Update.
389
5c99151a
JD
3902009-12-15 Joel E. Denny <jdenny@clemson.edu>
391
392 portability: use -DGNULIB_POSIXCHECK.
393 Reported by Eric Blake. See discussions at
394 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
395 and
396 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
397 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
398 * bootstrap.conf (gnulib_modules): Add all the printf modules
399 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
400 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
401 (excluded_files): Remove m4/printf-posix.m4.
402 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
403 lib/libbison.a so gnulib libraries can be linked.
404
75f94c6d
JD
4052009-12-15 Joel E. Denny <jdenny@clemson.edu>
406
407 gnulib: update for fix of fprintf-posix, which we'll use soon.
408 * etc/prefix-gnulib-mk (prefix): Adjust regex for make file
409 targets so that gnulib's new arg-nonnull.h and link-warning.h
410 are matched.
411 * gnulib: Update.
412
ca01f454
JD
4132009-12-14 Joel E. Denny <jdenny@clemson.edu>
414
415 Enable assertion output and --disable-assert for configure.
416 * bootstrap.conf (gnulib_modules): Add assert module.
417 * src/system.h (aver): Define as assert, and summarize the
418 discussion on this issue.
419
9dc3ee6d
JD
4202009-12-14 Joel E. Denny <jdenny@clemson.edu>
421
422 Expand GLR acronym in summary of Bison.
423 Based on discussion with Akim Demaille starting at
424 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
425 * doc/bison.texinfo (Introduction): Here.
426 * src/getargs.c (usage): Here.
427
d013372c
AR
4282009-10-03 Alex Rozenman <rozenman@gmail.com>
429
430 Document named references.
431 * doc/bison.texinfo (Actions): Add new example and xref to
432 Using Named References node.
433 (Using Named References): New node.
434
5297ebb3
JD
4352009-10-16 Joel E. Denny <jdenny@clemson.edu>
436
437 cleanup.
438 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
439 of char*.
440 (Sbitset__isEmpty): Use Sbitset instead of char*.
441 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
442 instead of char. This helps to avoid casting errors.
443 (Sbitset__or): Use Sbitset instead of char*.
444
175620d3
JD
4452009-10-16 Joel E. Denny <jdenny@clemson.edu>
446
447 portability: don't assume 8-bit bytes.
448 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
449 * src/Sbitset.h (Sbitset__nbytes): Here.
450 (Sbitset__byteAddress): Here.
451 (Sbitset__bit_mask): Here.
452 (Sbitset__last_byte_mask): Here.
453 (Sbitset__ones): Here.
454 (SBITSET__FOR_EACH): Here.
455
786578e3
JD
4562009-10-11 Joel E. Denny <jdenny@clemson.edu>
457
458 portability: use va_start and va_end in the same function.
459 * src/complain.c (error_message): Move va_end from here...
460 (ERROR_MESSAGE): ... to here.
461
416a9da6
JD
4622009-10-08 Joel E. Denny <jdenny@clemson.edu>
463
464 * data/bison.m4: Update comments for rename to muscle-tab.h.
465
10659d0e
JD
4662009-10-07 Joel E. Denny <jdenny@clemson.edu>
467
468 Minor code cleanup.
469 * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
470 replace all uses with UNIQSTR_CONCAT.
471 * src/uniqstr.c (uniqstr_vsprintf): New function.
472 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
473 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
474 macros.
475
3c5362b8
JD
4762009-10-06 Joel E. Denny <jdenny@clemson.edu>
477
478 * TODO (Complaint submessage indentation): New.
479
b143f404
JD
4802009-10-04 Joel E. Denny <jdenny@clemson.edu>
481
482 Minor code cleanup.
483 * src/parse-gram.y: Clean up sorting of declarations.
484 Use types to simplify %printer declarations where possible.
485 Provide %printer for BRACKETED_ID and symbol.prec.
486 * src/symtab.c: Whitespace change.
487
7439c5c0
JD
4882009-10-04 Joel E. Denny <jdenny@clemson.edu>
489
490 tests: skip tests of file names that platform does not support.
491 Reported by Michael Raskin at
492 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
493 * THANKS (Michael Raskin): Add.
494 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
495 to fail at least for file names containing ":" or "\".
496
45319f13
JD
4972009-09-23 Joel E. Denny <jdenny@clemson.edu>
498
499 yysyntax_error: avoid duplicate lookahead collection.
500 Except when memory reallocation is required, this change
501 eliminates the need to invoke yysyntax_error twice and thus to
502 repeat the collection of lookaheads. It also prepares for
503 future extensions that will make those repetitions more
504 expensive and that will require additional memory management in
505 yysyntax_error. Finally, it fixes an obscure bug already
506 exercised in the test suite.
507 * data/yacc.c (yysyntax_error): Add arguments for message
508 buffer variables stored in the parser. Instead of size, return
509 status similar to yyparse status but indicating success of
510 message creation. Other than the actual reallocation of the
511 message buffer, import and clean up memory management code
512 from...
513 (yyparse, yypush_parse): ... here.
514 * tests/regression.at (parse.error=verbose overflow): No longer
515 an expected failure.
516
52cea04a
JD
5172009-09-23 Joel E. Denny <jdenny@clemson.edu>
518
519 yysyntax_error: test memory management more.
520 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
521 * tests/regression.at (parse.error=verbose and
522 YYSTACK_USE_ALLOCA): New test group.
523 (parse.error=verbose overflow): New test group that reveals an
524 obscure bug. Expected fail for now.
525
37318e2f
JD
5262009-10-04 Joel E. Denny <jdenny@clemson.edu>
527
528 benchmarks: use %debug consistently among grammars.
529 * etc/bench.pl.in (generate_grammar_triangular): Do not activate
530 %debug by default. It can affect the timings even if yydebug=0.
531 (generate_grammar_calc): For consistency with other grammars,
532 use YYDEBUG environment variable to set yydebug.
533
f74d6d25
JD
5342009-10-03 Joel E. Denny <jdenny@clemson.edu>
535
536 Remove dead code.
537 * src/symtab.c (symbol_pack): Here because every symbol's number
538 is always defined by this time.
539
5b1ff423
AR
5402009-10-03 Alex Rozenman <rozenman@gmail.com>
541
542 Add additional space after periods in NEWS.
543 * NEWS (2.5): here.
544
47eced30
JD
5452009-09-29 Joel E. Denny <jdenny@clemson.edu>
546
547 Use the correct conversion specifier for size_t.
548 Reported by Jim Meyering.
549 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
550 because Sbitset__Index is size_t.
551 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
552
d8f68fc2
JD
5532009-09-27 Joel E. Denny <jdenny@clemson.edu>
554
555 tests: don't abuse AT_BISON_CHECK.
556 * tests/regression.at (parse-gram.y: LALR = IELR): Move
557 additional shell commands outside of AT_BISON_CHECK.
558
43aabb70
JD
5592009-09-26 Joel E. Denny <jdenny@clemson.edu>
560
561 tests: check that parse-gram.y's IELR and LALR are identical.
562 * tests/atlocal.in (abs_top_srcdir): New shell variable.
563 * tests/regression.at (parse-gram.y: LALR = IELR): New test
564 group.
565
66381412
AR
5662009-09-19 Alex Rozenman <rozenman@gmail.com>
567
568 Keep sub-messages aligned. Fix strings for translation.
5b1ff423
AR
569 * src/location.h (location_print): Add return value.
570 * src/location.c (location_print): Return number of printed
66381412 571 characters.
5b1ff423
AR
572 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
573 new functions.
574 * src/complain.cpp (indent_ptr): New static variable.
575 (error_message, complain_at_indent, warn_at_indent): Implement
576 the alignment mechanism.
577 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
578 for translations. Use new alignment mechanism.
579 * tests/named-ref.at: Adjust test-cases.
66381412
AR
580 * NEWS (2.5): Add an announcement about named references.
581
a6ca4ce2
AD
5822009-09-17 Akim Demaille <demaille@gostai.com>
583
584 doc: fixes.
585 * doc/bison.texinfo: here.
586 Reported by Alex Rozenman.
587
3cdc21cf
AD
5882009-09-16 Akim Demaille <demaille@gostai.com>
589
590 doc: lalr1.cc and variants.
591 * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and
592 "variant" %define variables.
593 (C++ Semantic Values): Split into...
594 (C++ Unions, C++ Variants): these.
595 The latter is new.
596 (C++ Parser Interface): Fix type names.
597 Document parser::syntax_error.
598 Document the fact that locations are not mandatory.
599 (C++ Scanner Interface): Split into...
600 (Split Symbols, Complete Symbols): these.
601 The later is new.
602 (Calc++ Parsing Driver): Use variants.
603 Add more comments.
604 Adjust style.
605 (Calc++ Parser): Declare all the tokens, no
606 longer accept raw characters.
607 Remove %union.
608 Adjust types and printers.
609 Remove destructors.
610 (Calc++ Scanner): Use make_<SYMBOL> functions.
611 Use strerror in error message.
612
f50bfcd6
AD
6132009-09-16 Akim Demaille <demaille@gostai.com>
614
615 doc: spell checking.
616 * doc/bison.texinfo: here.
617
6b5a0de9
AD
6182009-09-16 Akim Demaille <demaille@gostai.com>
619
620 doc: comment changes.
621 * doc/bison.texinfo: Comment changes.
622
2b08bceb
AD
6232009-09-16 Akim Demaille <demaille@gostai.com>
624
625 lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS.
626 * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the
627 constructor to take a token_type instead of the (internal) symbol
628 number.
629 Call yytranslate_.
630 * data/variant.hh (b4_symbol_constructor_define_): Therefore,
631 don't call yytranslate_ here.
632
c981ce9b
AD
6332009-09-16 Akim Demaille <demaille@gostai.com>
634
635 TODO: statistics.
636 * TODO (Figures): New.
637
00d80a9c
JD
6382009-09-13 Joel E. Denny <jdenny@clemson.edu>
639
640 tests: clean up push.at test group titles.
641 * tests/push.at: Remove "Push Parsing: " from test group titles
642 because these are already under the banner "Push Parsing Tests".
643
f64e406b
AR
6442009-09-12 Alex Rozenman <rozenman@gmail.com>
645
646 Provide an additional sub-message for clarity.
647 Add "symbol not found in production" error message when
648 an "invalid reference" is detected in named references
649 resolution.
650 * src/scan-code.l: Update "invalid reference" case.
651 * tests/named-ref.at: Adjust test-cases.
652
bb31eb56
JD
6532009-09-10 Joel E. Denny <jdenny@clemson.edu>
654
655 Clean up yacc.c a little.
656 * data/yacc.c: Clean up M4 for readability, and make output
657 whitespace more consistent. For the main parse function
658 comment, instead of saying "yyparse or yypush_parse", say either
659 "yyparse" or "yypush_parse" depending on which it actually is.
660
2d399888
JD
6612009-09-10 Joel E. Denny <jdenny@clemson.edu>
662
663 Fix --enable-gcc-warnings.
664 * src/parse-gram.y (%printer <param>): Handle param_none.
665
ff601366
AD
6662009-09-09 Akim Demaille <demaille@gostai.com>
667
668 lalr1.cc: syntax_error as exceptions.
669 It is common to use sort of factories in the user actions. These
670 factories may check some "syntactic" constraints that are not
671 enforced by the grammar itself. This is possible using YYERROR
672 within the action itself. Provide the user with a means to throw
673 a syntax_error exception.
674
675 * data/c++.m4 (b4_public_types_declare, b4_public_types_define):
676 Declare and define yy::parser::syntax_error.
677 * data/lalr1.cc: Include stdexcept.
678 (yy::parser::parse): Wrap the user action within a try/catch.
679 * data/glr.cc: Include stdexcept.
680
29660062
AD
6812009-09-09 Akim Demaille <demaille@gostai.com>
682
683 lalr1.cc: add missing "inline".
684 * data/c++.m4 (b4_public_types_define): Add missing inline to
685 implementations provided in headers.
686
2055a44e
AD
6872009-09-09 Akim Demaille <demaille@gostai.com>
688
689 %param: documentation.
690 * NEWS (2.6): Document %param, %lex-param, and %parse-param
691 changes.
692 * doc/bison.texinfo: Document that %lex-param and %parse-param
693 are n-ary.
694 Changes some examples to demonstrate it.
695 (Calc++ Parser): Use %param.
696
dd875058
AD
6972009-09-09 Akim Demaille <demaille@gostai.com>
698
699 Regen.
700
f71db70b
AD
7012009-09-09 Akim Demaille <demaille@gostai.com>
702
703 style changes.
704 * src/parse-gram.y (add_param): Scope changes.
705
eaca4c11
AD
7062009-09-09 Akim Demaille <demaille@gostai.com>
707
708 %parse: support several arguments.
709 * src/parse-gram.y (current_param): New.
710 (param_type): Add param_none.
711 (params): New nonterminal.
712 Use it.
713
b18cdd91
AD
7142009-09-09 Akim Demaille <demaille@gostai.com>
715
716 Regen.
717
a7706735
AD
7182009-09-09 Akim Demaille <demaille@gostai.com>
719
720 %param.
721 Provide a means to factor lex-param and parse-param common
722 declarations.
723
724 * src/parse-gram.y (param_type): New.
725 Define a %printer for it.
726 (add_param): Use it.
727 (%parse-param, %lex-param): Merge into...
728 (%parse): this new token.
729 Adjust the grammar to use it.
730 * src/scan-gram.l (RETURN_VALUE): New.
731 (RETURN_PERCENT_FLAG): Use it.
732 (RETURN_PERCENT_PARAM): New.
733 Use it to support %parse-param, %lex-param and %param.
734
9789acf0
JD
7352009-09-03 Joel E. Denny <jdenny@clemson.edu>
736
737 Use aver not assert.
738 * src/output.c: Don't include assert.h.
739 (output_skeleton): Use aver not assert.
740 * src/system.h (aver): In documentation of why, add links to
741 Paul Eggert's explanations in the mailing lists.
742
61bc57e5
AR
7432009-09-05 Alex Rozenman <rozenman@gmail.com>
744
745 Use "Unresolved reference" error message when no symbols were found
746 in a symbolic reference resolution. Remove .expr and -expr from
747 the shown reference when the reference is unresolved.
748 * src/scan-code.l: Change the error message, adjust location columns,
749 rename variable "exact_mode" to "explicit_bracketing".
750 * tests/named-ref.at: Adjust existing tests and add a new one.
751
f4c75eaf
AD
7522009-09-04 Akim Demaille <demaille@gostai.com>
753
754 Adjust synclines in src/parse-gram.[ch].
755 * tests/bison.in: Do some magic (including working around issues
756 with ylwrap) when this wrapper is used to compile
757 src/parse-gram.y.
758
c6abeab1
JD
7592009-09-03 Joel E. Denny <jdenny@clemson.edu>
760
761 Complain about unused %define variables and %code qualifiers.
762 * NEWS (2.5): Document.
763 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
764 * doc/bison.texinfo (Decl Summary): Document complaint, and
765 improve %define documentation a little otherwise.
766 * tests/input.at (Reject unused %code qualifiers): Update.
767 (%define errors): Update.
768 (%define, --define, --force-define): Update.
769 (%define backward compatibility): Update.
770 (Unused %define api.pure): Update.
771 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
772
82db7cdb
JD
7732009-09-03 Joel E. Denny <jdenny@clemson.edu>
774
775 Don't suppress warnings about unused parse.error.
776 * data/bison.m4 (b4_error_verbose_flag): Don't examine value of
777 %define variable parse.error unless b4_error_verbose_flag is
778 actually expanded in a skeleton.
779
2755de8f
AD
7802009-09-03 Akim Demaille <demaille@gostai.com>
781
782 * NEWS (2.4.2): Add "Internationalization" item.
783
1deef26d
AD
7842009-09-03 Akim Demaille <demaille@gostai.com>
785
786 bootstrap: fix/improve find_tool.
787 * bootstrap (find_tool): Improve error messages.
788 Fix typo about find_tool_names.
789
2646cd54
JD
7902009-08-29 Joel E. Denny <jdenny@clemson.edu>
791
792 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
793 See
794 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
795 * src/scan-code.h (code_props_rule_action_init): Rename
796 named_ref arg to name so it doesn't shadow named_ref type. This
797 makes it consistent with the function definition in scan-code.l
798 anyway.
799
cf499cff
JD
8002009-08-28 Joel E. Denny <jdenny@clemson.edu>
801
802 %define: accept unquoted values.
803 * NEWS (2.5): Group all %define changes together, and document
804 this one. Remove quotes in IELR and canonical LR entry.
805 * doc/bison.texinfo: Remove quotes in most examples throughout.
806 (Decl Summary): Update %define documentation.
807 (Table of Symbols): Likewise.
808 * src/ielr.c (LrType): Update documentation.
809 * src/parse-gram.y (content.opt): Add production for ID.
810 * tests/actions.at: Remove quotes in most tests.
811 * tests/calc.at: Likewise.
812 * tests/existing.at: Likewise.
813 * tests/input.at: Likewise.
814 * tests/local.at: Likewise.
815 * tests/push.at: Likewise.
816 * tests/reduce.at: Likewise.
817 * tests/torture.at: Likewise.
818
6ba96404
JD
8192009-08-28 Joel E. Denny <jdenny@clemson.edu>
820
821 %define lr.type: make values lowercase IDs.
822 That is, "LALR" => "lalr", "IELR" => "ielr", and
823 "canonical LR" => "canonical-lr".
824 * NEWS (2.5): Update documentation.
825 * doc/bison.texinfo (Decl Summary): Likewise.
826 * src/ielr.c (ielr): Use new values.
827 * src/ielr.h (ielr): Update documentation.
828 * src/reader.c (prepare_percent_define_front_end_variables): Use
829 and validate new values.
830 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
831 grammars.
832 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
833
4413bbd3
EB
8342009-08-27 Eric Blake <ebb9@byu.net>
835
836 scan-gram: avoid portability trap with ctype usage.
837 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
838 Avoid compiler warning.
839
b70c7fb4
JD
8402009-08-27 Joel E. Denny <jdenny@clemson.edu>
841
842 tests: use perl for printing special sequences to files.
843 And skip tests if perl is not available. This is better than
844 playing tricks with shell portability. Suggested by Akim
845 Demaille.
846 * tests/input.at (Bad character literals): Use it here for
847 omitting final newlines.
848 (Bad escapes in literals): Use it here for special characters.
849
d1cc31c5
JD
8502009-08-26 Joel E. Denny <jdenny@clemson.edu>
851
852 tests: show a use of %define lr.default-reductions "consistent"
853 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
854 prevents the omission of expected tokens for %error-verbose.
855
3bed3a75
AD
8562009-08-26 Akim Demaille <demaille@gostai.com>
857
858 tests: portability fix.
859 * tests/input.at (Bad escapes in literals): Don't expect "echo
860 '\0'" to output \ then 0.
861
aa0cb40d
JD
8622009-08-26 Joel E. Denny <jdenny@clemson.edu>
863
864 Actually handle the yytable zero value correctly this time.
865 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
866 zero values in the YYTABLE comments.
867 * data/glr.c (yytable_value_is_error): Don't check for zero
868 value.
869 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
870 * data/yacc.c (yytable_value_is_error): Likewise.
871 * data/lalr1.java (yy_table_value_is_error_): Likewise.
872 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
873 * src/tables.h: In header comments, explain why it's useless to
874 check for a zero value in yytable.
875
f2b30bdf
JD
8762009-08-25 Joel E. Denny <jdenny@clemson.edu>
877
878 More fixes related to last two patches.
879 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
880 comments: zero indicates syntax error not default action.
881 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
882 defined.
883 * data/glr.c (yyis_pact_ninf): Rename to...
884 (yypact_value_is_default): ... this.
885 (yyisDefaultedState): Update for rename.
886 (yyis_table_ninf): Rename to...
887 (yytable_value_is_error): ... this, and check for value zero
888 besides just YYTABLE_NINF.
889 (yygetLRActions): Check for default value from yypact. It
890 appears that this check is always performed before this function
891 is invoked, and so adding the check here is probably redundant.
892 However, the code may evolve after this subtlety is forgotten.
893 Also, update for rename to yytable_value_is_error. Because that
894 macro now checks for zero, a different but equivalent branch of
895 the if-then-else here is evaluated.
896 (yyreportSyntaxError): Update for rename to
897 yytable_value_is_error. The zero condition was mishandled
898 before.
899 (yyrecoverSyntaxError): Update for renames. No behavioral
900 changes.
901 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
902 New function.
903 (yy_table_value_is_error_): New function.
904 (parse): Use new functions where possible. No behavioral
905 changes.
906 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
907 The zero condition was mishandled before.
908 * data/yacc.c (yyis_pact_ninf): Rename to...
909 (yypact_value_is_default): ... this.
910 (yyis_table_ninf): Rename to...
911 (yytable_value_is_error): ... this, and check for value zero
912 besides just YYTABLE_NINF.
913 (yysyntax_error): Update for rename to yytable_value_is_error.
914 The zero condition was mishandled before.
915 (yyparse): Update for renames. No behavioral changes.
916 * src/tables.h: Improve comments about yypact, yytable, etc.
917 more. Most importantly, say yytable value of zero means syntax
918 error not default action.
919
53f036ce
JD
9202009-08-25 Joel E. Denny <jdenny@clemson.edu>
921
922 Fix %error-verbose for conflicts resolved by %nonassoc.
923 * NEWS (2.5): Document.
924 * data/glr.c (yyreportSyntaxError): Fix this by checking
925 yyis_table_ninf.
926 * data/yacc.c (yysyntax_error): Likewise.
927 * data/lalr1.cc (yysyntax_error_): Fix this by checking
928 yytable_ninf_.
929 * data/lalr1.java (yysyntax_error): Likewise.
930 * tests/conflicts.at (%nonassoc and eof): Update expected output
931 and remove FIXME.
932
87412882
JD
9332009-08-25 Joel E. Denny <jdenny@clemson.edu>
934
935 Some code and documentation improvements.
936 * data/c.m4 (b4_table_value_equals): New macro to capture
937 some repeated code.
938 * data/glr.c (yyis_pact_ninf): Use it here.
939 (yyis_table_ninf): Likewise.
940 (yyreportSyntaxError): Improve internal comments.
941 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
942 Use it everywhere possible.
943 (yyis_table_ninf): Likewise.
944 (yysyntax_error): Improve internal comments.
945 * data/lalr1.cc (yysyntax_error_): Likewise.
946 * data/lalr1.java (yysyntax_error): Likewise.
947 * src/tables.h: Improve comments about yypact, yytable, etc.
948
e6c849d8
JD
9492009-08-21 Joel E. Denny <jdenny@clemson.edu>
950
951 Use locale when quoting.
952 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
953 quote rather than implementing quoting here.
954
d8911864
EB
9552009-08-20 Eric Blake <ebb9@byu.net>
956
b0778bdd
EB
957 Make previous patch more robust.
958 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
959 argmatch.h.
960 (output_skeleton): Use it.
961 Suggested by Akim Demaille.
962
d8911864
EB
963 Import latest m4/m4.m4.
964 * submodules/autoconf: Update to autoconf 2.64.
965 * configure.ac (M4_GNU_OPTION): New define.
966 * src/output.c (output_skeleton): Use it to resolve FIXME.
967 * NEWS: Mention this.
968
c2724603
JD
9692009-08-19 Joel E. Denny <jdenny@clemson.edu>
970
971 Fix complaints about escape sequences.
972 Discussed starting at
973 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
974 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
975 For a \0 and similar escape sequences meaning the null
976 character, report an invalid escape sequence instead of an
977 invalid null character because the latter does not actually
978 appear in the user's input.
979 In all escape sequence complaints, don't escape the initial
980 backslash, and don't quote when the sequence appears at the end
981 of the complaint line unless there's whitespace that quotearg
982 won't escape.
983 Consistently say "invalid" not "unrecognized".
984 Consistently prefer "empty character literal" over "extra
985 characters in character literal" warning for invalid escape
986 sequences; that is, consistently discard those sequences.
987 * tests/input.at (Bad escapes in literals): New.
988
17aed602
AD
9892009-08-19 Akim Demaille <demaille@gostai.com>
990
991 doc: fixes.
992 * doc/bison.texinfo: Fix minor Texinfo errors.
993
9142239a
AD
9942009-08-19 Akim Demaille <demaille@gostai.com>
995
996 tests: distcc compliance.
997 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
998 error messages from the output.
999
171ad99d
AD
10002009-08-19 Akim Demaille <demaille@gostai.com>
1001
1002 variables: simplify the upgrade of namespace into api.namespace.
1003
1004 This patch simplifies "variables: rename namespace as
1005 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
1006 Suggested by Joel E. Denny in
1007 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
1008
1009 * src/muscle-tab.c (muscle_percent_variable_update): New.
1010 (muscle_percent_define_insert): Use it in replacement of the
1011 previous tr invocation.
1012 Remove variable_tr, no longer needed.
1013 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1014 Remove.
1015 * data/c++.m4: No longer handle namespace -> api.namespace.
1016 * tests/input.at (%define backward compatibility): Check that
1017 namespace is treated as api.namespace.
1018
d59e456d
AD
10192009-08-19 Akim Demaille <demaille@gostai.com>
1020
1021 doc: %initial-action to initialize yylloc.
1022 Reported by Bill Allombert.
1023 * doc/bison.texinfo: Set fill-column to 76.
1024 (Location Type): Document the use of %initial-action to initialize
1025 yylloc.
1026
ceb8b8e6
AD
10272009-08-19 Akim Demaille <demaille@gostai.com>
1028
1029 lalr1.cc: use state_type.
1030 * data/lalr1.cc (yysyntax_error_): Use state_type.
1031 Move argument names into yy*.
1032
7580c379
AD
10332009-08-19 Akim Demaille <demaille@gostai.com>
1034
1035 lalr1.cc: get rid of yyparse's yystate.
1036 yystate and yystack_[0].state are equal, keep only the latter.
1037 The former was also used as a temporary variable to compute the
1038 post-reduction state. Move this computation into an auxiliary
1039 function.
1040
1041 * data/glr.c (yyLRgotoState): Fuse variable definition and first
1042 assignment.
1043 * data/lalr1.cc (yy_lr_goto_state_): New.
1044 (yyparse): Use it.
1045 Replace remaining uses of yystate by yystate_[0].state.
1046 Remove the former.
1047
c4dc4c46
AD
10482009-08-19 Akim Demaille <demaille@gostai.com>
1049
1050 lalr1.cc: destroy $$ when YYERROR is called.
1051 * data/lalr1.cc (yyreduce): Compute the resulting state before
1052 running the user action so that yylhs is a valid symbol.
1053 (yyerrorlab): Since yylhs is complete (it knows its type), we can
1054 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
1055 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
1056
c67e466f
JD
10572009-08-18 Joel E. Denny <jdenny@clemson.edu>
1058
1059 maint: update for gnulib's recent update-copyright changes
1060 * gnulib: Update.
1061 * .x-update-copyright (COPYING): Add as it's no longer implied
1062 when .x-update-copyright is present.
1063 * cfg.mk (update-copyright-local): Remove, now ignored.
1064 (update-copyright): Declare update-b4-copyright as a dependency.
1065
af6d2358
AD
10662009-08-17 Akim Demaille <demaille@gostai.com>
1067
1068 build: require gettext 0.17.
1069
1070 Suggested by Bruno Haible.
1071 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
1072 * configure.ac: require gettext 0.17 to ensure compatibility with
1073 gnulib.
1074
91a2b9b1
AD
10752009-08-17 Akim Demaille <demaille@gostai.com>
1076
1077 build: lower gettext requirements.
1078
1079 Bison was uselessly requiring the formatstring macros from
1080 gettext, which resulted in mo files not being installed on systems
1081 that perfectly supported Bison mo files. Lower the requirement.
1082 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
1083
b0778bdd
EB
1084 * configure.ac: Require need-ngettext instead of
1085 need-formatstring-macros.
1086 Reported by Martin Jabocs.
1087 Suggested by Bruno Haible.
1088 * INSTALL: Restructure.
1089 (Internationalization): New.
91a2b9b1 1090
585935e8
JD
10912009-08-14 Joel E. Denny <jdenny@clemson.edu>
1092
1093 maint: fix use of copyright year intervals.
1094 * gnulib: Update.
1095 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
1096 as now recommended in gnulib/NEWS.
1097 * build-aux/update-b4-copyright: Fix.
1098 * cfg.mk (update-copyright-env): Configure update-copyright.
1099
83b60c97
JD
11002009-08-13 Joel E. Denny <jdenny@clemson.edu>
1101
1102 Make it easier to write deterministic tests.
1103 Continues Akim's work from his 2009-06-10 commits.
1104 * src/reader.c (check_and_convert_grammar): Don't add any
1105 symbols after the first symbols_do invocation.
1106 * src/symtab.c (symbols_sorted): New static global.
1107 (user_token_number_redeclaration): Update comments.
1108 (symbol_from_uniqstr): If a new symbol is being created, assert
1109 that symbols_sorted hasn't been allocated yet.
1110 (symbols_free): Free symbols_sorted.
1111 (symbols_cmp, symbols_cmp_qsort): New functions.
1112 (symbols_do): Sort symbol_table into symbols_sorted on first
1113 invocation.
1114 * tests/input.at (Numbered tokens): Recombine tests now that the
1115 output should be deterministic across multiple numbers.
1116
28169bab
AD
11172009-08-12 Akim Demaille <demaille@gostai.com>
1118
1119 tests: GCC 4.5 compliance.
1120 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
1121 messages about #error.
1122
9f14e187
AD
11232009-08-12 Akim Demaille <demaille@gostai.com>
1124
1125 build: fix the generation of the documentation.
1126 Some of our targets use "bison --help", but they can't depend on
1127 "bison" itself (to avoid additional requirements on the user), so
1128 they used to call "make src/bison" in the commands. Then
1129 concurrent builds may fail: one make might be aiming one of its
1130 jobs at compiling src/bison, and another job at generating the man
1131 page. If the latter is faster than the former, then we have two
1132 makes that concurrently try to compile src/bison.
1133
1134 This might also be a more convincing explanation for the failure
1135 described in the patch "build: fix paths".
1136
1137 * Makefile.am (SUFFIXES): Initialize.
1138 * build-aux/move-if-change: New, symlink to gnulib's.
1139 * build-aux/local.mk: Ship it.
1140 * doc/common.x: Remove, merged into...
1141 * doc/bison.x: here.
1142 * doc/local.mk (doc/bison.help): New.
1143 ($(CROSS_OPTIONS_TEXI)): Depend on it.
1144 Use src/bison.
1145 (.x.1): Replace with...
1146 (doc/bison.1): this explicit, simpler, target.
1147 (common_dep): Remove, inlined where appropriate.
1148 (SUFFIXES, PREPATH): Remove, unused.
1149
d1b55e81
AD
11502009-08-12 Akim Demaille <demaille@gostai.com>
1151
1152 gnulib: improve prefixing.
1153 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
1154 change the value of...
1155 (gl_LIBOBJS): this.
1156 Adjust more variables.
1157 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
1158 gl_LIBOBJS.
1159 (prefix): Also transform rules whose targets have slashes.
1160 Use $prefix liberally.
1161 Map @MKDIR_P@ to $(MKDIR_P).
1162 Prefix directories that are mkdir'd.
1163
838205d5
AD
11642009-08-12 Akim Demaille <demaille@gostai.com>
1165
1166 build: fix paths.
1167 When using $(top_builddir) inconsistently, Make (including GNU
1168 Make) is sometimes confused. As a result it may want to build
1169 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
1170 file, different names) concurrently, which, amusingly enough,
1171 might end with:
1172
1173 ranlib lib/libbison.a
1174 ranlib lib/libbison.a
1175 make[2]: *** [lib/libbison.a] Segmentation fault
1176
1177 on OS X.
1178
1179 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
1180 needed.
1181
67af7198
AD
11822009-08-12 Akim Demaille <demaille@gostai.com>
1183
1184 distcheck: fix.
1185
b0778bdd 1186 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
67af7198 1187
c467dc42
JD
11882009-08-10 Joel E. Denny <jdenny@clemson.edu>
1189
1190 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
1191
dfaa4860
JD
11922009-08-10 Joel E. Denny <jdenny@clemson.edu>
1193
1194 Miscellaneous code readability improvements.
1195
1196 * src/reader.c (reader): Move %define front-end variable
1197 defaults and checking into...
1198 (prepare_percent_define_front_end_variables): ... this new
1199 function.
1200
1201 * src/scan-gram.l (INITIAL): For consistency with string
1202 literals, don't store open quote on character literal. It's
1203 discarded before returning anyway.
1204 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
1205 Make length test more readable, and make the character stored
1206 for an empty literal more obvious while consistent with the
1207 previous behavior.
1208
1209 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
1210 USER_NUMBER_HAS_STRING_ALIAS throughout.
1211 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
1212 that is repeated in symtab.h. Improve argument names to make it
1213 clear which side of the symbol-string alias pair is which.
1214 (symbol_check_alias_consistency): Improve local variable names
1215 for the same purpose.
1216 * src/symtab.h (struct symbol): Make comments about aliases
1217 clearer.
1218 (symbol_make_alias): Improve comments and argument name.
1219 * src/output.c (token_definitions_output): Update for rename to
1220 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
1221
ce268795
AR
12222009-08-08 Alex Rozenman <rozenman@gmail.com>
1223
1224 Convert "misleading reference" messages to warnings.
1225 * src/scan-code.l: New function 'show_sub_messages', more
1226 factoring.
1227 * tests/named-ref.at: Adjust tests.
1228
401b73af
JD
12292009-08-06 Joel E. Denny <jdenny@clemson.edu>
1230
1231 maint: run "make update-copyright"
1232
a1a9422d
JD
12332009-08-06 Joel E. Denny <jdenny@clemson.edu>
1234
1235 maint: make update-b4-copyright easier to use
1236 * build-aux/update-b4-copyright: In warnings, report line
1237 numbers rather than character positions.
1238 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
1239 that update-copyright runs it.
1240 * gnulib: Update.
1241
0b61a8ec
JD
12422009-08-05 Joel E. Denny <jdenny@clemson.edu>
1243
1244 maint: clean up update-b4-copyright code
1245 * build-aux/update-b4-copyright: Do not accept 2-digit
1246 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
1247 Don't accept a `[' in a b4_copyright argument.
1248 Format code more consistently.
1249 Don't assume b4*copyright never occurs.
1250
269e222e
JD
12512009-08-04 Joel E. Denny <jdenny@clemson.edu>
1252
1253 maint: automate b4_copyright updates.
1254 * Makefile.am (update-b4-copyright): New target rule.
1255 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
1256 * build-aux/update-b4-copyright: New.
1257 * data/yacc.c: Remove stray characters around b4_copyright
1258 invocations.
1259
35905f2b
JD
12602009-08-04 Joel E. Denny <jdenny@clemson.edu>
1261
1262 maint: automate annual package-wide copyright-year update.
1263 * .x-update-copyright: New.
1264 * Makefile.am (EXTRA_DIST): Remove maint.mk.
1265 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
1266 update-copyright. Remove gnumakefile, which is implied by
1267 maintainer-makefile.
1268 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
1269 * gnulib: Update.
1270 * maint.mk: Remove, now copied from gnulib.
1271 * examples/extexi: Add missing "(C)" in copyright statement so
1272 update-copyright can recognize it.
1273 * src/LR0.h: Likewise.
1274 * src/print.h: Likewise.
1275 * src/print_graph.h: Likewise.
1276 * src/gram.c: Add missing comma in copyright statement.
1277 * src/gram.h: Likewise.
1278
b30e18dc
JD
12792009-08-04 Joel E. Denny <jdenny@clemson.edu>
1280
1281 Fix "make distcheck".
1282 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
1283 of just calc.stamp.
1284
8d90395d
JD
12852009-08-01 Joel E. Denny <jdenny@clemson.edu>
1286
1287 Pacify "gcc -Wunused" for the input function from Flex.
1288 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
1289 and later.
1290 * src/scan-code.l: Add "%option noinput", which I cannot find in
1291 the Flex manual, but which Flex has supported since at least as
1292 far back as 2.5.4. However, if any of our developers still use
1293 Flex 2.5.4, they'll need to stop configuring with
1294 --enable-gcc-warnings because "%option noinput" didn't work
1295 correctly until Flex 2.5.6.
1296 * src/scan-gram.l: Likewise.
1297 * src/scan-skel.l: Likewise.
1298
ba4184ec
AR
12992009-07-31 Alex Rozenman <rozenman@gmail.com>
1300
1301 Fix --enable-gcc-warnings problems.
1302 * src/reader.c: Adjust variable names.
1303 * src/scan-code.l: Fix prototypes and adjust names.
1304 * src/named-ref.c: Remove redundant "if".
1305
91a2af97
JD
13062009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1307
1308 Fix a --enable-gcc-warnings problem.
1309 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
1310 variable.
1311
3208e3f4
JD
13122009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1313
1314 Warn about character literals not of length one.
1315 * NEWS (2.5): Document.
1316 * src/scan-gram.l (INITIAL): Remove comment that we don't check
1317 the length.
1318 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
1319 * tests/input.at (Bad character literals): New test group.
1320
5add20ab 13212009-07-24 Alex Rozenman <rozenman@gmail.com>
13cdf208
AR
1322
1323 Fix some memory leaks.
1324 * src/named-ref.c: Add a pointer check (named_ref_free).
1325 * src/scan-code.l: New function (variant_table_free). Called in
1326 code_scanner_free.
1327 * src/symlist.c: Call to named_ref_free (symbol_list_free).
1328
e459fb0e
JD
13292009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1330
1331 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
1332
c4be5517
JD
13332009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
1334
1335 Some M4 cleanup in the testsuite.
1336 Suggested by Eric Blake at
1337 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
1338 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
1339 complicate the code by distinguishing between a missing value
1340 and an empty string value for an optional argument. This fix is
1341 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
1342 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
1343 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
1344 arguments are not needed because of the following changes.
1345 Fix stale comments.
1346 Bison developers should use GNU M4 and should not use
1347 POSIXLY_CORRECT when building the test suite, so do not
1348 complicate the code by avoiding $10 and above.
1349 Do not quote an empty string value for an optional argument, and
1350 do not distinguish between a missing value and an empty string
1351 value.
1352
feeb56cd
JD
13532009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1354
1355 Revert unnecessary column realignment in --help output.
1356 Reported by Akim Demaille at
1357 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
1358 * src/getargs.c (usage): Here.
1359
5add20ab 13602009-07-04 Alex Rozenman <rozenman@gmail.com>
629e4def
AR
1361
1362 Alphabetical order in src/local.mk.
1363 * src/local.mk: Adjust.
1364
5add20ab 13652009-07-04 Alex Rozenman <rozenman@gmail.com>
872b52bc
AR
1366
1367 Style changes and factoring.
1368 * src/named-ref.h: Add comments.
1369 * src/parse-gram.y: Readability and style changes.
1370 * src/reader.c: Factoring: assign_named_ref function.
1371 * src/scan-code.l: Factoring and style changes. Rename
1372 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
1373 Use "unsigned" type for variant index. Improve readablity.
1374 * src/scan-gram.l: Change error messages and add comments.
1375 * src/symlist.h: symbol_list_null: New function decl.
1376 * src/symlist.c: symbol_list_null: Implement here.
1377 * tests/named-refs.at: Adjust for new error messages.
1378
83ea2423
EB
13792009-06-29 Eric Blake <ebb9@byu.net>
1380
1381 scan-code: avoid compiler warnings
1382 * src/scan-code.l (parse_named_ref): Use correct specifiers.
1383
5ece73ea
AD
13842009-06-29 Akim Demaille <demaille@gostai.com>
1385
1386 build: avoid concurrent extraction of calc++.
1387 * examples/calc++/Makefile.am (calc.stamp): New.
1388 Depend on it to create the sources of calc++ so that concurrent
1389 builds don't launch several "extexi" in parallel.
1390 Not only this is inefficient, this also builds incorrect sources
1391 with several extractions mixed together.
1392
ad597a78
AD
13932009-06-29 Akim Demaille <demaille@gostai.com>
1394
1395 parse.error: fix.
1396 * data/bison.m4: Move code related to specific variables after the
1397 definition of the variable-maintaining macros so that we don't
1398 "invoke" b4_percent_define_check_values before it is defined.
1399
31b850d2
AD
14002009-06-29 Akim Demaille <demaille@gostai.com>
1401
1402 variables: parse.error
1403
1404 Implement, document, and test the replacement of %error-verbose
1405 by %define parse.error "verbose".
1406 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
1407 values of the parse.error variable.
1408 Make "simple" its default value.
1409 Check the valid values.
1410 * src/parse-gram.y: Use %define parse.error.
1411 (PERCENT_ERROR_VERBOSE): New token.
1412 Support it.
1413 * src/scan-gram.l: Support %error-verbose.
1414
1415 * doc/bison.texinfo (Decl Summary): Replace the documentation of
1416 %define error-verbose by that of %define parse.error.
1417 * NEWS: Document it.
1418
1419 * tests/actions.at, tests/calc.at: Use parse.error instead of
1420 %error-verbose.
1421
b9f1d9a4
AR
14222009-06-27 Alex Rozenman <rozenman@gmail.com>
1423
1424 Implement support for named symbol references.
1425 * src/parse-gram.y: Add new syntax (named_ref.opt).
1426 * src/reader.c: Store named refs in symbol lists.
1427 * src/reader.h: New argument for symbol_append and
1428 action_append functions.
1429 * src/scan-code.h: Add new field (named_ref) into
1430 code_props data structure. Keeps named ref of midrule
1431 actions.
1432 * src/scan-code.l: Support for named refs in semantic
1433 action code. New function 'parse_named_ref'.
1434 * src/scan-gram.l: Support bracketed id.
1435 * src/symlist.c: Store named refs in symbol lists.
1436 * src/symlist.h: New field in symbol list: named_ref.
1437 * src/named-ref.h: New file, a struct for named_ref.
1438 * src/named-ref.cp: New file, named_ref_new function.
1439 * src/local.mk: Add two new files.
1440 * tests/testsuite.at: Include new test group:
1441 * tests/named-refs.at: this new file.
1442
b5c212b6
AD
14432009-06-25 Akim Demaille <demaille@gostai.com>
1444
1445 hash: check insertion for memory exhaustion.
1446 * src/uniqstr.c (uniqstr_new): New.
1447
67501061
AD
14482009-06-24 Akim Demaille <demaille@gostai.com>
1449
1450 variables: rename namespace as api.namespace.
1451 Discussed in
1452 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
1453
1454 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1455 New.
1456 (b4_percent_define_use): New.
1457 Use it where applicable.
1458 * data/c++.m4: Replace uses of the variable "namespace" by
1459 "api.namespace".
1460 Default the latter to the former.
1461 * doc/bison.texinfo (Decl Summary): Document "namespace" as
1462 obsolete.
1463 Document api.namespace.
1464 Use @samp to document %define uses, keep @code for identifiers.
1465 * NEWS: Likewise.
1466 * tests/c++.at, tests/input.at: Test api.namespace instead of
1467 namespace. (The tests passed with namespace.)
1468
41976786
AD
14692009-06-11 Akim Demaille <demaille@gostai.com>
1470
1471 style changes.
1472 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
1473 * src/print-xml.c: Style changes.
1474 * tests/conflicts.at: Comment changes.
1475
44bb9084
AD
14762009-06-11 Akim Demaille <demaille@gostai.com>
1477
1478 xml: beware of user strings used to give a %prec to rules.
1479 * tests/conflicts.at (%prec with user strings): New.
1480 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
1481 XML output.
1482
04d1e39d
AD
14832009-06-11 Akim Demaille <demaille@gostai.com>
1484
1485 hash: check insertion for memory exhaustion.
1486 * src/muscle-tab.c (muscle_insert, muscle_grow)
1487 * src/state.c (state_hash_insert): Check the return value of
1488 hash_insert.
1489
a8873669
AD
14902009-06-11 Akim Demaille <demaille@gostai.com>
1491
1492 tests: honor TESTSUITEFLAGS in every check target.
1493 * tests/local.mk (RUN_TESTSUITE): New.
1494 (check-local, installcheck-local, maintainer-check-g++)
1495 (maintainer-check-posix, maintainer-check-valgrind): Use it.
1496
8893145a
AD
14972009-06-10 Akim Demaille <demaille@gostai.com>
1498
1499 deterministic test suite.
1500 Some consistency checks on symbols are performed after all the
1501 symbols were read, by an iteration over the symbol table. This
1502 traversal is nondeterministic, which can be a problem for test
1503 cases.
1504 Avoid this.
1505 Addresses another form of nondeterminism reported by Joel E. Denny.
1506 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1507
1508 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
1509 test in two.
1510 Use different file names for the three tests to make the
1511 maintenance easier.
1512
92d7a23a
AD
15132009-06-10 Akim Demaille <demaille@gostai.com>
1514
1515 gnulib: update.
b0778bdd
EB
1516 * gnulib: Update to latest.
1517 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
1518 * m4/.gitignore: Regen.
1519 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
1520 Call xalloc_die on hash_insert failures.
1521 Requested by the new __warn_unused_result__ attribute of
1522 hash_insert.
92d7a23a 1523
12cf133f
AD
15242009-06-10 Akim Demaille <demaille@gostai.com>
1525
1526 deterministic user-token-number redeclaration errors.
1527 Address nondeterminism reported by Joel E. Denny.
1528 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1529
1530 * src/uniqstr.h: Comment changes.
1531 * src/location.h (boundary_cmp, location_cmp): New.
1532 * src/symtab.c (user_token_number_redeclaration): New.
1533 (symbol_translation): Use it.
1534 * tests/input.at (Numbered tokens): Adjust the expected output.
1535
796a2b0a
AD
15362009-05-25 Akim Demaille <demaille@gostai.com>
1537
1538 build: avoid ignored errors.
1539 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
1540 errors, they pollute the output.
1541
0b6d43c5
JD
15422009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1543
1544 Convert multiple variable definition warnings to complaints.
1545 * NEWS (2.5): Add a new entry for that change.
1546 * doc/bison.texinfo (Decl Summary): Update %define entry.
1547 (Bison Options): Update -D/--define/-F/--force-define entry.
1548 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
1549 * src/muscle-tab.h (muscle_percent_define_insert): Update
1550 comments.
1551 * tests/input.at (`%define errors'): Update.
1552 (`%define, --define, --force-define'): Update.
1553
de5ab940
JD
15542009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1555
1556 -F/--force-define and relative %define/-D/--define priorities.
1557 * NEWS (2.5): Add documentation to -D/--define entry.
1558 * build-aux/cross-options.pl: Hard-code association of
1559 --force-define with %define.
1560 * doc/bison.texinfo (Decl Summary): In %define entry,
1561 cross-reference command-line options.
1562 (Bison Options): Add documentation to -D/--define entry.
1563 (Option Cross Key): Widen column for --force-define row.
1564 * src/getargs.c (usage): Document -F/--force-define. Realign
1565 options in output.
1566 (short_options, long_options, getargs): Parse -F/--force-define,
1567 and update muscle_percent_define_insert invocations.
1568 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
1569 (muscle_percent_define_insert): Add argument with that type.
1570 * src/muscle-tab.c (muscle_percent_define_insert): Implement
1571 -F/--force-define behavior and priorities.
1572 (muscle_percent_define_ensure): Update
1573 muscle_percent_define_insert invocation.
1574 * src/parse-gram.y (prologue_declaration): Update
1575 muscle_percent_define_insert invocations.
1576 * tests/input.at (`%define, --define'): Rename to...
1577 (`%define, --define, --force-define'): ... this and extend.
1578
f8e7258f
JD
15792009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1580
1581 Update some comments to make sense for -D.
1582 * data/bison.m4 (b4_check_user_names): In header comments, say
1583 "user occurrence" instead of "grammar occurrence".
1584 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
1585 (muscle_percent_code_grow): Likewise just for consistency.
1586
b987342b
JD
15872009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1588
1589 * data/c++.m4 (b4_namespace_close): Simplify slightly.
1590
4977e0a7
JD
15912009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
1592
1593 Handle a trailing `:' in a user-supplied C++ namespace better.
1594 * data/c++.m4 (b4_namespace_close): Don't let it be printed
1595 among the closing braces here. This fix might make the
1596 generated code easier to debug, but otherwise it should be
1597 insignificant because a trailing `:' is a C++ error already.
1598
9b04dad7
AD
15992009-05-19 Akim Demaille <demaille@gostai.com>
1600
1601 remove useless variable.
1602 * src/getargs.c (skeleton_arg): Remove now useless variable.
1603 Should help the compiler see that this printf-like call is sane.
1604
4c6622c2
AD
16052009-05-15 Akim Demaille <demaille@gostai.com>
1606
1607 Rename token.prefix as api.tokens.prefix.
1608 Discussed here.
1609 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
1610
1611 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
1612 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
1613 (token.prefix): Rename as...
1614 (api.tokens.prefix): this.
1615
3c248d70
AD
16162009-05-11 Akim Demaille <demaille@gostai.com>
1617
1618 doc: use C++ headers.
1619 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
1620 headers.
1621
99c08fb6
AD
16222009-05-11 Akim Demaille <demaille@gostai.com>
1623
1624 doc: token.prefix
1625 * doc/bison.simple (Decl Summary): Document token.prefix.
1626 (Calc++ Parser): Various fixes.
1627 Formatting changes.
1628 Use token.prefix.
1629 Introduce a macro TOKEN to shorten the code and make it more
1630 readable.
1631 (Calc++ Scanner): Adjust.
1632 * NEWS (Variable token.prefix): New.
1633
84a1cb5a
AD
16342009-05-04 Akim Demaille <demaille@gostai.com>
1635
1636 bison: catch bad symbol names.
1637 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
1638 * tests/input.at: Adjust.
1639
cdf3f113
AD
16402009-05-04 Akim Demaille <demaille@gostai.com>
1641
1642 identifiers: dashes are letters.
1643 Dashes can now start identifiers (symbols and directives).
84a1cb5a 1644
cdf3f113
AD
1645 * src/scan-gram.l ({letter}): Add dash.
1646 ({id}): Remove it.
1647 * tests/input.at (Symbols): Adjust.
1648 Remove stray comment.
1649 * tests/regression.at (Invalid inputs): Adjust error message.
1650 * doc/bison.texinfo (Symbols): Update.
1651
98a345a2
JD
16522009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
1653
1654 Declare %code to be a permanent feature.
1655 * NEWS (2.4.2): Here.
1656 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
1657 experimental.
1658 (Decl Summary): Likewise.
1659
67212941
JD
16602009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1661
1662 Convert underscores to dashes in some %define variable names.
1663 For now, just api.push-pull and lr.keep-unreachable-states.
1664 Maintain old names for backward compatibility.
1665 * NEWS (2.5): Document.
1666 * data/c.m4 (b4_identification): Update comment.
1667 * data/yacc.c: Update access.
1668 * doc/bison.texinfo: Update.
1669 * etc/bench.pl.in (bench_push_parser): Update use.
1670 * src/files.c (tr): Move to...
1671 * src/getargs.c, src/getargs.h (tr): ... here because I can't
1672 think of a better place to expose it. My logic is that, for all
1673 uses of tr so far, command-line arguments can be involved, and
1674 getargs.h is already included.
1675 * src/main.c (main): Update access.
1676 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
1677 variable names to new variable names before assigning value.
1678 * src/reader.c (reader): Update setting default.
1679 * tests/calc.at: Update uses.
1680 * tests/conflicts.at (Unreachable States After Conflict
1681 Resolution): Update use.
1682 * tests/input.at (%define enum variables): Update use.
1683 (%define backward compatibility): New test group.
1684 * tests/push.at: Update uses.
1685 * tests/reduce.at: Update uses.
1686 * tests/torture.at: Update uses.
1687
ba5c6d94
JD
16882009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1689
1690 Set all front-end %define defaults in one place.
1691 * src/main.c (main): Move lr.keep_unreachable_states default...
1692 * src/reader.c (reader): ... to here.
1693
5bab9d08
JD
16942009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1695
1696 Rename lr.default_reductions to lr.default-reductions.
1697 * NEWS (2.5): Here.
1698 * doc/bison.texinfo: Here.
1699 * src/lalr.c (initialize_LA): Here.
1700 * src/print.c (print_reductions): Here.
1701 * src/reader.c (reader): Here.
1702 * src/tables.c (action_row): Here.
1703 * tests/input.at (%define enum variables): Here.
1704 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
1705
d521ee19
JD
17062009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1707
1708 Pacify ./configure --enable-gcc-warnings.
1709 * tests/input.at (Symbols): Prototype yyerror and yylex.
1710
17112009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
c9aded4b
JD
1712
1713 Document how `%define "var" "value"' is not M4-friendly.
1714 * src/parse-gram.y (variable): In comments here.
1715
8f0d265e
JD
17162009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1717
1718 Clean up recent patches a little.
1719 Reported by Akim Demaille.
1720 * doc/bison.texinfo (Understanding): Fix typos.
1721 * src/print.c (print_reductions): Don't use negated variable.
1722
f4909773
JD
17232009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1724
1725 List accepted values for a %define enum variable with an invalid value.
1726 Suggested by Akim Demaille at
1727 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
1728 * data/bison.m4 (_b4_percent_define_check_values): Implement.
1729 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
1730 * tests/input.at (%define lr.default_reductions invalid values): Merge
1731 into...
1732 (%define enum variables): ... here, and update output.
1733
110ef36a
JD
17342009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
1735
1736 Rename "default rule" to "default reduction".
1737 This includes changing variable names in code, changing
1738 comments, and renaming %define lr.default_rules to %define
1739 lr.default_reductions.
1740 * NEWS (2.5): Update IELR documentation.
1741 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
1742 documentation.
1743 * data/glr.c, data/lalr1.java: Sync copyright dates.
1744 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
1745 and lr.type documentation. Make some other wording
1746 improvements.
1747 (Glossary): Adjust cross-references and Default Reduction
1748 definition.
1749 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
1750 Remove a confusing comment pointed out by Akim Demaille.
1751 (initialize_LA): Adjust code.
1752 * src/print-xml.c (print_reductions): Adjust code.
1753 * src/print.c (print_reductions): Adjust code.
1754 * src/reader.c (reader): Adjust code.
1755 * src/tables.c (action_row): Adjust code.
1756 (token_actions): Adjust code.
1757 * src/tables.h: Adjust YYDEFACT documentation.
1758 * tests/input.at (%define lr.default_rules invalid values):
1759 Rename test group to...
1760 (%define lr.default_reductions invalid values): ... this, and
1761 update grammar file and expected output.
1762 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
1763 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
1764
746ee38c
AD
17652009-04-21 Akim Demaille <demaille@gostai.com>
1766
1767 tests: check the use of dashes and periods in symbols.
1768 * tests/input.at (Symbol): New test group.
1769
eb45ef3b
JD
17702009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1771
1772 Document %define lr.type and lr.default_rules.
1773 * NEWS (2.5): Add an entry.
1774 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
1775 besides just LALR(1) and GLR(1).
1776 * doc/bison.texinfo (Introduction): Likewise.
1777 (Language and Grammar): Bison is no longer limited to LALR(1)
1778 restrictions.
1779 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
1780 when trying to distinguish from GLR. Talk about LR(1) grammars
1781 rather than LALR(1) grammars.
1782 (Decl Summary): In %define api.push_pull entry, say it applies
1783 to deterministic parsers in C rather than LALR(1) parsers in C.
1784 Add lr.default_rules entry.
1785 Add lr.type entry.
1786 (Mystery Conflicts): Bison is no longer limited to LALR(1)
1787 restrictions.
1788 (Generalized LR Parsing): Same changes as for the previous GLR
1789 section.
1790 (Memory Management): Say deterministic rather than LALR(1).
1791 (Understanding): Correct some bison output.
1792 Index discussion of "accepting state".
1793 Say deterministic rather than LALR(1).
1794 (Bison Options): In --yacc entry, say deterministic rather than
1795 LALR(1).
1796 In --report, --graph, and --xml entries, just don't mention
1797 LALR(1).
1798 (C++ Parsers): Say deterministic rather than LALR(1).
1799 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
1800 (Glossary): Add Accepting State, Consistent State, Default Rule,
1801 and IELR(1) definitions.
1802 In Generalized LR (GLR) definition, make same changes as in
1803 previous GLR sections.
1804 In LALR(1) definition, say Bison uses LALR(1) by default rather
1805 than implying Bison is limited to LALR(1).
1806 (LocalWords): Add IELR.
1807
db34f798
JD
18082009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1809
1810 Finish implementing %define lr.type.
1811 Its value can be "LALR", "IELR", or "canonical LR".
1812 * lib/timevar.def (TV_IELR_PHASE1): New var.
1813 (TV_IELR_PHASE2): New var.
1814 (TV_IELR_PHASE3): New var.
1815 (TV_IELR_PHASE4): New var.
1816 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
1817 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
1818 Sbitset.h, ielr.h, and ielr.c.
1819 * src/getargs.h, src/getargs.c (enum trace, trace_args,
1820 trace_types): Add trace_ielr.
1821 * src/lalr.h, src/lalr.c (ngotos): Export it.
1822 (F): Rename to...
1823 (goto_follows): ... this, update all uses, and export it.
1824 (set_goto_map): Export it.
1825 (map_goto): Export it.
1826 (compute_lookahead_tokens): Don't free goto_follows yet. Now
1827 handled in ielr.
1828 (initialize_LA): Export it. Move lookback allocation to...
1829 (lalr): ... here because, for canonical LR, initialize_LA must
1830 be invoked but lookback and much of the rest of LALR isn't
1831 needed.
1832 * main.c (main): Instead of lalr, invoke ielr, which invokes
1833 lalr.
1834 * src/reader.c (reader): Default lr.type to "LALR".
1835 Default lr.default_rules to "accepting" if lr.type is "canonical
1836 LR". Leave the default as "all" otherwise.
1837 Check for a valid lr.type value.
1838 * src/state.h, src/state.c (struct state_list): Add state_list
1839 member.
1840 (state_new): Initialize state_list member to NULL.
1841 (state_new_isocore): New function, exported.
1842 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
1843 exercises all values of lr.type.
1844 (GNU AWK Grammar): Rename test group to...
1845 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
1846 AT_TEST_EXISTING_GRAMMAR.
1847 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
1848 (GNU pic Grammar): Rename test group to...
1849 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
1850 AT_TEST_EXISTING_GRAMMAR.
1851 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
1852 all values of lr.type.
1853 (Single State Split): New test groups using AT_TEST_LR_TYPE.
1854 (Lane Split): Likewise.
1855 (Complex Lane Split): Likewise.
1856 (Split During Added Lookahead Propagation): Likewise.
1857
7fe11bb5
JD
18582009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1859
1860 Add new files for IELR and canonical LR implementation.
1861 * src/AnnotationList.c: New.
1862 * src/AnnotationList.h: New.
1863 * src/InadequacyList.c: New.
1864 * src/InadequacyList.h: New.
1865 * src/Sbitset.c: New.
1866 * src/Sbitset.h: New.
1867 * src/ielr.c: New.
1868 * src/ielr.h: New.
1869
7254f6a8
JD
18702009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1871
1872 Implement %define lr.default_rules.
1873 Its value describes the states that are permitted to contain
1874 default rules: "all", "consistent", or "accepting".
1875 * src/reader.c (reader): Default lr.default_rules to "all".
1876 Check for a valid lr.default_rules value.
1877 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
1878 is "accepting", then only mark the accepting state as
1879 consistent.
1880 (initialize_LA): Tell state_lookahead_tokens_count whether
1881 lr.default_rules is "accepting".
1882 * src/tables.c (action_row): If lr.default_rules is not "all",
1883 then disable default rules in inconsistent states.
1884 * src/print.c (print_reductions): Use this opportunity to
1885 perform some assertions about whether lr.default_rules was
1886 obeyed correctly.
1887 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
1888 helps with checking the parser tables for a grammar.
1889 * tests/input.at (%define lr.default_rules invalid values): New
1890 test group.
1891 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
1892 AT_TEST_TABLES_AND_PARSE.
1893 (`no %define lr.default_rules'): New test group generated by
1894 AT_TEST_LR_DEFAULT_RULES.
1895 (`%define lr.default_rules "all"'): Likewise.
1896 (`%define lr.default_rules "consistent"'): Likewise.
1897 (`%define lr.default_rules "accepting"'): Likewise.
1898
72e727f2
AD
18992009-04-20 Akim Demaille <demaille@gostai.com>
1900
1901 Formatting change.
1902
90462b8d
AD
19032009-04-20 Akim Demaille <demaille@gostai.com>
1904
1905 bison: factoring.
1906 * src/output.c (token_definitions_output): Use symbol_id_get
1907 instead of duplicating its logic.
1908 * TODO (YYERRCODE): Extend.
1909
4f646c37
AD
19102009-04-20 Akim Demaille <demaille@gostai.com>
1911
71b00ed8
AD
1912 variables: prefer error-verbose to error_verbose.
1913 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
1914 instead of error_verbose.
1915 * src/scan-gram.l (%error-verbose): Map to the error-verbose
1916 variable.
1917 * doc/bison.texinfo: Promote %define error-verbose instead of
1918 %error-verbose.
1919 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
1920
19212009-04-15 Akim Demaille <demaille@gostai.com>
1922
4f646c37
AD
1923 variables: accept dashes.
1924 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
1925 underscores.
1926 * src/scan-gram.l ({id}): Also accept dashes after the initial
1927 letter.
1928 ({directive}): Use {id}.
1929 * src/parse-gram.y: Comment and formatting changes.
1930 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
1931 symbols.
1932 * src/complain.h, src/complain.c (yacc_at): New.
1933 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
1934 symbol names.
1935 * src/output.c (token_definitions_output): Do not #define token
1936 names with dashes.
1937
184e3179
AD
19382009-04-20 Akim Demaille <demaille@gostai.com>
1939
1940 Consistently refer to Yacc, not YACC.
1941 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
1942
41253c3a
JD
19432009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
1944
1945 Pacify make maintainer-check-posix.
1946 * tests/input.at (%define, --define): Move bison command-line
1947 options before grammar file name.
1948
197b82ba
JD
19492009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1950
1951 Document semicolon warnings.
1952 * NEWS (2.5): Here.
1953
0c90a1f5
AD
19542009-04-14 Akim Demaille <demaille@gostai.com>
1955
1956 variables: use `parse.assert' instead of `assert'.
1957 * TODO (assert): Remove.
1958 * data/bison.m4 (b4_assert_if): Replace with...
1959 (b4_parse_assert_if): this.
1960 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
1961 * doc/bison.texinfo (Decl Summary): Document parse.assert.
1962
fa819509
AD
19632009-04-14 Akim Demaille <demaille@gostai.com>
1964
16dc0d90 1965 variables: use `parse.trace' instead of `debug'.
fa819509
AD
1966 * src/getargs.c (getargs): Map -t to %define trace.parse.
1967 * src/scan-gram.l (%debug): Map to %define trace.parse.
1968 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
1969 names to `_' in macro names.
1970 (b4_debug_if): Replace with...
1971 (b4_parse_trace_if): this.
1972 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1973 * data/yacc.c: Adjust.
1974 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
1975 Use @code to label the variable list.
1976 Document the variable parse.trace.
1977 (Tracing): Promote the parse.trace variable.
1978 * TODO: %printer is not documented.
1979
f7dae1ea
AD
19802009-04-14 Akim Demaille <demaille@gostai.com>
1981
1982 doc: minor fixes.
1983 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
1984 (Table of Symbols): Remove duplicate entry for %debug.
1985
3535c071
EB
19862009-04-10 Eric Blake <ebb9@byu.net>
1987
1988 submodules: update to latest
1989 * submodules/autoconf: Use latest upstream Autoconf.
1990
cf48f675
EB
19912009-04-06 Eric Blake <ebb9@byu.net>
1992
1993 Work around autoconf 2.63b bug in testsuite.
1994 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
1995 autoconf bug related to # in test.
1996
50cca368
JD
19972009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1998
1999 * NEWS (2.5): New section. Describe new -D/--define feature.
2000
3583d96b
AD
20012009-04-06 Akim Demaille <demaille@gostai.com>
2002
2003 Regen.
2004 * src/parse-gram.h, src/parse-gram.c: Regen.
2005
00f5d575
AD
20062009-04-06 Akim Demaille <demaille@gostai.com>
2007
2008 rename muscle_tab.* as muscle-tab.* for consistency.
2009 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
2010 * src/muscle-tab.h, src/muscle-tab.c: these.
2011 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
2012 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
2013
76bf5102
AD
20142009-04-06 Akim Demaille <demaille@gostai.com>
2015
2016 Makefile: introduce $(BISON).
2017 * src/local.mk (BISON): New.
2018 (YACC): Use it.
2019
bc0f5737
AD
20202009-04-06 Akim Demaille <demaille@gostai.com>
2021
2022 parser: handle %locations as %define locations.
2023 * src/getargs.h, src/getargs.c (locations_flag): Remove.
2024 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
2025 to set "locations" to true.
2026 * src/output.c (prepare): Don't output "locations".
2027 * src/scan-gram.l (%locations): Handle it as a %<flag>.
2028 * src/parse-gram.y: It's no longer a token.
2029 Don't handle it.
2030 * data/bison.m4 (b4_locations_if): Define it with
2031 b4_percent_define_if_define.
2032 * data/c.m4, data/glr.cc: Adjust.
2033
697c912f
AD
20342009-04-06 Akim Demaille <demaille@gostai.com>
2035
2036 Regen.
2037 * src/parse-gram.c: Regen.
2038
4920ae8b
AD
20392009-04-06 Akim Demaille <demaille@gostai.com>
2040
2041 muscle: factor the handling of obsolete of obsolete directives.
2042 Suggested by Joel E. Denny.
50cca368 2043
4920ae8b
AD
2044 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
2045 New, extracted from...
2046 * src/parse-gram.y (prologue_declaration: pure-parser): here.
2047 Remove it.
2048 (prologue_declaration: "%<flag>"): Use
2049 muscle_percent_define_ensure.
2050 (%error-verbose, %pure-parser): No longer tokens.
2051 * src/scan-gram.l (pure-parser): Return as a %<flag>.
2052
1d5b3c08
JD
20532009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2054
2055 Fix options documentation.
2056 * build-aux/cross-options.pl: As in --help output, write optional
2057 arguments as [=ARG] not =[ARG].
2058 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
2059
62c99cf4
JD
20602009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2061
2062 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
2063 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
2064 requirements for a correct m4 are stricter.
2065 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
2066 * configure.ac: Update to use AC_PROG_GNU_M4.
2067 Reported by Eric Blake.
2068
1c93f35b
JD
20692009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2070
2071 Help with updating web manual.
2072 * HACKING: Incorporate instructions from gnulib/doc/README.
2073 * bootstrap.conf (gnulib_modules): Add gendocs.
2074
86cfae0a
AD
20752009-04-03 Akim Demaille <demaille@gostai.com>
2076
2077 Regen.
2078 * src/parse-gram.h, src/parse-gram.c: Regen.
2079
ba061fa6
AD
20802009-04-03 Akim Demaille <demaille@gostai.com>
2081
2082 Factor %FLAG at scan level.
2083 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
2084 definitions and associated rules, replaced by....
2085 (PERCENT_FLAG): this new token type, and rule.
2086 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
2087 Use it for %debug and %error-verbose.
2088
b19ebeb3
AD
20892009-04-03 Akim Demaille <demaille@gostai.com>
2090
2091 Regen.
2092 * src/parse-gram.h, src/parse-gram.c: Regen.
2093
001a16a9
AD
20942009-04-03 Akim Demaille <demaille@gostai.com>
2095
2096 Treat %debug as %define debug.
2097 * data/bison.m4 (b4_debug_if): New.
2098 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
2099 * data/lalr1.java: Use it instead of b4_debug_flag.
2100 * src/getargs.h, src/getargs.c (debug_flag): Remove.
2101 * src/output.c (prepare): Don't output it.
2102 * src/parse-gram.y: Treat %debug as %define debug.
2103
21042009-04-03 Akim Demaille <demaille@gostai.com>
2105
2106 Treat %error-verbose as %define error_verbose.
2107 This allows to pass -Derror_verbose on the command line. Better
2108 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
2109 ERROR_VERBOSE being defined as false or true.
2110 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
2111 on b4_percent_define_ifdef, for does not check the defined value,
2112 but only whether the symbol is defined, rely on
2113 b4_percent_define_flag_if, so that a value of "false" is processed
2114 as a false.
2115 If not defined, define the flag to "false".
2116 (b4_error_verbose_if): New.
2117 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
2118 b4_error_verbose_flag.
2119 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
2120 * src/output.c (prepare): Don't output it.
2121 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
2122
92822aff
JD
21232009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2124
2125 Fix strange %define locations for default values.
2126 Reported by Akim Demaille at
2127 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
2128 and discussed again starting at
2129 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
2130 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
2131 because location information is bogus.
2132 Use angle brackets to delimit fake file name because square brackets
2133 look like underexpanded m4. Choose a better fake file name.
2134 Use negative line numbers.
2135 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
2136 * src/location.c (location_print): If line for a boundary is negative,
2137 only print that boundary's file name.
2138 * src/location.h: Document that.
2139 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2140 defaults): Update output.
2141
e021191b
JD
21422009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2143
2144 Pacify ./configure --enable-gcc-warnings.
2145 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
2146 in lib won't compile with it.
2147 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
2148
78f65418
AD
21492009-03-31 Akim Demaille <demaille@gostai.com>
2150
2151 bootstrap: --help to stdout.
2152 * bootstrap (usage): Don't send --help to stderr.
2153 Use a here doc instead of a long string.
2154
f7e241f4
AD
21552009-03-31 Akim Demaille <demaille@gostai.com>
2156
2157 bootstrap: README-hacking no longer exists
2158 * bootstrap (checkout_only_file): Set to HACKING.
2159
31d3e510
AD
21602009-03-26 Akim Demaille <demaille@gostai.com>
2161
2162 doc: merge HACKING and README-hacking.
2163 Two files is confusing.
2164 Reported by Alexandre Duret-Lutz.
1f9d8248 2165
31d3e510
AD
2166 * README-hacking: Merge into...
2167 * HACKING (Working from the repository): here.
2168
81535bfa
AD
21692009-03-26 Akim Demaille <demaille@gostai.com>
2170
2171 doc: update README-hacking.
2172 * README-hacking: We now use git and git submodules.
2173 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
2174
56f772e9
AD
21752009-03-26 Akim Demaille <demaille@gostai.com>
2176
2177 lalr1.cc: avoid GCC 4.3 warnings.
2178 GCC 4.3 now warns about "a || b && c" and asks for explicit
2179 parentheses.
2180 Reported by Alexandre Duret-Lutz.
2181 * data/location.cc: Update copyright years.
2182 (Position::operator==): Use parens to make precedence explicit.
2183 Compare lines and columns first, as they are more likely to be
2184 different, and they are faster to compare.
2185
11c073b7
AD
21862009-03-26 Akim Demaille <demaille@gostai.com>
2187
2188 gnulib: update.
2189 * gnulib: Update to latest.
2190 * src/local.mk (AM_CFLAGS): Move to...
2191 * Makefile.am: here.
2192 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
2193 AM_CFLAGS.
2194
91be6b28
AD
21952009-03-02 Akim Demaille <demaille@gostai.com>
2196
2197 Comment changes.
2198
cbf25ce7
AD
21992009-03-02 Akim Demaille <demaille@gostai.com>
2200
2201 Share b4_yytranslate_define.
2202 * data/lalr1.cc (b4_yytranslate_define): Move to...
2203 * data/c++.m4: here.
2204
882f02ed
AD
22052009-03-02 Akim Demaille <demaille@gostai.com>
2206
2207 Use locations in the variant example.
1f9d8248
AD
2208 Yes, this obfuscates the point of this example, variants only.
2209 But glr.cc cannot work (yet?) without locations. This change
2210 makes it easier to use this example with glr.cc.
11c073b7 2211
882f02ed
AD
2212 * examples/variant.yy (assert): %define it.
2213 (locations): Request them.
2214 (yylex): Bind the location to the stage.
2215
0623bacc
AD
22162009-03-02 Akim Demaille <demaille@gostai.com>
2217
2218 Dub make_TOKEN as a public type interface.
2219 * data/c++.m4 (b4_symbol_constructor_declare)
2220 (b4_symbol_constructor_define): New empty stubs.
2221 (b4_public_types_declare, b4_public_types_define): Use them.
2222 * data/lalr1.cc (b4_symbol_constructor_declare)
2223 (b4_symbol_constructor_declare_)
2224 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
2225 Move to...
2226 * data/variant.hh: here.
2227 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
2228 needed.
2229 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
2230 b4_symbol_constructor_declare, as it is now done by
2231 b4_public_types_define and b4_public_types_declare.
2232
5f5a90df
AD
22332009-03-02 Akim Demaille <demaille@gostai.com>
2234
2235 Coding style changes.
2236 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2237 (b4_symbol_constructor_declarations)
2238 (b4_symbol_constructor_definition_)
2239 (b4_symbol_constructor_definitions)
2240 (b4_yytranslate_definition): Rename as...
2241 (b4_symbol_constructor_declare_)
2242 (b4_symbol_constructor_declare)
2243 (b4_symbol_constructor_define_)
2244 (b4_symbol_constructor_define)
2245 (b4_yytranslate_define): these.
2246 * data/variant.hh (b4_variant_definition): Rename as...
2247 (b4_variant_define): this.
2248
b47b6ff7
AD
22492009-03-02 Akim Demaille <demaille@gostai.com>
2250
2251 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
2252 * data/bison.m4 (b4_percent_define_if_define): New.
2253 * data/c++.m4 (b4_variant_if): Move to...
2254 * data/bison.m4: Here, using b4_percent_define_if_define.
2255 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
2256 * data/bison.m4: Here, using b4_percent_define_if_define.
2257
1d6b689b
AD
22582009-03-02 Akim Demaille <demaille@gostai.com>
2259
2260 Dub symbol_type_base as a public type.
2261 * data/c++.m4 (b4_public_types_declare): Now define
2262 symbol_type_base and symbol_type.
2263 (b4_public_types_define): New.
2264 In both cases, the definitions are taken verbatim from lalr1.cc.
2265 * data/lalr1.cc: Adjust.
2266
4f84717d
AD
22672009-03-02 Akim Demaille <demaille@gostai.com>
2268
2269 b4_public_types_declare.
2270 * data/c++.m4 (b4_public_types_declare): New.
2271 * data/glr.cc, data/lalr1.cc: Use it.
2272
b9e4eb5b
AD
22732009-03-02 Akim Demaille <demaille@gostai.com>
2274
2275 b4_semantic_type_declare.
2276 * data/c++.m4 (b4_semantic_type_declare): New.
2277 Factors and generalizes what was in glr.cc and lalr1.cc.
2278 * data/variant.hh (b4_semantic_type_declare): Redefine it for
2279 variants.
2280 * data/lalr1.cc, data/glr.cc: Use it.
2281
6a6e7f0c
AD
22822009-02-26 Akim Demaille <demaille@gostai.com>
2283
2284 Upgrade gnulib.
2285 * gnulib: Upgrade from master.
2286 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
2287 Regen.
2288
e9e61b00
AD
22892009-02-25 Akim Demaille <demaille@gostai.com>
2290
2291 Remove useless arguments.
2292 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
2293 relevant.
2294
3eead995
AD
22952009-02-25 Akim Demaille <demaille@gostai.com>
2296
2297 Comment changes.
2298 * data/lalr1.cc: here.
2299
87f28efe
AD
23002009-02-25 Akim Demaille <demaille@gostai.com>
2301
2302 Fix glr.cc's debug level handling.
2303 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
2304 glr.c which is used.
2305 (debug_level, set_debug_level): Adjust.
2306
9be2a009
AD
23072009-02-25 Akim Demaille <demaille@gostai.com>
2308
2309 Copyright years.
2310 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
2311
07a6e87d
AD
23122009-02-25 Akim Demaille <demaille@gostai.com>
2313
2314 Style changes.
2315 * etc/bench.pl.in (generate_grammar_list): Consitently use
2316 location_type, not yy::location.
2317
33c78bd2
AD
23182009-02-25 Akim Demaille <demaille@gostai.com>
2319
2320 Comment change.
2321 * data/lalr1.cc: here.
2322
49572920
AD
23232009-02-19 Akim Demaille <demaille@gostai.com>
2324
2325 Make yyparser::error public.
2326 * data/lalr1.cc: here.
2327 There is no good reason to keep it private (and it is convenient
2328 to use it from the scanner for instance). It is already public in
2329 glr.cc.
2330
88654b47
AD
23312009-02-19 Akim Demaille <demaille@gostai.com>
2332
2333 Comment changes.
2334 * data/glr.cc: here.
2335
4524c55b
AD
23362009-02-19 Akim Demaille <demaille@gostai.com>
2337
2338 Remove trailing blanks.
6a6e7f0c
AD
2339 The epilogue has its own ending \n, no need to add another.
2340
4524c55b
AD
2341 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
2342 epilogue.
2343 * data/glr.cc: dnl when extending the epilogue.
2344 Remove stray "private:".
2345
6ceccee8
AD
23462009-02-19 Akim Demaille <demaille@gostai.com>
2347
2348 Use b4_c_modern.
2349 * data/c.m4 (b4_c_function_decl): Here.
2350
9c6a8966
AD
23512009-02-19 Akim Demaille <demaille@gostai.com>
2352
2353 Comment changes.
2354 * data/lalr1.cc: here.
2355
507aa0e2
AD
23562009-02-19 Akim Demaille <demaille@gostai.com>
2357
2358 Extract variant.hh
2359 * data/variant.hh: New, extracted from...
2360 * data/lalr1.cc: here.
2361 Adjust.
2362 * data/local.mk: Adjust.
2363
51bacae6
AD
23642009-02-19 Akim Demaille <demaille@gostai.com>
2365
2366 Extract stack.hh from lalr1.cc.
2367 * data/stack.hh: New.
2368 * data/lalr1.cc: Extract from here.
2369 * data/local.mk: Adjust.
2370
06c3084f
JD
23712009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
2372
2373 Add reminder about uploading public key to keys.gnupg.net.
2374 * HACKING (Release Procedure): Here.
2375
0ea583d2
AD
23762009-01-28 Akim Demaille <demaille@gostai.com>
2377
2378 * NEWS: Update information about 2.4.1 and 2.4.2.
2379
402b123d
AD
23802008-11-04 Akim Demaille <demaille@gostai.com>
2381
2382 Reformat NEWS.
2383 * NEWS: Use more outline-mode markup.
2384 Suggested by Jim Meyering.
2385
74553c98
AD
23862009-01-08 Akim Demaille <demaille@gostai.com>
2387
2388 Fix grep portability issues.
2389 Grep on Solaris does not support -q.
2390 Reported by Summum Bonum.
2391
2392 * NEWS: Add a stub for 2.4.2.
2393 * THANKS: Add Summum Bonum.
2394 * tests/atlocal.in (EGREP): New.
2395 (CC, CXX, XSLTPROC): Make it possible to override them via
2396 envvars.
2397 * tests/java.at: Use $EGREP instead of egrep.
2398 Use AT_CHECK's ignore instead of grep's -q.
2399
84eedf86
AD
24002008-12-11 Akim Demaille <demaille@gostai.com>
2401
2402 Pass the token type to yysyntax_error.
2403 * data/yacc.c (yysyntax_error): Take the transated token instead
2404 of the raw number.
2405 Adjust callers.
2406 * TODO: Update.
2407
5860cc8c
AD
24082008-12-11 Akim Demaille <demaille@gostai.com>
2409
2410 Formatting changes.
2411 * data/glr.c: Formatting changes.
2412
2b008529
AD
24132008-12-11 Akim Demaille <demaille@gostai.com>
2414
2415 Propagate i18n changes into glr.c.
2416 * TODO: Update.
2417 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
2418 building the error message format dynamically.
2419 * data/lalr1.java: Formatting changes.
2420
2cd1af95
AD
24212008-12-11 Akim Demaille <demaille@gostai.com>
2422
2423 Use testsuite -C.
2424 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
2425 Solves problems when top_srcdir is an absolute path.
2426 Suggested by Eric Blake.
2427 * configure.ac: Require Autoconf 2.62.
2428
eeb29422
AD
24292008-12-11 Akim Demaille <demaille@gostai.com>
2430
2431 Simplify the i18n of the error messages.
2432 * data/lalr1.cc: Comment changes.
2433 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
2434 lalr1.cc instead of building dynamically the format string.
2435
6617622c
AD
24362008-12-08 Akim Demaille <demaille@gostai.com>
2437
2438 Fix portability issue in the test suite.
2439 * tests/local.at (AT_MATCHES_CHECK): New.
2440 Based on Perl instead of Sed. Sed has too many portability
2441 pitfalls, not ever Sed is GNU Sed.
2442 * tests/actions.at (Fix user actions without a trailing semicolon):
2443 Use it.
2444
2ca1136c
AD
24452008-12-08 Akim Demaille <demaille@gostai.com>
2446
2447 Update data/README.
2448 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
2449
6c63b895
AD
24502008-12-08 Akim Demaille <demaille@gostai.com>
2451
2452 Install autoconf as a submodule to get m4sugar.
2453 * .gitmodules: Add submodules/autoconf.
2454 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
2455 submodules/autoconf.
2456
417e31d2
AD
24572008-12-08 Akim Demaille <demaille@gostai.com>
2458
2459 Test token.prefix in all the skeletons.
2460 * data/java.m4 (b4_token_enum): Use the token.prefix.
2461 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
2462 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
2463 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
2464 * tests/java.at: Comment changes.
2465 (AT_CHECK_JAVA_MINIMAL): Define the END token.
2466 (Java parser class and package names): Add token.prefix check.
2467
97abf544
AD
24682008-12-08 Akim Demaille <demaille@gostai.com>
2469
2470 Fix regeneration of atconfig.
2471 * tests/local.mk (tests/atconfig): The rule was incorrect, but
2472 remove it: now that there is no tests/Makefile.am, the top-level
2473 Makefile properly updates atconfig when needed.
2474
e8cd1ad6
DJ
24752008-12-07 Di-an Jan <dianj@freeshell.org>
2476
2477 Implement the FIXME that ends an user action with a semicolon
2478 if it seems necessary.
2479 * src/scan-code.l (flex rules section): Flag cpp directive from
2480 any `#' to the first unescaped end-of-line. Semicolon is not
2481 needed after `;', `{', '}', or cpp directives and is needed after
2482 any other token (whitespaces and comments have no effect).
2483 * tests/actions.at (Fix user actions without a trailing semicolon):
2484 New test.
2485 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
2486 to make user actions complete statements.
2487 Adjust column numbers in error messages.
2488 * tests/regression.at (Fix user actions without a trailing semicolon):
2489 Remove. Covered by new test.
2490
ce9447fc
AD
24912008-12-07 Akim Demaille <demaille@gostai.com>
2492
2493 Update gnulib.
2494 * gnulib: Update from master.
2495
d333175f
EB
24962008-12-05 Eric Blake <ebb9@byu.net>
2497
2498 Avoid compiler warning.
2499 * src/output.c (muscle_insert_item_number_table): Delete unused
2500 function.
2501
215b40ac
EB
25022008-12-02 Eric Blake <ebb9@byu.net>
2503
2504 Build testsuite with newer autoconf.
2505 * tests/output.at (m4_expand): Don't override in newer autoconf,
2506 where the underlying implementation changed.
2507 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
2508 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
2509 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
2510 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
2511 since some of them contain unbalanced ')'.
2512
3bb21113
AD
25132008-12-01 Akim Demaille <demaille@gostai.com>
2514
2515 Use b4_symbol for printers and destructors everywhere.
2516 * data/bison.m4 (b4_symbol_action_location): New.
2517 * data/c.m4 (b4_symbol_actions): Remove.
2518 Adjust all callers to use by b4_symbol_foreach and the corresponding
2519 b4_symbol_printer/destructor macro.
2520 * data/glr.cc: Adjust.
2521 * data/lalr1.java: Adjust the %destructor sanity check.
2522 * src/output.c (symbol_code_props_output): Remove, we no longer
2523 need the b4_symbol_printers/destructors tables.
2524
fb7c5b1f
AD
25252008-12-01 Akim Demaille <demaille@gostai.com>
2526
2527 Use b4_symbol_case_.
2528 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
2529 b4_symbol_case_.
2530
cf6fb222
AD
25312008-12-01 Akim Demaille <demaille@gostai.com>
2532
2533 Move b4_symbol based macro to bison.m4.
2534 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
2535 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
2536 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
2537 (b4_type_foreach): Move to...
2538 * data/bison.m4: Here.
2539 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
2540 b4_symbol_value_template instead of b4_symbol_value.
cf6fb222 2541
e3c52a63
AD
25422008-12-01 Akim Demaille <demaille@gostai.com>
2543
2544 b4_symbol/type_foreach.
2545 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
2546 Use them.
2547
2bde9113
AD
25482008-12-01 Akim Demaille <demaille@gostai.com>
2549
2550 Use the symbol properties to output the printer/destructor for lalr1.cc.
30c10faf
AD
2551 Instead of defining complex list of tuples to define various
2552 properties of the symbols, we now prefer to define symbols as
2553 "structs" in m4: using the symbol key (its number), and the
2554 property name, b4_symbol gives it value. Use this to handle
2555 destructors and printers.
2556
2bde9113
AD
2557 * src/output.c (CODE_PROP): New.
2558 (prepare_symbol_definitions): Use it to define the printer and
2559 destructor related attributes of the symbols.
2560 * data/lalr1.cc (b4_symbol_actions): Rename as...
2561 (b4_symbol_action): this.
2562 Use b4_symbol instead of 6 arguments.
2563 (b4_symbol_printer, b4_symbol_destructor): New.
2564 Use them instead of b4_symbol_actions.
2565
44494bf6
AD
25662008-12-01 Akim Demaille <demaille@gostai.com>
2567
2568 Avoid capturing variables too easily.
2569 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
2570 v__ and p__ instead of v and p.
2571
fad814bd
AD
25722008-12-01 Akim Demaille <demaille@gostai.com>
2573
2574 Remove spurious empty line before syncline.
2575 * data/bison.m4 (b4_syncline): Don't output an empty line before
2576 the output.
2577
feda5527
AD
25782008-11-26 Akim Demaille <demaille@gostai.com>
2579
2580 Convert lib/Makefile.am into lib/local.mk.
2581 The real problem is rather gnulib.mk, which itself is extracted
2582 from a Makefile.am that gnulib expects to the "recursive". The
2583 tool prefix-gnulib-mk converts such a gnulib.mk to be
2584 non-recursive. Also, some AC_SUBST variables need to be adjusted.
2585
2586 * etc/prefix-gnulib-mk: New.
2587 * bootstrap (slurp): Use it to convert further gnulib.mk.
2588 No longer try to avoid re-creation of lib/gnulib.mk as the changes
2589 are deeper.
2590 * lib/Makefile.am: Rename as...
2591 * lib/local.mk: this.
2592 Adjust to be prefixed.
2593 * Makefile.am, configure.ac: Adjust.
2594 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
2595
56ddee7f
AD
25962008-11-26 Akim Demaille <demaille@gostai.com>
2597
2598 s/_FLAGS/FLAGS/.
2599 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
2600 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
2601 Reported by Eric Blake.
2602
728e89a0
AD
26032008-11-26 Akim Demaille <demaille@gostai.com>
2604
2605 Use b4_parser_tables_define in glr.cc.
2606 * data/glr.c: Use b4_parser_tables_define instead of defining the
2607 (deterministic integral) tables by hand.
2608
2c1bf9bd
AD
26092008-11-26 Akim Demaille <demaille@gostai.com>
2610
2611 Use b4_parser_tables_define in Java.
2612 * data/java.m4 (b4_typed_parser_table): Rename as...
2613 (b4_typed_parser_table_define): this, for consistency.
2614 Accept a comment as $4.
2615 Move $2 into yy*_.
2616 (b4_integral_parser_table): Rename as...
2617 (b4_integral_parser_table_define): this.
2618 * data/lalr1.java: Adjust all uses.
2619 Use b4_parser_tables_define instead of generation by hand.
2620
ba206cf4
AD
26212008-11-26 Akim Demaille <demaille@gostai.com>
2622
2623 Prepare the convergence bw C style and Java table generation.
2624 * data/bison.m4 (b4_tables_map, b4_tables_declare)
2625 (b4_tables_define): Rename as...
2626 (b4_integral_parser_tables_map, b4_parser_tables_declare)
2627 (b4_parser_tables_define): these.
2628 * data/c.m4 (b4_table_define): Rename as...
2629 (b4_integral_parser_table_define): this.
2630 * data/lalr1.cc: Adjust.
2631 (b4_table_define, b4_table_declare): Rename as...
2632 (b4_integral_parser_table_define)
2633 (b4_integral_parser_table_declare): these.
2634 (yyrline_): Move the comment where it is actually used.
2635 * data/yacc.c: Adjust.
2636 (yyrline): Use b4_integral_parser_table_define.
2637
d12f8e49
AD
26382008-11-26 Akim Demaille <demaille@gostai.com>
2639
2640 Regen.
2641 * src/parse-gram.h, src/parse-gram.c: Regen.
2642
0991e29b
AD
26432008-11-26 Akim Demaille <demaille@gostai.com>
2644
2645 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
2646 * data/lalr1.cc (b4_tables_map): Move to...
2647 * data/bison.m4: here.
2648 Update the comment for yytable during the flight.
2649 (b4_tables_declare, b4_tables_define): New.
2650 * data/lalr1.cc: Use them.
2651 * data/c.m4 (b4_table_define): New.
2652 * data/yacc.c: Use b4_tables_define instead of output the tables
2653 by hand.
2654 * tests/regression.at (Web2c Actions): Adjust the expected output,
2655 the order of the tables changed.
2656
3d3bc1fe
AD
26572008-11-26 Akim Demaille <demaille@gostai.com>
2658
2659 Get rid of (yy)rhs and (yy)prhs.
2660 These tables are no longer needed in the parsers, and they don't seem to
2661 be useful. They are not documented either.
feda5527 2662
3d3bc1fe
AD
2663 * src/output.c (prepare_rules): Get rid of rhs and prhs.
2664 Adjust the computation of (yy)r2.
2665
08c81469
AD
26662008-11-26 Akim Demaille <demaille@gostai.com>
2667
2668 Rule length is unsigned.
2669 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
2670
932b0c96
AD
26712008-11-26 Akim Demaille <demaille@gostai.com>
2672
2673 Get rid of lalr1-split.cc.
2674 It was no longer maintainer.
feda5527 2675
932b0c96
AD
2676 * data/lalr1-split.cc: Remove.
2677 * etc/bench.pl.in (bench_fusion_parser): Remove.
2678 Adjust.
2679
8452c667
AD
26802008-11-26 Akim Demaille <demaille@gostai.com>
2681
2682 Use yy* consistently.
2683 * data/glr.c: Now that yyrhs no longer exists as a global
2684 variable, rename local "rhs" variables into "yyrhs" for
2685 consistency.
2686
783aa653
AD
26872008-11-25 Akim Demaille <demaille@gostai.com>
2688
2689 Get rid of yyrhs and yyprhs in glr.c.
2690 * data/glr.c (yyrhs, yyprhs): Remove.
2691 Instead, use the state stack and yystos.
2692
6130b755
AD
26932008-11-25 Akim Demaille <demaille@gostai.com>
2694
2695 Flag glr tests.
2696 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
2697 as an Autotest keyword.
2698
95a7b1c9
AD
26992008-11-25 Akim Demaille <demaille@gostai.com>
2700
2701 Prefer TESTSUITE_FLAGS.
2702 TESTSUITEFLAGS is barely readable.
feda5527 2703
95a7b1c9
AD
2704 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
2705 for backward compatibility.
2706 Use the former instead of the latter.
2707
b4f18401
AD
27082008-11-25 Akim Demaille <demaille@gostai.com>
2709
2710 Get rid of yyrhs and yyprhs in larl1.java.
2711 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
2712 (yy_reduce_print): Rather, use yystos_ and the state stack.
2713
c265fd6b
AD
27142008-11-25 Akim Demaille <demaille@gostai.com>
2715
2716 Formatting changes.
2717
68dbdee8
AD
27182008-11-25 Akim Demaille <demaille@gostai.com>
2719
2720 Get rid of yyrhs and yyprhs in yacc.c.
30c10faf
AD
2721 They were used to get the symbol types, given a rule number, when
2722 displaying the top of the stack before a reduction. But the
2723 symbol type is available from the state stack. This has two be
2724 benefits: two tables less in the parser (making it smaller), and a
2725 more consistent use of the three stacks which will help to fuse
2726 them.
feda5527 2727
68dbdee8
AD
2728 * data/yacc.c (yyprhs, yyrhs): Remove.
2729 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
2730 (yy_reduce_print): Take yyssp as argument.
2731 Use it, together with yystos, to get the symbol type.
2732 * tests/regression.at (Web2c Report): Remove these tables from the
2733 expected output.
2734
6ab1adbe
AD
27352008-11-25 Akim Demaille <demaille@gostai.com>
2736
2737 b4_tables_map.
2738 The point is to factor the generation of the tables across skeletons.
2739 This is language dependant.
feda5527 2740
6ab1adbe
AD
2741 * data/c.m4 (b4_comment_): New.
2742 Should be usable to define how to generate tables independently of
2743 the language.
2744 (b4_c_comment): New.
2745 (b4_comment): Bounce to b4_c_comment.
2746 Now support $2 = [PREFIX] for indentation.
2747 * data/lalr1.cc (b4_table_declare): Don't output a comment if
2748 there is no comment.
2749 Indent it properly when there is one.
2750 Output the ending semicolon.
2751 (b4_table_define): Space changes.
2752 Output the ending semicolon.
2753 (b4_tables_map): New.
2754 Use it twice instead of declaring and defining the (integral)
2755 tables by hand.
2756
0fddb3d5
AD
27572008-11-25 Akim Demaille <demaille@gostai.com>
2758
2759 b4_table_declare.
2760 * data/lalr1.cc (b4_table_declare): New.
2761 Use it to declare the tables defined with b4_table_define.
2762 (b4_table_define): Declare a third arg to match b4_table_declare
2763 signature.
2764 Move all the comments around invocations of b4_table_define into
2765 the invocations itselves.
2766 Move things around to have the order for declarations and
2767 definitions.
2768
c4ddc0fb
AD
27692008-11-25 Akim Demaille <demaille@gostai.com>
2770
2771 Formatting changes.
2772 * data/lalr1.java: here.
2773
e0c653e7
AD
27742008-11-25 Akim Demaille <demaille@gostai.com>
2775
2776 b4_args is more general than only C++.
2777 * data/lalr1.cc (b4_args, _b4_args): Move to...
2778 * data/bison.m4: here.
2779
4182a0a1
DJ
27802008-11-21 Di-an Jan <dianj@freeshell.org>
2781
2782 Implement no-XXX arguments for --warnings, --report, --trace.
2783 * src/getargs.c (flags_argmatch): Handles no-XXX.
2784 Fix typo in doxygen comment.
2785
01466c3e
AD
27862008-11-21 Akim Demaille <demaille@gostai.com>
2787
2788 Display the changes in cross-options.texi.
2789 * build-aux/cross-options.pl ($sep): New, to separate items.
2790 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
2791 changes.
2792
a7c09cba
DJ
27932008-11-20 Di-an Jan <dianj@freeshell.org>
2794
2795 Improves options in the manual.
2796 * doc/bison.texinfo (-g, -x): Add space before argument.
2797 (Option Cross Key): Implement FIXME: listing directives also.
2798 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
2799 (Short Option): Special case -d. Put arguments inside @option.
feda5527 2800 (Bison Directive): Add column, automatically extracted from
a7c09cba
DJ
2801 src/scan-gram.l (actual name passed as the first argument)
2802 with special case for %define.
2803 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
2804 to build-aux/cross-options.pl.
2805 * src/getargs.c (usage): Document limitations of cross-options.pl.
2806 * src/scan-gram.l: Likewise.
2807
6c88b51e
JD
28082008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2809
2810 Fix unexpanded macros in GLR defines file.
2811 Reported by Csaba Raduly at
2812 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
2813 * THANKS (Csaba Raduly): Add.
2814 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
2815 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
2816 lexer in a separate module that includes the defines file.
2817 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
2818 source.
2819 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
2820 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
2821 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
2822 (AT_DATA_SOURCE_PROLOGUE): New.
2823 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
2824 (AT_DATA_SOURCE): New.
2825 (AT_FULL_COMPILE): Extend to support an additional source file.
2826
1e034807
AD
28272008-11-18 Akim Demaille <demaille@gostai.com>
2828
2829 More TODO.
2830 * TODO: More short term issues.
2831
e3dda35c
AD
28322008-11-18 Akim Demaille <demaille@gostai.com>
2833
2834 Regen.
2835 * src/parse-gram.h, src/parse-gram.c: Regen.
2836
bd187d7b
AD
28372008-11-18 Akim Demaille <demaille@gostai.com>
2838
2839 Use b4_subtract where possible.
2840 * data/lalr1.cc (b4_subtract): Move to...
2841 * data/bison.m4: here.
2842 * data/glr.c (b4_rhs_data): Use it.
2843 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
2844
6085ab0d
AD
28452008-11-18 Akim Demaille <demaille@gostai.com>
2846
2847 Remove incorrect mode specification.
2848 * data/glr.cc: Don't pretend it's C code.
2849
9ce405ce
JD
28502008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2851
2852 Simplify last patch slightly.
2853 * src/getargs.c (getargs): Here.
2854
a8beef7e
JD
28552008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2856
2857 Fix last warning from --enable-gcc-warnings.
2858 * src/getargs.c (getargs): Don't assign const address to non-const
2859 pointer.
2860
d50eea6d
JD
28612008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2862
2863 Don't let maintainer-*-check targets force a version update.
2864 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
2865 handled.
2866
f5f419de
DJ
28672008-11-17 Di-an Jan <dianj@freeshell.org>
2868
2869 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
2870 Align menus. Adjust word wrapping. Use node names for menu names.
2871 (Examples): Don't abbreviate node names.
2872 (LocalWords): Remove abbreviations.
2873 (Copying): Make description a sentence.
d50eea6d 2874 (Java Action Features): Remove period to match the rest of menu.
f5f419de 2875
d73e55e0
DJ
28762008-11-17 Di-an Jan <dianj@freeshell.org>
2877
2878 Handles several --enable-gcc-warnings.
2879 * src/getargs.c (command_line_location): Set parameters to void.
2880 * src/output.c (symbol_type_name_cmp): Make static.
2881 (symbols_by_type_name): Set parameters to void.
2882 (symbol_definitions_output): Remove unused parameter. Rename as...
2883 (prepare_symbol_definitions): this.
2884 (muscles_output): Move symbol_definitions_output to...
2885 (output): here as prepare_symbol_definitions.
2886 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
d50eea6d 2887 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
d73e55e0 2888
68c989de
DJ
28892008-11-17 Di-an Jan <dianj@freeshell.org>
2890
2891 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
2892 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
2893
23ce6f4c
AD
28942008-11-16 Akim Demaille <demaille@gostai.com>
2895
2896 Add missing $(EXEEXT).
2897 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
2898 "src/bison$(EXEEXT)".
2899 Reported by Di-an Jan.
2900
dd704c35
AD
29012008-11-15 Akim Demaille <demaille@gostai.com>
2902
2903 * TODO: Update.
2904
dab244d5
AD
29052008-11-15 Akim Demaille <demaille@gostai.com>
2906
2907 Formatting changes.
2908 * tests/input.at: here.
2909
4b4da9fb
AD
29102008-11-15 Akim Demaille <demaille@gostai.com>
2911
2912 Remove duplicate header inclusion.
2913 * src/LR0.c: here.
2914
4ea3f53d
AD
29152008-11-15 Akim Demaille <demaille@gostai.com>
2916
2917 * src/parse-gram.h, src/parse-gram.c: Regen.
2918
cb823b6f
AD
29192008-11-15 Akim Demaille <demaille@gostai.com>
2920
2921 Support parametric types.
b06df3c2
AD
2922
2923 There are two issues to handle: first scanning nested angle
2924 bracket pairs to support types such as std::pair< std::string,
2925 std::list<std::string> > >.
2926
2927 Another issue is to address idiosyncracies of C++: do not glue two
2928 closing angle brackets together (otherwise it's operator>>), and
2929 avoid sticking blindly a TYPE to the opening <, as it can result
2930 in '<:' which is a digraph for '['.
2931
cb823b6f
AD
2932 * src/scan-gram.l (brace_level): Rename as...
2933 (nesting): this.
2934 (SC_TAG): New.
2935 Implement support for complex tags.
b06df3c2 2936 (tag): Accept
cb823b6f
AD
2937 , but not <.
2938 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
2939 (b4_symbol_variant): Leave space around types as parameters.
2940 * examples/variant.yy: Use nested template types and leading ::.
2941 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
2942 Rename as...
2943 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
2944 * tests/c++.at: Test parametric types.
2945
7b6e6753
AD
29462008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2947
2948 Test token.prefix.
2949 This is not sufficient, but we test at least that the make_SYMBOL
2950 interface is not affected by token.prefix. A more general test
2951 will be implemented when the support of token.prefix is generalized
2952 to more skeletons.
b06df3c2 2953
7b6e6753
AD
2954 * tests/c++.at: One more variant test, using token.prefix.
2955
dddec537
AD
29562008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2957
2958 Test the make_TOKEN interface.
2959 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
2960 Factor the common code in yylex.
2961 Use it to test "%define lex_symbol".
2962
7d3e21ba
AD
29632008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2964
2965 Formatting change.
2966
4fc55348
AD
29672008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2968
2969 Simplify code for variants bench marks.
2970 * etc/bench.pl.in (&generate_grammar_list): Define and use
2971 location_type.
2972 Factor the common code in yylex.
2973
070e6509
AD
29742008-11-15 Akim Demaille <demaille@gostai.com>
2975
2976 Better error message.
2977 * bootstrap (find_tool): Fix the error message.
2978
0078681b
AD
29792008-11-15 Akim Demaille <demaille@gostai.com>
2980
2981 Update variant.yy to newest interface.
2982 * examples/variant.yy: Define lex_symbol.
2983 Adjust.
2984
ff084799
AD
29852008-11-15 Akim Demaille <demaille@gostai.com>
2986
2987 Don't use locations in variant.yy.
2988 * examples/variant.yy: Adjust to not using locations.
2989
b0d79ec6
AD
29902008-11-15 Akim Demaille <demaille@gostai.com>
2991
2992 Comment changes.
2993 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
2994 comments for the license.
2995
d4977ce3
AD
29962008-11-15 Akim Demaille <demaille@gostai.com>
2997
2998 Remove tests/Makefile.am.
2999 * tests/Makefile.am: Rename as...
3000 * tests/local.mk: this.
3001 * Makefile.am, configure.ac: Adjust.
3002 * Makefile.am (DISTCLEANFILES): Define.
3003 (maintainer-check, maintainer-xml-check, maintainer-push-check):
3004 Remove, we no longer need to bounce to the real targets.
3005
87f1149a
AD
30062008-11-15 Akim Demaille <demaille@gostai.com>
3007
3008 Comment changes.
3009
36415906
AD
30102008-11-15 Akim Demaille <demaille@gostai.com>
3011
3012 djgpp/local.mk.
3013 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
3014 * djgpp/local.mk: this new file.
3015
e2c2f696
AD
30162008-11-15 Akim Demaille <demaille@gostai.com>
3017
3018 Remove doc/Makefile.am.
3019 * doc/Makefile.am: Rename as...
3020 * doc/local.mk: this.
3021 Adjust paths
3022 * Makefile.am, configure.ac: Adjust.
3023 * Makefile.am (MOSTLYCLEANFILES): New.
3024 * src/local.mk: Adjust.
3025
2ead32e6
AD
30262008-11-15 Akim Demaille <demaille@gostai.com>
3027
3028 Move sc_tight_scope into maint.mk.
b06df3c2
AD
3029 It does not work, and I don't know how it was supposed to work: it
3030 seems to be looking for sources in the build tree. I just moved
3031 it at a better place, fixing it is still required.
3032
2ead32e6
AD
3033 * src/local.mk (echo): Remove.
3034 (sc_tight_scope): Move to...
3035 * maint.mk: here.
3036
2df9ec37
AD
30372008-11-15 Akim Demaille <demaille@gostai.com>
3038
3039 Regen.
3040 * src/parse-gram.h, src/parse-gram.h: Regen.
3041
0305d25e
AD
30422008-11-15 Akim Demaille <demaille@gostai.com>
3043
3044 Remove src/Makefile.am.
3045 * src/Makefile.am: Rename as...
3046 * src/local.mk: this.
3047 Prefix all the paths with src/.
3048 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
3049 (AM_CPPFLAGS): Find find in builddir/src.
3050 (YACC): Move the flags into...
3051 (AM_YFLAGS): here.
3052 * maint.mk (sc_tight_scope): Disable.
3053 It used to bounce to the version in src/Makefile.am which is now
3054 part of this very Makefile.
3055 * Makefile.am, configure.ac: Adjust.
3056 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
3057 include "..." to find files "here": we are no longer in src/, so
3058 qualify the includes with src/.
3059 * doc/Makefile.am (PREPATH): No longer include the top_builddir
3060 prefix.
3061 (.x.1): Adjust to be able to create src/foo from the top level
3062 Makefile, instead of going bounce to src/Makefile the creation of
3063 foo.
3064
5277c0a3
AD
30652008-11-15 Akim Demaille <demaille@gostai.com>
3066
3067 Remove useless variable.
3068 * doc/Makefile.am (srcsrcdir): Remove.
3069
6a5aa0cd
AD
30702008-11-15 Akim Demaille <demaille@gostai.com>
3071
3072 Remove data/Makefile.am.
3073 * data/Makefile.am: Rename as...
3074 * data/local.mk: this.
3075 Adjust paths.
3076 * Makefile.am, configure.ac: Adjust.
3077
7cb794dc
AD
30782008-11-15 Akim Demaille <demaille@gostai.com>
3079
3080 Remove etc/Makefile.am.
3081 * etc/Makefile.am: Rename as...
3082 * etc/local.mk: this.
3083 Adjust.
3084 * Makefile.am, configure.ac: Adjust.
3085
cd409e3b
AD
30862008-11-15 Akim Demaille <demaille@gostai.com>
3087
3088 Remove examples/local.mk.
3089 examples/calc++/Makefile.am might be interesting to keep as is, since
3090 it is an example in itself.
2df9ec37 3091
cd409e3b
AD
3092 * examples/Makefile.am: Rename as...
3093 * examples/local.mk: this.
3094 Adjust.
3095 * Makefile.am, configure.ac: Adjust.
3096
9a1e4214
AD
30972008-11-15 Akim Demaille <demaille@gostai.com>
3098
3099 Remove build-aux/Makefile.am.
3100 Recursive Makefiles are really way too slow, let's get rid of some of
3101 them.
2df9ec37 3102
9a1e4214
AD
3103 * build-aux/Makefile.am: Rename as...
3104 * build-aux/local.mk: this.
3105 Adjust paths.
3106 * Makefile.am, configure.ac: Adjust.
3107
0634493c
AD
31082008-11-15 Akim Demaille <demaille@gostai.com>
3109
3110 Provide convenience constructors for locations and positions.
3111 * data/location.cc (position::position): Accept file, line and
3112 column as arguments with default values.
3113 Always qualify initial line and column literals as unsigned.
3114 (location::location): Provide convenience constructors.
3115
fe1b448a
AD
31162008-11-15 Akim Demaille <demaille@gostai.com>
3117
b06df3c2
AD
3118 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
3119 token type.
fe1b448a
AD
3120 Using template buys us nothing, and makes it uselessly complex to
3121 construct a symbol. Besides, it could not be generalized to other
3122 languages, while make_FOO would work in C/Java etc.
2df9ec37 3123
fe1b448a
AD
3124 * data/lalr1.cc (b4_symbol_): New.
3125 (b4_symbol): Use it.
3126 (b4_symbol_constructor_declaration_)
3127 (b4_symbol_constructor_definition_): Instead of generating
3128 specializations of an overloaded template function, just generate
3129 several functions whose names are forged from the token names
3130 without the token.prefix.
3131 (b4_symbol_constructor_declarations): Generate them for all the
3132 symbols, not just by class of symbol type, now that instead of
3133 specializing a function template by the token, we generate a
3134 function named after the token.
3135 (b4_symbol_constructor_specialization_)
3136 (b4_symbol_constructor_specializations): Remove.
3137 * etc/bench.pl.in: Adjust to this new API.
3138
5679f311
AD
31392008-11-13 Akim Demaille <demaille@gostai.com>
3140
3141 %define token.prefix.
b06df3c2
AD
3142 Provide a means to add a prefix to the name of the tokens as
3143 output in the generated files. Because of name clashes, it is
3144 good to have such a prefix such as TOK_ that protects from names
3145 such as EOF, FILE etc. But it clutters the grammar itself.
2df9ec37 3146
5679f311
AD
3147 * data/bison.m4 (token.prefix): Empty by default.
3148 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
3149 * data/lalr1.cc (b4_symbol): Ditto.
3150
3204049e
AD
31512008-11-13 Akim Demaille <demaille@gostai.com>
3152
3153 Compute at M4 time some of the subtractions.
90290ce5 3154 * data/lalr1.cc (b4_subtract): New.
3204049e
AD
3155 (b4_rhs_data): Use it.
3156
202598d3
AD
31572008-11-13 Akim Demaille <demaille@gostai.com>
3158
3159 symbol::token.
b06df3c2 3160 This allows the user to get the type of a token returned by yylex.
2df9ec37 3161
202598d3
AD
3162 * data/lalr1.cc (symbol::token): New.
3163 (yytoknum_): Define when %define lex_symbol, independently of
3164 %debug.
3165 (yytoken_number_): Move into...
3166 (symbol::token): here, since that's the only use.
3167 The other one is YYPRINT which was not officially supported
3168 by lalr1.cc, and anyway it did not work since YYPRINT uses this
3169 array under a different name (yytoknum).
3170
fc2476c7
AD
31712008-11-13 Akim Demaille <demaille@gostai.com>
3172
3173 YYERRCODE.
3174 * TODO (YYERRCODE): Mention the case of $undef.
3175
865f1e9f
AD
31762008-11-13 Akim Demaille <demaille@gostai.com>
3177
3178 TODO: YYPRINT.
3179 * TODO (YYPRINT): New.
3180
cb0b136a
AD
31812008-11-13 Akim Demaille <demaille@gostai.com>
3182
3183 Comment changes.
3184 * data/lalr1.cc, data/yacc.c: Fix the description of the
3185 yytranslate and yytoknum tables.
3186
2c086d29
AD
31872008-11-13 Akim Demaille <demaille@gostai.com>
3188
3189 Define make_symbol in the header.
b06df3c2
AD
3190 To reach good performances these functions should be inlined (yet
3191 this is to measure precisely). To this end they must be available
3192 to the caller.
2df9ec37 3193
2c086d29
AD
3194 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
3195 location_type with the class name.
3196 Since will now be output in the header, declare "inline".
3197 No longer use b4_symbol_constructor_specializations, but
3198 b4_symbol_constructor_definitions in the header.
3199 Don't call it in the *.cc file.
3200
1c4af381
AD
32012008-11-13 Akim Demaille <demaille@gostai.com>
3202
3203 Define yytranslate in the header for lex_symbol.
3204 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
3205 into the header file when using %define lex_symbol.
3206 (yytranslate_): Declare inline.
3207
e51b0a82
AD
32082008-11-13 Akim Demaille <demaille@gostai.com>
3209
b06df3c2
AD
3210 Define the constructors of symbol_type in
3211 b4_symbol_constructor_definitions.
e51b0a82 3212 The constructors are called by the make_symbol functions, which a
b06df3c2
AD
3213 forthcoming patch will move elsewhere. Hence the interest of
3214 putting them together.
2df9ec37 3215
b06df3c2
AD
3216 The stack_symbol_type does not need to be moved, it is used only
3217 by the parser.
2df9ec37 3218
e51b0a82
AD
3219 * data/lalr1.cc: Move symbol_type and symbol_base_type
3220 constructors into...
3221 (b4_symbol_constructor_definitions): here.
3222 Adjust.
3223
78835571
AD
32242008-11-13 Akim Demaille <demaille@gostai.com>
3225
3226 Make it easier to move the definition of yytranslate_.
3227 Forthcoming changes will make it possible to use yytranslate_
3228 from outside the parser implementation file.
2df9ec37 3229
78835571
AD
3230 * data/lalr1.cc (b4_yytranslate_definition): New.
3231 Use it.
3232
c1e6c88c
AD
32332008-11-13 Akim Demaille <demaille@gostai.com>
3234
3235 Remove useless class specification.
3236 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
3237 to refer to the class name to use a type defined by the class for
3238 arguments of member functions.
3239
4654b0c0
AD
32402008-11-13 Akim Demaille <demaille@gostai.com>
3241
3242 Finer input type for yytranslate.
3243 This patch is debatable: the tradition expects yylex to return an int
3244 which happens to correspond to token_number (which is an enum). This
3245 allows for instance to return characters (such as '*' etc.). But this
3246 goes against the stronger typing I am trying to have with the new
3247 lex interface which return a symbol_type. So in this case, feed
3248 yytranslate_ with a token_type.
2df9ec37 3249
4654b0c0
AD
3250 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
3251 expect a token_type.
3252
dd735e4e
AD
32532008-11-13 Akim Demaille <demaille@gostai.com>
3254
3255 Honor lex-params in %define lex_symbol mode.
3256 * data/lalr1.cc: Use b4_lex_param.
3257
6659366c
AD
32582008-11-13 Akim Demaille <demaille@gostai.com>
3259
3260 Simplify names.
3261 * src/output.c (symbol_definitions_output): Rename symbol
3262 attributes type_name and has_type_name as type and has_type.
3263 * data/lalr1.cc: Adjust uses.
3264
e9805e57
AD
32652008-11-13 Akim Demaille <demaille@gostai.com>
3266
3267 Use b4_type_names for the union type.
b06df3c2
AD
3268 The union used to compute the size of the variant used to iterate
3269 over the type of all the symbols, with a lot of redundancy. Now
3270 iterate over the lists of symbols having the same type-name.
2df9ec37 3271
e9805e57
AD
3272 * data/lalr1.cc (b4_char_sizeof_): New.
3273 (b4_char_sizeof): Use it.
3274 Adjust to be called with a list of numbers instead of a single
3275 number.
3276 Adjust its caller for new-line issues.
3277
aea10ef4
AD
32782008-11-13 Akim Demaille <demaille@gostai.com>
3279
3280 Define the "identifier" of a symbol.
b06df3c2
AD
3281 Symbols may have several string representations, for instance if
3282 they have an alias. What I call its "id" is a string that can be
3283 used as an identifier. May not exist.
2df9ec37 3284
b06df3c2
AD
3285 Currently the symbols which have the "tag_is_id" flag set are
3286 those that don't have an alias. Look harder for the id.
2df9ec37 3287
aea10ef4
AD
3288 * src/output.c (is_identifier): Move to...
3289 * src/symtab.c (is_identifier): here.
3290 * src/symtab.h, src/symtab.c (symbol_id_get): New.
3291 * src/output.c (symbol_definitions_output): Use it to define "id"
3292 and "has_id".
3293 Remove the definition of "tag_is_id".
3294 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
3295 "tag_is_id" were used to produce code.
3296 We still use "tag" for documentation.
3297
2ea7730c
AD
32982008-11-11 Akim Demaille <demaille@gostai.com>
3299
3300 Locations are no longer required by lalr1.cc.
3301 * data/lalr1.cc (_b4_args, b4_args): New.
3302 Adjust all uses of locations to make them optional.
3303 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
3304 (AT_CHECK_NAMESPACE): Check the use of locations.
3305 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
3306 without locations with lalr1.cc.
3307 Test these cases.
3308 * tests/output.at: Check lalr1.cc with and without location
3309 support.
3310 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
3311 Don't use locations.
3312
7ca2266a
AD
33132008-11-11 Akim Demaille <demaille@gostai.com>
3314
3315 AT_FULL_COMPILE.
3316 * tests/local.at (AT_FULL_COMPILE): New.
3317 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
3318
1a7a65f9
AD
33192008-11-11 Akim Demaille <demaille@gostai.com>
3320
3321 Support parens in calc++.
3322 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
3323 * examples/calc++/test (run): Check the expected output.
3324 Adjust callers.
3325 Check parens too.
3326
c944f7f2
AD
33272008-11-11 Akim Demaille <demaille@gostai.com>
3328
3329 Simplify lalr1.cc since %defines is mandatory.
3330 * data/lalr1.cc: Remove useless calls to b4_defines_if.
3331
dada3cd1
AD
33322008-11-11 Akim Demaille <demaille@gostai.com>
3333
3334 TODO: yyfmt.
3335 * TODO (yysyntax_error): New item.
3336
422c18f4
AD
33372008-11-11 Akim Demaille <demaille@gostai.com>
3338
3339 Prefer M4 to CPP.
3340 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
3341 YYERROR_VERBOSE.
3342
a0ffc175
AD
33432008-11-11 Akim Demaille <demaille@gostai.com>
3344
3345 Support i18n of the parse error messages.
3346 * TODO (lalr1.cc/I18n): Remove.
3347 * data/lalr1.cc (yysyntax_error_): Support the translation of the
3348 error messages, as done in yacc.c.
3349 Stay within the yy* pseudo namespace.
3350
00a8a083
AD
33512008-11-11 Akim Demaille <demaille@gostai.com>
3352
3353 More TODO.
3354 * TODO (single stack, yysyntax_error): New.
3355
09277875
AD
33562008-11-11 Akim Demaille <demaille@gostai.com>
3357
3358 Make it possible to return a symbol_type from yylex.
3359 * data/lalr1.cc (b4_lex_symbol_if): New.
3360 (parse): When lex_symbol is defined, expected yylex to return the
3361 complete lookahead.
3362 * etc/bench.pl.in (generate_grammar_list): Extend to support this
3363 yylex interface.
3364 (bench_variant_parser): Exercise it.
3365
64c1b92a
AD
33662008-11-11 Akim Demaille <demaille@gostai.com>
3367
3368 Remove useless bench case.
3369 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
3370 no longer used.
3371
2722aa42
AD
33722008-11-11 Akim Demaille <demaille@gostai.com>
3373
3374 Improve display of directives.
3375 * etc/bench.pl.in (parse_term): Don't add useless eol.
3376
918eb7c5
AD
33772008-11-11 Akim Demaille <demaille@gostai.com>
3378
3379 Use string_cast in the bench.
3380 * etc/bench.pl.in (generate_grammar_list): Define and use
3381 string_cast.
3382
39be9022
AD
33832008-11-11 Akim Demaille <demaille@gostai.com>
3384
3385 Replace yychar with a Boolean.
3386 * data/lalr1.cc (parse::yychar): Replace by...
3387 (parse::yyempty): this.
3388
a2e3fa77
AD
33892008-11-11 Akim Demaille <demaille@gostai.com>
3390
3391 Factor the tables.
3392 * TODO: New item.
3393
aba12ad1
AD
33942008-11-11 Akim Demaille <demaille@gostai.com>
3395
3396 Let yytranslate handle the eof case.
3397 * data/lalr1.cc (yytranslate_): Handle the EOF case.
3398 Adjust callers.
3399 No longer expect yychar to be equal to yyeof_, rather, test the
3400 lookahead's (translated) kind.
3401
27cb5b59
AD
34022008-11-11 Akim Demaille <demaille@gostai.com>
3403
3404 yychar cannot be empty in yyerrlab.
3405 * TODO (yychar == yyempty_): New.
3406 * data/lalr1.cc: Remove the handling of this case.
3407 This eases forthcoming changes related to yychar and yytranslate.
3408
fce629c0
AD
34092008-11-11 Akim Demaille <demaille@gostai.com>
3410
3411 Bench: syntactic sugar for %define/#define.
3412 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
3413 (&bench_push_parser, bench_variant_parser): Use this feature.
3414 (&eat): New.
3415 Use it.
3416
ce671960
AD
34172008-11-11 Akim Demaille <demaille@gostai.com>
3418
3419 Less memory pressure on the "list" bench.
3420 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
3421 the values, to limit memory pressure.
3422
2873fdf8
AD
34232008-11-11 Akim Demaille <demaille@gostai.com>
3424
3425 Introduce make_symbol.
b06df3c2
AD
3426 make_symbol provides a means to construct a full symbol (kind,
3427 value, location) in a single shot. It is meant to be a Symbol
3428 constructor, parameterized by the symbol kind so that overloading
3429 would prevent incorrect kind/value pairs. Unfortunately
3430 parameterized constructors do not work well in C++ (unless the
3431 parameter also appears as an argument, which is not acceptable),
3432 hence the use of a function instead of a constructor.
2df9ec37 3433
2873fdf8
AD
3434 * data/lalr1.cc (b4_symbol_constructor_declaration_)
3435 (b4_symbol_constructor_declarations)
3436 (b4_symbol_constructor_specialization_)
3437 (b4_symbol_constructor_specializations)
3438 (b4_symbol_constructor_definition_)
3439 (b4_symbol_constructor_definitions): New.
3440 Use them where appropriate to generate declaration, declaration of
3441 the specializations, and implementations of the templated
3442 overloaded function "make_symbol".
3443 (variant::variant): Always define a default ctor.
3444 Also provide a copy ctor.
3445 (symbol_base_type, symbol_type): New ctor overloads for value-less
3446 symbols.
3447 (symbol_type): Now public, so that functions such as yylex can use
3448 it.
3449
8be046d7
AD
34502008-11-11 Akim Demaille <demaille@gostai.com>
3451
3452 Inform m4 whether a tag is a valid id.
3453 * src/output.c (is_identifier): New.
3454 (symbol_definitions_output): Use it to define tag_is_id.
3455 But maybe this should be done at m4 level?
3456
de62edee
AD
34572008-11-11 Akim Demaille <demaille@gostai.com>
3458
3459 Test 214 was failing: it greps with a pattern containing [ ]*
3460 which obviously meant to catch spaces and tabs, but contained only
3461 spaces. Tabulations in sources are a nuisance, so to simplify the
3462 matter, get rid of all the tabulations in the Java sources. The
3463 other skeletons will be treated equally later.
3464
3465 * data/java.m4, data/lalr1.java: Untabify.
3466 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
3467 tabulations are no longer generated.
3468
905f0697
PB
34692008-11-11 Paolo Bonzini <bonzini@gnu.org>
3470
3471 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
3472 * configure.ac: Adjust usage.
3473 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3474 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3475 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
3476
09ccae9b
DJ
34772008-11-10 Di-an Jan <dianj@freeshell.org>
3478
3479 Workaround Java's ``code too large'' problem for parser tables
3480 in most cases, by using one function per initialization.
3481 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
3482 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
3483 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
3484 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
3485 (yytname_): Use b4_typed_parser_table.
3486 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
3487 ``code too large'' error.
3488
1979121c
DJ
34892008-11-10 Di-an Jan <dianj@freeshell.org>
3490
3491 * NEWS: Document them.
de62edee 3492
1979121c
DJ
3493 General Java skeleton improvements.
3494 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
3495 using gcj < 4.3 in the testsuite, according to comments in
3496 gnulib/m4/javacomp.m4.
3497 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
3498 location_type, position_type): Remove extraneous brackets from
3499 b4_percent_define_default.
3500 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
3501 m4_define and m4_define_default.
3502 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
3503 which marks the end of user code with appropriate syncline, like all
3504 the other skeletons.
3505 (b4_user_post_prologue): Add. Don't silently drop.
3506 (yylex): Remove.
3507 (parse): Inline yylex.
3508 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
3509 (%{...%}): Fix typo of %code imports.
3510 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
3511
3512 Support annotations on parser class with %define annotations.
3513 * data/lalr1.java (annotations): Add to parser class modifier.
3514 * doc/bison.texinfo (Java Parser Interface): Document
3515 %define annotations.
3516 (Java Declarations Summary): Document %define annotations.
3517 * tests/java.at (Java parser class modifiers): Test annotations.
3518
3519 Do not generate code for %error-verbose unless requested.
3520 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
3521 Make private. Make conditional on %error-verbose.
3522 (getErrorVerbose, setErrorVerbose): New.
3523 (yytnamerr_): Make conditional on %error-verbose.
3524 (yysyntax_error): Make some code conditional on %error-verbose.
3525 * doc/bison.texinfo (Java Bison Interface): Remove the parts
3526 about %error-verbose having no effect.
3527 (getErrorVerbose, setErrorVerbose): Document.
3528
3529 Move constants for token names to Lexer interface.
3530 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
3531 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
3532 (parse): Qualify EOF to Lexer.EOF.
3533 * doc/bison.texinfo (Java Parser Interface): Move documentation of
3534 EOF and token names to Java Lexer Interface.
3535 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
3536
3537 Make yyerror public.
3538 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
3539 (yyerror): Change to public. Add Javadoc comments. Use longer
3540 parameter names. Make the body rather than the declarator
3541 conditional on %locations.
3542 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
3543
3544 Allow user to add code to the constructor with %code init.
3545 * data/java.m4 (b4_init_throws): New, for %define init_throws.
3546 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
3547 Add %code init to the front of the constructor body.
3548 * doc/bison.texinfo (YYParser.YYParser): Document %code init
3549 and %define init_throws.
3550 (Java Declarations Summary): Document %code init and
3551 %define init_throws.
3552 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
3553 (Java constructor init and init_throws): Add tests.
de62edee 3554
42f832d6
AD
35552008-11-10 Akim Demaille <demaille@gostai.com>
3556
3557 Update TODO.
3558 * TODO (-D): is implemented.
3559 (associativity): Same precedence must have the same associativity.
3560 For instance, how can a * b / c be parsed if * is %left and / is
3561 %right?
3562 (YYERRORCODE, YYFAIL, YYBACKUP): New.
3563
247efe34
AD
35642008-11-10 Akim Demaille <demaille@gostai.com>
3565
3566 Formatting changes.
3567
5d731440
AD
35682008-11-10 Akim Demaille <demaille@gostai.com>
3569
3570 More information about the symbols.
3571 * src/output.c (type_names_output): Document all the symbols,
3572 including those that don't have a type-name.
3573 (symbol_definitions_output): Define "is_token" and
3574 "has_type_name".
3575 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
3576 type-name, now that they are defined too in b4_type_names.
3577
21db118b
AD
35782008-11-10 Akim Demaille <demaille@gostai.com>
3579
3580 Regen.
3581
6ed15cde
AD
35822008-11-10 Akim Demaille <demaille@gostai.com>
3583
3584 Make parser::yytranslate static.
b06df3c2
AD
3585 Small speedup (1%) on the list grammar. And makes yytranslate_
3586 available in non member functions.
de62edee 3587
6ed15cde
AD
3588 * data/lalr1.cc (yytranslate_): Does not need to be a instance
3589 function.
3590
30bb2edc
AD
35912008-11-10 Akim Demaille <demaille@gostai.com>
3592
3593 Avoid trailing spaces.
3594 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
3595 * data/lalr1.cc: Don't indent before rule and symbol actions, as
3596 they can be empty, and anyway this incorrectly indents the first
3597 action.
3598
b3a28fd4
AD
35992008-11-10 Akim Demaille <demaille@gostai.com>
3600
3601 Comment changes.
3602
914202bd
AD
36032008-11-10 Akim Demaille <demaille@gostai.com>
3604
3605 Use "enum" for integral constants.
3606 This is just nicer to read, I observed no speedup.
de62edee 3607
914202bd
AD
3608 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
3609 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
3610 (yyuser_token_number_max_, yyundef_token_): Move into...
3611 (yytranslate_): here.
3612
c17f9a4a
AD
36132008-11-10 Akim Demaille <demaille@gostai.com>
3614
3615 Shortcuts in bench directives.
3616 * etc/bench.pl.in (parse_dirs): New.
3617 Use it.
3618 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
3619 Create the benches in "benches/".
3620
b9855ea5
AD
36212008-11-10 Akim Demaille <demaille@gostai.com>
3622
3623 Formatting changes.
3624 * data/lalr1.cc: here.
3625
6e097787
AD
36262008-11-10 Akim Demaille <demaille@gostai.com>
3627
3628 Adjust verbose message to using emacs.
3629 * etc/bench.pl.in: Inform compilation-mode when we change the
3630 directory.
3631 (generate_grammar_list): Recognize %define "variant" in addition
3632 to %define variant.
3633
4c3cc7da
AD
36342008-11-10 Akim Demaille <demaille@gostai.com>
3635
3636 Classify symbols by type-name.
3637 * src/uniqstr.h (UNIQSTR_CMP): New.
3638 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
3639 (type_names_output): New.
3640 (muscles_output): Use it.
3641 * data/lalr1.cc (b4_symbol_action_): Remove.
3642 (b4_symbol_case_, b4_type_action_): New.
3643 Adjust uses of b4_symbol_action_ to use b4_type_action_.
3644
d69c9694
AD
36452008-11-10 Akim Demaille <demaille@gostai.com>
3646
3647 Change the handling of the symbols in the skeletons.
3648 Before we were using tables which lines were the symbols and which
3649 columns were things like number, tag, type-name etc. It is was
3650 difficult to extend: each time a column was added, all the numbers had
3651 to be updated (you asked for colon $2, not for "tag"). Also, it was
3652 hard to filter these tables when only a subset of the symbols (say the
3653 tokens, or the nterms, or the tokens that have and external number
3654 *and* a type-name) was of interest.
de62edee 3655
d69c9694
AD
3656 Now instead of monolithic tables, we define one macro per cell. For
3657 instance "b4_symbol(0, tag)" is a macro name which contents is
3658 self-decriptive. The macro "b4_symbol" provides easier access to
3659 these cells.
de62edee 3660
d69c9694
AD
3661 * src/output.c (type_names_output): Remove.
3662 (symbol_numbers_output, symbol_definitions_output): New.
3663 (muscles_output): Call them.
3664 (prepare_symbols): Define b4_symbols_number.
3665
5263bea9
AD
36662008-11-10 Akim Demaille <demaille@gostai.com>
3667
3668 --trace=muscles
3669 * src/getargs.h, src/getargs.c (trace_muscle): New.
3670 (trace_types, trace_args): Support it.
3671 * src/output.c (output_skeleton): Use it.
3672
4175f6bb
AD
36732008-11-10 Akim Demaille <demaille@gostai.com>
3674
3675 muscles_output.
3676 * src/output.c (muscles_output): New, extracted from...
3677 (output_skeleton): here.
3678 Adjust.
3679
1de69d6a
AD
36802008-11-10 Akim Demaille <demaille@gostai.com>
3681
3682 Formatting changes.
3683
36db78a7
AD
36842008-11-10 Akim Demaille <demaille@gostai.com>
3685
3686 Update the variant example.
3687 * examples/variant.yy: Formatting changes.
3688 One stage build.
3689
e5eb92e7
AD
36902008-11-10 Akim Demaille <demaille@gostai.com>
3691
3692 Support constructor with an argument.
3693 This improves the "list" bench by 2%.
de62edee 3694
e5eb92e7
AD
3695 * data/lalr1.cc (variant::build): Add an overloaded version with
3696 an argument.
3697 * tests/c++.at (AT_CHECK_VARIANT): Check it.
3698
76307410
AD
36992008-11-10 Akim Demaille <demaille@gostai.com>
3700
3701 Test variants.
3702 * tests/c++.at (AT_CHECK_VARIANTS): New.
3703 Use it with and without %define assert.
3704
d78f0ac9
AD
37052008-11-10 Akim Demaille <demaille@gostai.com>
3706
3707 Add %precedence support.
3708 Unfortunately it is not possible to reuse the %prec directive. This
3709 is because to please POSIX, we do not require to end the rules with a
3710 semicolon. As a result,
de62edee 3711
d78f0ac9 3712 foo: bar %prec baz
de62edee 3713
d78f0ac9
AD
3714 is ambiguous: either a rule which precedence is that of baz, or a rule,
3715 and then a declaration of the precedence of the token baz.
de62edee 3716
d78f0ac9
AD
3717 * doc/bison.texinfo: Document %precedence.
3718 (Precedence Only): New.
3719 * src/assoc.h, src/assoc.c (precedence_assoc): New.
3720 * src/conflicts.c (resolve_sr_conflict): Support it.
3721 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
3722 Parse it.
3723 * tests/calc.at: Use %precedence for NEG.
3724 * tests/conflicts.at (%precedence does not suffice)
3725 (%precedence suffices): New tests.
3726
c85be41a
AD
37272008-11-09 Akim Demaille <demaille@gostai.com>
3728
3729 Make benches in a sub dirs.
3730 * etc/bench.pl.in ($dir): New.
3731 Use it.
3732 Check the use of constructors with an argument.
3733 (bench_variant_parser): Fix.
3734
db65ca1f
AD
37352008-11-09 Akim Demaille <demaille@gostai.com>
3736
3737 fix eof condition
3738
9b0efa5b
AD
37392008-11-09 Akim Demaille <demaille@gostai.com>
3740
3741 Fix --help.
3742
432ac57a
AD
37432008-11-09 Akim Demaille <demaille@gostai.com>
3744
3745 Require the generation of parse-gram.output.
3746 * src/Makefile.am (YACC): Pass --report=all.
3747
deef2a0a
AD
37482008-11-09 Akim Demaille <demaille@gostai.com>
3749
3750 Formatting changes.
3751
df72984a
AD
37522008-11-09 Akim Demaille <demaille@gostai.com>
3753
3754 Update TODO.
3755 * TODO: Remove obsolete items.
3756 Update others.
3757
f10e19fd
AD
37582008-11-09 Akim Demaille <demaille@gostai.com>
3759
3760 Enhance bench.pl.
3761 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
3762 (@token, $grammar, $bench): New.
3763 (generate_grammar_variant): Rename as...
3764 (generate_grammar_list): this.
3765 (generate_grammar): Adjust.
3766 (bench_grammar): Rename as...
3767 (bench): this.
3768 Use it in the various bench-marking routines.
3769 (-b, -g): New options.
3770
5de9c593
AD
37712008-11-09 Akim Demaille <demaille@gostai.com>
3772
3773 Use a static hierarchy for symbols in the C++ parser.
3774 * data/lalr1.cc (symbol_base_type, symbol_type)
3775 (stack_symbol_type): Make it a static hierarchy.
3776 Adjust dependencies.
3777
757f8f98
AD
37782008-11-09 Akim Demaille <demaille@gostai.com>
3779
3780 bench.pl -d, --directive.
3781 * etc/bench.pl.in (@directive): New.
3782 (&bench_grammar): Use it.
3783 (&bench_list_grammar): New, to provide access to the "variant"
3784 grammar.
3785 Use it.
3786 (getopts): Support -d, --directive.
3787
d3be4f6d
AD
37882008-11-09 Akim Demaille <demaille@gostai.com>
3789
3790 Use inline for small operations.
3791 * data/lalr1.cc (symbol_base_type, symbol_type)
3792 (stack_symbol_type): Declare constructor and other operations as
3793 inline.
3794 (yy_destroy_): Inline.
3795
1f7d007b
AD
37962008-11-09 Akim Demaille <demaille@gostai.com>
3797
3798 Introduce a hierarchy for symbols.
3799 * data/lalr1.cc (symbol_base_type, symbol_type): New.
3800 (data_type): Rename as...
3801 (stack_symbol_type): this.
3802 Derive from symbol_base_type.
3803 (yy_symbol_value_print_): Merge into...
3804 (yy_symbol_print_): this.
3805 Rename as...
3806 (yy_print_): this.
3807 (yydestruct_): Rename as...
3808 (yy_destroy_): this.
3809 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
3810 (parser::parse): yyla is now of symbol_type.
3811 Use its type member instead of yytoken.
3812
bc0b0477
AD
38132008-11-09 Akim Demaille <demaille@gostai.com>
3814
3815 Rename data_type and stack_symbol_type.
3816 * data/lalr1.cc (data_type): Rename as...
3817 (stack_symbol_type): this.
3818
57295d14
AD
38192008-11-09 Akim Demaille <demaille@gostai.com>
3820
3821 Handle semantic value and location together.
3822 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
3823 yydata.value and yydata.location.
3824 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
3825 (YY_SYMBOL_PRINT): Now take semantic value and location as a
3826 single arg.
3827 Adjust all callers.
3828 (yydestruct_): New overload for a stack symbol.
3829
e9b0834e
AD
38302008-11-09 Akim Demaille <demaille@gostai.com>
3831
3832 Push a complete symbol, not connected parts.
3833 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
3834 state, value and location.
3835 Adjust callers.
3836
6082531a
AD
38372008-11-09 Akim Demaille <demaille@gostai.com>
3838
3839 Agregate yylval and yylloc.
3840 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
3841 (parser::yyla): this.
3842
33c195cc
AD
38432008-11-09 Akim Demaille <demaille@gostai.com>
3844
3845 Rely on the state stack to display reduction traces.
b06df3c2
AD
3846 To display rhs symbols before a reduction, we used information
3847 about the rule reduced, which required the tables yyrhs and
3848 yyprhs. Now use rely only on the state stack to get the same
3849 information.
de62edee 3850
33c195cc
AD
3851 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
3852 Use them.
3853 (parser::yyrhs_, parser::yyprhs_): Remove.
3854 (parser::yy_reduce_print_): Use the state stack.
3855
e1f93869
AD
38562008-11-09 Akim Demaille <demaille@gostai.com>
3857
3858 Fuse yyval and yyloc into yylhs.
3859 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
3860 yylhs.
3861 (parse): Replace yyval and yyloc with yylhs.value and
3862 yylhs.location.
3863 After a user action, compute yylhs.state earlier.
3864 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
3865 fresh error_token.
3866
2935744b
DJ
38672008-11-09 Di-an Jan <dianj@freeshell.org>
3868
3869 Remove unused variable.
3870 * src/output.c (type_names_output): Remove unused variable sep.
3871
bbf9ca37
PB
38722008-11-09 Paolo Bonzini <bonzini@gnu.org>
3873
3874 Change tests/output.at quoting.
3875 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
3876 expanding arguments.
3877
d9a9b96b
JD
38782008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3879
3880 Don't add a semicolon to actions for %skeleton or %language.
3881 It breaks Java test cases as reported by Akim Demaille.
3882 * src/scan-code.l: Implement.
3883
51365192
JD
38842008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3885
3886 Clean up %skeleton and %language priority implementation.
3887 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
3888 remove static qualifier because others will soon need to see it.
3889 (language_prio): Likewise.
3890 (getargs): Use command_line_prio rather than 0.
3891 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
3892 enum fields.
3893 (skeleton_prio): Extern it.
3894 (language_prio): Extern it.
3895 * src/parse-gram.y: Use grammar_prio rather than 1.
3896
9380cfd0
AD
38972008-11-07 Akim Demaille <demaille@gostai.com>
3898
3899 Moving push traces into yypush_.
3900 * data/lalr1.cc (yypush_): Now takes a optional trace message.
3901 Adjust all uses.
3902
8901f32e
AD
39032008-11-07 Akim Demaille <demaille@gostai.com>
3904
3905 The single-stack C++ parser is now the standard one.
3906 * data/lalr1.cc: Rename as...
3907 * data/lalr1-split.cc: this.
3908 * data/lalr1-fusion.cc: Rename as...
3909 * data/lalr1.cc: this.
3910 * etc/bench.pl.in: Adjust.
3911
8cdabf02
AD
39122008-11-07 Akim Demaille <demaille@gostai.com>
3913
3914 Avoid empty-if warnings.
3915 Reported by Quentin Hocquet.
de62edee 3916
8cdabf02
AD
3917 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
3918 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
3919
5a893c2b
AD
39202008-11-07 Akim Demaille <demaille@gostai.com>
3921
3922 Pass command line location to skeleton_arg and language_argmatch.
3923 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
3924 The location argument is now mandatory.
3925 Adjust all dependencies.
3926 (getargs): Use command_line_location.
3927
58697c6d
AD
39282008-11-07 Akim Demaille <demaille@gostai.com>
3929
3930 -D, --define.
3931 * src/getargs.c (usage): Document -D.
3932 Fix help string for --locations.
3933 (command_line_location): New.
3934 (short_options, long_options, getargs): Support -D, --define.
3935 (getargs): Move -d support at the right place.
3936 * doc/bison.texinfo (Bison Options): Update.
3937 * tests/input.at (%define, --define): New.
3938
9fe5a457
AD
39392008-11-07 Akim Demaille <demaille@gostai.com>
3940
3941 Initialize the muscle table before parsing the command line.
3942 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
3943 (getargs): Define file_name.
3944 * src/main.c (main): Initialize muscle_tab before calling
3945 getargs.
3946 * src/muscle_tab.c (muscle_init): No longer define file_name, as
3947 its value is not available yet.
3948
56c5eca9
AD
39492008-11-07 Akim Demaille <demaille@gostai.com>
3950
3951 Locations without columns for command line arguments.
3952 * src/location.c (location_print): Don't display negative columns.
3953 * src/location.h: Document this.
3954
9b9e0a7d
AD
39552008-11-07 Akim Demaille <demaille@gostai.com>
3956
3957 Fix --help.
3958 * src/getargs.c (usage): Fix help string for -W.
3959
74eae918
AD
39602008-11-07 Akim Demaille <demaille@gostai.com>
3961
3962 Handle more general types of option arguments.
3963 * build-aux/cross-options.pl: The argument ends at the first
3964 space, not the first non-symbol character.
3965 Use @var for each word appearing the argument description.
3966
a3d4c6fb
AD
39672008-11-07 Akim Demaille <demaille@gostai.com>
3968
3969 Destroy the variants that remain on the stack in case of error.
3970 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
3971 destructor.
3972 Display the value only if yymsg is nonnull.
3973 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
3974
2d32fc9f
AD
39752008-11-07 Akim Demaille <demaille@gostai.com>
3976
3977 Add "%define assert" to variants.
3978 This is used to help the user catch cases where some value gets
3979 ovewritten by a new one. This should not happen, as this will
3980 probably leak.
de62edee 3981
2d32fc9f
AD
3982 Unfortunately this uncovered a bug in the C++ parser itself: the
3983 lookahead value was not destroyed between two calls to yylex. For
3984 instance if the previous lookahead was a std::string, and then an int,
3985 then the value of the std::string was correctly taken (i.e., the
3986 lookahead was now an empty string), but std::string structure itself
3987 was not reclaimed.
de62edee 3988
2d32fc9f
AD
3989 This is now done in variant::build(other&) (which is used to take the
3990 value of the lookahead): other is not only stolen from its value, it
3991 is also destroyed. This incurs a new performance penalty of a few
3992 percent, and union becomes faster again.
de62edee 3993
2d32fc9f
AD
3994 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
3995 (b4_variant_if): New.
3996 (variant::built): New.
3997 Use it whereever the status of the variant changes.
3998 * etc/bench.pl.in: Check the penalty of %define assert.
3999
f6038cb8
AD
40002008-11-07 Akim Demaille <demaille@gostai.com>
4001
4002 Use "%define variant" in bench.pl.
4003 * etc/bench.pl.in: No longer use the pseudo directive %variants,
4004 just use %define variants.
4005
ccde1f98
AD
40062008-11-07 Akim Demaille <demaille@gostai.com>
4007
4008 Regen.
4009 * src/parse-gram.h, src/parse-gram.c: Regen.
4010
58bd33b7
JD
40112008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
4012
4013 Fix user actions without a trailing semicolon.
4014 Reported by Sergei Steshenko at
4015 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
4016 * THANKS (Sergei Steshenko): Add.
4017 * src/scan-code.l (SC_RULE_ACTION): Fix it.
4018 * tests/regression.at (Fix user actions without a trailing semicolon):
4019 New test case.
4020
639867b5
AD
40212008-11-04 Akim Demaille <demaille@gostai.com>
4022
4023 Use b4_copyright_years.
4024 * data/yacc.c (b4_copyright_years): New.
4025 Fix its value according to the comments in the file.
4026 Use it and undefine it.
4027
3c262606
AD
40282008-11-04 Akim Demaille <demaille@gostai.com>
4029
4030 Formatting changes.
4031 * data/lalr1-fusion.cc, src/parse-gram.y: here.
4032
a2b93d52
AD
40332008-11-04 Akim Demaille <demaille@gostai.com>
4034
4035 Formatting changes.
4036 * data/lalr1-fusion.cc: here.
4037
3a2803df
AD
40382008-11-04 Akim Demaille <demaille@gostai.com>
4039
4040 Use strict on bench.pl.
4041 * etc/bench.pl.in (&run, &generate_grammar): New.
4042 Rename the grammar generating functions for consistency.
4043 Change the interface so that the list of benches to run is passed
4044 as (optionless) arguments.
4045 (&compile): Use &run.
4046
a0d4650a
AD
40472008-11-04 Akim Demaille <demaille@gostai.com>
4048
4049 Remove spurious initial empty lines.
4050 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
4051 * data/yacc.c: End the @output lines with an @.
4052
cac9e09b
AD
40532008-11-04 Akim Demaille <demaille@gostai.com>
4054
4055 Improve the display of sizes.
4056 * etc/bench.p.in: Higher precision.
4057 Sort by decreasing size.
4058
4af4348a
AD
40592008-11-04 Akim Demaille <demaille@gostai.com>
4060
4061 Don't memcpy C++ structures.
4062 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
4063 arguments.
4064 (variant::build): New overload for
4065 copy-construction-that-destroys.
4066 (variant::swap): New.
4067 (parser::yypush_): Use it in variant mode.
4068
ef05c4d6
AD
40692008-11-04 Akim Demaille <demaille@gostai.com>
4070
4071 Better defaults for bench.pl.
4072 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
4073 default values.
4074 Adjust &verbose uses.
4075 (-q, --quiet): New.
4076
9718cfa9
AD
40772008-11-04 Akim Demaille <demaille@gostai.com>
4078
4079 Make variant.yy more complex.
4080 std::list cannot be copied via memcpy, they are more demanding than
4081 std::string. Use one std::list to strengthen the test.
de62edee 4082
9718cfa9
AD
4083 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
4084 Adjust.
4085 Create a list of strings, instead of a single large string.
4086
a6df593d
AD
40872008-11-04 Akim Demaille <demaille@gostai.com>
4088
4089 bench.pl --bench.
4090 * etc/bench.pl.in (--bench, $bench): New.
4091
006a0303
AD
40922008-11-04 Akim Demaille <demaille@gostai.com>
4093
4094 Sort methods.
4095 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
4096 Define it after as().
4097
faef3466
AD
40982008-11-04 Akim Demaille <demaille@gostai.com>
4099
4100 Useless parens.
4101 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
4102
2141aded
AD
41032008-11-04 Akim Demaille <demaille@gostai.com>
4104
4105 Issue missing synclines after user actions.
4106 * data/c.m4 (b4_case): Issue synclines on the output file.
4107
e426d17b
AD
41082008-11-04 Akim Demaille <demaille@gostai.com>
4109
4110 Remove trailing empty line.
4111 * data/lalr1-fusion.cc: Don't add an empty line after the user's
4112 epilogue.
4113
a9ce3f54
AD
41142008-11-04 Akim Demaille <demaille@gostai.com>
4115
4116 Fix output of copyright years.
4117 * data/bison.m4 (b4_copyright): Fix the indentation of the
4118 copyright year paragraph.
4119 Use b4_copyright_years when no years are given.
4120 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
4121 (b4_copyright_years): New.
4122 Use it.
4123
59c544c2
AD
41242008-11-04 Akim Demaille <demaille@gostai.com>
4125
4126 Avoid the spurious initial empty line.
4127 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
4128 the end of @output request to suppress the empty line that
4129 results.
4130
96b15448
AD
41312008-11-04 Akim Demaille <demaille@gostai.com>
4132
4133 Remove parser::rhs_number_type.
4134 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
4135 (yyrhs_): Use b4_table_define.
4136
f0633174
AD
41372008-11-04 Akim Demaille <demaille@gostai.com>
4138
4139 Fix iteration type.
4140 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
4141
417b8004
AD
41422008-11-04 Akim Demaille <demaille@gostai.com>
4143
4144 Factor the declaration of the integer tables.
4145 * data/lalr1-fusion.cc (b4_table_define): New.
4146 Use it.
4147
1a5246c6
AD
41482008-11-03 Akim Demaille <demaille@gostai.com>
4149
4150 Fix indentation of tables in lalr1.cc
4151 * data/lalr1-fusion.cc: Fix the indentation.
4152
f8a95c9c
AD
41532008-11-03 Akim Demaille <demaille@gostai.com>
4154
4155 Destroy the lhs symbols after reduction.
4156 * data/lalr1-fusion.cc (parse): After the user action, when in
4157 variant mode, destroy the lhs symbols.
4158
d7f4d823
AD
41592008-11-03 Akim Demaille <demaille@gostai.com>
4160
4161 Simplify yysyntax_error_ use.
4162 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
4163 type, but make it unnamed in the declaration when it is not used.
4164
8b9c89fb
AD
41652008-11-03 Akim Demaille <demaille@gostai.com>
4166
4167 Let yy::variant::build return an lvalue.
4168 * data/lalr1-fusion.cc (variant::build): Return a reference to the
4169 object.
4170
83243c24
AD
41712008-11-03 Akim Demaille <demaille@gostai.com>
4172
4173 Define yy::variant only when needed.
4174 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
4175 used.
4176
429b4848
AD
41772008-11-03 Akim Demaille <demaille@gostai.com>
4178
4179 Bench the three-stack lalr1.cc.
4180 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
4181 one-stack one.
4182
414c76a4
AD
41832008-11-03 Akim Demaille <demaille@gostai.com>
4184
4185 Fail on parse error in calc++.
4186 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
4187 status.
4188 * examples/calc++/test ($me, $number, $exit, run): New.
4189 Use them to propagate errors to the exit status.
4190
8a5783fd
AD
41912008-11-03 Akim Demaille <demaille@gostai.com>
4192
4193 Don't specify the skeleton twice in the example.
4194 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
4195 file does what is needed.
4196
0cc5bead
AD
41972008-11-03 Akim Demaille <demaille@gostai.com>
4198
4199 bench: Improve output.
4200 * etc/bench.pl.in (bench_grammar): Tune the printf format.
4201
5b421a4e
AD
42022008-11-03 Akim Demaille <demaille@gostai.com>
4203
4204 bench: check impact of %debug on variants.
4205 * etc/bench.pl.in (variant_grammar): Fix the computation of
4206 $variant.
4207 Generate a grammar file that can work with or without %debug.
4208 Do use the @directive.
4209 (bench_variant_parser): Check impact of %debug.
4210 (@directives): Rename all the occurrences to...
4211 (@directive): this, for consistency.
4212
d11ee647
AD
42132008-11-03 Akim Demaille <demaille@gostai.com>
4214
4215 bench: report the size too.
4216 * etc/bench.pl.in ($iterations): Defaults to -3.
4217 (&bench_grammar): Require hireswallclock.
4218 Compute and display the size of the result.
4219 More comments.
4220
e1b74b92
AD
42212008-11-03 Akim Demaille <demaille@gostai.com>
4222
4223 bench: More use of the verbosity level.
4224 * etc/bench.pl.in ($verbose, &verbose): New.
4225 Use them.
4226 More POD documentation.
4227
7e5f9c54
AD
42282008-11-03 Akim Demaille <demaille@gostai.com>
4229
4230 bench.pl: a command line interface
4231 * etc/bench.pl.in: More doc.
4232 Some fixes in the documentation.
4233 ($cflags, $iterations, &help, &getopt): New.
4234 Use them.
4235 (&variant_grammar): Let the number of stages be 10 times what is
4236 specified.
4237
7109a18d
AD
42382008-11-03 Akim Demaille <demaille@gostai.com>
4239
4240 Bench the use of Boost.Variants.
4241 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
4242 New.
4243 (&compile): Be ready to compile C++ parsers.
4244 (&bench_push_parser): Move debug information to the outermost
4245 level.
4246 * THANKS: Add Michiel De Wilde.
4247
922730fe
AD
42482008-11-03 Akim Demaille <demaille@gostai.com>
4249
4250 bench.pl: Pass directives as a list instead of as a string.
4251 * etc/bench.pl.in (&directives): New.
4252 (&triangular_grammar, &calc_grammar): Use it to format the Bison
4253 directives.
4254 (&triangular_grammar): Do use the directives (were ignored).
4255 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
4256 directives.
4257
7484f1d4
AD
42582008-11-03 Akim Demaille <demaille@gostai.com>
4259
4260 Improve genericity of bench.pl.
4261 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
4262 argument.
4263 (&bench_push_parser): New.
4264 Call it.
4265
15129f25
AD
42662008-11-03 Akim Demaille <demaille@gostai.com>
4267
4268 Add documentation to bench.pl.
4269 * etc/bench.pl.in: Comment changes.
4270
0e0ed236
AD
42712008-11-03 Akim Demaille <demaille@gostai.com>
4272
4273 Fuse the three stacks into a single one.
de62edee 4274
b06df3c2
AD
4275 In order to make it easy to perform benchmarks to ensure that
4276 there are no performance loss, lalr1.cc is forked into
4277 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
4278 lalr1.cc.
4279
4280 Meanwhile, to make sure that lalr1-fusion.cc is correctly
4281 exercized by the test suite, the user must install a symbolic link
4282 from lalr1.cc to it.
de62edee 4283
b06df3c2
AD
4284 Instead of having three stacks (state, value, location), use a
4285 stack of triples. This considerably simplifies the code (and it
4286 will be easier not to require locations as currently does the C++
4287 parser), and also gives a 10% speedup according to
4288 etc/bench (probably mainly since memory allocation is done once
4289 instead of three times).
de62edee 4290
0e0ed236
AD
4291 Another motivation is to make it easier to destruct properly
4292 semantic values: now that they are bound to their state (hence
4293 symbol type) it will be easier to call the appropriate destructor.
de62edee 4294
0e0ed236 4295 These changes should probably benefit the C parser too.
de62edee 4296
b06df3c2
AD
4297 * data/lalr1.cc: Copy as...
4298 * data/lalr1-fusion.cc: this new file.
0e0ed236
AD
4299 (b4_rhs_value, b4_rhs_location): New definitions overriding those
4300 from c++.m4.
4301 (state_stack_type, semantic_stack_type, location_stack_type)
4302 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
4303 (data_type, stack_type, yystack_): New.
4304 (YYLLOC_DEFAULT, yypush_): Adjust.
4305 (yyerror_range): Now based on data_type, not location_type.
4306
7dedf26e
AD
43072008-11-03 Akim Demaille <demaille@gostai.com>
4308
4309 Push the state, value, and location at the same time.
4310 This is needed to prepare a forthcoming patch that fuses the three
4311 stacks into one.
de62edee 4312
7dedf26e
AD
4313 * data/lalr1.cc (parser::yypush_): New.
4314 (parser::yynewstate): Change the semantics: instead of arriving to
4315 this label when value and location have been pushed, but yystate
4316 is to be pushed on the state stack, now the three of them must
4317 have been pushed before. yystate still must be the new state.
4318 This allows to use yypush_ everywhere instead of individual
4319 handling of the stacks.
4320
c4585f1e
AD
43212008-11-03 Akim Demaille <demaille@gostai.com>
4322
4323 Prefer references to pointers.
4324 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
4325 definition to use references instead of pointers.
4326 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
4327 Take the value and location as references.
4328 Adjust callers.
4329
56017c17
AD
43302008-11-03 Akim Demaille <demaille@gostai.com>
4331
4332 stack::size instead of stack::height.
4333 * data/lalr1.cc (stack::height): Rename as...
4334 (stack::size): this.
4335 Fix the output type.
4336 Comment changes.
4337
5ab8c47b
AD
43382008-11-03 Akim Demaille <demaille@gostai.com>
4339
4340 Use variants to support objects as semantic values.
b06df3c2
AD
4341 This patch was inspired by work by Michiel De Wilde. But he used
4342 Boost variants which (i) requires Boost on the user side, (ii) is
4343 slow, and (iii) has useless overhead (the parser knows the type of
4344 the semantic value there is no reason to duplicate this
4345 information as Boost.Variants do).
4346
4347 This implementation reserves a buffer large enough to store the
4348 largest objects. yy::variant implements this buffer. It was
4349 implemented with Quentin Hocquet.
de62edee 4350
5ab8c47b
AD
4351 * src/output.c (type_names_output): New.
4352 (output_skeleton): Invoke it.
4353 * data/c++.m4 (b4_variant_if): New.
4354 (b4_symbol_value): If needed, provide a definition for variants.
4355 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
4356 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
4357 (b4_char_sizeof, yy::variant): New.
4358 (parser::parse): If variants are requested, define
4359 parser::union_type, parser::variant, change the definition of
4360 semantic_type, construct $$ before running the user action instead
4361 of performing a default $$ = $1.
4362 * examples/variant.yy: New.
4363 Based on an example by Michiel De Wilde.
4364
1fa5d8bb
AD
43652008-11-03 Akim Demaille <demaille@gostai.com>
4366
4367 Parameterize the extraction of semantic values.
4368 To make future changes easier, no longer rely on ".TYPE" being the
4369 way to get a semantic value.
de62edee 4370
1fa5d8bb
AD
4371 * data/c.m4 (b4_symbol_value): New.
4372 Use it.
4373 * data/c++.m4, data/yacc.c: Use it.
4374 * data/glr.c: Use b4_symbol_value.
4375 (b4_rhs_data): New.
4376 Use it.
4377
91ba8a55
AD
43782008-11-03 Akim Demaille <demaille@gostai.com>
4379
4380 Prepare easier M4 changes.
4381 * data/lalr1.cc: Use escaped [] instead of literals to prepare
4382 future changes.
4383
c9ba9e59
JD
43842008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4385
4386 Initiate further development.
4387 * NEWS: Create an empty section for new entries.
4388 * gnulib: Update submodule to HEAD.
4389
bfb40910
JD
43902008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4391
4392 * NEWS: Version 2.4.
4393
241fda7a
JD
43942008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4395
4396 Prepare for next release.
4397 * NEWS: Briefly mention changes since 2.3b.
4398 * README: Say GNU m4 1.4.6, which we've been requiring in release
4399 announcements already, not 1.4.3, which breaks the build.
4400
ed4d67dc
JD
44012008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4402
4403 Say %language is experimental.
4404 We're thinking of extending it's effect on output file naming. See the
4405 thread at
4406 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
4407 * NEWS: Say it's experimental.
4408 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
4409 recommend it over %skeleton for now.
4410 (Bison Options): Likewise.
4411 (C++ Bison Interface): Use %skeleton not %language.
4412 (Calc++ Parser): Use %skeleton not %language.
4413 * src/getargs.c (usage): Say it's experimental.
4414
e254a580
DJ
44152008-11-01 Di-an Jan <dianj@freeshell.org>
4416 Paolo Bonzini <bonzini@gnu.org>
4417
4418 Support all Java parser class modifiers.
4419 * data/java.m4 (b4_percent_define_get3): New.
4420 (b4_final_if, b4_strictfp_if): New.
4421 * data/lalr1.java (final, strictfp, extends, implements): Support.
4422 * doc/bison.texinfo (final, strictfp, extends, implements): Add
4423 documentation.
4424 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
4425 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
4426 (AT_CHECK_JAVA_GREP): New.
4427 (Java parser class modifiers): New test.
4428 (Java parser class extends and implements): New test.
4429
4430 Model exception propagation better with throws and lex_throws.
4431 * data/java.m4 (b4_list2): New.
4432 (throws): Change default.
4433 * data/lalr1.java (yyaction): Add throws.
4434 (parse): Add lex_throws in addition to throws.
4435 * doc/bison.texinfo (throws, lex_throws): Add documentation.
4436 * tests/java.at (Java throws specifications): New test.
4437
4438 Improve documentation for Java parsers.
4439 * doc/bison.texinfo (Java Parsers): Add subsections.
4440 Don't quote first argument of %define.
4441 (Java Bison Interface): Document output files. Move documentation
4442 of parser class and merge into Java Parser Interface. Document
4443 features that error out. Document directives with no effect.
4444 Move note about Javadoc higher.
4445 (Java Semantic Values): Explicitly mention stype.
4446 Document that generic types cannot be used.
4447 (Java Location Values): Use @deftypeivar. Document constructors.
4448 Correct return value for toString.
4449 (Java Parser Interface): List undocumented constants/fields.
4450 Move documentation of fields added by %parse-param closer to list
4451 of members. Document that token names are added as fields.
4452 Document constructors accurately. Remove error method.
4453 (Java Scanner Interface): Move note on %pure-parser to Java Bison
4454 Interface. Describe %code lexer and yylex accutately.
4455 Remove documentation that does not match the code.
4456 (Java Action Features): New.
4457 (Java Differences): Add reference. Add item on semantic values.
4458 Add note about @{ ... @}. Clarify %% epilogue placement.
4459 (Java Declarations Summary): New.
4460
4461 Fix Java skeleton.
4462 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
4463 (b4_remove_comma): Quote test argument.
4464 (b4_identification): Remove "bison" field.
4465 * tests/java.at (Java parser class and package names): New test.
4466 (Java %parse-param and %lex-param): New test.
4467 (Java stype, position_class and location_class): New test.
4468
f259e4e6
PB
44692008-10-31 Di-an Jan <dianj@freeshell.org>
4470
4471 * data/lalr1.jave: Update copyright years.
4472 (YYParser): Correct name of "generated from" file in Javadoc:
4473 use b4_file_name instead of @ofile@.
4474 (Location constructor): Correct Javadoc parameter name.
4475 (yylloc): Add missing opening m4 quote after b4_location_if.
4476 This removes a stray [ in the Javadoc of Lexer.getStartPos.
4477 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
4478 (YYParser constructor): Correct Javadoc parameter name.
4479
cae5057f
JD
44802008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
4481
4482 Always put auxiliary code files in the same dir as other output files.
4483 * src/files.c (compute_file_name_parts): When the user specifies
4484 --output but not --file-prefix, extract the directory prefix from the
4485 file prefix not from the grammar file name. This affects the location
4486 of files like location.hh generated by the C++ skeleton. The includes
4487 in the other output files require this fix.
4488 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
4489 for expected output files.
4490 (Output files): Add a test for the above.
4491
4af432ba
JD
44922008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
4493
4494 * gnulib: Update submodule to HEAD.
4495
e26d4e43
JD
44962008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4497
4498 Update copyright year.
4499 * src/files.c: Here.
4500
c0ee9e21
DJ
45012008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
4502
4503 Don't overwrite the input file.
4504 * src/files.c (output_file_name_check): Fatal error if using input file
4505 for output.
4506 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
4507 argument.
4508 (Conflicting output files): Add test.
4509
482dc52f
AD
45102008-10-28 Akim Demaille <demaille@gostai.com>
4511
4512 Space changes.
4513 * data/lalr1.cc: Formatting changes.
4514
52cbbe84
AD
45152008-10-28 Akim Demaille <demaille@gostai.com>
4516
4517 Don't define debugging functions when !YYDEBUG.
4518 * data/lalr1.cc (debug_stream, set_debug_stream)
4519 (debug_level_type, debug_level, set_debug_level): Don't
4520 declare them when YYDEBUG is not defined.
4521 The implementation are already YYDEBUG-aware.
4522
0925d5bf
AD
45232008-10-28 Akim Demaille <demaille@gostai.com>
4524
4525 Prefer "continue" for empty loop bodies.
4526 * etc/bench.pl.in: Use "continue" instead of {}.
4527
cf98343c
AD
45282008-10-28 Akim Demaille <demaille@gostai.com>
4529
4530 Space and comments changes.
4531 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
4532 * data/c.m4, data/lalr1.cc: Space changes.
4533
9f467b7d
AD
45342008-10-28 Akim Demaille <demaille@gostai.com>
4535
4536 Make gnulib a submodule.
4537 * gnulib: New.
4538 * .gitmodules (gnulib): New.
4539
0f0e1ace
JD
45402008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4541
4542 Fix yyerror_range for user-defined location type in C++. Reported by
4543 Georg Sauthoff at
4544 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
4545 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
4546 * THANKS (Georg Sauthoff): Add.
4547
548e2104
JD
45482008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4549
4550 Update several administrative files mainly to facilitate releasing.
4551 * HACKING (Administrivia): Make the git-merge-changelog notes more
4552 helpful.
4553 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
4554 (Release Procedure): Update for git and add numerous details that were
4555 previously missing.
4556 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
4557 * maint.mk (announcement): Don't list bison as a bootstrap tool so
4558 that announcements don't claim we bootstrapped with whatever bison
4559 happened to be in PATH. Add flex as a bootstrap tool.
4560 * Makefile.maint: Remove, previously replaced by maint.mk.
4561 * Makefile.cfg: Remove, and migrate settings to...
4562 * cfg.mk: ... here for the sake of `make announcement'.
4563 * bootstrap.conf (gnulib_modules): Add announce-gen.
4564 * README: Say GNU Bison instead of just Bison. Suggested by Karl
4565 Berry.
4566
ddf17a6e
PB
45672008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
4568
4569 Small but important bugfixes for the Java skeleton.
4570 * data/lalr1.java (yyerror): Change Location to b4_location_type.
4571 (yy_symbol_print): Call toString on yyvaluep.
4572
e1145ad8
AD
45732008-08-29 Akim Demaille <demaille@gostai.com>
4574
4575 Clarify UPDATED use.
215b40ac 4576 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 4577 not to the release date of Bison.
215b40ac 4578 Reported by Joel E. Denny.
e1145ad8 4579
0df72d78
AD
45802008-08-29 Akim Demaille <demaille@gostai.com>
4581
4582 * README: Update FAQ pointer.
4583 Reported by Joel E. Denny.
4584
9a90b6bb
EB
45852008-08-27 Eric Blake <ebb9@byu.net>
4586
4587 Resync m4sugar from autoconf.
4588 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
4589 (m4_init): Adjust to latest m4.git changes.
4590 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
4591 effects.
4592 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
4593 (_m4_list_cmp): Reduce side effects.
4594
65015668
AD
45952008-08-27 Akim Demaille <demaille@gostai.com>
4596
4597 Check yyerrok in calc.at.
215b40ac
EB
4598 * tests/calc.at (calc.y): Use yyerrok on "( error )".
4599 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
4600 expected.
65015668 4601
98e26a92
AD
46022008-08-27 Akim Demaille <demaille@gostai.com>
4603
4604 Support yyerrok in lalr1.cc.
4605 YYBACKUP is still to import back into lalr1.cc.
215b40ac 4606 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 4607
86c0e784
JD
46082008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4609
4610 For maintainer-check*, don't recompile for a $(VERSION) update.
4611 * cfg.mk: New file.
4612 (_is-dist-target): Override the one in GNUmakefile.
4613 * Makefile.am (EXTRA_DIST): Add cfg.mk.
4614
88511166
JD
46152008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4616
4617 Update for recent change to gnulib.
4618 * src/parse-gram.y: Don't include strverscmp.h. It comes from
4619 string.h now.
4620
6bbb2ed5
EB
46212008-08-15 Eric Blake <ebb9@byu.net>
4622
d67c52e8
EB
4623 Remaining m4sugar merge from autoconf.
4624 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
4625 * data/m4sugar/foreach.m4: New file, copied from autoconf.
4626 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
4627 * src/output.c (output_skeleton): Tell m4 how to find it.
4628
6bbb2ed5
EB
4629 Partial m4sugar merge from autoconf: m4_map.
4630 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
4631 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
4632 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
4633 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
4634 for empty list.
4635 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
4636 Likewise.
4637 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
4638 declares it.
4639
8dce3875
JD
46402008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
4641
4642 Keep .version and PACKAGE_VERSION in sync.
4643 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
4644 dependency, and add comments justifying this in more detail. Discussed
4645 starting at
4646 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
4647
882a1fbf
EB
46482008-08-06 Eric Blake <ebb9@byu.net>
4649
a3764451
EB
4650 Partial m4sugar merge from autoconf: m4_shiftn.
4651 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
4652 (m4_shift2, m4_shift3): New macros.
4653 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
4654 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
4655 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
4656 * data/java.m4 (b4_remove_comma): Likewise.
4657
882a1fbf
EB
4658 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
4659 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
4660 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
4661 (m4_init): Consolidate wrapped text into single m4_wrap.
4662 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
4663 in wrapped text.
4664
a30e920d
EB
46652008-08-05 Eric Blake <ebb9@byu.net>
4666
dfcc5959
EB
4667 Partial m4sugar merge from autoconf: builtins, version.m4.
4668 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
4669 (m4_prepend): Remove, as it is unused and inherently quadratic,
4670 whereas m4_append is linear in newer m4.
4671 (m4_mkstemp): New builtin.
4672 (m4_symbols): Make rename conditional.
4673 (m4_version_prereq): Ensure fatal error if used in bison, which
4674 intentionally lacks version.m4.
4675
a30e920d
EB
4676 Fix comments in m4sugar.
4677 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
4678
445b7470
JD
46792008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4680
4681 Update for recent .gitignore fix in Gnulib.
4682 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
4683 anchored .gitignore entries.
4684
a1e50014
JD
46852008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4686
4687 Set gnu or gnits strictness.
4688 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
4689 development and gnits strictness for releases. Based on Eric Blake's
4690 suggestion at
4691 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
4692
d43f77e7
PB
46932008-07-31 Paolo Bonzini <bonzini@gnu.org>
4694
4695 * NEWS: Clarify documentation of %language.
4696
fee2ed87
PB
46972008-07-31 Paolo Bonzini <bonzini@gnu.org>
4698
4699 Support usage of git-merge-changelog.
4700 * .gitattributes: New.
4701 * HACKING: Document usage of git-merge-changelog.
4702 * bootstrap: Install git-merge-changelog entries in .git/config
4703 if appropriate.
4704
78029cd5
JD
47052008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4706
4707 Remove remaining dependence on CVS Id keyword.
4708 * ChangeLog: For the sake of people still using CVS, don't use dollars
4709 when mentioning Id.
4710 * data/xslt/bison.xsl: Remove Id from header comments, where it was
4711 unusual anyway.
4712 * data/xslt/xml2dot.xsl: Likewise.
4713 * data/xslt/xml2text.xsl: Likewise.
4714 * data/xslt/xml2xhtml.xsl: Likewise.
4715 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
4716 * doc/Makefile.am (neutralize): Remove, no longer needed.
4717 (.x.1): Don't use neutralize.
4718 (edit): Don't substitute for ID.
4719 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
4720
c53d18b1
JD
47212008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4722
4723 Fix dependence on computed configure variables.
4724 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
4725 $(top_srcdir)/configure.ac so that changes to computed variables, such
4726 as PACKAGE_VERSION, are seen.
4727 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
4728
5523ac79
JD
47292008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
4730
4731 Update copyright dates for recent changes.
4732 * Makefile.am: Here.
4733 * src/Makefile.am: Here.
4734 * src/reduce.c: Here.
4735 * tests/reduce.at: Here.
4736
8fa36911
JD
47372008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
4738
4739 Use git-version-gen for version names between releases.
4740 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
4741 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
4742 * .prev-version: New.
4743 * .version.in: Remove.
78029cd5 4744 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
4745 revision.
4746 * GNUmakefile: Remove, now copied from Gnulib.
4747 * Makefile.am: Add code suggested by comments in
4748 build-aux/git-version-gen.
4749 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
4750 .prev-version, and .version.
4751 * NEWS (2.3b+): Rename to...
4752 (?.?): ... this because we're dropping the "+" version naming scheme,
4753 but, in general, we still can't be sure of our next release name.
4754 * bootstrap: Add a quick hack to remove from .gitignore the
4755 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
4756 entry. This should really be fixed in gnulib instead.
4757 * bootstrap.conf (gnulib_modules): Add gnumakefile.
4758 * configure.ac (AC_INIT): Set version name by invoking
4759 build-aux/git-version-gen.
4760 (AC_CONFIG_FILES): Remove .version, now generated by
4761 build-aux/git-version-gen.
4762 * maint.mk: New, copied from coreutils.
4763 * doc/.cvsignore (bison.1): Add.
4764 * doc/.gitignore (/bison.1): Add.
4765 * doc/bison.1: Remove, generated.
4766 * src/.cvsignore (revision.c): Remove.
4767 * src/.gitignore (/revision.c): Remove.
4768 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
4769 (BUILT_SOURCES): Remove revision.c.
4770 (revision.c): Remove.
4771 * src/getargs.c (version): Don't print revision after the VERSION.
4772 * src/revision.h: Remove.
4773
bcf07cb7
JD
47742008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4775
4776 Fix untranslatable composition of sentences. Reported by Goran
4777 Uddeborg at
4778 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
4779 * THANKS (Goran Uddeborg): Add.
4780 * src/reduce.c (reduce_print): Report the number of nonterminals and
4781 rules useless in the grammar in separate sentences.
4782 * tests/reduce.at (Useless Rules): Update output.
4783 (Reduced Automaton): Likewise.
4784 (Underivable Rules): Likewise.
4785 (Empty Language): Likewise.
4786
9aacab9a
JD
47872008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4788
4789 Fix some .gitignore and .cvsignore problems.
4790 * bootstrap (insert_sorted_if_absent): Replace all uses with...
4791 (insert_vc_ignore): ... this new function, which prepends `/' to all
4792 .gitignore entries before passing them to insert_sorted_if_absent.
4793 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
4794 .cvsignore files are maintained even though Bison developers run
4795 bootstrap while using Git.
4796 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
4797 unneeded by Bison.
4798 (gnulib): Add.
4799 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
4800 unneeded. Reported by Eric Blake.
4801 * lib/.gitignore (/*~): Add.
4802 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
4803 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
4804 Blake.
4805 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
4806
a9fc7990
JD
48072008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4808
4809 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
4810 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
4811 * bootstrap.conf (gnulib_modules): Add unsetenv.
4812 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
4813 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
4814 (/setenv.m4): Add.
4815 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
4816 the first argument because it may become position-dependent, and unset
4817 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
4818 Add comments explaining these issues in more detail.
4819
0f1d6f10
JD
48202008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
4821
4822 Add .gitignore everywhere based on .cvsignore.
4823 * .gitignore: New.
4824 * build-aux/.gitignore: New.
4825 * data/.gitignore: New.
4826 * doc/.gitignore: New.
4827 * etc/.gitignore: New.
4828 * examples/.gitignore: New.
4829 * examples/calc++/.gitignore: New.
4830 * lib/.gitignore: New.
4831 * m4/.gitignore: New.
4832 * po/.gitignore: New.
4833 * runtime-po/.gitignore: New.
4834 * src/.gitignore: New.
4835 * tests/.gitignore: New.
4836
7bd1665a
JD
48372008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4838
4839 * NEWS (2.3b+): New section, empty for now.
4840 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
4841
72c5b982
JD
48422008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4843
4844 * NEWS (2.3b): Update release date since there has been a delay in
4845 getting the announcements and tarballs out.
4846
bd02cd5d
JD
48472008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4848
4849 * NEWS: Version 2.3b.
4850 * configure.ac (AC_INIT): Likewise.
4851 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
4852
9126263e
JD
48532008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4854
4855 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
4856 been doing it for years.
4857 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
4858 (Release Procedure): Add FIXME about make alpha being unmaintained.
4859
fa6aa7b3
JD
48602008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
4861
4862 * data/yacc.c: Reformat m4 a little for readability.
4863 * src/lalr.c (build_relations): Correct comment.
4864
d30b312d
JMG
48652008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4866
4867 DJGPP specific issue.
4868 * djgpp/config.sed: Fixes required to run configure scripts generated
4869 by autoconf 2.62.
4870
138d4cd9
JD
48712008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4872
4873 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
4874 coordinator@translationproject.org.
4875
8f7e2e1f
JD
48762008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4877
4878 * THANKS: Add Eric Blake.
4879
f55efa38
JD
48802008-04-23 Eric Blake <ebb9@byu.net>
4881
4882 Revert prior patch, by working around autoconf regression.
4883 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
4884 ("Output file name: ("): Uncomment test.
4885 ("Output file name: )"): Likewise.
4886 Based on an idea from Noah Misch.
4887
096c9f9d
JD
48882008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4889
4890 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
4891 2.61. Reported by Juan Manuel Guerrero at
4892 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
4893 * tests/output.at ("Output file name: ("): Comment out test case for
4894 now.
4895 ("Output file name: )"): Likewise.
4896
0f664b89
JD
48972008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4898
4899 * GNUmakefile: Update git-version-gen invocation so make dist
4900 succeeds.
4901
1cfe6375
JD
49022008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4903
4904 Update to the current gnulib CVS repository, and fix trigraph handling
4905 in Bison.
4906 * bootstrap: Update gnulib CVS repository URL.
4907 (symlink_to_dir): Encapsulate the code that guarantees the destination
4908 directory exists into...
4909 (check_dst_dir): ... this new function, and...
4910 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
4911 fail when copying files into lib/uniwidth/.
4912 * src/output.c (prepare_symbols): When writing yytname muscles, where
4913 symbol names will be encoded in C-string literals, tell quotearg to
4914 escape trigraphs. This used to be the default in gnulib.
4915 * tests/regression.at (Token definitions): Because of the change in
4916 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
4917 escapes trigraphs in symbol names. Thus, yytname no longer has
4918 trigraphs unnecessarily doubly escaped. Update test case output.
4919 Extend test case to be sure Bison's own error messages will no longer
4920 have trigraphs in symbol names unnecessarily escaped once.
4921
74c52fc8
JD
49222008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
4923
4924 Fix make dist infinite loop reported by Juan Manuel Guerrero at
4925 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
4926 * .cvsignore: Add .version.
4927 * .version.in: New.
4928 * bootstrap.conf (gnulib_modules): Add git-version-gen.
4929 * configure.ac (AC_CONFIG_FILES): Add .version.
4930 * build-aux/.cvsignore: Add git-version-gen.
4931
8e55b3aa
JD
49322008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4933
4934 * NEWS (2.3a+): Mention that -g now takes an argument.
4935 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
4936 consistency. Update the -g and -x entries now that they take
4937 arguments. Use brackets to indicate optional arguments.
4938 * src/getargs.c (usage): Explain the relationship between arguments of
4939 long and short options more completely. Document --defines and -d
4940 separately since the former takes an argument but, for POSIX Yacc, the
4941 latter does not.
4942 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 4943 (getargs): Sort cases.
8e55b3aa 4944
59c5ac72
AD
49452008-02-28 Akim Demaille <demaille@gostai.com>
4946
4947 * doc/bison.texinfo: Fix a few typos.
4948
118d4978
AD
49492008-02-28 Akim Demaille <akim@epita.fr>
4950
4951 * doc/bison.texinfo (Bison Options): Document -W.
4952 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
4953
7020f1e9
AD
49542008-02-28 Akim Demaille <akim@epita.fr>
4955
4956 * src/getargs.c (short_options): Split and sort for readability.
4957 -g and -x take optional arguments, just like their long options.
4958 * build-aux/cross-options.pl: Use /x to make the regexp easier to
4959 understand.
4960 Fix the handling of $opt which resulted in all the argument to be
4961 considered as optional.
4962
59da312b
JD
49632008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
4964
4965 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
4966 say its interface is experimental.
4967 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4968 Java.
4969 (Bison Options): In the -L and --language entry, mention Java.
4970 (Java Bison Interface): Say the interface is experimental.
4971 * src/getargs.c (usage): Mention -L and --language.
4972
4973 * NEWS (2.3a+): Say the push parsing interface is experimental.
4974 * doc/bison.texinfo (Push Decl): Likewise.
4975 (Decl Summary): Likewise in the "%define api.push_pull" entry.
4976 (Push Parser Function): Likewise.
4977 (Pull Parser Function): Likewise.
4978 (Parser Create Function): Likewise.
4979 (Parser Delete Function): Likewise.
4980 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
4981 yypull_parse, and yypush_parse entries.
4982
4983 * NEWS (2.3a+): Mention XML support, and say the schema is
4984 experimental.
4985 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
4986 * src/getargs.c (usage): Say the XML schema is experimental.
4987
4988 * NEWS (2.3a+): Say option instead of flag.
4989
2bb3ebec
WP
49902008-02-21 Wojciech Polak <polak@gnu.org>
4991
4992 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
4993 text.
4994
333e670c
JD
49952008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
4996
4997 Fix impure push parser compile error reported by Bob Rossi at
4998 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
4999 * data/yacc.c: Clean up whitespace in the output a little.
5000 (yypstate_allocated): Define for impure push parsers regardless of
5001 whether the pull interface is also requested.
5002 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
5003 check impure push parsers without the pull interface.
5004
5005 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
5006 yyerror takes arguments specified by %parse-param while yypstate_new
5007 does not.
5008 * doc/bison.texinfo (Parser Create Function): Document that
5009 yypstate_new returns 0 for multiple impure parser instances.
5010 * tests/push.at (Push Parsing: Multiple impure instances): Update
5011 expected stderr output.
5012
798096e1
JD
50132008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5014
5015 * runtime-po/POTFILES.in (push.c): Remove.
5016
9ca7f077
JD
50172008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5018
5019 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
5020 * data/push.c: Rename to...
5021 * data/yacc.c: ... this, overwriting it.
5022 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
5023 `%push-pull-parser' -> `%define api.push_pull "both"'.
5024 Remove old yacc.c tests, and update push.c tests to yacc.c.
5025
42ee26bb
JD
50262008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5027
5028 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
5029 `"%code top" blocks' instead of `%code "top" blocks'.
5030 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
5031 Clean up whitespace in the output a little.
5032
b1cc23c4
JD
50332008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5034
5035 Fix documentation problems reported by Tim Josling at
5036 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
5037 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
5038 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
5039 integers. Explain the effect of literal string aliases on error
5040 messages. Copy token 0 documentation from the C++ skeleton
5041 documentation.
5042
ab7f29f8
JD
50432008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5044
5045 Accept a token number in a %left, %right, or %nonassoc for POSIX
5046 conformance. Reported by Tim Josling at
5047 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
5048 * NEWS (2.3a+): Mention.
5049 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
5050 and code numbers are treated by precedence declarations.
5051 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
5052 of symbols.1.
5053 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
5054 of symbol.
5055 (symbol.prec): New, just like symbol but allows INT.
5056 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
5057 longer holds.
5058 * tests/regression.at (Token number in precedence declaration): New
5059 test case.
5060
a924ef36
JMG
50612008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5062
5063 DJGPP specific issues.
5064 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
5065 be changed. Copyright timestamp adjusted.
5066 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
5067 be changed. Copyright timestamp adjusted.
5068 * djgpp/config.site: Copyright timestamp adjusted.
5069 * djgpp/config_h.sed: Copyright timestamp adjusted.
5070 * djgpp/djunpack.bat: Copyright timestamp adjusted.
5071 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
5072 filename translation list.
5073 * djgpp/subpipe.c (init_subpipe): Check the environment variables
5074 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
5075 files shall be created. Before trying to use the temp dir where the
5076 environment variable points to check that the dir really exists. If
5077 not default to the cwd as temp dir. Copyright timestamp adjusted.
5078 * djgpp/subpipe.h: Copyright timestamp adjusted.
5079 * djgpp/testsuite.sed: Copyright timestamp adjusted.
5080
389c8cfd
PE
50812008-01-30 Paul Eggert <eggert@cs.ucla.edu>
5082
5083 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
5084
5d1cfef4
PE
50852008-01-09 Paul Eggert <eggert@cs.ucla.edu>
5086
5087 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
5088 Problem reported by Claudio Saavedra in
5089 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
5090
e2dcf996
WP
50912008-01-05 Wojciech Polak <polak@gnu.org>
5092
5093 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
5094 document's title with the input grammar file name.
5095
da730230
JD
50962007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
5097
5098 Automate regression testing of the XML/XSLT implementation. Discussed
5099 starting at
5100 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
5101 * configure.ac (XSLTPROC): New substitution.
5102 * Makefile.am (maintainer-xml-check): New phony target invoking...
5103 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
5104 invoking make maintainer-check with BISON_TEST_XML=1.
5105 * tests/atlocal.in (XSLTPROC): New.
5106 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
5107 not to report reachable memory when Bison is expected to have a
5108 non-zero exit status and (2) to compare XML/XSLT output with --graph
5109 and --report=all output for every working grammar when
5110 BISON_TEST_XML=1.
5111 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
5112 (AT_BISON_CHECK_XML): New.
5113 (AT_QUELL_VALGRIND): New.
5114 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
5115 (AT_CHECK): ... don't redefine this since this was the old way to
5116 quell Valgrind.
5117 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
5118 AT_BISON_CHECK invocations.
5119 * tests/c++.at: Likewise.
5120 * tests/calc.at: Likewise.
5121 * tests/conflicts.at: Likewise.
5122 * tests/cxx-type.at: Likewise.
5123 * tests/existing.at: Likewise.
5124 * tests/glr-regression.at: Likewise.
5125 * tests/headers.at: Likewise.
5126 * tests/input.at: Likewise.
5127 * tests/java.at: Likewise.
5128 * tests/output.at: Likewise.
5129 * tests/push.at: Likewise.
5130 * tests/reduce.at: Likewise.
5131 * tests/regression.at: Likewise.
5132 * tests/sets.at: Likewise.
5133 * tests/skeletons.at: Likewise.
5134 * tests/synclines.at: Likewise.
5135 * tests/torture.at: Likewise.
5136 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
5137 tends to hang xsltproc.
5138 (Big horizontal): Likewise.
5139
408476bc
JD
51402007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5141
5142 In XML output, remove redundant class attribute on symbol element.
5143 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
5144 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
5145 look up a symbol to determine whether it's a nonterminal or terminal.
5146 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
5147 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
5148
5149 Add prec/assoc information to XML output.
5150 * src/gram.c (grammar_rules_print_xml): For each rule that has a
5151 %prec, add a percent_prec attribute.
5152 * src/print-xml.c (print_grammar): For each terminal that has a
5153 precedence or associativity, add a prec or assoc attribute.
5154 (xml_indent): New.
5155 (xml_puts): Use xml_indent.
5156 (xml_printf): Use xml_indent.
5157 * src/print-xml.h (xml_indent): Prototype.
5158
5159 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
5160 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5161
d4a26c48
JD
51622007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5163
5164 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
5165 (bison:ruleByNumber): ... this for clarity.
5166 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
5167 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
5168 (xsl:template match="reduction"): Update.
5169 (xsl:template match="item"): Update.
5170 (xsl:template match="reduction"): Update.
5171
5172 In the XML output, don't print the list of rules where symbols appear.
5173 Compute it in XSLT instead. Discussed at
5174 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
5175 * data/xslt/bison.xsl (bison:ruleByLhs): New.
5176 (bison:ruleByRhs): New.
5177 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
5178 bison:ruleByRhs.
5179 (xsl:template match="terminal/rule"): Remove.
5180 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5181 bison:ruleByRhs.
5182 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5183 Remove.
5184 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
5185 bison:ruleByRhs and mode="number-link" for rule template.
5186 (xsl:template match="terminal/rule"): Remove.
5187 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5188 bison:ruleByRhs and mode="number-link" for rule template.
5189 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5190 Rewrite as...
5191 (xsl:template match="rule" mode="number-link"): ... this.
5192 * src/print-xml.c (print_grammar): Don't print the list of rules.
5193
ef1b4273
JD
51942007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5195
5196 Don't let --report affect XML output; always print all information.
5197 Discussed at
5198 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
5199 * src/conflicts.c (log_resolution): Implement.
5200 * src/print-xml.c (print_core): Implement.
5201 (print_state): Implement.
5202 (print_xml): Implement.
5203
5204 * NEWS (2.3a+): Fix quotes.
5205 * src/parse-gram.y (prologue_declaration): For consistency with -v,
5206 don't let %verbose clear the list specified by --report.
5207
0f6cd9e3
AD
52082007-11-26 Akim Demaille <akim@epita.fr>
5209
5210 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
5211
d80fb37a
JD
52122007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
5213
5214 In the XML output, list useless and unused symbols and rules with the
5215 useful ones and add a "usefulness" attribute. Discussed starting at
5216 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
5217 * src/gram.c (grammar_rules_partial_print_xml): Remove.
5218 (grammar_rules_print_xml): Print all rules instead of just those
5219 useful in the grammar, and add a "usefulness" attribute.
5220 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
5221 * src/print-xml.c (print_rules_useless_in_parser): Remove.
5222 (print_grammar): Print all nonterminals instead of just useful ones,
5223 and add a "usefulness" attribute to nonterminals and terminals.
5224 (print_xml): Don't print a separate "reductions" or
5225 "rules-useless-in-parser" element.
5226 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
5227 (reduce_xml): Remove.
5228 (reduce_token_unused_in_grammar): New.
5229 (reduce_nonterminal_useless_in_grammar): New.
5230 * src/reduce.h (reduce_xml): Remove prototype.
5231 (reduce_token_unused_in_grammar): Add prototype.
5232 (reduce_nonterminal_useless_in_grammar): Add prototype.
5233 * data/xslt/xml2text.xsl: Update for XML changes.
5234 * data/xslt/xml2xhtml.xsl: Update for XML changes.
5235 * tests/reduce.at (Useless Terminals): Update output.
5236 (Useless Rules): Update output.
5237 (Reduced Automaton): Update output.
5238
5239 Say "Terminals unused in grammar" instead of "Unused terminals".
5240 * NEWS (2.3a+): Update.
5241 * doc/bison.texinfo (Understanding): Update example output.
5242 * src/reduce.c (reduce_output): Implement.
5243 * data/xslt/xml2text.xsl: Implement.
5244 * data/xslt/xml2xhtml.xsl: Implement.
5245
1bb2bd75
JD
52462007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
5247
5248 Accept --report-file=FILE to override the default `.output' filename.
5249 * NEWS (2.3a+): Mention.
5250 * doc/bison.texinfo (Bison Options): Add an entry.
5251 * src/files.c (compute_output_file_names): Don't override
5252 spec_verbose_file if already set.
5253 * src/getargs.c (usage): Document --report-file.
5254 (REPORT_FILE_OPTION): New anonymous enum member.
5255 (long_options): Add entry for it.
5256 (getargs): Add case for it setting spec_verbose_file.
5257
5258 * build-aux/cross-options.pl: Don't record a short option just because
5259 there's an arg.
5260 * doc/.cvsignore: Add yacc.1.
5261
a005a9c4
AD
52622007-11-14 Akim Demaille <akim@epita.fr>
5263
5264 * doc/yacc.1.in: New.
5265 * configure.ac, doc/Makefile.am: Adjust.
5266 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
5267 config.h symbol.
5268 Use AC_SUBST for assignments too.
5269 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
5270
cff03fb2
JD
52712007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5272
5273 * src/gram.c: Remove comments that duplicate comments in gram.h.
5274
5275 When reporting useless rules and nonterminals, say "useless in grammar"
5276 instead of "useless", and say "useless in parser" instead of "never
5277 reduced". Discussed starting at
5278 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
5279 * NEWS (2.3a+): Mention this change.
5280 * data/xslt/xml2text.xsl: Update output text and expected input XML
5281 element names to match changes below.
5282 * data/xslt/xml2xhtml.xsl: Likewise.
5283 (xsl:template match="bison-xml-report"): Add missing entry in Table of
5284 Contents: "Rules useless in parser due to conflicts".
5285 * doc/bison.texinfo (Decl Summary): Reword a little.
5286 (Understanding): Update example output for changes below.
5287 * src/gram.c: (rule_useful_p): Rename to...
5288 (rule_useful_in_grammar_p): ... this.
5289 (rule_useless_p): Rename to...
5290 (rule_useless_in_grammar_p): ... this.
5291 (rule_never_reduced_p): Rename to...
5292 (rule_useless_in_parser_p): ... this.
5293 (grammar_rules_print): Update for renames.
5294 (grammar_rules_print_xml): Update for renames.
5295 (grammar_rules_never_reduced_report): Rename to...
5296 (grammar_rules_useless_report): ... this since it is used for either
5297 kind of useless rule.
5298 * src/gram.h: Reword comments and update function names in prototypes.
5299 * src/main.c (main): Say "rule useless in parser due to conflicts".
5300 * src/print-xml.c (print_rules_never_reduced): Rename to...
5301 (print_rules_useless_in_parser): ... this, and rename output XML
5302 element "rules-never-reduced" to "rules-useless-in-parser".
5303 (print_xml): Update for rename.
5304 * src/print.c (print_results): Say "Rules useless in parser due to
5305 conflicts".
5306 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
5307 (nonterminals_reduce): Say "nonterminal useless in grammar".
5308 (reduce_output): Say "Nonterminals useless in grammar".
5309 Say "Rules useless in grammar".
5310 (reduce_xml): Rename output XML element "useless" to
5311 "useless-in-grammar".
5312 (reduce_print): Don't report the count of grammatically useless rules
5313 as "rules never reduced" just because %yacc is specified.
5314 In the correct report of this count, say nonterminal(s) and rule(s)
5315 "useless in grammar".
5316 * tests/conflicts.at (S/R in initial): Update expected output.
5317 (Defaulted Conflicted Reduction): Likewise.
5318 (Unreachable States After Conflict Resolution): Likewise.
5319 * tests/existing.at (GNU pic Grammar): Likewise.
5320 * tests/reduce.at (Useless Nonterminals): Likewise.
5321 (Useless Rules): Likewise.
5322 (Reduced Automaton): Likewise.
5323 (Underivable Rules): Likewise.
5324 (Empty Language): Likewise.
5325
66f0441d
JD
53262007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5327
5328 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
5329 here document and before the EOF so that BSD's implementation of Bourne
5330 shell doesn't parse the delimiter as part of the here document.
5331 * doc/.cvsignore: Add cross-options.texi.
5332 * src/getargs.c (usage): Add a blank line after the warning categories.
5333
d0ee4105
PB
53342007-11-08 Paolo Bonzini <bonzini@gnu.org>
5335
5336 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
5337
e8b1fb9b
AD
53382007-11-05 Akim Demaille <akim@epita.fr>
5339
5340 Remove Id: from bison.1.
5341 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
5342 (perl -0777 -pi -e 's/\.PP\nId): New.
5343 (.x.1): Use it to ignore the version control revision.
5344
2f7a96b5
AD
53452007-11-05 Akim Demaille <demaille@gostai.com>
5346
5347 * build-aux/Makefile.am: Ship cross-options.pl.
5348 * doc/Makefile.am: Always refer to cross-options.texi with
5349 $(srcdir).
5350 (MAINTAINERCLEANFILES): Add it.
5351
f4101aa6
AD
53522007-11-04 Akim Demaille <demaille@gostai.com>
5353
5354 Generate the long/short option cross-table.
5355 * build-aux/cross-options.pl: New.
5356 * doc/Makefile.am (cross-options.texi): New.
5357 * doc/bison.texinfo: Use it.
5358
727a1401
AD
53592007-11-04 Akim Demaille <demaille@gostai.com>
5360
5361 Generate bison.1 using help2man.
5362 * doc/common.x, doc/bison.x: New.
5363 * doc/Makefile.am (bison.1, .x.1): New.
5364 The code is taken from autoconf-2.61/man/Makefile.am.
5365 * configure.ac: Look for help2man.
5366
6aeb9c57
AD
53672007-11-04 Akim Demaille <demaille@gostai.com>
5368
5369 Complete --help.
5370 * src/getargs.c (usage): Document -W, make it clear that -d,
5371 -g and -x have optional arguments.
5372
d7be4085
AD
53732007-11-04 Akim Demaille <demaille@gostai.com>
5374
5375 Find sha1sum when named gsha1sum.
5376 * bootstrap (find_tool): New.
5377 ($SHA1SUM): New.
5378
d9df47b6
JD
53792007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5380
5381 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
5382 at
5383 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
5384 * NEWS (2.3a+): Mention.
5385 * data/bison.m4 (b4_pure_if): Don't define it here.
5386 * data/c.m4 (b4_identification): Depend on individual skeletons to
5387 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
5388 values of the %define variables api.pure or api.push_pull. Define
5389 YYPURE, YYPUSH, and YYPULL accordingly.
5390 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
5391 glr.cc has already defined b4_pure_flag.
5392 * data/push.c: Define b4_pure_if based on `%define api.pure'.
5393 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 5394 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
5395 * doc/bison.texinfo (Pure Decl): Update.
5396 (Push Decl): Update.
5397 (Decl Summary): Add api.pure to %define entry.
5398 In %pure-parser entry, say it's deprecated and reference %define.
5399 (Pure Calling): Update.
5400 (Error Reporting): Update.
5401 (C++ Scanner Interface): Update.
5402 (How Can I Reset the Parser): Update.
5403 (Table of Symbols): In %pure-parser entry, say it's deprecated and
5404 reference %define.
5405 * src/getargs.c (pure_parser): Remove global variable.
5406 * src/getargs.h (pure_parser): Remove extern.
5407 * src/output.c (prepare): Don't define pure_flag muscle.
5408 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
5409 wrapper around `%define api.pure'.
5410 * tests/calc.at (Simple LALR Calculator): Update.
5411 (Simple GLR Calculator): Update.
5412 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
5413 Update.
5414 (GLR: Resolve ambiguity, pure, locations): Update.
5415 (GLR: Merge conflicting parses, pure, no locations): Update.
5416 (GLR: Merge conflicting parses, pure, locations): Update.
5417 * tests/glr-regression.at (Uninitialized location when reporting
5418 ambiguity): Update
5419 * tests/input.at (Unused %define api.pure): New test case.
5420 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
5421 AT_PURE_IF and AT_PURE_AND_LOC_IF.
5422 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5423
c373bf8b
JD
54242007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5425
5426 %define push_pull -> %define api.push_pull. Discussed starting at
5427 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
5428 * data/push.c: Expect the new name.
5429 * data/yacc.c: Likewise.
5430 * doc/bison.texinfo (Push Decl): Update.
5431 (Decl Summary): Update %define entry.
5432 (Push Parser Function): Update.
5433 (Pull Parser Function): Update.
5434 (Parser Create Function): Update.
5435 (Parser Delete Function): Update.
5436 * tests/calc.at (Simple LALR Calculator): Update.
5437 * tests/input.at (%define enum variables): Update.
5438 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5439 (Push Parsing: Multiple impure instances): Update.
5440 (Push Parsing: Unsupported Skeletons): Update.
5441 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
5442 (Exploding the Stack Size with Malloc): Update.
5443
5444 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
5445 other entries some.
5446
32f19b6b
JD
54472007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
5448
5449 For the XML output's terminal element, rename @number to @token-number,
5450 and add @symbol-number. In the nonterminal element, rename @number to
5451 @symbol-number. Discussed starting at
5452 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
5453 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
5454 renames.
5455 (xsl:template match="nonterminal"): Likewise.
5456 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
5457 (xsl:template match="nonterminal"): Likewise.
5458 * src/print-xml.c (print_grammar): Implement.
5459
255a6b90
JD
54602007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5461
5462 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
5463 2007-10-11 change, the child elements here are items not rules.
408476bc 5464 (xsl:template match="item"): New.
255a6b90
JD
5465 (xsl:template match="rule"): Update for new reduced itemset.
5466 (xsl:template match="point"): Remove.
5467 (xsl:template match="empty"): For consistency with --graph, don't
5468 output "/* empty */".
5469 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
5470 line-wrap, don't pass a negative value as first-line-length since this
5471 won't work with the following changes.
5472 (xsl:template name="line-wrap"): Simplify slightly.
5473 (xsl:template name="ws-search"): Eliminate recursion.
5474 * src/print_graph.c (print_core): Don't print a reduction's lookahead
5475 set next to an item whose dot is not at the end of the RHS even if it
5476 happens to be associated with the same rule.
5477
88c78747
JD
54782007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5479
31984206
JD
5480 Add %define lr.keep_unreachable_states.
5481 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
5482 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
5483 * src/main.c (main): Implement it.
5484 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5485 Extend to test it, and fix a typo.
5486
54872007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5488
5489 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
5490 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
5491 the example .output text.
5492 * tests/regression.at (Extra lookahead sets in report): Improve wording
5493 of comments.
5494
b7a70162
WP
54952007-10-17 Wojciech Polak <polak@gnu.org>
5496
5497 * src/print-xml.c (print_grammar): Renamed
5498 <terminal> and <nonterminal> attributes:
5499 "type" to "number" and "symbol" to "name".
5500 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
5501 Use new attribute names.
5502 (xsl:template match="nonterminal"): Likewise.
5503 * data/xslt/xml2xhtml.xsl: Likewise.
5504
a0de5091
JD
55052007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
5506
5507 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
5508 (Option Cross Key): Likewise.
5509
5510 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
5511 next to an item whose dot is not at the end of the RHS even if it
5512 happens to be associated with the same rule.
5513 * src/print.c (print_core): Likewise.
5514 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
5515 (Resolved SR Conflicts): Update output.
5516 * tests/regression.at (Extra lookahead sets in report): New test case.
5517
4c20d18d
WP
55182007-10-11 Wojciech Polak <polak@gnu.org>
5519
5520 * src/print-xml.c (print_core): Remove item set
5521 redundancy.
5522 * data/xslt/bison.xsl (bison:ruleNumber): New key.
5523 Improve processing time. Suggested by Joel E. Denny.
5524 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
5525 Write xsl:param "required" attribute as comment.
5526 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
5527 (xsl:template match="rule"): Support new reduced itemset.
5528 (xsl:template match="point"): Remove.
5529 * data/xslt/xml2xhtml.xsl: Likewise.
5530
f506ad1c
JD
55312007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5532
5533 * src/getargs.c (version): Update copyright year.
5534
21f1b063
JD
55352007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5536
5537 Make xml2dot.xsl and --graph produce the same output.
5538 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
5539 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
5540 escaped later.
5541 (xsl:template name="output-node"): Use the new escape template instead
5542 of the string-replace template directly.
5543 (xsl:template name="output-edge"): Likewise.
5544 (xsl:template name="escape"): New, escapes backslashes and newlines in
5545 addition to quotation marks.
5546 * src/graphviz.c (start_graph, output_node, output_edge): Add
5547 whitespace to output for legibility.
5548
5549 Make xml2text.xsl and --report produce the same output, and remove the
5550 XML "conflicts" element since a conflict summary is easily extracted
5551 from the automaton.
5552 * data/xslt/bison.xsl: New.
5553 (xsl:template match="state" mode="bison:count-conflicts): New.
5554 * data/xslt/xml2text.xsl: Import bison.xsl.
5555 (xsl:template match="bison-xml-report"): Instead of styling the
5556 "conflicts" element, style the "automaton" element with mode
5557 "conflicts". Unlike the former, the latter lists S/R and R/R
5558 conflicts for a state on the same line.
5559 (xsl:template match="conflicts"): Remove.
5560 (xsl:template match="conflict"): Remove.
5561 (xsl:template match="terminal"): Line-wrap the list of rules in which
5562 the terminal is used.
5563 (xsl:template match="nonterminal"): Likewise for nonterminals.
5564 (xsl:template match="automaton" mode="conflicts"): New.
5565 (xsl:template match="state" mode="conflicts"): New.
5566 (xsl:template name="line-wrap"): New.
5567 (xsl:template name="ws-search"): New.
5568 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
5569 (xsl:template match="bison-xml-report"): Instead of styling the
5570 "conflicts" element, style the "automaton" element with mode
5571 "conflicts."
5572 (xsl:template match="conflicts"): Remove.
5573 (xsl:template match="conflict"): Remove.
5574 (xsl:template match="automaton" mode="conflicts"): New.
5575 (xsl:template match="state" mode="conflicts): New.
5576 * src/conflicts.c (conflicts_output_xml): Remove.
5577 * src/conflicts.h (conflicts_output_xml): Remove prototype.
5578 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
5579 * src/print.c (print_grammar): Consistently wrap at the 66th column so
5580 the corresponding XSLT is easier. Also, never wrap between a word and
5581 the comma that follows it.
5582
793fbca5
JD
55832007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5584
5585 Improve C++ namespace support. Discussed starting at
5586 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
5587 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
5588 b4_namespace_close): New macros that interpret the %define variable
5589 "namespace" so its value can contain "::" to indicate nested
5590 namespaces.
5591 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
5592 the above macros.
5593 * data/lalr1.cc (b4_namespace): Likewise.
5594 * data/location.cc (b4_namespace): Likewise.
5595 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
5596 inside a new table in the general %define entry. Document `%define
5597 namespace' there as well. Point the %name-prefix entry to it since it
5598 explains it more completely in the case of C++.
5599 (C++ Bison Interface): Mention `%define namespace' instead of
5600 %name-prefix.
5601 (Table of Symbols): Remove the `%define push_pull' entry. The %define
5602 entry suffices.
5603 * tests/c++.at (Relative namespace references): New test case.
5604 (Absolute namespace references): New test case.
5605 (Syntactically invalid namespace references): New test case.
5606 * tests/input.at (C++ namespace reference errors): New test case.
5607
35b8730d
JD
56082007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5609
5610 Add syncline support and location accessor to internal %define
5611 interfaces.
5612 * data/bison.m4 (b4_percent_define_get_loc): New.
5613 (b4_percent_define_get_syncline): New.
5614 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
5615 (b4_percent_define_default): Record defining location as line 1 rather
5616 than 0 for the sake of synchronizing #line's, and define
5617 b4_percent_define_syncline(VARIABLE).
5618 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
5619 * src/muscle_tab.c (muscle_syncline_grow): New.
5620 (muscle_code_grow): Use muscle_syncline_grow.
5621 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
5622 define b4_percent_define_syncline(VARIABLE).
5623 (muscle_percent_define_get_loc): New.
5624 (muscle_percent_define_get_syncline): New.
5625 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
5626 remove some unused variables.
5627 (muscle_percent_define_default): Record defining location as line 1
5628 rather than 0 for the sake of synchronizing #line's, and define
5629 b4_percent_define_syncline(VARIABLE).
5630 (muscle_percent_define_check_values): Use
5631 muscle_percent_define_get_loc.
5632 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
5633 (muscle_percent_define_get_syncline): Prototype.
5634 * tests/skeletons.at (%define Boolean variables: invalid skeleton
5635 defaults): Update output for location change.
5636 (Complaining during macro argument expansion): Extend to test
5637 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
5638
7dc4a694
JD
56392007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
5640
5641 Fix some error-reporting macro bugs.
5642 * data/bison.m4 (b4_cat): New.
5643 (b4_error, b4_error_at): Use b4_cat to send error directives directly
5644 to stdout so they don't become arguments to other macros. Update
5645 comments and add examples.
5646 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
5647 add examples.
5648 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
5649 after printing the error directive so that M4 doesn't report subsequent
5650 problems that are induced by this problem.
5651 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
5652 instead of just in them. Recognize @\n in both places. Both expand to
5653 the empty string. Needed by b4_cat.
5654 * tests/skeletons.at (Complaining during macro argument expansion):
5655 New test case.
5656 (Fatal errors make M4 exit immediately): New test case.
5657
d4bd2295
JD
56582007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
5659
5660 Implement --print-datadir.
5661 * src/getargs.c (usage): Mention.
5662 (PRINT_DATADIR_OPTION): New anonymous enum member.
5663 (long_options): Add entry for it.
5664 (getargs): Add case for it calling compute_pkgdatadir.
5665 * src/output.c (output_skeleton): Encapsulate data directory
5666 computation from here...
5667 (prepare): ... and from here...
5668 (compute_pkgdatadir): ... into this new function.
5669 * src/output.h (compute_pkgdatadir): Prototype.
5670
34cdeddf
JD
56712007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
5672
5673 * src/print-xml.c (escape_bufs): New static global variable
5674 replacing...
5675 (xml_escape_n): ... the static local variable buf here.
5676 (print_xml): Free memory for escape_bufs.
5677 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
5678
d782395d
JD
56792007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
5680
5681 Replace `%push-parser' and `%push-pull-parser' with
5682 `%define push_pull "push"' and `%define push_pull "both"'.
5683 `%define push_pull "pull"' is the default.
5684 * doc/bison.texinfo (Push Decl, Push Parser Function,
5685 Pull Parser Function, Parser Create Function, Parser Delete Function):
5686 Update declarations.
5687 (Decl Summary, Table of Symbols): Replace %push-parser and
5688 %push-pull-parser entries with a %define push_pull entry.
5689 * data/bison.m4 (b4_percent_define_check_values): New macro.
5690 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
5691 definitions...
5692 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
5693 definitions...
5694 * data/push.c: ... to here and compute them from the value of the
5695 %define variable push_pull.
5696 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
5697 parsing requests here...
5698 * data/yacc.c: ... hack this to switch to push.c any time
5699 b4_use_push_pull_flag or the %define variable push_pull is set. This
5700 will go away when we mv push.c yacc.c.
5701 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
5702 push parsing is not supported since unused %define variables are
5703 reported anyway.
5704 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
5705 * src/muscle_tab.h (muscle_percent_define_check_values): Update
5706 comments for consistency with b4_percent_define_check_values.
5707 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
5708 muscles.
5709 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
5710 Remove.
5711 (prologue_declaration): Remove %push-parser and %push-pull-parser
5712 rules.
5713 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
5714 * tests/calc.at: Update declarations.
5715 * tests/input.at (%define enum variables): New test case.
5716 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
5717 declaration.
5718 (Push Parsing: Multiple impure instances): Update declaration.
5719 (Push Parsing: Unsupported Skeletons): New test case.
5720 * tests/torture.at (Exploding the Stack Size with Alloca): Update
5721 declaration.
5722 (Exploding the Stack Size with Malloc): Update declaration.
5723
3f999f78
WP
57242007-09-24 Wojciech Polak <polak@gnu.org>
5725
5726 Add XSLT transformations.
5727
5728 * data/xslt/xml2dot.xsl: Transform XML into DOT.
5729 * data/xslt/xml2text.xsl: Transform XML into plain text.
5730 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
5731 * data/Makefile.am (xsltdir): New variable.
5732 (dist_xslt_DATA): Add xslt/*.xsl files.
5733
a4f75309
PE
57342007-09-23 Paul Eggert <eggert@cs.ucla.edu>
5735
5736 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
5737 Problem reported by Wojciech Polak.
5738 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
5739 (xml_printf): Undo change I made on 21 September; that is,
5740 indent 2 spaces, not 1.
5741
ad5feac4
JD
57422007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
5743
5744 Pacify ./configure --enable-gcc-warnings.
5745 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
5746 `char const *' instead of `char *'.
5747 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
5748 local variable `sep'.
5749
41d7a5f2
PE
57502007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5751
5752 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
5753 elsewhere.
5754 * src/print-xml.c: Prefer "const" after types; that's more consistent.
5755 (xml_printf): Indent just 1 space for level.
5756 (e_char, xlate_char): Remove.
5757 (xml_escape_string): Rewrite to avoid undefined behavior (used
5758 storage that was freed from the stack).
5759 (xml_escape_n): Don't bother checking for subscript error.
5760
3f999f78
WP
57612007-09-21 Wojciech Polak <polak@gnu.org>
5762
5763 Add Bison XML Automaton Report.
41d7a5f2
PE
5764
5765 Add support for an -x option to generate an XML report.
5766 It is not documented yet.
5767 * src/print-xml.c: New file.
5768 * src/print-xml.h: Likewise.
5769 * lib/timevar.def (TV_XML): New var.
5770 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
5771 * src/conflicts.c: Include print-xml.h.
5772 (solved_conflicts_xml_obstack): New var.
5773 (log_resolution, conflicts_solve, conflicts_free):
5774 Add support for XML report.
5775 (conflicts_output_val): New function.
5776 * src/conflicts.h (conflicts_output_val): New decl.
5777 * src/files.c (spec_xml_file): New var.
5778 (compute_output_file_names, output_file_names_free): Add XML support.
5779 * src/files.h (spec_xml_file): New decl.
5780 * src/getargs.c (xml_flag): New var.
5781 (usage, short_options, long_options, getargs): Add XML support.
5782 * src/getargs.h (xml_flag): New decl.
5783 * src/gram.c: Include print-xml.h.
5784 (rule_lhs_print_xml, rule_rhs_print_xml):
5785 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
5786 New functions.
5787 * src/gram.h: Declare external ones.
5788 * src/main.c: Include print-xml.h.
5789 (main): Add XML support.
5790 * src/reduce.c: Include print-xml.h.
5791 (reduce_xml): New function.
5792 * src/reduce.h: Declare it.
5793 * src/state.c: Include print-xml.h.
5794 (state_new): Add XML support.
5795 (state_rule_lookahead_tokens_print_xml): New function.
5796 * src/state.h: Declare it.
5797 (struct state): New member solved_conflicts_xml.
5798 * src/symtab.c (symbol_class_get_string): New function.
5799 * src/symtab.h: Declare it.
5800
6d8e724d
PE
58012007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5802
5803 * GNUmakefile: Switch to coreutils's version.
5804 * bootstrap: Likewise.
5805 * Makefile.cfg: Adjust to new GNUmakefile.
5806 * README-hacking: Likewise.
5807
5808 Import from gnulib:
5809
5810 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
5811 Bruno Haible <bruno@clisp.org>
5812
5813 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
5814 and is a script that invokes bison. Tighten the code. Add comments.
5815
922bdd7f
JD
58162007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
5817
5818 Spell "boolean" as "Boolean". Reported by Akim Demaille.
5819 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
5820 * doc/bison.texinfo (Decl Summary): Fix.
5821 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
5822 * tests/input.at (Boolean %define variables): Update output.
5823 * tests/skeletons.at (%define boolean variables: invalid skeleton
5824 defaults): Rename to...
5825 (%define Boolean variables: invalid skeleton defaults): ... this and
5826 update output.
5827
1b17b01d
JD
58282007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
5829
5830 In impure push mode, don't allow more than one yypstate to be allocated
5831 since multiple impure parsers would corrupt yynerrs.
5832 * data/push.c (yypstate_allocated): New static global variable
5833 initialized to 0.
5834 (yypull_parse): If yypstate_new returns 0, don't report it as memory
5835 exhaustion if yypstate_allocated is 1, but still return 2.
5836 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
5837 already 1. Otherwise, set it to 1.
5838 (yypstate_delete): Set it to 0.
5839 * tests/push.at (Push Parsing: Multiple impure instances): New test
5840 case.
5841
9987d1b3
JD
58422007-08-17 Bob Rossi <bob@brasko.net>
5843
5844 * doc/bison.texinfo (Push Decl): Document the push parser.
5845 (Table of Symbols): Ditto.
5846 (Pure Decl): Ditto.
5847 (Decl Summary): Ditto.
5848 (Multiple Parsers, Push Parser Function, Pull Parser Function,
5849 Parser Create Function, Parser Delete Function):
5850 Add new push parser symbols.
5851 (Table of Symbols): Document push-parser, push-pull-parser,
5852 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
5853
f16b0819
PE
58542007-08-15 Paul Eggert <eggert@cs.ucla.edu>
5855
5856 Update to GPLv3.
5857 * doc/gpl-3.0.texi: New file.
5858 * doc/gpl.texi: Remove.
5859 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
5860 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
5861 * README-hacking, TODO, bootstrap, bootstrap.conf:
5862 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
5863 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
5864 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
5865 * data/lalr1.cc, data/lalr1.java, data/location.cc:
5866 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
5867 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
5868 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
5869 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
5870 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
5871 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
5872 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
5873 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
5874 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
5875 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
5876 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
5877 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
5878 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
5879 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
5880 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
5881 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
5882 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
5883 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
5884 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
5885 * src/complain.c, src/complain.h, src/conflicts.c:
5886 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
5887 * src/files.h, src/flex-scanner.h, src/getargs.c:
5888 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
5889 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
5890 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
5891 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
5892 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
5893 * src/print.c, src/print.h, src/print_graph.c:
5894 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
5895 * src/reduce.h, src/relation.c, src/relation.h:
5896 * src/revision.h, src/scan-code.h, src/scan-code.l:
5897 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
5898 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
5899 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
5900 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
5901 * tests/Makefile.am, tests/actions.at, tests/c++.at:
5902 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
5903 * tests/existing.at, tests/glr-regression.at:
5904 * tests/headers.at, tests/input.at, tests/java.at:
5905 * tests/local.at, tests/output.at, tests/push.at:
5906 * tests/reduce.at, tests/regression.at, tests/sets.at:
5907 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
5908 * tests/torture.at:
5909 Update to GPLv3.
5910
728c4be2
JD
59112007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5912
5913 Get rid of broken %no-parser, -n, and --no-parser implementation and
5914 documentation.
5915 * TODO: Don't mention them.
5916 * doc/bison.1: Likewise.
5917 * doc/bison.texinfo (Decl Summary): Likewise.
5918 (Bison Options): Likewise.
5919 (Option Cross Key): Likewise.
5920 * src/getargs.c (no_parser_flag): Remove global variable.
5921 (usage): Don't print description of -n and --no-parser.
5922 (long_options): Remove --no-parser entry here.
5923 (getargs): Remove -n case in the switch here.
5924 * src/getargs.h (no_parser_flag): Remove extern.
5925 * tests/regression.at (Web2c Actions): Remove comment that mentions
5926 --no-parser.
5927
5d31a216
JD
59282007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5929
5930 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
5931 name user variables starting with `yy'. Just pass NULL instead of a
5932 dummy local &yylval to yypush_parse.
5933 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
5934 starting with `yy'.
5935
a2ea208d
JD
59362007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
5937
5938 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
5939 true since it's then always used regardless of whether yyoverflow is
5940 defined. Reported by Christian Burger at
5941 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
5942 * THANKS: Add Christian Burger.
5943
91661ebb
JD
5944 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5945 node names: say "Decl Summary" not "Bison Declaration Summary".
5946
cbd50549
JD
59472007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
5948
5949 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
5950 determine whether this function has already complained about an invalid
5951 value for a %define boolean variable, don't check whether Bison has
5952 ever examined the value. As written, the check was a tautology.
5953 Instead, record and check for this complaint using a separate muscle.
5954
eb1b0740
JD
59552007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5956
5957 Fix push parsing memory leak reported by Brandon Lucia at
5958 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
5959 * THANKS: Add Brandon Lucia.
5960 * data/push.c (yypstate_delete): Free the stack if it was reallocated
5961 but the parse never completed and thus freed it.
5962 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
5963 * tests/testsuite.at: Include push.at.
5964 * test/push.at: New.
5965 (Push Parsing: Memory Leak for Early Deletion): New test case.
5966
9d774aff
JD
59672007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
5968
5969 Improve handling of multiple S/R conflicts in the same state and of S/R
5970 conflicts involving multiple reductions.
5971 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
5972 set for a state here or Bison will abort if it is reassigned on a
5973 later conflicted reduction in the same state.
5974 Similarly, don't finalize and assign the solved conflicts report here
5975 or it will be lost if it is reassigned on a later conflicted reduction
5976 in the same state.
5977 (set_conflicts): Instead, assign them both here after all S/R conflicts
5978 in the state have been fully examined.
5979 * src/print.c (shift_set): Rename to...
5980 (no_reduce_set): ... this.
5981 (print_reductions): Update for rename, and add %nonassoc error action
5982 tokens to no_reduce_set so that, when printing the first remaining
5983 reduction on an error action token, the reduction is enclosed in
5984 brackets.
5985 (print_results): Update for rename.
5986 * tests/conflicts.at (Solved conflicts report for multiple reductions
5987 in a state): New test case.
5988 (%nonassoc error actions for multiple reductions in a state): New test
5989 case.
5990
5991 * src/main.c (main): Don't depend on C99 features.
5992
10159d2a
JD
59932007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
5994
5995 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
5996 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
5997 uniwidth.
10159d2a 5998
953b3935
JD
59992007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
6000
6001 * bootstrap (slurp): Create target directories that don't exist.
6002 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
6003
6ce2d93a
JD
60042007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6005
6006 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
6007 than item number.
6008 * closure.c (closure): Likewise.
6009 * state.h (reductions): Comment sorting of rules.
6010 (state): Comment sorting of items.
6011
ce3448d5
JD
60122007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
6013
6014 Fix C++ test cases after recent Gnulib changes. Discussed starting at
6015 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
6016 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
6017 definition in order to avoid Gnulib headers since we don't use config.h
6018 here.
6019 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
6020 rather than AT_DATA so that config.h is included.
6021
8a86eef0
JD
60222007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
6023
6024 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
6025 instead of fprintf. Guard these functions with #if YYDEBUG instead of
6026 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
6027 and so that YYFPRINTF is guaranteed to be defined here.
6028
b1a81613
JD
60292007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6030
6031 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
6032 with...
6033 (muscle_percent_define_check_values): ... this more helpful function.
6034 Again, it's not used yet, but it will be.
6035 * src/muscle_tab.h: Likewise.
6036
71b61d4d
JD
6037 Improve some comments in parser table construction.
6038 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
6039 (generate_states): Don't mention ruleset, which is internal to closure.
6040 * src/closure.c (closure): Explain sorting of core and itemset, which
6041 is required for this function to behave correctly.
6042 * src/closure.h (closure): Mention sorting.
6043
2a6b783d
JD
60442007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
6045
6046 * src/lalr.c (state_lookahead_tokens_count): For code readability,
6047 move the check for disabled transitions to an aver since conflict
6048 resolution hasn't happened yet.
6049
6050 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
6051 labels a state as inconsistent just because it has error transitions.
6052 The original form of this check appeared in revision 1.1 of lalr.c,
6053 which was committed on 1991-12-21. Now (at least), changing the
6054 consistency label on such a state appears to have no useful effect in
6055 any of the places it is examined, which I enumerate below. The key
6056 point to understanding each item in this enumeration is that a state
6057 with an error transition is labelled consistent in the first place only
6058 if it has no rules, so the check cannot matter for states that have
6059 rules. (1) Labelling a state as inconsistent will cause set_conflicts
6060 to try to identify its conflicts, and a state must have *rules* to have
6061 conflicts. (2) Labelling a state as inconsistent will affect how
6062 action_row sets the default *rule* for the state. (3) Labelling a
6063 state as inconsistent will cause build_relations to add lookback edges
6064 to *rules* in that state.
6065 * src/state.h (struct state): Word the comment for member consistent
6066 more carefully.
6067
14462c2b
JD
60682007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
6069
6070 Don't depend on C99 features.
6071 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
6072 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
6073 * src/reader.c (check_and_convert_grammar): Fix for-loop.
6074 * src/state.c (state_mark_reachable_states): Fix for-loop.
6075 (state_remove_unreachable_states): Fix for-loop.
6076
6077 Don't widen struct state with member reachable just to temporarily
6078 record reachability. Instead, use a local bitset.
6079 * src/state.h (struct state): Remove member.
6080 * src/state.c (state_new): Don't initialize it.
6081 (state_mark_reachable_states): Rename to...
6082 (state_record_reachable_states): ... this, and use bitset.
6083 (state_remove_unreachable_states): Use bitset.
6084
5a43d418
JD
60852007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
6086
6087 * src/Makefile.am (yacc): Quote target action commands properly so
6088 that the yacc script isn't corrupt. Reported by Hans Aberg at
6089 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
6090
0c650a20
JD
6091 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
6092 the case of pure parsers. Reported by Frans Englich at
6093 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
6094 * THANKS: Add Frans Englich.
6095
61fee93e
JD
6096 * NEWS (2.3a+): In the %code entry, reference section `Bison
6097 Declaration Summary' from the manual now since the %code summary has
6098 moved there.
6099 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
6100 in the rules section must be terminated by semicolons.
6101
f124d423
JD
61022007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
6103
6104 Extend the front-end API for %define variables to more completely
6105 mirror the back-end. This will be useful in the future.
6106 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
6107 Update comments to mention the new front-end counterparts of these
6108 macros.
6109 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
6110 for muscle_string_decode and muscle_location_decode.
6111 (muscle_string_decode): New static function.
6112 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
6113 (muscle_percent_define_get, muscle_percent_define_ifdef): New
6114 functions.
6115 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
6116 muscle_percent_define_get to mimic the b4_percent_define_flag_if
6117 implementation more closely.
6118 (muscle_percent_define_invalid_value): New function.
6119 * src/muscle_tab.h (muscle_percent_define_get,
6120 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
6121 Prototype.
6122
75ad86ee
JD
61232007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
6124
6125 * NEWS (2.3a+): Mention yesterday's state-removal change.
6126 (2.3a): Remove the %language entry, which was added after 2.3a.
6127 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
6128 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
6129 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
6130 tests/existing.at: Update copyright date.
6131
5967f0cf
JD
61322007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6133
6134 If conflict resolution makes states unreachable, remove those states,
6135 report rules that are then unused, and don't report conflicts in those
6136 states.
6137 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
6138 New global function.
6139 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
6140 function.
6141 * src/main.c (main): After conflict resolution, remove the unreachable
6142 states and update all data structures that reference states by number.
6143 * src/state.c (state_new): Initialize each state's reachable member to
6144 false.
6145 (state_mark_reachable_states): New static function.
6146 (state_remove_unreachable_states): New global function.
6147 * src/state.h (struct state): Add member bool reachable.
6148 (state_remove_unreachable_states): Prototype.
6149 * tests/conflicts.at (Unreachable States After Conflict Resolution):
6150 New test case.
6151 * tests/existing.at (GNU pic Grammar): Update test case output now that
6152 an unused rule is discovered.
6153
b09f4f48
JD
61542007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6155
6156 Minor code cleanup in parser table construction.
6157 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
6158 (new_itemsets, save_reductions): Update for rename to nitemset.
6159 * src/closure.c (nritemset): Rename to...
6160 (nitemset): ... this since the "r" appears to meaningless and isn't
6161 used in the comments.
6162 (closure): Update for rename.
6163 * src/closure.h (nritemset): Update extern to...
6164 (nitemset): ... this.
6165 * src/lalr.c (LA): Fix a typo in comments.
6166 * src/print.c (print_core): Update for rename to nitemset.
6167 * src/print_graph.c (print_graph): Likewise.
6168 * src/state.h: Fix some typos in header comments.
6169
bbb44d83
PE
61702007-04-04 Paul Eggert <eggert@cs.ucla.edu>
6171
9b33de72
PE
6172 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
6173 still sticks to ASCII. Sorry!
6174
bbb44d83
PE
6175 * README-hacking: New file, taken mostly from coreutils, with changes
6176 for Bison. Contains much of the contents of:
6177 * README-cvs: Remove.
6178 * bootstrap: Sync from gnulib.
6179 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
6180 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
6181
29553547
JD
61822007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
6183
6184 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
6185 Setzer.
6186 (Java Differences): Fix some typos.
6187 * THANKS: Add Sebastian Setzer.
6188
01b477c6
PB
61892007-03-07 Paolo Bonzini <bonzini@gnu.org>
6190
730739e4
AD
6191 * data/java.m4 (b4_single_class_if): Remove.
6192 (b4_abstract_if): Look at "%define abstract".
6193 (b4_lexer_if): New.
6194 (b4_union_name): Rename...
6195 (b4_yystype): ... to this. Map to "%define stype".
6196 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
6197 b4_maybe_throws): Fix quoting.
6198 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
6199 * data/lalr1.java (Lexer interface): Always define.
6200 (Lexer interface within parser class): Remove.
6201 (YYLexer class): New, used when "%code lexer" is present.
6202 (constructor): When "%code lexer" is used, pass %lex-param
6203 to the lexer constructor.
6204 (yylex, yyparse): Remove %lex-param from method invocations
6205 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
6206
6207 * doc/bison.texinfo (Java Bison Interface): Mention "%define
6208 abstract". Rename "%define union_name" to "%define stype".
6209 Rename method names according to previous patch.
6210 (Java Scanner Interface): Describe "%code lexer" instead of
6211 "%pure-parser" and "%define single_class".
6212 (Java Differences): Mention "%code lexer".
6213
6214 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
6215 Include scanner here, using macros from tests/local.at.
6216 (AT_DATA_CALC_Y): Remove final argument.
6217 (_AT_CHECK_JAVA_CALC): Likewise.
6218 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
6219 of %locations and %error-verbose.
6220 (main): Test with and without %lex-param.
6221 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
6222 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 6223
122bea3a
JMG
62242007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6225
6226 DJGPP spefic issue. Inhibit the use of disallowed characters for
6227 file name genertion on Win98, WinXP, etc. These are |<>":?*\
6228 and concern testsuite case 46.
6229 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
6230 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
6231 * djgpp/config.bat: Inhibit the use of disallowed characters.
6232
9611cfa2
JD
62332007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6234
6235 Miscellaneous %define and %code cleanup.
6236 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
6237 values are interpreted.
6238 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
6239 documentation a little more.
6240 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
6241 muscle_percent_define_insert, muscle_percent_code_grow): New
6242 functions/macros.
6243 * src/muscle_tab.h (muscle_percent_define_insert,
6244 muscle_percent_code_grow): Prototype.
6245 * src/parse-gram.y (prologue_declaration): Use
6246 muscle_percent_define_insert and muscle_percent_code_grow when parsing
6247 %define and %code directives.
6248
6249 Make it easy to share %define boolean variables between the front-end
6250 and back-end. Though not used yet, this will be useful in the future.
6251 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
6252 Bison uses of names rather than just skeleton uses of names.
6253 (b4_percent_define_get, b4_percent_define_ifdef): Rename
6254 b4_percent_define_skeleton_variables(VARIABLE) to
6255 b4_percent_define_bison_variables(VARIABLE).
6256 (b4_percent_code_get, b4_percent_code_ifdef): Rename
6257 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
6258 b4_percent_code_bison_qualifiers(QUALIFIER).
6259 (b4_check_user_names_wrap): Update for renames.
6260 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
6261 muscle_percent_define_default): New functions mimicking
6262 b4_percent_define_flag_if and b4_percent_define_default.
6263
6264 For %define variables, report locations for invalid values and
bbb44d83 6265 redefinitions.
9611cfa2
JD
6266 * data/bison.m4 (b4_percent_define_flag_if): Read
6267 b4_percent_define_loc(VARIABLE) to report the location of an invalid
6268 value for VARIABLE.
6269 (b4_percent_define_default): Save a special location in
6270 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
6271 must later be reported as invalid.
6272 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
6273 functions.
6274 (muscle_percent_define_insert): Record the location of VARIABLE in
6275 muscle percent_define_loc(VARIABLE), and use it to report the previous
6276 location for a redefinition.
6277 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
6278 (muscle_percent_define_default): Update like b4_percent_define_default.
6279 (muscle_grow_user_name_list): Rename to...
6280 (muscle_user_name_list_grow): ... this for consistency and use
6281 muscle_location_grow.
6282 * src/muscle_tab.h (muscle_location_grow): Prototype.
6283 * tests/input.at (%define errors): Update expected output.
6284 * tests/skeletons.at (%define boolean variables: invalid skeleton
6285 defaults): New test case.
6286
0bf92491
JD
62872007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
6288
6289 * src/print.c (lookahead_set, state_default_rule): Remove.
6290 (print_reductions): Replace state_default_rule invocation with
6291 equivalent use of yydefact, which was computed in token_actions in
6292 tables.c.
6293 (print_results): Don't allocate lookahead_set.
6294
d3b12988
PB
62952007-02-27 Paolo Bonzini <bonzini@gnu.org>
6296
6297 * data/lalr1.java: Prefix all private members with yy.
6298
f57a7536
JD
62992007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
6300
6301 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 6302 Sebastien Fricker at
f57a7536 6303 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 6304 * THANKS: Add Sebastien Fricker.
f57a7536
JD
6305 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
6306 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
6307 accept a variable number of arguments.
6308
6404a5bf
JD
63092007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
6310
6311 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
6312
e4e09639
JMG
63132007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6314
6315 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
6316 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
6317 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
6318
d7e0a1a7
PE
63192007-02-11 Paul Eggert <eggert@cs.ucla.edu>
6320
6321 Undo my 2007-02-07 change, switching back to the c-strcase module
6322 introduced in the 2007-02-03 change. Bruno Haible reported that
6323 the 2007-02-07 change would be dangerous in Turkish if we add a
6324 language whose name contains "i", since "i" is not lowercase "I"
6325 in Turkish.
6326 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
6327 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
6328 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
6329 * m4/.cvsignore: Remove strcase.m4.
6330 * src/getargs.c: Revert 2007-02-07 change, as follows.
6331 Include c-strcase.h.
6332 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
6333
deee93a1
JD
63342007-02-11 Bruno Haible <bruno@clisp.org>
6335
6336 Enable the Java related testsuite tests when the only Java compiler
6337 found is a gcj < 4.3. Discussed at
6338 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
6339 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
6340
574add85
JD
63412007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
6342
6343 * data/Makefile.am: Update copyright date.
6344 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
6345 yypstate_new returns NULL.
6346 (yypstate_new): Return NULL if malloc does.
6347 * src/reader.c (packgram): Move translation of rule actions from the
6348 beginning of packgram to...
6349 (check_and_convert_grammar): ... here right before packgram is invoked
6350 so it's easier to write more complete comments, and remove redundant
6351 code.
6352
e785ccf7
JD
63532007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
6354
6355 As in semantic actions, make @$ in %initial-action, %destructor, and
6356 %printer imply %locations.
6357 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
6358 scanning @$.
6359 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
6360 (@$ in %initial-action implies %locations,
6361 @$ in %destructor implies %locations,
6362 @$ in %printer implies %locations): ... these new test cases.
6363
1cfe1ed7
PE
63642007-02-07 Paul Eggert <eggert@cs.ucla.edu>
6365
6366 Undo most of the 2007-02-03 change, switching to the strcase module
6367 now that gnulib strcase has been fixed.
6368 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
6369 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
6370 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
6371 * m4/.cvsignore: Add strcase.m4.
6372 * src/getargs.c: Revert 2007-02-03 change, as follows.
6373 Don't include c-strcase.h.
6374 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
6375 strcasecmp has "unspecified behavior" outside the POSIX locale,
6376 but it works fine in practice if at least one argument is ASCII,
6377 as is the case in Bison.
6378
0049ec86
PB
63792007-02-07 Paolo Bonzini <bonzini@gnu.org>
6380
6381 * tests/java.at: Skip tests if only one of javac/java is present.
6382 Reported by Joel E. Denny.
6383 * tests/atlocal.in: Adjust copyright years.
6384
63852007-02-05 Paolo Bonzini <bonzini@gnu.org>
6386
6387 * data/lalr1.java (Stack): Work around old verifiers that disallow
6388 access to the private fields of an inner class, from the outer class.
6389 We can make Stack's fields public because user code doesn't have access
6390 to the instance of Stack used by parse(). Reported by Paul Eggert.
6391
2c2b7220
PE
63922007-02-03 Paul Eggert <eggert@cs.ucla.edu>
6393
6394 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
6395 the right spot for these files?
6396 * bootstrap.conf (gnulib_modules): Add c-strcase.
6397 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
6398 c-strncasecmp.c.
6399 * src/getargs.c: Include c-strcase.h.
6400 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
6401 to avoid unspecified behavior.
6402
b2b81dae
JD
64032007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
6404
6405 * doc/bison.texinfo (Decl Summary): Correct typo.
6406
c1d19e10
PB
64072007-01-30 Paolo Bonzini <bonzini@gnu.org>
6408
6409 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
6410 Complain if the value does not match empty, "true" or "false".
6411 * data/c++.m4: Adjust default definitions of %define variables.
6412 * data/java.m4: Adjust default definitions of %define variables.
6413 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
6414 to above behavior.
6415 * tests/input.at (Boolean %define variables): Test new behavior.
6416
8405b70c
PB
64172007-01-29 Paolo Bonzini <bonzini@gnu.org>
6418
6419 * NEWS: Mention java.
6420 * TODO: Remove things that are done.
6421 * bootstrap.conf: Add javacomp-script and javaexec-script.
6422 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
6423
6424 * data/Makefile.am: Add new files.
6425 * data/java-skel.m4: New.
6426 * data/java.m4: New.
6427 * data/lalr1.java: New.
6428
6429 * doc/bison.texinfo: Put "A Complete C++ Example" under
6430 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
6431 under Other Languages.
6432
6433 * src/getargs.c (valid_languages): Add Java.
6434 * src/getargs.h (struct bison_language): Update size of string fields.
6435
6436 * tests/Makefile.am: Add java.at.
6437 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
6438 * tests/java.at: New.
6439 * tests/testsuite.at: Include it.
6440
3eb82471
JD
64412007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
6442
6443 Clean up.
6444 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
6445 at_directive_argv arguments so these no longer have to be global
6446 variables. Also, update the implementation for the following changes.
6447 (fail_for_at_directive_too_many_args,
6448 fail_for_at_directive_too_few_args): Add at_directive_name argument.
6449 (at_directive_name): Remove as at_directive_argv[0] will be used for
6450 this now.
6451 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
6452 for the directive name.
6453 (at_directive_argc, at_directive_argv): Make these local within
6454 skel_lex instead of global.
6455 (INITIAL): Update directive start action for above changes.
6456 (SC_AT_DIRECTIVE_ARG): Rename to...
6457 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
6458 (SC_AT_DIRECTIVE_SKIP_WS): Update.
6459 (scan_skel): Move yylex_destroy to...
6460 (skel_scanner_free): ... here.
6461 * tests/skeletons.at (installed skeleton file name): Rename to...
6462 (installed skeleton file names): ... this.
6463
148d66d8
JD
64642007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
6465
6466 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6467 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
6468 Summary" not "Directives".
6469 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
6470 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
6471 since the former is now the more complete one.
6472 (Prologue Alternatives): Likewise and do the same for %defines.
6473 (Table of Symbols): Add summary of %code, add summary of %define, and
6474 move full %code documentation to...
6475 (Decl Summary): ... here for consistency with other entries in these
6476 sections.
6477 Move %define entry in order to keep this list alphabetized.
6478 Reword %define entry a little to put less emphasis on the skeleton
6479 concept, which most users shouldn't have to think about.
6480
665f0c24
PE
64812007-01-26 Paul Eggert <eggert@cs.ucla.edu>
6482
6483 Adjust to recent gnulib changes.
6484 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
6485 Add string.h, string_.h, unistd_.h, wchar_.h.
6486 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
6487 * src/system.h: Don't include <stpcpy.h>; this is now done by
6488 <string.h>.
6489
592d0b1e
PB
64902007-01-23 Paolo Bonzini <bonzini@gnu.org>
6491
6492 Simplify implementation of unqualified %code, implement macros for
6493 uniform treatment of boolean %define flags. Document %define.
6494 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
6495 b4_percent_code_ifdef): New.
6496 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
6497 * data/c++.m4: Define default value for global_tokens_and_yystype.
6498 * data/glr.cc: Likewise.
6499 * data/location.cc: Use b4_percent_define_flag_if.
6500
148d66d8 6501 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
6502
6503 * src/parse-gram.y (Unqualified %code): Change muscle name to
6504 b4_percent_code().
6505 (content.opt): Default to empty.
6506
a7867f53
JD
65072007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6508
6509 Implement support for relative and absolute skeleton file names.
6510 Discussed starting at
6511 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
6512 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
6513 (Bison Options): Document in --skeleton entry.
6514 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
6515 full_skeleton can't necessarily hold all of pkgdatadir.
6516 If the specified skeleton file name contains a `/', don't prepend
6517 pkgdatadir.
6518 * src/parse-gram.y (prologue_declaration): If the specified skeleton
6519 file name contains a `/', prepend the grammar file directory.
6520 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
6521 * skeletons.at: New file.
6522 (relative skeleton file names): New test case.
6523 (installed skeleton file names): New test case.
6524 * tests/testsuite.at: Include skeletons.at.
6525
6526 * bootstrap: Update copyright to 2007.
6527
830c9b18
PB
65282007-01-17 Paolo Bonzini <bonzini@gnu.org>
6529
6530 * bootstrap: Remove occurrences of .#bootmp from the files.
6531
a8c2e813
AD
65322007-01-17 Akim Demaille <akim@epita.fr>
6533
6534 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
6535 nonterminals.
6536 Use per-type %printer.
6537
279cabb6
JD
65382007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6539
6540 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
6541 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6542 djgpp/config.site, src/files.c, src/files.h, src/main.c,
6543 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
6544 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
6545 tests/glr-regression.at, tests/input.at, tests/local.at,
6546 tests/output.at, tests/torture.at: Update copyright to 2007.
6547
bb32f4f2
AD
65482007-01-16 Akim Demaille <akim@epita.fr>
6549
6550 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
6551 error code.
6552 (Calc++ Scanner): Exit with failure if we can't open the input
6553 file.
6554 Accept "-" standing for stdin.
6555 (Calc++ Top Level): Print the result only if the parsing was
6556 successful.
6557
7cff04b5
AD
65582007-01-16 Akim Demaille <akim@epita.fr>
6559
6560 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
6561
a4e25e1d
JD
65622007-01-15 Paolo Bonzini <bonzini@gnu.org>
6563 and Joel E. Denny <jdenny@ces.clemson.edu>
6564
6565 Clean up %define and %code implementation in M4 some. Most
6566 importantly, rename all related macros to be in the b4_percent_define
6567 and b4_percent_code namespaces. Also, complete support for `.' in
6568 %define variable names and %code qualifiers.
6569 * data/bison.m4 (b4_check_user_names): Check for special
6570 "SKELETON-NAMESPACE(name)" macros instead of using two nested
6571 m4_foreach loops.
6572 (b4_get_percent_define, b4_get_percent_code): Rename to...
6573 (b4_percent_define_get, b4_percent_code_get): ... these.
6574 Extend documentation with examples.
6575 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
6576 b4_percent_define_skeleton_variables and
6577 b4_percent_code_skeleton_qualifiers.
6578 Expect any value for the %define variable `foo' to be stored in the
6579 macro named `b4_percent_define(foo)'; expect any %code blocks for the
6580 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
6581 expect any unqualified %code blocks to be stored in a macro named
6582 `b4_percent_code_unqualified'.
6583 Use m4_indir so that %define variable names and %code qualifiers can
6584 contain `.', which is allowed by the grammar parser.
6585 (b4_percent_define_default): New macro to set a default value for a
6586 %define variable.
6587 (m4_wrap): Update wrapped code, and fix some underquoting.
6588 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
6589 Expect grammar uses of %define variables and %code qualifiers to be
6590 defined in b4_percent_define_user_variables and
6591 b4_percent_code_user_qualifiers.
6592 * data/c++.m4: Use b4_percent_define_default rather than
6593 m4_define_default. Fix some underquoting. Skeleton usage of %define
6594 variable define_location_comparison now implies skeleton usage of
6595 %define variable filename_type.
6596 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6597 data/push.c, data/yacc.c: Update macro names.
6598 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
6599 muscle names.
6600
e37c665c
JMG
66012007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6602
6603 DJGPP specific issues.
6604
6605 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
6606 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
6607
7d2d521f
JD
66082007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6609
6610 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
6611 run parsers in all tests so that Valgrind is invoked during
6612 maintainer-check-valgrind.
6613 (Duplicate representation of merged trees): Free all semantic values.
6614 (Duplicated user destructor for lookahead): Likewise.
6615
e0ac9b4b
JD
66162007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6617
6618 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
6619 command-line prefix.
6620 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
6621 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
6622 miss Valgrind messages.
6623 (Exploding the Stack Size with Malloc): Likewise.
6624
78143faa
JD
66252007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6626
6627 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
6628 locals. Reported by Juan Manuel Guerrero at
6629 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
6630 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
6631 Fix some indentation also.
6632 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
6633 explaining this issue.
6634
7ecec4dd
JD
66352007-01-09 Paolo Bonzini <bonzini@gnu.org>
6636 and Joel E. Denny <jdenny@ces.clemson.edu>
6637
6638 Simplify union and prologue handling, and escape union and lex/parse
6639 params with digraphs.
6640 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
6641 values to the empty string since these are no longer guaranteed
6642 initialized by the front-end.
6643 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
6644 braces around b4_user_stype since this is no longer done by the
6645 front-end.
6646 * src/files.c, src/files.h (pre_prologue_obstack,
6647 post_prologue_obstack): Remove.
6648 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
6649 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
6650 with digraphs. This fixes lex params and parse params.
6651 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
6652 * src/output.c (prepare): Remove muscle insertion of the prologues.
6653 (output): Remove freeing of pre_prologue_obstack and
6654 post_prologue_obstack.
6655 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
6656 than prologue_augment for prologue parsing so you don't need prologue
6657 obstacks.
5c80250c
JD
6658 (grammar_declaration): For %union RHS, use `braceless' instead of
6659 "{...}" so that braces are already stripped and code is escaped with
6660 digraphs.
7ecec4dd
JD
6661 * src/reader.c (prologue_augment): Remove.
6662 (reader): Remove initialization of pre_prologue_obstack and
6663 post_prologue_obstack.
6664 * src/reader.h (prologue_augment): Remove.
6665
6666 * data/c.m4: Remove stray parenthesis.
6667
16dc6a9e
JD
66682007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6669
6670 Remove quotes from variables names in %define directives and from
6671 qualifiers in %code directives, and restrict the characters that are
6672 allowed in them to M4-friendly ones. For %define, continue to support
6673 the quoted form as a deprecated feature. Discussed starting at
6674 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
6675 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
6676 %code.
6677 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
6678 (Decl Summary): In %defines entry, update mention of `%code requires'
6679 and `%code provides'.
16dc6a9e
JD
6680 (C++ Location Values): Update %define uses.
6681 (Calc++ Parser Interface): Likewise.
6682 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 6683 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
6684 * src/parse-gram.y (prologue_declaration): For %define variables, use
6685 `variable' instead of `STRING'.
6686 (grammar_declaration): For %code qualifiers, use `ID' instead of
6687 `STRING'.
6688 (variable): New nonterminal that takes an `ID' or a `STRING'.
6689 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
6690 and %define uses.
6691 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
6692 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
6693 (%define errors): Update %define uses.
6694
e9813cd4
JD
66952007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6696
6697 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
6698 instead of muscle_insert for %define values so that M4-special
6699 characters are replaced with digraphs.
6700 * tests/input.at (%define errors): Extend to check weird values.
6701
6afc30cc
JD
67022007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6703
6704 Instead of having skeletons declare all valid %define variables and
6705 %code qualifiers, provide macros that retrieve the associated values
6706 and build these lists automatically. Thus Bison will now warn when a
6707 variable or qualifier is not used by the skeleton in the current
6708 invocation regardless of whether it might sometimes be used by that
6709 skeleton in other invocations. Also, move all %define value macros to
6710 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
6711 form, which is replaced by %code.
6712 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
6713 (b4_check_user_names): ... this, and change the series of valid name
6714 arguments to a single list argument for names used in the skeleton
6715 similar to the existing list argument for names used in the grammar.
6716 Warn instead of complaining.
6717 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
6718 values and %code code, to format %code code properly, and to build
6719 lists of all %define variables and %code qualifiers used in the
6720 skeleton: b4_skeleton_percent_define_variables and
6721 b4_skeleton_percent_code_qualifiers.
6722 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
6723 Remove, and...
6724 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
6725 the skeleton names lists can finish building first. In place of
6726 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
6727 expect the lists b4_user_percent_define_variables and
6728 b4_user_percent_code_qualifiers.
6729 * data/c++.m4: Where setting default values for b4_parser_class_name,
6730 b4_location_type, b4_filename_type, b4_namespace, and
6731 b4_define_location_comparison, update their names to the
6732 b4_percent_define_ namespace.
6733 * data/glr.c: Don't use b4_check_percent_define_variables and
6734 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6735 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
6736 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 6737 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
6738 * data/location.cc: Use b4_get_percent_define.
6739 * data/push.c: Don't use b4_check_percent_define_variables and
6740 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6741 * data/yacc.c: Likewise, and don't call m4_exit in
6742 b4_use_push_for_pull_if or m4_wrap code will never execute.
6743 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
6744 Rename to...
6745 (muscle_grow_user_name_list): ... this for consistency with the
6746 terminology used in bison.m4.
6747 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
6748 %define variable names, and rename muscle used_percent_define_variables
6749 to user_percent_define_variables.
6750 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
6751 user_percent_code_qualifiers.
6752 (content): Remove.
6753 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
6754 {CODE} form is no longer accepted.
6755 * tests/input.at (Reject bad %code qualifiers): Rename to...
6756 (Reject unused %code qualifiers): ... this, and update test output.
6757 (%define error): Update test output.
6758
7eb8a0bc
JD
67592007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
6760
6761 Check for unrecognized %define variables similar to checking for
6762 unrecognized %code qualifiers. Check for redefined %define variables.
6763 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
6764 generalizes...
6765 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
6766 (b4_check_percent_define_variables): New, also wraps it.
6767 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
6768 variables using b4_check_percent_define_variables.
6769 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
6770 all those exercised in the test suite and all those listed in the
6771 `Default values' section of c++.m4. Are there others?
6772 * data/push.c, data/yacc.c: Declare no valid %define variables.
6773 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
6774 similar to muscle_find, but it works even when the muscle stores a
6775 const value.
6776 (muscle_grow_used_name_list): New function for constructing the used
6777 name list muscles that b4_check_for_unrecognized_names requires.
6778 * src/parse-gram.y (prologue_declaration): Warn if a variable is
6779 %define'd more than once. Define the b4_used_percent_define_variables
6780 muscle with muscle_grow_used_name_list.
6781 (grammar_declaration): Abbreviate %code code with
6782 muscle_grow_used_name_list.
6783 * tests/input.at (%define errors): New.
6784
3fc65ead
JD
67852007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6786
6787 Provide warn_at, complain_at, and fatal_at function callbacks to the
6788 skeletons, and use this for %code qualifier complaints.
6789 * data/bison.m4 (b4_error_at): New, invoked by...
6790 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
6791 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
6792 @fatal_at(...@) directives.
6793 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
6794 qualifiers in b4_used_percent_code_qualifiers and to use
6795 b4_complain_at.
6796 * src/location.c, src/location.h (boundary_set_from_string): New global
6797 function.
6798 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
6799 function.
6800 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
6801 to b4_used_percent_code_qualifiers.
6802 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
6803 function.
6804 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
6805 (lineno): Rename to...
6806 (out_lineno): ... this so I don't misunderstand it again.
6807 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
6808 here; these newlines are in the input but not the output file.
6809 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
6810 (at_directive_perform): ... this new static function, and add handling
6811 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
6812 directives.
6813 * tests/input.at (Reject bad %code qualifiers): Update test output with
6814 locations and extend.
6815
6816 * tests/output.at (Output file name: [, Output file name: ]): Remove
6817 bogus comment about these tests failing.
6818
1c7b7e1d
JD
68192007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6820
6821 Clean up b4_check_percent_code_qualifiers a little.
6822 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
6823 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
6824 documentation and add examples.
6825 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
6826 qualifiers here.
6827
08af01c2
JD
68282007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6829
6830 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
6831 unreliable -- especially when they're hidden inside another macro.
6832 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
6833 data/c.m4: Remove m4_divert(-1).
6834 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6835 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
6836 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 6837 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
6838 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
6839 pushed and popped by m4sugar, should be first on the stack.
6840
6841 Provide warn, complain, and fatal function callbacks to the skeletons.
6842 This provides more flexibility than m4_fatal, improves the error
6843 message format, and captures messages for translation. Discussed
6844 starting at
6845 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
6846 * data/bison.m4 (b4_error): New, invoked by...
6847 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
6848 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
6849 directives. Because these M4 macros might be called when the current
6850 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
6851 the previous removal of uses of m4_divert, which caused trouble.
6852 (b4_check_percent_code_qualifiers): Use b4_complain instead of
6853 m4_fatal to report unrecognized %code qualifiers.
6854 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
6855 push parser requests.
6856 * data/glr.c: Use b4_complain instead of m4_fatal to report
6857 non-deterministic push parser requests.
6858 Update @output usage to @output(...@) form.
6859 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
6860 report missing %defines. Update @output usage to @output(...@) form.
6861 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
6862 @output(...@) form.
6863 * src/main.c (main): Invoke skel_scanner_free.
6864 * src/scan-skel.h (skel_scanner_free): Prototype new function.
6865 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
6866 obstack_for_string from flex-scanner.h.
6867 (YY_DECL): Use to declare skel_lex static.
6868 (decode_at_digraphs): Remove; now handled in the new
6869 SC_AT_DIRECTIVE_ARG start condition.
6870 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
6871 functions.
6872 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
6873 at_directive_argv): New static globals.
6874 (INITIAL): Use fail_for_invalid_at.
6875 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
6876 recognize the start of a generalized `@directive(...@)' form and
6877 start...
6878 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
6879 directive args (using the new obstack_for_string), to decode the
6880 contained @ diagraphs, and to perform the directive. It recognizes
6881 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
6882 @output(...@).
6883 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
6884 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
6885 `@,'.
6886 (scan_skel): Initialize obstack_for_string on the first call.
6887 (skel_scanner_free): New function to free obstack_for_string.
6888 * tests/input.at (Reject bad %code qualifiers): Update test output.
6889
8e0a5e9e
JD
68902007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
6891
6892 Consolidate the 4 prologue alternative directives (%code, %requires,
6893 %provides, and %code-top) into a single %code directive with an
6894 optional qualifier field. Discussed at
6895 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
6896 * NEWS (2.3a+): Rewrite the existing entry for the prologue
6897 alternatives.
6898 * doc/bison.texinfo (Prologue Alternatives): Update.
6899 (Decl Summary): Update to %code "requires" and %code "provides".
6900 (Calc++ Parser): Update to %code "requires".
148d66d8 6901 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
6902 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
6903 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
6904 are replaced by b4_percent_code_provides and b4_percent_code_requires,
6905 which are skeleton-specific.
6906 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
6907 declare what %code qualifiers it supports and to complain if any other
6908 qualifiers were used in the grammar.
6909 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
6910 and b4_user_code([b4_percent_code_provides]) in place of
6911 b4_user_requires and b4_user_provides.
6912 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
6913 Add b4_user_code([b4_percent_code_top]) and
6914 b4_user_code([b4_percent_code]).
6915 Invoke b4_check_percent_code_qualifiers.
6916 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6917 PERCENT_REQUIRES): Remove.
6918 (grammar_declaration): Remove RHS's for %code-top, %provides, and
6919 %requires. Rewrite the %code RHS as the unqualified form defining the
6920 muscle b4_percent_code. Add another RHS for the qualified %code form,
6921 which defines muscles of the form b4_percent_code_QUALIFIER and the
6922 b4_used_percent_code_qualifiers muscle.
6923 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6924 PERCENT_REQUIRES): Remove.
6925 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
6926 %code "requires" and %code "provides".
6927 * tests/input.at (Reject bad %code qualifiers): New.
6928
95021767
JD
69292007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6930
6931 Use the new code_props interface for destructors and printers.
6932 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
6933 printer_location members, and change the type of the destructor and
6934 printer members to code_props.
6935 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
6936 symbol_printer_get, semantic_type_destructor_set,
6937 semantic_type_printer_set, default_tagged_destructor_set,
6938 default_tagless_destructor_set, default_tagged_printer_set,
6939 default_tagless_printer_set): Use code_props in arguments and return
6940 types in place of char const * and location.
6941 (symbol_destructor_location_get, symbol_printer_location_get): Remove
6942 since the locations are now contained in the return of
6943 symbol_destructor_get and symbol_printer_get.
6944 * src/output.c (symbol_destructors_output, symbol_printers_output):
6945 Replace with...
6946 (symbol_code_props_output): ... this to eliminate duplicate code.
6947 (output_skeleton): Update to use symbol_code_props_output.
6948 * src/reader.c (symbol_should_be_used): Update use of
6949 symbol_destructor_get.
6950 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6951 Update uses of the various _destructor_set and _printer_set functions.
6952 * src/symtab.c: (default_tagged_destructor_location,
6953 default_tagless_destructor_location, default_tagged_printer_location,
6954 default_tagless_printer_location): Remove since we...
6955 (default_tagged_destructor, default_tagless_destructor,
6956 default_tagged_printer, default_tagless_printer): ... change the type
6957 of these to code_props.
6958 (symbol_new, semantic_type_new, symbol_destructor_set,
6959 semantic_type_destructor_set, symbol_destructor_get,
6960 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
6961 symbol_check_alias_consistency, default_tagged_destructor_set,
6962 default_tagless_destructor_set, default_tagged_printer_set,
6963 default_tagless_printer_set): Update.
6964 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
6965 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
6966 code_props members.
6967 (symbol_print): Use SYMBOL_CODE_PRINT.
6968
f6857bbf
JD
69692007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6970
6971 Use the new code_props interface for rule actions.
6972 * src/symlist.h (symbol_list): Replace action, action_location, and
6973 used members with a code_props action_props member.
6974 * src/reader.c (symbol_should_be_used, grammar_rule_check,
6975 grammar_midrule_action, grammar_current_rule_merge_set,
6976 grammar_current_rule_symbol_append, packgram): Update.
6977 * src/scan-code.h (translate_rule_action): Remove, no longer used.
6978 * src/scan-code.l (handle_action_dollar): Update.
6979 (translate_rule_action): Remove, no longer used.
6980 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
6981
7c0c6181
JD
69822007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6983
6984 Use the new code_props interface in parse-gram.y.
6985 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
6986 Update all uses of translate_* functions to use the new code_props
6987 interface and to use gram_scanner_last_string_free and
6988 code_scanner_last_string_free where possible.
6989 (grammar_declaration): symbol_list_destructor_set and
6990 symbol_list_printer_set now perform the translation, so don't do it
6991 here. Use gram_scanner_last_string_free where possible.
6992 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
6993 translate_code): Remove, no longer used.
6994 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
6995 symbol_list_printer_set): Perform code translation here rather than
6996 depending on the caller to do so.
6997
6998 * src/symlist.h (struct symbol_list): Correct some documentation typos.
6999 * src/scan-gram.h (gram_last_string): Remove declaration.
7000 * src/scan-gram.l (last_string): Declare it static.
7001
28e52c0d
JD
70022007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7003
7004 Encapsulate code properties and related functionality for the various
7005 destructors, printers, and actions into a code_props structure and
7006 interface. This patch merely implements code_props in scan-code.h and
7007 scan-code.l. Future patches will rewrite other modules to use it.
7008 Discussed starting at
7009 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
7010 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
7011 consistently initialize const structs that have an empty location
7012 field.
7013 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
7014 to ensure consistency.
7015 * src/scan-code.h (code_props): New structure.
7016 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
7017 function, macro, and const global variable for initializing a
7018 code_props with no code.
7019 (code_props_plain_init, code_props_symbol_action_init,
7020 code_props_rule_action_init, code_props_translate_code): The rest of
7021 the new code_props functional interface. Among other things, the init
7022 functions set the code_props kind field so that
7023 code_props_translate_code will know whether to behave like
7024 translate_symbol_action, translate_rule_action, or translate_code.
7025 These old translate functions must remain until all other modules are
7026 updated to use the new code_props interface.
7027 (code_scanner_last_string_free): New function similar to
7028 gram_scanner_last_string_free.
7029 (code_scanner_free): Add documentation.
7030 * src/scan-code.l: Implement the new interface.
7031 (code_lex): Make it static, add a code_props* argument, and remove the
7032 rule argument.
7033 (last_string): New static global similar to the one in scan-gram.l.
7034 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
7035 instead of rule.
7036 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
7037 code_props since Bison may one day use this information for destructors
7038 and printers.
7039 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
7040 (handle_action_dollar): Use symbol_list_n_get and set used flag
7041 directly since symbol_list_n_used_set is removed.
7042 (translate_action): Add a code_props* argument and remove the rule,
7043 action, and location arguments. Pass the code_props* on to code_lex.
7044 (translate_rule_action, translate_symbol_action, translate_code):
7045 Rewrite as wrappers around the new code_props interface.
7046 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
7047 it would eventually need to break the encapsulation of code_props.
7048
96034983
JD
70492007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7050
7051 * etc/.cvsignore: New.
7052
945e396c
JD
70532007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7054
7055 Add maintainer-push-check to run maintainer-check using push parsing in
7056 place of pull parsing where available.
7057 * Makefile.am (maintainer-push-check): New.
7058 * data/bison.m4 (b4_use_push_for_pull_if): New.
7059 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
7060 appropriately based on their existing values.
7061 (yypush_parse): Don't print push-parser-specific diagnostics if push
7062 parsing is being used in place of pull parsing.
7063 * data/yacc.c: If push parsing should replace pull parsing, redirect to
7064 push.c.
7065 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
7066 variable, and insert b4_use_push_for_pull_flag into muscles.
7067 * tests/Makefile.am (maintainer-push-check): New.
7068
7d596384
JD
70692006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7070
7071 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
7072 (whether successful or failed) so that yypush_parse can be invoked
7073 again to start a new parse using the same yypstate.
7074 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
7075 check multiple yypull_parse invocations on the same yypstate. For pull
7076 mode, extend to check multiple yyparse invocations.
7077 (Exploding the Stack Size with Alloca): Extend to try with
7078 %push-pull-parser.
7079 (Exploding the Stack Size with Malloc): Likewise.
7080
7081 * tests/calc.at (Simple LALR Calculator): Don't specify
7082 %skeleton "push.c" since %push-pull-parser implies that now.
7083 * tests/headers.at (export YYLTYPE): Don't check for the push
7084 declarations. Otherwise, this test case can't be used to see if push
7085 mode can truly emulate pull mode.
7086 * tests/input.at (Torturing the Scanner): Likewise.
7087 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
7088 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
7089 AT_YACC_IF, which now includes the case of push mode since %skeleton
7090 need not be used for push mode. This will be more intuitive once
7091 push.c is renamed to yacc.c.
7092
7172e23e
JD
70932006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7094
7095 For push mode, convert yyparse from a macro to a function, invoke yylex
7096 instead of passing a yylexp argument to yypull_parse, and don't
7097 generate yypull_parse or yyparse unless %push-pull-parser is declared.
7098 Discussed starting at
7099 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
7100 * data/bison.m4 (b4_pull_if): New.
7101 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
7102 * data/push.c: Improve M4 quoting a little.
7103 (b4_generate_macro_args, b4_parenthesize): Remove.
7104 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
7105 any time a pull parser is requested.
7106 Don't #define this as a wrapper around yypull_parse. Instead, when
7107 both push and pull are requested, make it a function that does that
7108 same thing.
7109 (yypull_parse): If there's a b4_prefix, #define this to
7110 b4_prefix[pull_parse] when both push and pull are requested.
7111 Don't define this as a function unless both push and pull are
7112 requested.
7113 Remove the yylexp argument and hard-code yylex invocation instead.
7114 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
7115 %push-parser.
7116 * src/getargs.c (pull_parser): New global initialized to true.
7117 * getargs.h (pull_parser): extern it.
7118 * src/output.c (prepare): Insert pull_flag muscle.
7119 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
7120 (prologue_declaration): Set both push_parser and pull_parser = true for
7121 %push-pull-parser. Set push_parser = true and pull_parser = false for
7122 %push-parser.
7123 * src/scan-gram.l: Don't accept %push_parser as an alternative to
7124 %push-parser since there's no backward-compatibility concern here.
7125 Scan %push-pull-parser.
7126 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
7127 instead of %push-parser.
7128 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
7129 prototype it in the module that calls yyparse.
7130 * tests/input.at (Torturing the Scanner): Likewise.
7131 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
7132
2e7944cb
JD
71332006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
7134
7135 Update etc/bench.pl. Optimize push mode a little (the yyn change
7136 deserves most of the credit).
7137 * Makefile.am (SUBDIRS): Add etc subdirectory.
7138 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
7139 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
7140 yytoken, yyval, and yyloc declarations to...
7141 (yyparse or yypush_parse): ... here to improve performance. For
7142 yypush_parse invocations after the first, be sure to assign yyn its old
7143 value again.
7144 (yypstate_new): Don't bother initializing the yyresult field since the
7145 initial value isn't used.
7146 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
7147 remove the #define that, in push mode, set it to yyps->NAME.
7148 * etc/Makefile.am: New.
7149 * etc/bench.pl: Remove and build it instead from...
7150 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
7151 "tests/bison" from the build directory by default rather than just
7152 invoking "bison" from $PATH.
7153 (calc_grammar): Update push parser code: don't declare yylval globally,
7154 don't define yyparse_wrapper, and don't #define yyparse.
7155 (bench_grammar): Update to check all working combinations of yacc.c,
7156 push.c, impure, pure, pull, and push.
7157
c3d50342
JD
71582006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7159
7160 For push mode, add pull wrappers around yypush_parse.
7161 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
7162 (yypull_parse): New function wrapping yypush_parse.
7163 (yyparse): New #define wrapping yypull_parse.
7164 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
7165 is declared.
7166 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
7167 prototype yylex in the module that calls yyparse, and don't prototype
7168 yyparse there. Otherwise, the yyparse expansion won't compile.
7169 * tests/input.at (Torturing the Scanner): Likewise.
7170
94ebeba5
JD
71712006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7172
7173 Enable push parsers to operate in impure mode. Thus, %push-parser no
7174 longer implies %pure-parser. The point of this change is to move
7175 towards being able to test the push parser code by running the entire
7176 test suite as if %push-parser had been declared.
7177 * data/push.c (yypush_parse): For impure mode, remove the
7178 yypushed_char, yypushed_val, and yypushed_loc arguments.
7179 Instead, declare these as local variables initialized to the global
7180 yychar, yylval, and yylloc.
7181 For the first yypush_parse invocation only, restore the initial values
7182 of these global variables when it's time to read a token since they
7183 have been overwritten.
7184 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
7185 %push-parser.
7186 * tests/calc.at (Simple LALR(1) Calculator): Always declare
7187 %pure-parser along with %push-parser since this test case was designed
7188 for pure push parsers.
7189 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
7190 (AT_YACC_OR_PUSH_IF): New.
7191 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
7192 add a note that it's still wrong for some cases (as it has been for a
7193 while).
7194 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
7195 %push-parser no longer implies %pure-parser.
7196
a0633178
JD
71972006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7198
7199 Remove some unnecessary differences between the pull parser code and
7200 the push parser code. This patch enables yynerrs in push mode.
7201 * data/push.c: Reformat M4 a little.
7202 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
7203 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
7204 because push mode is on. Instead, if pure mode is on, move yynerrs
7205 to...
7206 (b4_declare_parser_state_variables): ... here.
7207 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
7208 to yyps->NAME so it can be used in yypush_parse.
7209 (yypush_parse): Don't omit uses of yynerrs in push mode.
7210
8646b6a3
JD
72112006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7212
7213 Fix bug such that the first pushed token's value and location are
7214 sometimes overwritten (sometimes by %initial-action) before being used.
7215 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
7216 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
7217 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
7218 more closely mimic the pull parser logic.
7219 Don't copy the pushed token to yychar, yylval, and yylloc until it's
7220 time to read a token, which is after any initialization of yylval and
7221 yylloc.
7222 (gottoken): Rename label to...
7223 (yyread_pushed_token): ... for clarity and to avoid infringing on the
7224 user namespace.
7225
9baf4d74
JD
72262006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7227
7228 Rearrange initialization of the parser state variables so that the
7229 skeleton doesn't have to have a copy for pull mode and another for push
7230 mode. This patch also fixes at least a bug such that yylloc was not
7231 initialized (with b4_location_initial_line and
7232 b4_location_initial_column) upon calling yypush_parse. However, that
7233 initialization now overwrites the first token's location;
7234 %initial-action assigning @$ already did the same thing, and both bugs
7235 will be fixed in a later patch.
7236 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
7237 (b4_declare_parser_state_variables): Remove initialization of yytoken,
7238 yyss, yyvs, yyls, and yystacksize.
7239 (yypstate_new): Remove initialization of some yypstate fields: yystate,
7240 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
7241 yylsp.
7242 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
7243 yyps->NAME so it can be used in yypush_parse.
7244 (yyparse or yypush_parse): For yypush_parse, don't print the
7245 "Starting parse" diagnostic for invocations after the first.
7246 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
7247 yypush_parse, only do it for the first invocation.
7248 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
7249 initialization to occur in yypush_parse but only on the first
7250 invocation.
7251
23522164
JD
72522006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7253
7254 * data/push.c: Add CPP guards around push parser declarations in both
7255 the header and the code file.
7256 In the code file, move the push parser declarations to the same place
7257 they appear in the header file.
7258 Clean up the M4 some, especially the inconsistent underquoting in
7259 some b4_c_function_def and b4_c_function_decl uses.
7260
bb010fe5
JD
72612006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7262
7263 Encapsulate the push parser state variables into an M4 macro so the
7264 push skeleton doesn't have to list them again for pull mode's yyparse.
7265 For push mode, remove yypush_parse's local equivalents of these
7266 variables to eliminate unnecessary copying between the two sets at
7267 run-time. This patch also fixes at least a bug related to multiple
7268 %initial-action invocations in push mode.
7269 * data/push.c (b4_declare_parser_variables): Rename to...
7270 (b4_declare_scanner_communication_variables): ... this for clarity and
7271 update both uses.
7272 (b4_declare_yyparse_variables): Remove and move its contents to the one
7273 spot where it was invoked.
7274 (b4_declare_parser_state_variables): New macro containing the parser
7275 state variables required by push mode.
7276 (struct yypstate): Replace all fields but yynew with
7277 b4_declare_parser_state_variables.
7278 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
7279 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
7280 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
7281 (yyparse or yypush_parse): For yyparse in pull mode, replace local
7282 parser state variable declarations with
7283 b4_declare_parser_state_variables.
7284 Don't initialize parser state variables when calling yypush_parse since
7285 yypstate_new already does that.
7286 Invoke the user's initial action only upon the first yypush_parse
7287 invocation.
7288 Remove all code that copies between the local parser state variables
7289 and the yypstate.
7290
2d212f8c
JD
72912006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7292
7293 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
7294 prevent a name collision in a future patch where these names will
7295 sometimes be #define'd.
7296 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
7297 since it no longer has the same name as the existing argument.
7298 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
7299
e6e704dc
JD
73002006-12-19 Paolo Bonzini <bonzini@gnu.org>
7301 and Joel E. Denny <jdenny@ces.clemson.edu>
7302
7303 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
7304 that the argument is case-insensitive, and there's no `=' here.
7305 For the %skeleton entry, mention that %language is better.
7306 (Bison Options): Likewise for --language and --skeleton. Move the
7307 --skeleton entry so that the `Tuning the parser' section is sorted
7308 alphabetically on long options.
7309 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
7310 %language directive in detail here; cross-reference the %language
7311 documentation instead.
7312 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
7313 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 7314 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
7315 * examples/extexi (normalize): Instead of replacing every %require
7316 argument with the current Bison version, just substitute for
7317 `@value{VERSION}'. This guarantees that we're testing what actually
7318 appears in the documentation.
7319 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
7320 rather than `@VERSION@'.
7321
0e021770
PE
73222006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7323
fd575f05
PE
7324 * NEWS: Reword the %language news a bit, and put it earlier.
7325
0e021770
PE
7326 * src/getargs.c (skeleton_arg): Last arg is now location const *.
7327 Rewrite to simplify the logic.
7328 (language_argmatch): Likewise.
fd575f05
PE
7329 (program_name): We now own this var.
7330 * src/getargs.h (struct bison_language): Use char[] rather than
7331 const char *.
0e021770
PE
7332
7333 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
7334 Java is supported.
7335 * src/complain.c (program_name): Remove decl; no longer needed.
7336 * src/main.c (program_name): Remove; now belongs to getargs.
7337
73382006-12-18 Paolo Bonzini <bonzini@gnu.org>
7339
7340 * NEWS: Document %language.
7341
7342 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
7343
7344 * data/c-skel.m4, data/c++-skel.m4: New files.
7345 * data/glr.c: Complain on push parsers.
7346
7347 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
7348 over %skeleton.
148d66d8 7349 (Decl Summary): Document %language and %skeleton.
0e021770
PE
7350 (Command line): Document -L.
7351
7352 * examples/extexi: Rewrite %require directive.
7353 * examples/calc++/Makefile.am: Pass VERSION to extexi.
7354
7355 * src/files.c (compute_exts_from_gc): Look in language structure
7356 for .y extension.
7357 (compute_file_name_parts): Check whether .tab should be added.
7358 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
7359 (language, skeleton_arg, language_argmatch): New.
7360 (long_options): Add --language.
7361 (getargs): Use skeleton_arg, add -L/--language.
7362 * src/getargs.h: Include location.h.
7363 (struct bison_language, language, skeleton_arg, language_argmatch): New.
7364 * src/output.c (prepare): Pick default skeleton from struct language.
7365 Don't dispatch C skeletons here.
7366 * src/parse-gram.y (PERCENT_LANGUAGE): New.
7367 (prologue_declaration): Add "%language" rule, use skeleton_arg.
7368 * src/scan-gram.l ("%language"): New rule.
7369
7370 * tests/calc.at: Test %skeleton and %language.
7371 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
7372 (AT_GLR_IF): Look for %skeleton "glr.cc".
7373 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
7374 (AT_YACC_IF): Reject %language.
7375
5691bf57
PE
73762006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7377
db06f0ce
PE
7378 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
7379 since it wasn't used; only the typedef name 'semantic_type' is needed.
7380 Also, omit trailing white space.
7381
5691bf57
PE
7382 * bootstrap: Sync from coreutils.
7383 (gnulib_extra_files): Add build-aux/announce.gen.
7384 (slurp): Adjust .gitignore files like .cvsignore files.
7385 * build-aux/announce-gen: Remove from CVS, since bootstrap
7386 now creates this.
7387
791934e4
JD
73882006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
7389
7390 Make %push-parser imply %pure-parser. This fixes several bugs; see
7391 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
7392 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
7393 pure_parser = true.
7394 * data/push.c: Don't bother testing b4_push_if when deciding whether
7395 to expand b4_declare_parser_variables globally.
7396 (yypush_parse): Likewise in here.
7397
7398 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
7399 (yy_reduce_print): Reformat M4 for readability.
7400
ee5abb37
JD
74012006-12-15 Bob Rossi <bob@brasko.net>
7402 and Joel Denny <jdenny@ces.clemson.edu>
7403
7404 * data/push.c (yypstate): Add typedef, and update all uses of
7405 struct yypstate to just yypstate.
7406 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
7407
16ca01f9
JD
74082006-12-14 Bob Rossi <bob@brasko.net>
7409
7410 * data/push.c (yypush_parse): Declare prototype regardless of
7411 %locations option.
7412
ab8e7e1a
JD
74132006-12-14 Bob Rossi <bob@brasko.net>
7414
7415 * data/push.c (yyparse): Remove the prototype and the #define when in
7416 push-parser mode.
7417
9bf32be3
JD
74182006-12-13 Bob Rossi <bob@brasko.net>
7419
7420 * data/push.c (yypstate_init): Rename to...
7421 (yypstate_new): ... this and use b4_c_function_def.
7422 (yypstate_delete): New.
7423 (yypush_parse): Change parameters yynval and yynlloc to be const.
7424 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
7425 yypstate_delete functions.
7426
f02e2948
JD
74272006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
7428
7429 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
7430 strange test case titles. Reported by Bob Rossi.
7431
38eb7751
PE
74322006-12-13 Paul Eggert <eggert@cs.ucla.edu>
7433
7434 * TODO: Add pointer to Sylvain Schmitz's work on static detection
7435 of potential ambiguities in GLR grammers.
7436
bd9d212b
JD
74372006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
7438
7439 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
7440 `bison ', use m4_index instead of m4_substr since chopping up a string
7441 containing M4-special characters causes problems here.
7442
7443 Fix a couple of bugs related to special characters in user-specified
7444 file names, and make it easier for skeletons to compute output file
7445 names with the same file name prefix as Bison-computed output file
7446 names.
7447 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
7448 b4_parser_file_name and b4_spec_defines_file instead of
7449 @output_parser_name@ and @output_header_name@, which are now redundant.
7450 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
7451 b4_parser_file_name, b4_spec_defines_file, and the new
7452 @basename(FILENAME@) instead of @output_parser_name@ and
7453 @output_header_name@, which inappropriately escaped the file names as
7454 C string literals.
7455 * src/files.c (all_but_ext): Remove static qualifier.
7456 (compute_output_file_names): Move `free (all_but_ext)' to...
7457 (output_file_names_free): ... here since all_but_ext is needed later.
7458 * src/files.h (all_but_ext): Extern.
7459 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
7460 exactly what MUSCLE_INSERT_STRING used to do.
7461 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
7462 characters are escaped properly.
7463 * src/output.c (prepare): Define muscle file_name_all_but_ext as
7464 all_but_ext.
7465 For pkgdatadir muscle, maintain previous functionality by using
7466 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
7467 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
7468 digraphs would never be expanded. Hopefully no one has M4-special
7469 characters in his Bison installation path.
7470 * src/scan-skel.l: Don't parse @output_header_name@ and
7471 @output_parser_name@ anymore since they're now redundant.
7472 In @output, use decode_at_digraphs.
7473 Parse a new @basename command that invokes last_component.
7474 (decode_at_digraphs): New.
7475 (BASE_QPUTS): Remove unused.
7476 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
7477 (Output file name): New tests.
7478
3f7ca628
JD
74792006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
7480
7481 Warn about output files that are generated by the skeletons and that
7482 conflict with other output files.
7483 * data/glr.c: Don't generate the header file here when glr.cc does.
7484 * src/files.c (file_names, file_names_count): New static globals.
7485 (compute_output_file_names): Invoke output_file_name_check for files
7486 not generated by the skeletons and remove existing checks.
7487 (output_file_name_check): New function that warns about conflicting
7488 output file names.
7489 (output_file_names_free): Free file_names.
7490 * src/files.h (output_file_name_check): Declare.
7491 * src/scan-skel.l: Invoke output_file_name_check for files generated by
7492 the skeletons.
7493 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
7494 (Conflicting output files): New tests.
7495
178e123e
PE
74962006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7497
7498 * doc/bison.texinfo: Fix a couple of typos.
7499
75002006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
7501
7502 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
7503 Rename to...
7504 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
7505 update all uses.
7506 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
7507 (yypush_parse): Rename yypvars argument to yyps and remove redundant
7508 local pv.
7509 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
7510 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
7511
ea17f233
JD
75122006-12-07 Bob Rossi <bob@brasko.net>
7513 and Joel Denny <jdenny@ces.clemson.edu>
7514
7515 * data/push.c (yypvarsinit): Change return type from void* to struct
7516 yypvars*. No longer cast to void* on return.
7517 (struct yypvars): Remove yylen since it need not be remembered between
7518 yypushparse invocations.
7519 (yypushparse): Don't copy between yylen and pv->yylen.
7520
55a30bda
JD
75212006-12-05 Bob Rossi <bob@brasko.net>
7522
7523 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
7524 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
7525 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
7526 (struct yypvars): Remove b4_declare_parser_variables.
7527 (yypvarsinit): Remove init code for removed variables.
7528 (global scope): Do not declare b4_declare_parser_variables if
7529 push or pure mode.
7530 (yypushparse): Add b4_declare_parser_variables.
7531 Init new local variables, and remove init code for removed
7532 yypvars variables.
7533 (yyparse): Delete.
7534 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
7535 and yyparse for other modes.
7536 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
7537 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
7538 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
7539 (AT_PURE_LEX_IF): True if pure or push parser.
7540
85894313
JD
75412006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
7542
7543 Document Yacc prologue alternatives and default %destructor's and
7544 %printer's as experimental. Don't mention Java yet. Discussed at
7545 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
7546 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
7547 (2.3a): Annotate this entry to say the old forms of these features were
7548 also experimental.
7549 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 7550 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
7551 of Java (we'll want this back eventually).
7552
02975b9a
JD
75532006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
7554
7555 Support a file name argument to %defines. Deprecate `=' in
7556 %file-prefix, %name-prefix, and %output. Discussed at
7557 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
7558 * NEWS (2.3a+): Mention.
148d66d8 7559 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
7560 form of %defines, and remove `=' from entries for %file-prefix,
7561 %name-prefix, and %output.
7562 * src/parse-gram.y (prologue_declaration): Implement.
7563 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
7564 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
7565 all but one occurrence of %name-prefix.
7566 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
7567 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
7568 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
7569 occurrence of each of %file-prefix and %output. Add check for %defines
7570 with argument.
7571 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
7572 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
7573 Remove the `=' from %output.
7574
287b314e
JD
75752006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
7576
7577 Don't escape $ in test case titles since Autoconf 2.61 now does that
7578 correctly.
7579 * tests/actions.at (Default %printer and %destructor are not for error
7580 or $undefined): Here.
7581 (Default %printer and %destructor are not for $accept): Here.
7582 * tests/input.at (Invalid $n and @n): Here.
7583
3ebecc24
JD
75842006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
7585
7586 Rename <!> to <>. Discussed starting at
7587 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
7588 * NEWS (2.3a+): Update.
148d66d8 7589 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
7590 Update.
7591 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
7592 * src/scan-gram.l (INITIAL): Implement.
7593 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
7594 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
7595 comment.
7596 * tests/actions.at (Default tagless %printer and %destructor,
7597 Default tagged and per-type %printer and %destructor,
7598 Default %printer and %destructor are not for error or $undefined,
7599 Default %printer and %destructor are not for $accept,
7600 Default %printer and %destructor for mid-rule values): Update.
7601 * tests/input.at (Default %printer and %destructor redeclared,
7602 Unused values with default %destructor): Update.
7603
26b8a438
JD
76042006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
7605
7606 Don't let %prec take a nonterminal.
7607 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
7608 token.
7609 * tests/input.at (%prec takes a token): New test checking that %prec
7610 won't take a nonterminal.
7611
07c39ae9
JD
76122006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7613
405d53b7
JD
7614 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
7615 it was double-quoted.
07c39ae9
JD
7616 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
7617 grammar is maintained with Bison's highest standards.
7618 * src/getargs.c: Fix some typos in Doxygen comments.
7619
580b8926
JD
76202006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7621
7622 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
7623 later. Reported by Paul Eggert in
7624 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
7625 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
7626 * src/scan-code.l (translate_action): Don't bother invoking
7627 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
7628 (code_scanner_free): Instead of invoking
7629 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
7630 which frees more.
7631 * src/scan-gram.l (gram_scanner_free): Likewise.
7632 * src/scan-skel.l (scan_skel): Likewise.
7633
4502eadc
JD
76342006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
7635
7636 * src/files.c (tr): Change return type to void.
7637 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
7638 has been called previously for the same key.
7639 (muscle_find): Return storage instead of value so that
7640 --enable-gcc-warnings doesn't produce warnings that the return discards
7641 const. aver that the value and storage are the same since storage
7642 could potentially be NULL when value is not.
7643 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
7644 same as 0.
7645
7746c8f6
PE
76462006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7647
7648 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
7649 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
7650 us a slightly cleaner distribution, and also works.
7651 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
7652 gnulib changes.
7653
eb095650
PE
76542006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
7655 and Paul Eggert <eggert@cs.ucla.edu>
7656
7657 Don't let Bison leak memory except when it complains.
7658 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
7659 (spec_defines_file, dir_prefix): Now char *, not const char *,
7660 since they are freed.
7661 * src/files.c: Likewise.
7662 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
7663 Likewise.
7664 (tr): Now operates in-place. All uses changed.
7665 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
7666 values.
7667 (compute_file_name_parts, compute_output_file_names): Don't store
7668 read-only data in variables that will be freed.
7669 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
7670 src_extension, and header_extension.
7671 (output_file_names_free): New public function to free
7672 spec_verbose_file, spec_graph_file, spec_defines_file,
7673 parser_file_name, and dir_prefix.
7674 * src/getargs.c (getargs): Don't store read-only data in variables that
7675 will be freed.
7676 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
7677 (which previously existed but was unused), and quotearg_free.
7678 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
7679 * src/muscle_tab.c: Likewise.
7680 (muscle_entry): Make the value char const *,
7681 and add a new storage member that is char * and can be freed.
7682 (muscle_entry_free): New private function.
7683 (muscle_init): Use it instead of free.
7684 (muscle_insert, muscle_grow): Update and use new storage member.
7685 (muscle_code_grow): Free the string passed to muscle_grow
7686 since it's not needed anymore.
7687 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
7688 add a new `char *code' member.
7689 ("{...}"): Declare semantic type as code.
7690 * src/scan-code.h (translate_rule_action):
7691 (translate_symbol_action, translate_code, translate_action): Return
7692 `char const *' rather than `char *' since external code should not free
7693 these strings.
7694 * src/scan-code.l: Likewise.
7695 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
7696 which is "{...}" in the parser.
7697 * tests/Makefile.am (maintainer-check-valgrind): Set
7698 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
7699 Valgrind.
7700 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
7701 complain.
7702 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
7703 expecting a non-zero exit status sets --leak-check=summary and
7704 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
7705 this case, and we don't want to hear about it.
7706
ac564be4
PE
77072006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7708
7709 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
7710 instead of from the template, to simplify configuration a bit.
7711 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
7712 and m4/wint_t.m4, as they are needed with the latest gnulib.
7713
17bd8a73
JD
77142006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7715
7716 Disable unset/unused mid-rule value warnings by default, and recognize
7717 --warnings=midrule-values to enable them. Discussed starting at
7718 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
7719 * NEWS (2.3a+): Mention.
7720 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
7721 warnings): Add entry for midrule-values subargument.
7722 * src/reader.c (symbol_should_be_used): Don't return true just because
7723 the value is a set/used mid-rule value unless
7724 --warnings=midrule-values was specified.
7725 * tests/input.at (Unused values, Unused values before symbol
7726 declarations): Run tests with and without --warnings=midrule-values.
7727
7728 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
7729 than LIST_FREE directly.
7730
89eb3c76
JD
77312006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7732
7733 Finish implementing --warnings=error, which should not be implied by
7734 --warnings=all (or by its synonyms -W and --warnings without
7735 subarguments).
7736 * src/complain.c (set_warning_issued): New function to report that
7737 warnings are being treated as errors and to record an error if so.
7738 Invoke...
7739 (warn_at, warn): ... here.
7740 * src/getargs.c (warnings_args, warnings_types): Reorder so that
7741 "error - warnings are errors" does not appear above "all - all of the
7742 above".
7743 (getargs): For -W and --warnings without subarguments, don't let
7744 FLAGS_ARGMATCH set warnings_error in warnings_flag.
7745 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
7746
ba7560e2
JD
77472006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7748
7749 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
7750 empty subargument list. For example: `bison --warnings= parser.y'.
7751
31283fc3
JD
77522006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7753
7754 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
7755 the parser header file so that gcc doesn't warn.
7756
12e35840
JD
77572006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7758
7759 Split the default %destructor/%printer into two kinds: <*> and <!>.
7760 Discussed starting at
7761 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
7762 * NEWS (2.3a+): Mention.
7763 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
7764 previous change today related to mid-rules.
148d66d8 7765 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 7766 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
7767 (TYPE_TAG_ANY): Add as <*>.
7768 (TYPE_TAG_NONE): Add as <!>.
7769 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
7770 for <*> and <!>.
7771 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
7772 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
7773 * src/symlist.c (symbol_list_default_new): Split into tagged and
7774 tagless versions.
7775 (symbol_list_destructor_set, symbol_list_printer_set): Split
7776 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
7777 SYMLIST_DEFAULT_TAGLESS.
7778 * src/symlist.h: Update symbol_list_default*_new prototypes.
7779 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
7780 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
7781 * src/symtab.c (default_destructor, default_destructor_location,
7782 default_printer, default_printer_location): Split each into tagged and
7783 tagless versions.
7784 (symbol_destructor_get, symbol_destructor_location_get,
7785 symbol_printer_get, symbol_printer_location_get): Implement tagged
7786 default and tagless default cases.
7787 (default_destructor_set, default_printer_set): Split each into tagged
7788 and tagless versions.
7789 * src/symtab.h: Update prototypes.
7790 * tests/actions.at (Default %printer and %destructor): Rename to...
7791 (Default tagless %printer and %destructor): ... this, and extend.
7792 (Per-type %printer and %destructor): Rename to...
7793 (Default tagged and per-type %printer and %destructor): ... this, and
7794 extend.
7795 (Default %printer and %destructor for user-defined end token): Extend.
7796 (Default %printer and %destructor are not for error or $undefined):
7797 Update.
7798 (Default %printer and %destructor are not for $accept): Update.
7799 (Default %printer and %destructor for mid-rule values): Extend.
7800 * tests/input.at (Default %printer and %destructor redeclared): Extend.
7801 (Unused values with default %destructor): Extend.
7802
f91b1629
JD
78032006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7804
7805 Don't apply the default %destructor/%printer to an unreferenced midrule
7806 value. Mentioned at
7807 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
7808 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
7809 like $@n instead of just @n so that the default %destructor/%printer
7810 logic doesn't see them as user-defined symbols.
7811 (symbol_is_dummy): Check for both forms of the name.
7812 * src/reader.c (packgram): Remove the `$' from each midrule symbol
7813 name for which the midrule value is referenced in any action.
7814 * tests/actions.at (Default %printer and %destructor for mid-rule
7815 values): New test.
7816 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
7817 for change to dummy symbol names.
7818
519d0004
JD
78192006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7820
7821 Warn about unset midrule $$ if the corresponding $n is used.
7822 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
7823 $n usage.
7824 (packgram): Before invoking grammar_rule_check on any rule, make sure
7825 all actions have already been scanned in order to set `used' flags.
7826 Otherwise, checking that a midrule's $$ is set will not always work
7827 properly because the midrule check must forward-reference the midrule's
7828 parent rule.
7829 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
7830 warning.
7831
a501eca9
JD
78322006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7833
7834 More improvements to the documentation of the prologue alternatives:
7835 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
7836 Bison manual.
7837 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
7838 some text to clarify the relative importance of the new directives and
7839 to show how these directives may be viewed as code labels.
7840
2cbe6b7f
JD
78412006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
7842
7843 Similar to the recently removed %before-header, add %code-top as the
7844 alternative to the pre-prologue. Mentioned at
7845 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
7846 Also, let the prologue alternatives appear in the grammar section.
7847 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
7848 (prologue_declaration): Move the existing prologue alternatives to...
7849 (grammar_declaration): ... here and add %code-top.
7850 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
7851
7852 Clean up and extend documentation for the prologue alternatives.
7853 * NEWS (2.3a+): Describe prologue alternatives.
7854 * doc/bison.texinfo (Prologue): Move discussion of prologue
7855 alternatives to...
7856 (Prologue Alternatives): ... this new section, and extend it to discuss
7857 all 4 directives in detail.
148d66d8
JD
7858 (Table of Symbols): Clean up discussion of prologue alternatives and
7859 add %code-top.
2cbe6b7f 7860
e557d3ea
JMG
78612006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7862
7863 DJGPP specific issues.
7864
7865 * djgpp/config.bat: config.hin has been moved to lib. Adjust
7866 config.bat accordingly.
7867 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
7868 * djgpp/config.site: Likewise.
7869
136a0f76
PB
78702006-10-16 Paolo Bonzini <bonzini@gnu.org>
7871
27bd5d67
PB
7872 Replace %*-header with %provides, %requires, %code. See discussion at
7873 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
7874
136a0f76
PB
7875 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
7876 (b4_user_start_header): Remove.
7877 * data/glr.c: Use new macros instead of b4_*start_header
7878 and b4_*end_header.
7879 * data/glr.cc: Likewise.
7880 * data/lalr1.cc: Likewise.
7881 * data/push.c: Likewise.
7882 * data/yacc.c: Likewise.
7883
7884 * doc/bison.texinfo: Remove %before-header, rename
7885 %{start,end,after}-header to %requires, %provides, %code.
7886
7887 * src/parse-gram.y: Likewise (also rename token names accordingly).
7888 * src/scan-gram.l: Likewise.
7889 * tests/actions.at: Likewise.
7890
10f429ef
PE
78912006-10-14 Paul Eggert <eggert@cs.ucla.edu>
7892
7893 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
7894 Problem reported by Joel E. Denny.
7895
78962006-10-14 Jim Meyering <jim@meyering.net>
7897
7898 (Sync from coreutils.)
7899 Work also when the working directory (with e.g. coreutils sources)
7900 is version controlled with git, rather than CVS.
7901 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
7902 rather than CVS.
7903 In messages and comments, say e.g., "checked-out sources",
7904 rather than "CVS sources".
7905 (version_controlled_file): New function. Work for git as well as
7906 for CVS. Don't use grep's -q option.
7907 (slurp): Call it here, in place of CVS-specific code.
7908
c4bd5bf7
JD
79092006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
7910
7911 Fix testsuite for ./configure --enable-gcc-warnings:
7912 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
7913 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
7914 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
7915 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
7916 * test/regression.at (Diagnostic that expects two alternatives):
7917 Likewise.
7918
46356ea4
PE
79192006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7920
231ed89a
PE
7921 * bootstrap.conf (gnulib_modules): Add config-h.
7922 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
7923 worry about HAVE_CONFIG_H.
7924 * lib/abitset.c: Likewise.
7925 * lib/bitset.c: Likewise.
7926 * lib/bitset_stats.c: Likewise.
7927 * lib/bitsetv-print.c: Likewise.
7928 * lib/bitsetv.c: Likewise.
7929 * lib/ebitset.c: Likewise.
7930 * lib/get-errno.c: Likewise.
7931 * lib/lbitset.c: Likewise.
7932 * lib/subpipe.c: Likewise.
7933 * lib/timevar.c: Likewise.
7934 * lib/vbitset.c: Likewise.
7935 * lib/bitset.c: Include "bitset.h" first, to test interface.
7936 * lib/bitset_stats.c: Include "bitset_stats.h" first.
7937 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
7938 * lib/bitsetv.c: Include "bitsetv.h" first.
7939 * lib/get-errno.c: Include "get-errno.h" first.
7940 * m4/.cvsignore: Add config-h.m4.
7941 * tests/actions.at (Default %printer and %destructor for ...):
7942 Adjust expected line numbers in output to reflect removal of #if
7943 HAVE_CONFIG_H lines.
7944 * tests/glr-regression.at (Missed %merge type warnings when ...):
7945 Likewise.
7946 * tests/regression.at (Braced code in declaration in rules section):
7947 Likewise.
7948 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
7949 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
7950 Include <config.h> unconditionally.
7951
46356ea4
PE
7952 * bootstrap: Sync from coreutils, as follows:
7953
7954 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7955
7956 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
7957 variable was sometimes used without being initialized. This
7958 messed up the installation of the INSTALL file in some cases.
7959
7960 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7961
7962 * bootstrap (usage, main program, symlink_to_gnulib): Add option
7963 --copy. Inspired by a suggestion from Bruno Haible.
7964
7965 2006-10-03 Jim Meyering <jim@meyering.net>
7966
7967 * bootstrap: Undo last change to this file, since now gnulib-tool
7968 sticks with the automake default in generating dependencies.
7969
dd4bf078
PE
79702006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7971
cf2a5f7c
PE
7972 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
7973 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
7974
7975 * doc/bison.1: Add copyright notice.
7976
7977 * data/glr.c: Don't include <stdarg.h>; not used.
7978
35fe0834
PE
7979 * NEWS: The -g and --graph options now output graphs in Graphviz
7980 DOT format, not VCG format.
7981 * doc/bison.1: Likewise.
7982 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
7983 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
7984 of this change in
7985 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
7986 * TODO: Remove Graphviz entry.
7987 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
7988 remove vcg.c, vcg.h, vcg_defaults.h.
7989 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
7990 * src/graphviz.c, src/graphviz.h: New files.
7991 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
7992 * src/files.h: Make comment more generic.
7993 * src/main.c (main): Likewise.
7994 * src/print_graph.h: Likewise.
7995 * src/getargs.c (usage): Make usage description more generic.
7996 * src/print_graph.c: Include graphviz.h rather than vcg.h.
7997 (static_graph, fgraph): Remove. All uses changed to pass
7998 arguments instead of sharing a static var.
7999 (print_core, print_actions, print_state, print_graph):
8000 Output graphviz format rather than VCG format.
8001 * tests/.cvsignore: Remove *.vcg; add *.dot.
8002 * tests/output.at: Expect *.dot files, not *.vcg files.
8003
dd4bf078
PE
8004 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
8005 accommodates the 2006-10-08 change.
8006
efdd7421
PE
80072006-10-11 Bob Rossi <bob@brasko.net>
8008
8009 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
8010 (b4_yyssa, b4_yyerror_range): New macros.
8011 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
8012 (yypvarsinit): Remove init of removed fields.
8013 (yypushparse): Remove use of removed fields; use new macros instead.
8014
96a1981a
PE
80152006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8016
8017 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
8018 in a push parser. Reindent slightly to match yacc.c better.
8019
80202006-10-11 Bob Rossi <bob@brasko.net>
8021
46356ea4
PE
8022 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
8023 yymsg_alloc fields.
8024 (yypvarsinit, yypushparse): Remove init of removed fields.
8025 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 8026
c1630a8b
PE
80272006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8028
8029 * THANKS: Add Paolo Bonzini and Bob Rossi.
8030
90b9908d
PB
80312006-10-08 Paolo Bonzini <bonzini@gnu.org>
8032
8033 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
8034 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
8035 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
8036 b4_define_user_cde and uses): Remove.
8037 (b4_comment, b4_prefix, b4_sync_start): New.
8038 * data/bison.m4: New file, with most of the content removed from c.m4.
8039 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
8040 * src/output.c (output_skeleton): Pass bison.m4.
8041 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
8042 only if specified.
8043
cf806753
PE
80442006-10-05 Paul Eggert <eggert@cs.ucla.edu>
8045
8046 Fix test failure reported by Tom Lane in
8047 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
8048 and try to make such failures easier to catch in the future.
8049 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
8050 that's now the caller's responsibility.
8051 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
8052 Set yychar = YYEOF if it's negative.
8053 * tests/actions.at (yylex): Abort if asked to read past EOF.
8054 * tests/conflicts.at (yylex): Likewise.
8055 * tests/cxx-type.at (yylex): Likewise.
8056 * tests/glr-regression.at (yylex): Likewise.
8057 * tests/input.at (yylex): Likewise.
8058 * tests/regression.at (yylex): Likewise.
8059 * tests/torture.at (yylex): Likewise.
8060
0e2f006a
PE
80612006-10-01 Paul Eggert <eggert@cs.ucla.edu>
8062
8063 Fix problems with translating English-language diagnostics.
8064 * bootstrap: Fix bug introduced in recent bootstrap changes, with
8065 respect to bison-runtime pot generation. The YY_ stuff
8066 wasn't being captured.
8067 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
8068 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
8069 * runtime-po/POTFILES.in: Add data/push.c.
8070
e3ddc1e3
PE
80712006-09-29 Paul Eggert <eggert@cs.ucla.edu>
8072
8073 Merge bootstrap changes from coreutils.
8074
8075 2006-09-28 Jim Meyering <jim@meyering.net>
8076
8077 Automatically generated dependencies are important even
8078 when all of the sources in a directory come from gnulib.
8079 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
8080 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
8081
8082 2006-09-23 Jim Meyering <jim@meyering.net>
8083
8084 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
8085
8086 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8087
8088 * bootstrap: Add support for --force.
8089 (usage): New function. Describe usage less tersely.
8090 (CVS_only_file): New var.
8091
01e972b3
PE
80922006-09-21 Paul Eggert <eggert@cs.ucla.edu>
8093
8094 * data/push.c (YYPUSH_MORE): Make it an enum instead.
8095 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
8096 Adjust white space and comments to match GNU style better.
8097
c63d3e90
PE
80982006-09-20 Bob Rossi <bob@brasko.net>
8099
8100 * data/push.c (yyresult_get): Remove function.
8101 (YYPUSH_MORE): Add #define.
8102 (yypushparse): Modify return value.
8103
e70f46d1
PE
81042006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8105
8106 * stamp-h.in: Remove; no longer needed.
8107 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
8108 Remove config.h, config.hin, intl (no longer created).
8109 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
8110 stamp-h1.
8111
8112 Sync bootstrap from coreutils, as follows:
8113
8114 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
8115
8116 * bootstrap (symlink_to_gnulib): New function.
8117 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
8118 to copies-of-gnulib.
8119 (cp_mark_as_generated, slurp, gnulib_files):
8120 Avoid making a copy if it's the same as the old version.
8121 (gnulib_files): Add support for this variable (used by Bison).
8122
a92be413
PE
81232006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8124
8125 * src/getargs.c (usage): Rework to use conventions similar to
8126 coreutils, to make translation a bit easier and the code a bit
8127 smaller. Problem reported by Tim Van Holder.
8128
4f82b42a
PE
81292006-09-15 Paul Eggert <eggert@cs.ucla.edu>
8130
3b2942e6
PE
8131 Use some of gnulib's new modules, taken from coreutils.
8132
8133 * bootstrap: Sync from coreutils, except add support for gnulib_files.
8134 * bootstrap.conf: New file.
8135 (gnulib_modules): Add configmake, inttypes, unistd.
8136 (XGETTEXT_OPTIONS): Add complain, complain_at,
8137 fatal, fatal_at, warn, warn_at, unexpected_end.
8138 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
8139 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
8140 (gl_EARLY): Add.
8141 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
8142 (gl_INIT): Add
8143 (GNULIB_AUTOCONF_SNIPPET): Remove.
8144 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
8145 the pickiest.
8146 * lib/.cvsignore: Add inttypes_.h.
8147 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
8148 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
8149 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
8150 no-longer-necessary initializations.
8151 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
8152 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
8153 use the unistd module.
8154 * src/system.h: Likewise.
8155 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
8156 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
8157 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
8158 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
8159 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
8160 * src/system.h: Include inttypes.h unconditionally, now that we
8161 use the inttypes module. Don't bother to include stdint.h, since
8162 inttypes.h now does that for us.
8163 (LOCALEDIR): Remove, now that we use the configmake module.
8164 * src/getargs.c: Include configmake.h.
8165 * src/main.c: Likewise.
8166 * src/output.c: Likewise.
8167 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
8168 not from $abs_top_builddir, since config.h moved.
8169
8170
4f82b42a
PE
8171 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
8172 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
8173
8174 * src/parse-gram.y (symbol_declaration): Don't put statements
8175 before declarations; it's not portable to C89.
8176 * src/scan-code.l (handle_action_at): Likewise.
8177
8178 * src/scan-code.l: Always initialize braces_level; the old code
8179 left it uninitialized and therefore had undefined behavior.
8180
8181 Don't attempt to redefine 'assert', since it runs afoul of
8182 systems where standard headers (mistakenly) include <assert.h>.
8183 Instead, define and use our own alternative, called 'aver'.
8184 * src/reader.c: Don't include assert.h, since we no longer
8185 use assert.
8186 * src/scan-code.l: Likewise.
8187 * src/system.h (assert): Remove, replacing with....
8188 (aver): New function, taking a bool arg. All uses changed.
8189 * src/tables.c (pack_vector): Ensure that aver arg is bool,
8190 not merely an integer.
8191
31c10e38
PE
81922006-09-15 Bob Rossi <bob@brasko.net>
8193
d6bdb90a
JD
8194 Add support for push parsing. Based on the original work of
8195 Odd Arild Olsen <oao@fibula.no>.
31c10e38
PE
8196 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
8197 * data/c.m4 (YYPUSH): New.
8198 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
d6bdb90a 8199 * data/push.c: New file.
31c10e38
PE
8200 * src/getargs.c (push_parser): New var.
8201 * src/getargs.h (push_parser): New declaration.
8202 * src/output.c (prepare): Add macro insertion of `push_flag'.
8203 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
8204 (prologue_declaration): Parse %push-parser.
8205 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
8206 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
8207 list of removed lines from the traces observed.
8208 (AT_CHECK_CALC_LALR): Added push parser tests.
8209
fa7b79c0
PE
82102006-09-13 Paul Eggert <eggert@cs.ucla.edu>
8211
21fe08ca
PE
8212 * NEWS: Version 2.3a.
8213 * configure.ac (AC_INIT): Likewise.
8214
e8ec4d9b
PE
8215 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
8216 "#define YYSTYPE int" that caused "make maintainer-check" to fail
8217 due to header ordering dependencies. I don't know why the #define
8218 was there.
8219
fa7b79c0
PE
8220 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
8221 runtime cost when YYDEBUG is not defined, and so that some tests
8222 that used to fail now work. Problem and initial suggestion by
8223 Paolo Bonzini.
8224 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
8225 * data/glr.cc (b4_parser_class_name):
8226 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
8227 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
8228 (yydebug_) [YYDEBUG]: New member.
8229 (yycdebug_): Now defined only if YYDEBUG.
8230 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
8231 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
8232 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
8233 if YYYDEBUG.
8234 (debug_stream, set_debug_stream, debug_level, set_debug_level):
8235 Define only if YYDEBUG.
8236 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
8237 set_debug_level.
8238 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
8239 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
8240 AT_CHECK_CALC_GLR_CC that are working now.
8241
4ec13d60
PE
82422006-09-12 Paul Eggert <eggert@cs.ucla.edu>
8243
8244 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
8245 We don't need them in glr.cc, and glr.c defines them.
8246 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
8247 assumes that defining it to anything is the same as defining
8248 it to 1. Problem reported by Paolo Bonzini.
8249
8e1687ae
PE
82502006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
8251
8252 * data/c.m4 (b4_null, b4_case): Define.
8253 * src/output.c (prepare_symbols): Use b4_null.
8254 (user_actions_output): Use b4_case.
8255
3dc5e96b
PE
82562006-09-11 Paul Eggert <eggert@cs.ucla.edu>
8257
aef3da86
PE
8258 * data/glr.c (b4_shared_declarations): Put start-header first,
8259 before any #includes that we generate, so that feature-test
8260 macros work. Problem reported by Michael Deutschmann in
8261 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
8262 * data/lalr1.cc: Likewise.
8263 * doc/bison.texinfo (Prologue): Document that feature-test macros
8264 should be defined before any Bison declarations.
8265 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
8266 that depend on location.hh after, not before, Bison decls, since
8267 we now include location.hh after the first user prologue.
8268
3dc5e96b
PE
8269 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
8270 Sander Brandenburg in
8271 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
8272 Also, fix minor white space and comment issues.
aef3da86
PE
8273 (Prologue): Mention that it's better to define feature-test macros
8274 before Bison declarations. Problem reported by Michael Deutschmann.
8275
8276 * README-cvs: Fix typo: "&" should be "&&". Problem reported
8277 by Jim Meyering.
8278 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
8279 This adjusts to recent gnulib changes.
3dc5e96b 8280
b2a0b7ca
JD
82812006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8282
8283 Finish implementation of per-type %destructor/%printer. Discussed
8284 starting at
8285 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
8286 and
8287 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
8288 * NEWS (2.3+): Add a description of this feature to the default
8289 %destructor/%printer description.
8290 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
8291 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
8292 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
8293 list node contains a semantic type.
8294 * src/symtab.c, src/symtab.h: Extend with a table that associates
8295 semantic types with their %destructor's and %printer's.
8296 (semantic_type_from_uniqstr, semantic_type_get,
8297 semantic_type_destructor_set, semantic_type_printer_set): New functions
8298 composing the public interface of that table.
8299 (symbol_destructor_get, symbol_destructor_location_get,
8300 symbol_printer_get, symbol_printer_location_get): If there's no
8301 per-symbol %destructor/%printer, look up the per-type before trying
8302 the default.
8303 * tests/actions.at (Per-type %printer and %destructor): New test case.
8304 * tests/input.at (Default %printer and %destructor redeclared):
8305 Extend to check that multiple occurrences of %symbol-default in a
8306 single %destructor/%printer declaration is an error.
8307 (Per-type %printer and %destructor redeclared, Unused values with
8308 per-type %destructor): New test cases.
8309
3be03b13
JD
83102006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8311
8312 Require default %destructor/%printer to be declared using
8313 %symbol-default instead of an empty symbol list, and start working on
8314 new per-type %destructor/%printer. Discussed at
8315 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
8316 * NEWS (2.3+): Add %symbol-default to example.
8317 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 8318 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
8319 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
8320 (generic_symlist, generic_symlist_item): New nonterminals for creating
8321 a list in which each item is a symbol, semantic type, or
8322 %symbol-default.
8323 (grammar_declaration): Use generic_symlist in %destructor and %printer
8324 declarations instead of symbols.1 or an empty list.
8325 (symbol_declaration, precedence_declaration, symbols.1): Update actions
8326 for changes to symbol_list.
8327 * src/reader.c: Update for changes to symbol_list.
8328 * src/scan-code.l: Likewise.
8329 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
8330 * src/symlist.c, src/symlist.h: Extend such that a list node may
8331 represent a semantic type or a %symbol-default in addition to just an
8332 ordinary symbol. Add switched functions for setting %destructor's and
8333 %printer's.
8334 * tests/actions.at, tests/input.at: Add %symbol-default to all default
8335 %destructor/%printer declarations.
8336
3508ce36
JD
83372006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
8338
8339 Whether the default %destructor/%printer applies to a particular symbol
8340 isn't a question of whether the user *declares* that symbol (in %token,
8341 for example). It's a question of whether the user by any means
8342 *defines* the symbol at all (by simply using a char token, for
8343 example). $end is defined by Bison whereas any other token with token
8344 number 0 is defined by the user. The error token is always defined by
8345 Bison regardless of whether the user declares it with %token, but we
8346 may one day let the user define error as a nonterminal instead.
8347 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
8348 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
8349 the meaning of "user-defined".
8350 * tests/actions.at (Default %printer and %destructor for user-declared
8351 end token): Rename to...
8352 (Default %printer and %destructor for user-defined end token): ...
8353 this.
8354
8355 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
8356 computation of whether to apply the default, don't maintain a list of
8357 every Bison-defined symbol. Instead, just check for a first character
8358 of '$', which a user symbol cannot have, and check for the error token.
8359
9350499c
JD
83602006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
8361
8362 Don't apply the default %destructor or %printer to the error token,
8363 $undefined, or $accept. This change fits the general rule that the
8364 default %destructor and %printer are only for user-declared symbols,
8365 and it solves several difficulties that are described in the new test
8366 cases listed below.
8367 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
8368 * tests/actions.at (Default %printer and %destructor are not for error
8369 or $undefined, Default %printer and %destructor are not for $accept):
8370 New test cases.
8371
4d7370cb
JD
83722006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
8373
8374 Allow %start after the first rule.
8375 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
8376 when parsing the first rule.
8377 (check_and_convert_grammar): Search for it here after all grammar
8378 declarations have been parsed. Skip midrules, which have dummy LHS
8379 nonterminals.
8380 * src/symtab.c (symbol_is_dummy): New function.
8381 * src/symtab.h (symbol_is_dummy): Declare it.
8382 * tests/input.at (%start after first rule): New test.
8383
6d0ef4ec
JD
83842006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8385
8386 Redo some of the previous commit: add back the ability to use
8387 non-aliased/undeclared string literals since it might be useful to
8388 those declaring %token-table.
8389 * src/reader.c (check_and_convert_grammar): Undo changes in previous
8390 commit: don't worry about complaints from symbols_pack.
8391 * src/symtab.c (symbol_new, symbol_class_set,
8392 symbol_check_alias_consistency): Undo changes in previous commit: count
8393 each string literal as a new symbol and token, assign it a symbol
8394 number, and don't complain about non-aliased string literals.
8395 (symbols_pack): Since symbol_make_alias still does not decrement symbol
8396 and token counts but does still set aliased tokens to the same number,
8397 symbol_pack_processor now leaves empty slots in the symbols array.
8398 Remove those slots.
8399 * tests/regression.at (Undeclared string literal): Remove test case
8400 added in previous commit since non-aliased string literals are allowed
8401 again.
8402 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
8403 remove unnecessary string literal declarations.
8404 * tests/sets.at (Firsts): Likewise.
8405
965537bc
JD
84062006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8407
8408 Don't allow an undeclared string literal, but allow a string literal to
8409 be used before its declaration.
8410 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
8411 symbols_pack complained.
8412 * src/symtab.c (symbol_new): Don't count a string literal as a new
8413 symbol.
8414 (symbol_class_set): Don't count a string literal as a new token, and
8415 don't assign it a symbol number since symbol_make_alias does that.
8416 (symbol_make_alias): It's not necessary to decrement the symbol and
8417 token counts anymore. Don't assume that an alias declaration occurs
8418 before any uses of the identifier or string, and thus don't assert that
8419 one of them has the highest symbol number so far.
8420 (symbol_check_alias_consistency): Complain if there's a string literal
8421 that wasn't declared as an alias.
8422 (symbols_pack): Bail if symbol_check_alias_consistency failed since
8423 symbol_pack asserts that every token has been assigned a symbol number
8424 although undeclared string literals have not.
8425 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 8426 string literal): New test cases.
965537bc
JD
8427 (Characters Escapes, Web2c Actions): Declare string literals as
8428 aliases.
8429 * tests/sets.at (Firsts): Likewise.
8430
47aee066
JD
84312006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
8432
8433 In the grammar scanner, STRING_FINISH unclosed constructs and return
8434 them to the parser in order to improve error messages.
8435 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
8436 SC_BRACED_CODE, SC_PROLOGUE): Implement.
8437 * tests/input.at (Unclosed constructs): New test case.
8438 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
8439 seen.
8440
8441 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
8442 unused global.
8443
1f6b3679
JD
84442006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
8445
8446 Handle string aliases for character tokens correctly.
8447 * src/symtab.c (symbol_user_token_number_set): If the token has an
8448 alias, check and set its alias's user token number instead of its own,
8449 which is set to indicate the alias. Previously, every occurrence of
8450 the character token in the grammar overwrote that alias indicator with
8451 the character code.
8452 * tests/input.at (String aliases for character tokens): New test.
8453
219741d8
JD
84542006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
8455
8456 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
8457
11daa4e7
PE
84582006-08-11 Paul Eggert <eggert@cs.ucla.edu>
8459
8460 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
8461 to prevent failures when building on older platforms.
8462 Check for autopoint failure.
8463 Set XGETTEXT_OPTIONS to values that check for C format strings,
8464 so that translators are warned about them (this also helps
8465 prevent core dumps).
8466
8467 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
8468 function, since it simplifies our code a bit.
8469
8470 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
8471 rather than -W, so we don't get bogus warnings about sign comparisons.
8472 Add -Wpointer-arith, since that warning is useful (it reports code
8473 that does not conform to C89 and that some compilers reject).
8474 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
8475 since it's no longer needed.
8476
f9bfc42a
JD
84772006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
8478
8479 Clean up scanners a bit.
8480 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
8481 definitions so gcc won't warn when obstack_for_string is unused.
8482 * src/scan-code.l: config.h and system.h are already #include'd by
8483 scan-code-c.c, so get rid of them here.
8484 * src/scan-gram.l: Likewise.
8485 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
8486 definitions rather than duplicating the rest of it.
8487 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
8488
06e8700a
JD
84892006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
8490
8491 Suppress signed/unsigned comparison warnings for yycheck.
8492 * data/c.m4 (b4_safest_int_type): New macro.
8493 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
8494 a signed int type, cast it to b4_safest_int_type first.
8495 * data/yacc.c: Likewise.
8496 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
8497 also overwritten.
8498
9c437126
PE
84992006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
8500
8501 * doc/bison.texinfo: Fix some typos.
8502
284d8a13
PE
85032006-08-02 Paul Eggert <eggert@cs.ucla.edu>
8504
8505 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
8506 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
8507
8508 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
8509 the latest gnulib does this a different way.
8510 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
8511 translation was patched, so stop omitting it.
8512
ec5479ce
JD
85132006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8514
8515 Enable declaration of default %printer/%destructor. Make the parser
8516 use these for all user-declared grammar symbols for which the user does
8517 not declare a specific %printer/%destructor. Thus, the parser uses it
8518 for token 0 if the user declares it but not if Bison generates it as
8519 $end. Discussed starting at
8520 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
8521 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
8522 and
8523 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
8524 * NEWS (2.3+): Mention.
8525 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
8526 declare a %destructor for a mid-rule's semantic value. It's just
8527 impossible to declare one specific to it.
8528 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
8529 code. Describe default %destructor form.
8530 * src/parse-gram.y (grammar_declaration): Parse default
8531 %printer/%destructor declarations.
8532 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
8533 and symbol_destructor_location_get rather than accessing the destructor
8534 and destructor_location members of struct symbol.
8535 (symbol_printers_output): Likewise but for %printer's.
8536 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
8537 again.
8538 * src/symtab.c (default_destructor, default_destructor_location,
8539 default_printer, default_printer_location): New static global
8540 variables to record the default %destructor and %printer.
8541 (symbol_destructor_get, symbol_destructor_location_get,
8542 symbol_printer_get, symbol_printer_location_get): New functions to
8543 compute the appropriate %destructor and %printer for a symbol.
8544 (default_destructor_set, default_printer_set): New functions to set the
8545 default %destructor and %printer.
8546 * src/symtab.h: Prototype all those new functions.
8547 * tests/actions.at (Default %printer and %destructor): New test to
8548 check that the right %printer and %destructor are called, that they're
8549 not called for $end, and that $$ and @$ work correctly.
8550 (Default %printer and %destructor for user-declared end token): New
8551 test to check that the default %printer and %destructor are called for
8552 a user-declared end token.
8553 * tests/input.at (Default %printer and %destructor redeclared, Unused
8554 values with default %destructor): New tests to check related grammar
8555 warnings and errors.
8556
868d2d96
JD
85572006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8558
8559 Clean up handling of %destructor for the end token (token 0).
8560 Discussed starting at
8561 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
8562 and
8563 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
8564
8565 Make the skeletons consistent in how they pop the end token and invoke
8566 its %destructor.
8567 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
8568 state, which has token number 0, since this would invoke the
8569 %destructor for the end token.
8570 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
8571 until after shifting the end token, or else it won't be popped.
8572 * data/yacc.c (yyparse): Likewise.
8573
8574 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
8575 it's the end token. Upon termination, destroy an unshifted lookahead
8576 even when it's the end token.
8577 * data/lalr1.cc (yy::parser::parse): Likewise.
8578 * data/yacc.c (yyparse): Likewise.
8579
8580 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
8581 value warnings for the end token when the user gives the end token a
8582 %destructor.
8583
8584 * tests/actions.at (Printers and Destructors): Test all the above.
8585
62a9592d
PE
85862006-07-24 Paul Eggert <eggert@cs.ucla.edu>
8587
8588 Update to latest gnulib and gettext versions.
8589 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
8590 Add fopen-safer.
8591 (gnulib_files): Add m4/warning.m4. Don't worry about files
8592 overwritten by autopoint.
8593 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
8594 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
8595 rejects them.
8596 Don't use autoreconf; instead, invoke autopoint etc. by hand,
8597 so that we can remove the intl files at a better time.
8598 (intl_files_to_remove): Remove aclocal.m4, since it gets
8599 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
8600 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
8601 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
8602 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
8603 Remove datarootdir hack; no longer needed.
8604 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
8605 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
8606 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
8607 strdup.h.
8608 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
8609 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
8610
10d6970f
PE
86112006-07-20 Paul Eggert <eggert@cs.ucla.edu>
8612
8613 * bootstrap: Adjust to today's change to gnulib-tool by invoking
8614 it with --assume-autoconf='latest-stable'.
8615
50a33993
JD
86162006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
8617
8618 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
8619 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
8620 YYSTYPE' and `{'.
8621 * src/muscle_tab.h (muscle_grow): Replace the header comments with
8622 those from muscle_tab.c since the old ones are misleading.
8623
2ce4ed68
AD
86242006-07-13 Akim Demaille <akim@epita.fr>
8625
8626 Support %define "KEY" {VALUE}.
8627 * src/scan-code.h, src/scan-code.l (translate_action)
8628 (translate_rule_action, translate_symbol_action, translate_code):
8629 Return char *, not const char *.
8630 * src/parse-gram.y (declaration): Rename as...
8631 (prologue_declaration): this.
8632 (string_content): Remove this nonterminal, use STRING.
8633 (braceless, content, content.opt): New nonterminal.
8634 Use them.
8635 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
8636 as value.
8637 * src/scan-gram.l (getargs.h): Don't include it.
8638
db7e5eb5
PE
86392006-07-12 Paul Eggert <eggert@cs.ucla.edu>
8640
8641 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
8642 rather than a for-loop that declares a local bool variable. This
8643 should work around a compatibility problem with a Cray x1e C++
8644 compiler reported by Hung Nguyen in
8645 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
8646 The for-loop was introduced in the 2004-11-17 change but I don't
8647 know why it was needed.
8648
a5d80ba5
AD
86492006-07-12 Akim Demaille <akim@epita.fr>
8650
8651 * data/c.m4: Comment changes.
8652
23eb2a69
AD
86532006-07-10 Akim Demaille <akim@lrde.epita.fr>
8654
8655 * src/complain.c (error_message, ERROR_MESSAGE): New.
8656 To factor...
8657 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
8658 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
8659
ddc8ede1
PE
86602006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8661
8662 * NEWS: Instead of %union, you can define and use your own union type
8663 YYSTYPE if your grammar contains at least one <type> tag.
8664 Your YYSTYPE need not be a macro; it can be a typedef.
8665 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
8666 (Union Decl, Decl Summary): Document this.
8667 * data/glr.c (YYSTYPE): Implement this.
8668 * data/glr.cc (YYSTYPE): Likewise.
8669 * data/lalr1.cc (YYSTYPE): Likewise.
8670 * data/yacc.c (YYSTYPE): Likewise.
8671 * src/output.c (prepare): Output tag_seen_flag.
8672 * src/parse-gram.y (declaration, grammar_declaration):
8673 Use 'union_seen' rather than 'typed' to determine whether
8674 %union has been seen, since grammars can now be typed without
8675 %union.
8676 (symbol_declaration, type.opt, symbol_def):
8677 Keep track of whether a tag has been seen.
8678 * src/reader.c (union_seen, tag_seen): New vars.
8679 (typed): remove.
8680 * src/reader.h (union_seen, tag_seen, typed): Likewise.
8681 * src/scan-code.l (untyped_var_seen): New variable.
8682 (handle_action_dollar): Adjust to above changes.
8683 (handle_action_dollar, handle_action_at):
8684 Improve overflow checking for outlandish numbers.
8685 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
8686 avoid new diagnostics generated by above changes.
8687 * tests/regression.at (YYSTYPE typedef): Add test to check
8688 for type tags without %union.
8689
8690 * src/symlist.c (symbol_list_length): Return int, not unsigned
8691 int, since callers expect int. This may need to get revisited
8692 once we have proper integer overflow checking.
8693
8694 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
8695 object is now static.
8696
8697 * src/getargs.c (flags_argmatch): Return void, not int,
8698 to pacify ./configure --enable-gcc-warnings.
8699
8700 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
8701 since last_string is already defined to FLEX_PREFIX (last_string).
8702
7b42569e
AD
87032006-07-09 Akim Demaille <akim@lrde.epita.fr>
8704
8705 Implement --warnings/-W.
8706 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
8707 replaced by...
8708 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
8709 Adjust callers.
8710 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
8711 (warnings_args, warnings_types): New.
8712 (getargs, short_options, long_options): Accept -W/--warnings.
8713 Sort the options by alphabetical order, upper case letter right
8714 before its lower case.
8715
3b452f4e
JD
87162006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
8717
8718 Change %merge result type clash warnings to errors. Discussed at
8719 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
8720 * src/reader.c (record_merge_function_type): Use complain_at.
8721 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8722 declared later): Update test case results.
8723
b8a41559
AD
87242006-07-09 Akim Demaille <akim@lrde.epita.fr>
8725
8726 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
8727 to be in alphabetical order.
8728 (trace_args): Spelling fixes.
8729
cd9e1ba2
PE
87302006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8731
8732 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
8733 so they don't collide with user-defined macros.
8734 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
8735 this was never guaranteed, and now that we're using gnulib stdint,
8736 which defines int_fast16_t to long int, the problem is exposed.
8737
cb48f191
PE
87382006-07-08 Paul Eggert <eggert@cs.ucla.edu>
8739
b8445a15
PE
8740 * data/c.m4 (b4_basename): Simplify a bit, since we don't
8741 need the full POSIX semantics (and weren't implementing them
8742 anyway).
8743
cb48f191
PE
8744 Adjust to Autoconf 2.60 and today's gnulib.
8745 * bootstrap (gnulib_modules): Add stdint.
8746 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
8747 no longer copies it.
8748 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
8749 since stdint needs the former and wcwidth (which is now required
8750 by mbswidth) needs the latter.
8751 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
8752 work around a compatibility glitch between gettext 0.14.6 and
8753 Autoconf 2.60.
8754 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
8755 Do not check for uintptr_t, since new stdint module does the right
8756 thing.
8757 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
8758 Add stdint.h, stdint_.h, wcwidth.h.
8759 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
8760 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
8761 stdint.m4, wchar_t.m4, wcwidth.m4.
8762 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
8763 usual order for ../lib/*.h files.
8764 (file_name_split): Use last_component, not base_name, to adjust
8765 to gnulib changes.
8766 * src/parse-gram.h: Include <strverscmp.h> in the usual order
8767 for ../lib/*.h files.
8768 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
8769 Define unconditionally, since we now assume the stdint module.
8770 * src/scan-skel.l: Include <dirname.h>.
8771 (BASE_QPUTS): Use last_component, not base_name.
8772 * src/system.h: Include <unlocked-io.h> in the usual order
8773 for ../lib/*.h files. Include <stdint.h> unconditionally,
8774 since we now use the stdint module.
8775 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
8776 HAVE_UINTPTR_T, since we now use the stdint module.
8777 (base_name): Remove decl, since files now include <dirname.h>
8778 to get the decl.
8779
cd48d21d
AD
87802006-07-08 Akim Demaille <akim@lrde.epita.fr>
8781
8782 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
8783 New, default to 1.
8784 * data/yacc.c, data/glr.c, data/location.cc: Use them.
8785 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
8786 default.
8787 * tests/calc.at: Adjust.
8788
8ec0a172
AD
87892006-07-08 Akim Demaille <akim@lrde.epita.fr>
8790
b8445a15 8791 * data/c.m4 (b4_basename): New.
8ec0a172
AD
8792 (b4_syncline): Also output the location of its invocation (from
8793 the skeleton).
8794 (b4_user_action, b4_define_user_action, b4_user_actions)
8795 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
8796 (b4_user_stype): New.
8797 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
8798
4a678af8
JD
87992006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8800
8801 In the grammar file, the first column is 1 not 0 on the first line as
8802 on every other line.
8803 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
8804 * tests/input.at (Torturing the Scanner): Update output.
8805
8806 * src/scan-gram.l (scanner_cursor): Declare it static.
8807
dd60572a
JD
88082006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8809
8810 In warnings, say "previous declaration" rather than "first
8811 declaration".
8812 * src/symtab.c (redeclaration): Do that here.
8813 * src/reader.c (record_merge_function_type): In the case of a result
8814 type clash, report the previous declaration rather than the very first
8815 one in the grammar file.
8816 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8817 declared later): Add a third declaration to check this behavior.
8818 * tests/input.at (Incompatible Aliases): Update output.
8819
2073e1b6
AD
88202006-06-27 Akim Demaille <akim@epita.fr>
8821
8822 * doc/Doxyfile.in: New.
8823 * doc/Makefile.am: Use it.
8824 * src/lalr.h, src/symtab.h: Initial doxygenation.
8825
8ee5b538
JD
88262006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8827
8828 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
8829 declared after the %merge. This continues the effort of the previous
8830 patch.
8ee5b538
JD
8831 * src/reader.c (get_merge_function): Don't set the merger type yet.
8832 (record_merge_function_type): New function for setting the merger type
8833 and checking for clashes.
8834 (grammar_current_rule_merge_set): Set the location of the %merge for
8835 the current rule.
8836 (packgram): Invoke record_merge_function_type for each rule now that
8837 all symbol type declarations have been parsed.
8838 * src/reader.h (merger_list.type_declaration_location): New member
8839 storing the location of the first %merge from which the type for this
8840 merging function was derived.
8841 * src/symlist.h (symbol_list.merger_declaration_location): New member
8842 storing the location of a rule's %merge, if any.
8843 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8844 declared later): New test to catch the error fixed by the above patch.
8845
ffa4ba3a
JD
88462006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8847
8848 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
8849 declarations appear after the rules. Discussed at
8850 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
8851 and
8852 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
8853 Don't mistake the type of $$ in a midrule to be that of its parent
8854 rule's $$.
ffa4ba3a
JD
8855 * src/reader.c (grammar_current_rule_end): Don't invoke
8856 grammar_rule_check yet since not all symbol declarations may have been
8857 parsed yet.
8858 (grammar_midrule_action): Likewise.
8859 Don't record whether the midrule's $$ has been used yet since actions
8860 haven't been translated yet.
8861 Record the midrule's parent rule and its RHS index within the parent
8862 rule.
8863 (grammar_current_rule_action_append): Don't translate the action yet
8864 since not all symbol declarations may have been parsed yet and, thus,
8865 warnings about types for $$, $n, @$, and @n can't be reported yet.
8866 (packgram): Translate the action and invoke grammar_rule_check now that
8867 all symbol declarations have been parsed.
8868 * src/scan-code.l (handle_action_dollar): Now that this is invoked
8869 after parsing the entire grammar file, the symbol list here in the case
8870 of a midrule is actually the midrule's empty RHS, so reference its
8871 parent rule's RHS where necessary.
8872 On the other hand, now that you can already know it's a midrule, you
8873 aren't forced to think $$ has the same type as its parent rule's $$.
8874 (handle_action_at): In the case of a midrule, reference the parent rule
8875 where necessary.
8876 * src/symlist.c (symbol_list_new): Initialize new midrule-related
8877 members.
8878 (symbol_list_length): Now that this is invoked after all rules have
8879 been parsed, a NULL symbol (rather than a NULL symbol list node)
8880 terminates a rule. symbol_list_print already does this correctly.
8881 * src/symlist.h (symbol_list.midrule_parent_rule,
8882 symbol_list.midrule_parent_rhs_index): New members so that midrules can
8883 remember their relationships with their parents.
8884 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
8885 fixed by the above patch.
8886 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
8887 implementing...
8888 (Unused values): ... this old test case and...
8889 (Unused values before symbol declarations): ... this new test case.
8890 This one is the same as `Unused values' except that all symbol
8891 declarations appear after the rules in order to catch the rest of the
8892 errors fixed by the above patch.
8893
e256e17f
JD
88942006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8895
300a1930
JD
8896 More cleanup.
8897 * src/reader.c (current_rule): Declare it static since it's no longer
8898 used outside this file.
8899 (grammar_current_rule_action_append): Remove redundant arguments from
8900 translate_rule_action invocation.
8901 * src/reader.h (current_rule): Remove this unused extern.
8902 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
8903 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 8904
381ecb06
JD
89052006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
8906
8907 Clean up yesterday's patch.
8908 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
8909 to...
8910 * src/reader.c (grammar_current_rule_action_append): ... here for
8911 consistency with grammar_current_rule_symbol_append.
8912 * tests/regression.at (Braced code in declaration in rules section):
8913 Make yyerror and yylex static as usual.
8914
4210cd0b
JD
89152006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
8916
8917 Fix bug that mistakes braced code in a declaration in the rules section
8918 to be a rule action. Mentioned at
8919 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
8920 * src/scan-gram.l: Move midrule action detection from the start of the
8921 scanning of any braced code to...
8922 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
8923 action. For readability, use $2 and @2 rather than the equivalent
8924 global variables.
8925 * tests/regression.at (Braced code in declaration in rules section):
8926 New test to catch the error fixed by the above patch.
8927
8928 Work on code readability some.
8929 * src/scan-code.l (current_rule): Get rid of this misleading and
8930 redundant declaration: it's actually extern'ed in reader.h.
8931 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
8932 translate_action): Add a rule argument and use it instead of the global
8933 current_rule.
8934 (translate_rule_action): This already receives current_rule through an
8935 argument, so pass it on to translate_action instead of assigning
8936 current_rule to current_rule.
8937 (translate_symbol_action, translate_code): Pass rule = NULL to
8938 translate_action.
8939
34f98f46
JD
89402006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
8941
8942 Rename %before-definitions to %start-header and %after-definitions to
8943 %end-header. Don't use these declarations to separate pre-prologue
8944 blocks from post-prologue blocks. Add new order-independent
8945 declarations %before-header and %after-header as alternatives to the
8946 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
8947 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
8948 * NEWS (2.3+): Update for these changes.
8949 * data/glr.c (b4_before_definitions): Update to...
8950 (b4_start_header): ... this.
8951 (b4_after_definitions): Update to...
8952 (b4_end_header): ... this.
8953 * data/glr.cc: Likewise.
8954 * data/lalr1.cc: Likewise.
8955 * data/yacc.c: Likewise.
8956 * doc/bison.texinfo (The prologue): Update names, and replace remaining
8957 prologue blocks with %*-header declarations.
8958 (Calc++ Parser): Likewise.
91661ebb 8959 (Decl Summary): Update names.
148d66d8 8960 (Table of Symbols): Update description.
34f98f46
JD
8961 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
8962 (PERCENT_END_HEADER): ... this.
8963 (PERCENT_BEFORE_DEFINITIONS): Update to...
8964 (PERCENT_START_HEADER): ... this.
8965 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8966 (declaration): Update token names and m4 macro names.
8967 When parsing %end-header and %start-header, invoke translate_code
8968 before muscle_code_grow, and no longer set global booleans to remember
8969 whether these declarations have been seen.
8970 Parse new %after-header and %before-header.
8971 * src/reader.c (before_definitions, after_definitions): Remove.
8972 (prologue_augment): Accept a new bool argument to specify whether to
8973 augment the pre-prologue or post-prologue.
8974 * src/reader.h (before_definitions, after_definitions): Remove these
8975 extern's.
8976 (prologue_augment): Add new bool argument.
8977 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
8978 (PERCENT_END_HEADER): ... this.
8979 (PERCENT_BEFORE_DEFINITIONS): Update to...
8980 (PERCENT_START_HEADER): ... this.
8981 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8982 * tests/actions.at (Printers and Destructors): Update names.
8983
31b2b07e
JD
89842006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
8985
8986 Add comparison operators for C++ location classes. Discussed at
8987 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
8988 * data/c++.m4 (b4_define_location_comparison): New boolean %define
8989 declaration indicating whether filename_type has an operator==. If
8990 filename_type is `std::string', it defaults to `1', `0' otherwise.
8991 * data/location.cc: Iff b4_define_location_comparison is `1', add
8992 operator== and operator!= for class position and for class location.
8993
8994 Some minor fixes.
8995 * src/scan-action.l: Remove unused file.
8996 * src/symtab.c (symbol_printer_set): Use printer_location not
8997 destructor_location.
8998 * src/symtab.h (struct symbol): Replace incorrect source comment for
8999 printer members.
9000 * tests/input.at (Incompatible Aliases): Update output with correct
9001 printer location.
9002
9bc0dd67
JD
90032006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
9004
9005 Don't put the pre-prologue in the header file. For the yacc.c code
9006 file and the glr.c header and code files, move the pre-prologue before
9007 the token definitions. Add new %before-definitions and
9008 %after-definitions to declare code that will go in both the header file
9009 and code file. Discussed at
9010 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
9011 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
9012 and
9013 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
9014 * NEWS (2.3+): Describe these changes.
9015 * data/glr.c (b4_pre_prologue): Move from within to before...
9016 (b4_shared_declarations): ... this.
9017 Add new b4_before_definitions before b4_token_enums.
9018 Add new b4_after_definitions at the end.
9019 * data/glr.cc (b4_pre_prologue): Replace with...
9020 (b4_before_definitions): ... this in the header file.
9021 (b4_after_definitions): New near the end of the header file.
9022 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
9023 code file right before including the header file.
9024 (b4_before_definitions): New in the previous position of
9025 b4_pre_prologue in the header file.
9026 (b4_after_definitions): New near the end of the header file.
9027 * data/yacc.c: Clean up some m4 quoting especially in the header file.
9028 (b4_token_enums_defines): In the code file, move to right before
9029 YYSTYPE for consistency with the header file.
9030 (b4_before_definitions): New right before b4_token_enums_defines in
9031 both the header and code file.
9032 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
9033 header and code file.
9034 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
9035 of prologues for %union dependencies.
91661ebb
JD
9036 (Decl Summary): In %defines description, mention the effect of
9037 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
9038 (Calc++ Parser): Forward declare driver in a %before-definitions rather
9039 than in the pre-prologue so that make check succeeds.
148d66d8 9040 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
9041 %after-definitions.
9042 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
9043 %before-definitions.
9044 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
9045 (declaration): Parse those declarations and append to
9046 b4_before_definitions and b4_after_definitions, respectively.
9047 * src/reader.c (before_definitions, after_definitions): New bools to
9048 track whether those declarations have been seen.
9049 (prologue_augment): Add to the post-prologue if %union,
9050 %before-definitions, or %after-definitions has been seen.
9051 * src/reader.h (before_definitions, after_definitions): New extern's.
9052 * src/scan-gram.l: Scan the new declarations.
9053 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
9054 prologue block in a %before-definitions or a %after-definitions based
9055 on whether the %union is declared.
9056 * tests/regression.at (Early token definitions with --yacc, Early token
9057 definitions without --yacc): Move tests for token definitions into the
9058 post-prologue since token names are no longer defined in the
9059 pre-prologue.
9060
203b9274
AD
90612006-06-20 Akim Demaille <akim@epita.fr>
9062
9063 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
9064 (symbol_get): Use it.
9065 * src/parse-gram.y: Use it.
9066
a7ee59cf
JD
90672006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
9068
9069 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
9070 build succeeds when configured with --enable-gcc-warnings.
9071
5a2baae7
PE
90722006-06-19 Paul Eggert <eggert@cs.ucla.edu>
9073
33ad1a9c
PE
9074 * src/parse-gram.y (char_name): New function.
9075 (CHAR, STRING, string_content): For %printer, properly escape.
9076 (ID): Prefer fputs to fprintf.
9077 (id): Reindent to be consistent with other rules.
9078 Properly quote char.
9079
5a2baae7
PE
9080 The Translation Project changed its way of publishing translations
9081 to maintainers. I haven't received any responses to my request
9082 for supporting the old way, or for documenting the new way. I
9083 have modified 'bootstrap' to use screen scraping
9084 (in this case, HTML scraping). This is unreliable and inelegant,
9085 but I don't see any better way. Yuck.
9086 * bootstrap (TP_URL, WGET_COMMAND): New vars.
9087 (get_translations): New function, which uses HTML scraping to
9088 deduce locations of latest translations.
9089 Use this function to grab both bison and bison-runtime .po files.
9090 Don't bother priming the pump for the runtime-po domain any more,
9091 as it's now translated better than bison is.
9092
58d7a1a1
AD
90932006-06-19 Akim Demaille <akim@epita.fr>
9094
9095 * src/scan-gram.l: No longer "parse" things after `%union' until
9096 `{'. Rather, return a single "%union" token.
9097 No longer make symbols: return strings, and leave the conversion
9098 to symbols to the parser.
9099 (SC_PRE_CODE, token_type): Remove.
9100 * src/parse-gram.y (%union): New field `character'.
9101 Sort tokens.
9102 (CHAR): New token.
9103 (ID, ID_COLON): Now that the scanner no longer makes them
9104 identifiers, adjust all uses to invoke symbol_get.
9105 (id_colon): New, wraps the conversion from string to symbol.
9106 (%union): Accept a possible union_name.
9107 (symbol): Now can be a char.
9108 * data/c.m4 (b4_union_name): Leave a default value.
9109 * data/glr.c, data/yacc.c: Use it.
9110
b931235e
JD
91112006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
9112
9113 For associating token numbers with token names for "yacc.c", don't use
9114 #define statements unless `--yacc' is specified; always use enum
9115 yytokentype. Most important discussions start at:
9116 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
9117 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
9118 and
9119 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
9120 * NEWS (2.3+): Mention.
9121 * data/c.m4 (b4_yacc_if): New.
9122 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
9123 token #define's.
9124 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
9125 on token name definitions.
9126 * src/getargs.c (usage): Capitalize `Yacc' in English.
9127 * src/output.c (prepare): Define b4_yacc_flag.
9128 * tests/regression.at (Early token definitions): Test that tokens names
9129 are defined before the pre-prologue not just before the post-prologue.
9130 Remove this test case and copy to...
9131 (Early token definitions with --yacc): ... this to test #define's.
9132 (Early token definitions without --yacc): ... and this to test enums.
9133
9e6e7ed2
PE
91342006-06-11 Paul Eggert <eggert@cs.ucla.edu>
9135
9136 * NEWS: Reword the post-2.3 change to not be so optimistic about
9137 removing the old "look-ahead" spelling.
9138 Update previous look-ahead/lookahead change reports.
9139 * REFERENCES: look-ahead -> lookahead (since that's
9140 what he actually wrote).
9141 * doc/refcard.tex: look ahead -> lookahead,
9142 look-ahead -> lookahead
9143
742e4900
JD
91442006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
9145
9146 For consistency, use `lookahead' instead of `look-ahead' or
9147 `look_ahead'. Discussed starting at
9148 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
9149 and then at
9150 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
9151 * NEWS: For the next release, note the change to `--report'.
9152 * TODO, doc/bison.1: Update English.
9153 * doc/bison.texinfo: Update English.
9154 (Understanding Your Parser, Bison Options): Document as
9155 `--report=lookahead' rather than `--report=look-ahead'.
9156 * src/conflicts.c: Update English in comments.
9157 (lookahead_set): Rename from look_ahead_set.
9158 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
9159 (resolve_sr_conflict): Rename local look_ahead_tokens to
9160 lookahead_tokens, and update other uses.
9161 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
9162 count_rr_conflicts, conflicts_free): Update uses.
9163 * src/getargs.c (report_args): Move "lookahead" before alternate
9164 spellings.
9165 (report_types): Update uses.
9166 (usage): For `--report' usage description, state `lookahead' spelling
9167 rather than `look-ahead'.
9168 * src/getargs.h (report.report_lookahead_tokens): Rename from
9169 report_look_ahead_tokens.
9170 * src/lalr.c: Update English in comments.
9171 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
9172 (state_lookahead_tokens_count): Rename from
9173 state_look_ahead_tokens_count.
9174 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9175 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
9176 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9177 Update other uses.
9178 Update English in output.
9179 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
9180 * src/print.c: Update English in comments.
9181 (lookahead_set): Rename from look_ahead_set.
9182 (print_reduction): Rename argument lookahead_token from
9183 look_ahead_token.
9184 (print_core, state_default_rule, print_reductions, print_results):
9185 Update uses.
9186 * src/print_graph.c: Update English in comments.
9187 (print_core): Update uses.
9188 * src/state.c: Update English in comments.
9189 (reductions_new): Update uses.
9190 (state_rule_lookahead_tokens_print): Rename from
9191 state_rule_look_ahead_tokens_print, and update other uses.
9192 * src/state.h: Update English in comments.
9193 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
9194 (state_rule_lookahead_tokens_print): Rename from
9195 state_rule_look_ahead_tokens_print.
9196 * src/tables.c: Update English in comments.
9197 (conflict_row, action_row): Update uses.
9198 * tests/glr-regression.at
9199 (Incorrect lookahead during deterministic GLR,
9200 Incorrect lookahead during nondeterministic GLR): Rename
9201 print_look_ahead to print_lookahead.
9202 * tests/torture.at: Update English in comments.
9203 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
9204 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
9205 (Many lookahead tokens): Update uses.
9206 * data/glr.c: Update English in comments.
9207 * lalr1.cc: Likewise.
9208 * yacc.c: Likewise.
9209 * src/conflicts.h: Likewise.
9210 * src/lalr.h: Likewise.
9211 * src/main.c: Likewise.
9212 * src/output.c: Likewise.
9213 * src/parse-gram.c: Likewise.
9214 * src/tables.h: Likewise.
9215 * tests/calc.at: Likewise.
9216
3c40d0b5
JD
92172006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
9218
9219 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
9220
5d278082
PE
92212006-06-07 Paul Eggert <eggert@cs.ucla.edu>
9222
9223 * TODO: Add request from Nelson H. F. Beebe to be able to install
9224 Bison without installing the yacc script.
9225
9e668899
JD
92262006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9227
9228 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
9229 and yytext if they're already #define'd.
9230 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
9231 * src/scan-code-c.c: ... here.
9232 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
9233 <config.h>.
9234
0c8e079f
JD
92352006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9236
9237 Get Bison to build again when configured with --enable-gcc-warnings.
9238 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
9239 missing #include's.
9240 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
9241 loc argument as it shadows a global.
9242 * src/scan-gram.l: Remove stray comma that prevents boundary_set
9243 invocation.
9244
9245 * src/.cvsignore: Add scan-code.c.
9246
2346344a
AD
92472006-06-07 Akim Demaille <akim@epita.fr>
9248
9249 * src/scan-gram.l: Move the "add a trailing ; to actions" code
9250 to...
9251 * src/scan-code.l: here.
9252 * tests/input.at (Torturing the Scanner): Fix another location
9253 error.
9254
4862bdfd
AD
92552006-06-07 Akim Demaille <akim@epita.fr>
9256
9257 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
9258
e9071366
AD
92592006-06-06 Akim Demaille <akim@epita.fr>
9260
9261 Extract the parsing of user actions from the grammar scanner.
9262 As a consequence, the relation between the grammar scanner and
9263 parser is much simpler. We can also split "composite tokens" back
9264 into simple tokens.
9265 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
9266 * src/scan-gram.l (add_column_width, adjust_location): Move to and
9267 rename as...
9268 * src/location.h, src/location.c (add_column_width)
9269 (location_compute): these.
9270 Fix the column count: the initial column is 0.
9271 (location_print): Be robust to ending column being 0.
9272 * src/location.h (boundary_set): New.
9273 * src/main.c: Adjust to scanner_free being renamed as
9274 gram_scanner_free.
9275 * src/output.c: Include scan-code.h.
9276 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
9277 Use boundary_set.
9278 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
9279 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
9280 which is now, again, a separate token.
9281 Adjust all dependencies.
9282 Whereever actions with $ and @ are used, use translate_code.
9283 (action): Remove this nonterminal which is now useless.
9284 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
9285 (grammar_current_rule_action_append): Use translate_code.
9286 (packgram): Bound check ruleno, itemno, and rule_length.
9287 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
9288 (last_string, last_braced_code_loc, max_left_semantic_context)
9289 (scanner_initialize, scanner_free, scanner_last_string_free)
9290 (gram_out, gram_lineno, YY_DECL_): Move to...
9291 * src/scan-gram.h: this new file.
9292 (YY_DECL): Rename as...
9293 (GRAM_DECL): this.
9294 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
9295 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9296 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9297 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9298 Move these declarations, and...
9299 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
9300 these to...
9301 * src/flex-scanner.h: this new file.
9302 * src/scan-gram.l (rule_length, rule_length_overflow)
9303 (increment_rule_length): Remove.
9304 (last_braced_code_loc): Rename as...
9305 (gram_last_braced_code_loc): this.
9306 Adjust to the changes of the parser.
9307 Move all the handling of $ and @ into...
9308 * src/scan-code.l: here.
9309 * src/scan-gram.l (handle_dollar, handle_at): Remove.
9310 (handle_action_dollar, handle_action_at): Move to...
9311 * src/scan-code.l: here.
9312 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
9313 scan-code.h, scan-code-c.c, scan-gram.h.
9314 (EXTRA_bison_SOURCES): Add scan-code.l.
9315 (BUILT_SOURCES): Add scan-code.c.
9316 (yacc): Be robust to white spaces.
9317
9318 * tests/conflicts.at, tests/input.at, tests/reduce.at,
9319 * tests/regression.at: Adjust the column numbers.
9320 * tests/regression.at: Adjust the error message.
7891a7c4 9321
184e42f0
JD
93222006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9323
9324 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9325 Use Akim's wording from
9326 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
9327
7891a7c4
JD
93282006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9329
9330 Between Bison releases, manually append `+' to the previous Bison
9331 release number, and use that as a signal to automatically print the
9332 ChangeLog's CVS Id keyword from --version. Discussed starting at
9333 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
9334 * ChangeLog: Add Id header.
9335 * configure.ac (AC_INIT): Append `+' to `2.3'.
9336 * src/.cvsignore: Add revision.c.
9337 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
9338 (BUILT_SOURCES): Add revision.c.
9339 (revision.c): New target rule. This file defines a new global variable
9340 named revision. It initializes it with either the Id from ChangeLog
9341 or, if VERSION doesn't contain `+', with the empty string.
9342 * src/getargs.c (version): Print the value of revision.
9343 * src/revision.h: Extern revision.
9344
4ad3ed84
PE
93452006-06-05 Paul Eggert <eggert@cs.ucla.edu>
9346
9347 * NEWS: Version 2.3.
9348 * configure.ac (AC_INIT): Likewise.
9349
02103984
PE
93502006-05-30 Paul Eggert <eggert@cs.ucla.edu>
9351
9352 * data/glr.c (YYRECOVERING): Define to be a function-like macro
9353 with no arguments, not as an object-like macro. This is for
9354 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
9355 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
9356 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
9357 Document this.
9358
2c08afa5
JD
93592006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
9360
9361 * src/getargs.c (usage): Back out yesterday's modification of the
9362 --help output so that we don't have to wait for translation before
9363 releasing 2.3.
9364
6077da58
PE
93652006-05-29 Paul Eggert <eggert@cs.ucla.edu>
9366
9367 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
9368 Problem reported by Akim Demaille.
9369
2a26b6c2
JD
93702006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
9371
9372 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9373
aefef0d6
PE
93742006-05-26 Paul Eggert <eggert@cs.ucla.edu>
9375
9376 * data/yacc.c (yy_reduce_print): Omit trailing white space in
9377 generated source code. Problem reported by Frans Englich in
9378 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
9379
fcd8e201
PE
93802006-05-22 Paul Eggert <eggert@cs.ucla.edu>
9381
9382 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
9383 shell, not within 'make', so that 'make' by an ordinary builder
9384 (using GNU make) does not worry about configuring gzip. This also
9385 works around a bug reported independently by Keith Thompson and by
9386 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
9387 stderr rather than stdout, messing up the build logs.
9388
7b5cdcbd
JD
93892006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9390
9391 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
9392 to make sure that YYID will never be unused. This fixes a 'make
9393 maintainer-check' failure caused by the recent changes to the 'Trivial
9394 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
9395 not used.
9396 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
9397
5ad0a449
JD
93982006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9399
9400 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
9401 state before an empty RHS is always resolved here. Only the location
9402 of that state is guaranteed to be resolved, and that's enough. This
9403 fixes the remaining bug reported by Derek M. Jones in
9404 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9405 * tests/glr-regression.at (Uninitialized location when reporting
9406 ambiguity): Test the above case.
9407 Also, the embedded comments in this test case claim it checks the case
9408 of an empty RHS that has inherited the initial location. However, the
9409 corresponding LHS was already resolved, so yyresolveLocations didn't
9410 actually have reason to modify it. Fix this by forcing
9411 nondeterministic operation at the beginning of the parse.
9412
50cce58e
PE
94132006-05-20 Paul Eggert <eggert@cs.ucla.edu>
9414
9415 * data/c.m4 (b4_yy_symbol_print_generate):
9416 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
9417 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
9418 of the bugs reported today by Derek M Jones in
9419 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9420 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
9421 defined to be a type name without parens or brackets.
9422 (Location Type): Similarly for YYLTYPE.
9423 * tests/regression.at (Trivial grammars): Put in a test for this
9424 bug that will be caught by 'make maintainer-check' (though not,
9425 alas, by 'make check' unless your compiler is picky).
9426
ab8d9dc5
PE
94272006-05-19 Paul Eggert <eggert@cs.ucla.edu>
9428
0d2c8934 9429 * NEWS: Version 2.2.
ab8d9dc5
PE
9430 * configure.ac (AC_INIT): Likewise.
9431
9138c575
JD
94322006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
9433
9434 * data/glr.c (yyreportTree): Make room in yystates for the state
9435 preceding the RHS. This fixes the segmentation fault reported by Derek
9436 M. Jones in
9437 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
9438 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
9439 to the user. Reported for yyreportTree by Derek M. Jones later in the
9440 same thread.
9441 * THANKS: Add Derek M. Jones.
9442 Update my email address.
9443 Fix typo in Steve Murphy's name.
9444
276f48df
PE
94452006-05-14 Paul Eggert <eggert@cs.ucla.edu>
9446
d6645148
PE
9447 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
9448 checking against YYLAST that caused the parser to miss a potential
9449 alternative in its diagnostic.
9450 Problem reported by Maria Jose Moron Fernandez in
9451 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
9452 * data/lalr1.cc (yysyntax_error_): Likewise.
9453 * data/yacc.c (yysyntax_error): Likewise.
9454 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
9455 tokens, in case we run into an older C compiler.
9456 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
9457 Use them to check for the off-by-one error fixed above.
9458
276f48df
PE
9459 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
9460 YYSIZE_T, not size_t.
9461 * tests/regression.at (Trivial grammars): New test, to catch
9462 the error fixed by the above patch.
9463
cd8b5791
AD
94642006-05-14 Akim Demaille <akim@lrde.epita.fr>
9465
9466 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
9467 scheme.
9468 Reported by Steve Murphy.
9469
34376418
AD
94702006-05-14 Akim Demaille <akim@lrde.epita.fr>
9471
9472 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
9473 * data/glr.cc: b4_location_flag is now b4_locations_flag.
9474
327afc7c
AD
94752006-05-14 Akim Demaille <akim@lrde.epita.fr>
9476
9477 Implement --trace=m4.
9478 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
9479 * src/output.c (output_skeleton): When set, pass -dV to m4.
9480
9481 Factor the handling of flags in m4.
9482 * src/output.c (prepare): Rename the muscle names debug, defines,
9483 error_verbose to debug_flag, defines_flag, error_verbose_flag.
9484 * data/c.m4: Adjust.
9485 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
9486 Use b4_define_flag_if to define other b4_FLAG_if macros.
9487 (b4_location_if): As a consequence, rename as...
9488 (b4_locations_if): this, for consistency.
9489 Adjust all the skeletons.
9490
ba9ecd19
AD
94912006-05-14 Akim Demaille <akim@lrde.epita.fr>
9492
9493 * etc/bench.pm: Shorten bench names.
9494
4e83ea15
AD
94952006-05-14 Akim Demaille <akim@lrde.epita.fr>
9496
9497 * src/output.h, src/output.c (error_verbose): Move to...
9498 * src/getargs.h, src/getargs.c: here.
9499 Sort the flags.
9500 Adjust dependencies.
9501
6e93d810
PE
95022006-05-13 Paul Eggert <eggert@cs.ucla.edu>
9503
9504 * data/c.m4 (b4_copyright): Put the special exception for Bison
9505 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
9506 uses changed. Suggested by Akim Demaille. Also, wrap the
9507 copyright notice, in case it is longer than 80 columns. Replace
9508 comma by newline after title.
6e93d810 9509
eaea13f5
PE
95102006-05-11 Paul Eggert <eggert@cs.ucla.edu>
9511
9512 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
9513 incompatibility, not a bug. Mention that it wasn't fixed as of
9514 flex 2.5.33.
9515
3cf084ec
AD
95162006-05-11 Akim Demaille <akim@lrde.epita.fr>
9517
9518 * examples/extexi: Enforce the precedence of concatenation over
9519 >>.
0a9f1c7d 9520 Reported by Tommy Nordgren.
3cf084ec 9521
32c96bd7
AD
95222006-05-11 Akim Demaille <akim@lrde.epita.fr>
9523
9524 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
9525 with the member "token".
f94705b2 9526 Reported by Martin Nylin.
32c96bd7 9527
eaea13f5
PE
95282006-05-08 Paul Eggert <eggert@cs.ucla.edu>
9529
9530 * data/glr.c: Switch to Bison 2.2 special-exception language in
9531 the copyright notice. Use more-regular format for titles and
9532 copyright notices.
9533 * data/glr.cc: Likewise.
9534 * data/location.cc: Likewise.
9535 * data/yacc.cc: Likewise.
9536 * doc/bison.texinfo (Conditions): Document this.
9537 * NEWS: likewise. Upgrade version to 2.2.
9538
6e2d1146
AD
95392006-04-27 Akim Demaille <akim@lrde.epita.fr>
9540
9541 * data/glr.cc: Remove dead code.
9542
47671055
PE
95432006-04-25 Paul Eggert <eggert@cs.ucla.edu>
9544
9545 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
9546 that variable and the line breaks the bootstrap. Problem reported
9547 by Juan M. Guerrero.
9548
ed2e6384
AD
95492006-04-24 Akim Demaille <akim@lrde.epita.fr>
9550
9551 * doc/bison.texinfo (Multiple start-symbols): New.
9552
3cedc2dc
AD
95532006-04-24 Akim Demaille <akim@lrde.epita.fr>
9554
9555 * etc/README, etc/bench.pl: New.
9556
b2ddc3f3
AD
95572006-04-03 Akim Demaille <akim@lrde.epita.fr>
9558
9559 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
9560 rule.
9561 Reported by Mickael Labau.
9562 * tests/input.at (Torturing the Scanner): Test it.
9563
91e3ac9a
PE
95642006-03-16 Paul Eggert <eggert@cs.ucla.edu>
9565
9566 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
9567 Problem reported by Bob Rossi.
9568
95692006-03-13 Paul Eggert <eggert@cs.ucla.edu>
9570
9571 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
9572 and didn't really work.
9573 For the index, use @ifnotinfo, not @iftex.
9574 Minor cleanups of spacing and terminology.
9575
5cf61e93
AD
95762006-03-12 Akim Demaille <akim@lrde.epita.fr>
9577
9578 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
9579 of AT_NAME_PREFIX when %name-prefix is not used.
9580
aa08666d
AD
95812006-03-12 Akim Demaille <akim@lrde.epita.fr>
9582
9583 Apply --prefix to C++ skeletons too: they change the namespace.
9584 The test suite already exercize these cases.
9585 * data/c++.m4 (b4_namespace): New.
9586 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
9587 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
9588 * data/yacc.c, data/glr.c: Remove a useless `[]'.
9589 * doc/bison.texinfo: Document it.
9590 (Option Cross Key): Use @multitable in all formats. It looks
9591 nicer, even in TeX outputs.
9592 (Rules): Use the same code whatever the output type is.
9593 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
9594 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
9595 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 9596
45567173
AD
95972006-03-10 Akim Demaille <akim@lrde.epita.fr>
9598
9599 * TODO: Remove dead items.
9600
e9d8f881 96012006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
9602
9603 * doc/FAQ: Remove, merged into...
9604 * doc/bison.texinfo (FAQ): this.
9605 * doc/Makefile.am (EXTRA_DIST): Adjust.
9606
c095d689
AD
96072006-03-10 Akim Demaille <akim@lrde.epita.fr>
9608
9609 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
9610 even if empty.
9611 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
9612 * doc/bison.texinfo (Calc++ Scanner): Use it.
9613
6e0f8287
PE
96142006-03-09 Paul Eggert <eggert@cs.ucla.edu>
9615
9616 Fix two nits reported by twlevo, plus one more that I discovered.
9617
9618 * src/assoc.h (assoc_to_string): Give a name to the arg, as
9619 this is the usual Bison style.
9620 * src/location.h (location_print): Likewise.
9621
9622 * src/reader.h (token_name): Likewise.
9623
d6b771c3
PE
96242006-03-08 Paul Eggert <eggert@cs.ucla.edu>
9625
9626 Fix some nits reported by twlevo.
9627 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
9628 and "POSIX". Use more-modern syntax for URLs. Mention C++
9629 and ask for Java. Don't hardwire OS version numbers. Add
9630 copyright notice.
9631 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
9632 * src/conflicts.c (solved_conflicts_obstack): Now static.
9633
1e137b71
JD
96342006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
9635
9636 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
9637 page. Say "you can use it" not "you may use it" as on the web page;
9638 we're describing capabilities not granting permission.
9639
73f2e47e
PE
96402006-03-06 Paul Eggert <eggert@cs.ucla.edu>
9641
6d05403d
PE
9642 * data/glr.c (yyresolveLocations): Rename local variables to avoid
9643 shadowing warnings. Use usual patter for iterating through RHS.
9644 * tests/glr-regression.at
9645 (Uninitialized location when reporting ambiguity):
9646 Modify yylex so that it uses its argument, rather than trying
9647 to rely on ARGSUSED (which doesn't work for gcc with warnings).
9648 const char -> char const.
9649
73f2e47e
PE
9650 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
9651 Don't use tabs inside commands; it messes up 'ps'.
9652 Problem reported by twlevo.
9653
8710fc41
JD
96542006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
9655
9656 * tests/glr-regression.at (Uninitialized location when reporting
9657 ambiguity): New test case.
9658 * data/glr.c (yyresolveLocations): New function, which uses
9659 YYLLOC_DEFAULT.
9660 (yyresolveValue): Invoke yyresolveLocations before reporting an
9661 ambiguity.
9662 * doc/bison.texinfo (Default Action for Locations): Note
9663 YYLLOC_DEFAULT's usage for ambiguity locations.
9664 (GLR Semantic Actions): Cross-reference those notes.
9665
ae952af2
JD
96662006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
9667
9668 * tests/glr-regression.at (Leaked semantic values when reporting
9669 ambiguity): Remove unnecessary union and type declarations.
9670 (Leaked lookahead after nondeterministic parse syntax error): New test
9671 case.
9672 * data/glr.c (yyparse): Check for zero stacks remaining before
9673 attempting to shift the lookahead so that you don't lose it.
9674
35ee866a
JD
96752006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9676
9677 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
9678 * tests/glr-regression.at (Leaked semantic values when reporting
9679 ambiguity): New test case.
9680 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
9681 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
9682 now unnecessary yystackp parameter.
9683 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
9684 destructors can be called.
9685
9686 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
9687 in existing testcases.
9688
520181ab
JD
96892006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9690
9691 Don't leak semantic values for parent RHS when a user action cuts the
9692 parser, and clean up related code a bit.
9693 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
9694 cuts parse): Rename to...
9695 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
9696 for leaked parent RHS values.
9697 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
9698 between an unresolved state (non-empty chain of semantic options) and
9699 an incomplete one (signaled by an empty chain).
ae952af2 9700 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
9701 successfully or unsuccessfully resolved yyGLRState to...
9702 (yyresolveValue): ... here so that yyresolveValue always leaves a
9703 yyGLRState with consistent data and thus is easier to understand.
9704 Remove the yyvalp and yylocp parameters since they are always just
9705 taken from the yys parameter. When reporting a discarded merged value
9706 in debugging output, note that it is incompletely merged. Document the
9707 interface.
9708 (yyresolveAction): If resolving any of the RHS states fails, destroy
9709 them all rather than leaking them. Thus, as long as user actions are
9710 written to clean up the RHS correctly, yyresolveAction always cleans up
9711 the RHS of a semantic option. Document the interface.
9712
18d9185c
PE
97132006-02-27 Paul Eggert <eggert@cs.ucla.edu>
9714
9715 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
9716 led to a segmentation fault in GNU Pascal. Problem reported
9717 by Waldek Hebisch.
9718
841a7737
JD
97192006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
9720
9721 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
9722 mid-rule action inside a nonterminal symbol in order to declare a
9723 destructor for its semantic value.
9724
fc3f467f
PE
97252006-02-16 Paul Eggert <eggert@cs.ucla.edu>
9726
9727 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
9728 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
9729 __cplusplus && ! defined _STDLIB_H && !
9730 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
9731 defined free))]: Include <stdlib.h> rather than rolling our own
9732 declarations of malloc and free, to avoid problems with
9733 incompatible declarations (using 'throw') C++'s stdlib.h. This
9734 should fix Debian bug 340012
9735 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
9736 reported by Guillaume Melquiond.
9737
a3af26dd
PE
97382006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9739
4d7bc38c
PE
9740 * NEWS: Clarify symbols versus types in unused-value warnings.
9741
a3af26dd
PE
9742 * configure.ac (AC_INIT): Bump version number.
9743
4e26c69e
PE
97442006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9745
9746 * NEWS: Version 2.1a.
9747 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
9748 since C99 requires this.
9749
498e897c
PE
97502006-02-11 Paul Eggert <eggert@cs.ucla.edu>
9751
9752 * m4/c-working.m4: New file.
9753 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
9754
57bb17ca
PE
97552006-02-10 Paul Eggert <eggert@cs.ucla.edu>
9756
9757 * Makefile.maint: Merge from coreutils.
9758
0be105dc
PE
97592006-02-09 Paul Eggert <eggert@cs.ucla.edu>
9760
9761 More portability fixes for problems summarized by Nelson H. F. Beebe.
9762
9763 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
9764 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
9765 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
9766 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
9767 messes up because C++ code is compiled in 32-bit mode but linked
9768 in 64-bit mode.
9769
6fc0c024
PE
97702006-02-08 Paul Eggert <eggert@cs.ucla.edu>
9771
9772 More portability fixes for problems summarized by Nelson H. F. Beebe.
9773
7870f699
PE
9774 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
9775 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
9776
6fc0c024
PE
9777 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
9778 nodist_PROGRAMS, since we don't need to actually compile the
9779 example if we're just doing a plain 'make'. This avoids bothering
9780 the installer unnecessarily about problems due to weird C++
9781 compilers.
9782
fe6c2fde
PE
97832006-02-06 Paul Eggert <eggert@cs.ucla.edu>
9784
9785 More portability fixes for problems summarized by Nelson H. F. Beebe.
9786
9787 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
9788 than #include "...", and compile with -I'.'. The old method was
9789 not portable, according to Posix and the C standard, and it does
9790 not work with Sun C 5.7, where previous #line directives affect
9791 the working directory used in later #include "..." directives.
9792
927b425b
JMG
97932006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9794
9795 Various DJGGP specific issues in /djgpp
9796
d9735e9e
PE
97972006-02-02 Paul Eggert <eggert@cs.ucla.edu>
9798
9799 More portability fixes for problems summarized by Nelson H. F. Beebe.
9800
9801 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
9802 '#include <map>' works and that you can apply ++ to iterators.
9803
5a6755af
PE
98042006-02-01 Paul Eggert <eggert@cs.ucla.edu>
9805
67a0dc4f
PE
9806 Work around portability problems summarized by Nelson H. F. Beebe in
9807 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
9808
8c86f0ef
PE
9809 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9810 that '#include <string>' works.
9811
de35dd59
PE
9812 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
9813 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
9814 "warning: sorry: semantics of inline function static data `const
9815 unsigned char translate_table[262]' are wrong (you'll wind up with
9816 multiple copies)".
9817
67a0dc4f
PE
9818 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
9819 or, xor to not_, and_, or_, and xor_, respectively. This works
9820 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
9821 random system header somewhere that includes the equivalent of
9822 <iso646.h>.
9823
5a6755af
PE
9824 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
9825 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 9826 Suite Version 2.0.
5a6755af 9827
3f001415
JD
98282006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
9829
9830 During deterministic GLR operation, user actions should be able to
9831 influence the parse by changing yychar. To make this easier to fix and
9832 to make glr.c easier to evolve in general, don't maintain yytoken in
9833 parallel with yychar; just compute yytoken when needed.
9834 * tests/glr-regression.at (Incorrect lookahead during deterministic
9835 GLR): Check that setting yychar in a user action has the intended
9836 effect.
9837 * data/glr.c (yyGLRStack): Remove yytokenp member.
9838 (yyclearin): Don't set *yytokenp.
9839 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
9840 yychar rather than *yytokenp to determine the current lookahead.
9841 Compute yytoken locally when needed.
9842 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
9843 point to.
9844
9845 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
9846 after `--report' documentation.
9847
e2a8c0f5
PE
98482006-01-30 Paul Eggert <eggert@cs.ucla.edu>
9849
9850 * src/parse-gram.y (grammar_declaration): Location of printer
9851 symbol is @1, not list->location. Bug reported by twlevo.
9852 * tests/input.at (Incompatible Aliases): Adjust to above change.
9853
6b702268
PE
98542006-01-29 Paul Eggert <eggert@cs.ucla.edu>
9855
27622431
PE
9856 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
9857 all the test at once. This makes the output easier to read in the
9858 normal case.
9859
6b702268
PE
9860 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
9861 got from <http://bro-ids.org/download.html>. The bug is that
9862 when two actions appeared in succession, the second one was
9863 scanned before the first one was added to the grammar rule
9864 as a midrule action. Bison then output the incorrect warning
9865 "parse.y:905.17-906.36: warning: unused value: $3".
9866 * src/parse-gram.y (BRACED_CODE, action): These are no longer
9867 associated with a value.
9868 (rhs): Don't invoke grammar_current_rule_action_append.
9869 (action): Invoke it here instead.
9870 * src/reader.c (grammar_midrule_action): Now extern.
9871 (grammar_current_rule_action_append): Don't invoke
9872 grammar_midrule_action; that is now the scanner's job.
9873 * src/reader.h (last_string, last_braced_code_loc):
9874 (grammar_midrule_action): New decls.
9875 * src/scan-gram.l (last_string): Now extern, sigh.
9876 (last_braced_code_loc): New extern variable.
9877 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
9878 rule already has an action.
9879 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
9880 * tests/input.at (AT_CHECK_UNUSED_VALUES):
9881 Add some tests to check that the above changes fixed the bug.
9882
d40ba6c2
PE
98832006-01-27 Paul Eggert <eggert@cs.ucla.edu>
9884
9885 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
9886 All used changed. Check whether the symbol has a destructor,
9887 not whether it is typed.
9888 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
9889 that the values are still reported as unused. All line numbers
9890 adjusted.
9891
401aace6
PE
98922006-01-23 Paul Eggert <eggert@cs.ucla.edu>
9893
9894 Work around a bug in bro 0.8, which underparenthesizes its
9895 definition of YYLLOC_DEFAULT.
9896 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
9897 their arguments.
9898 * data/lalr1.cc: Likewise.
9899 * data/yacc.cc: Likewise.
9900
06f01bc4
PE
99012006-01-22 Paul Eggert <eggert@cs.ucla.edu>
9902
401aace6
PE
9903 Work around a bug in Pike 7.0, and give the Pike folks a
9904 better way to override the usual int widths.
9905 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
9906 user can override the types.
9907 (short): #undef, to work around a bug in Pike 7.0.
9908 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
9909 (union yyalloc.yyss): Use yytype_int16 rather than short.
9910 All uses changed.
9911 (yysigned_char): Remove.
9912 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
9913 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
9914 * tests/regression.at (Web2c Actions): Adjust to above changes.
9915
9916 * src/reader.c (check_and_convert_grammar): New function.
9917 (reader): Close the input file even if something went wrong during
9918 parsing. Minor file descriptor leak reported by twlevo.
9919
06f01bc4
PE
9920 * src/assoc.c (assoc_to_string): Use a default: abort (); case
9921 to pacify gcc -Wswitch-default.
9922 * src/scan-gram.l (adjust_location): Use a default: break; case
9923 to pacify gcc -Wswitch-default.
9924 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
9925 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9926 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9927 Move these decls to scan-skel.l, since they don't need to be
9928 visible elsewhere.
9929 * src/scan-skel.l: Accept the above decls.
9930 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
9931 is used.
9932
02650b7f
PE
99332006-01-21 Paul Eggert <eggert@cs.ucla.edu>
9934
9935 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
9936 since we don't want to insist on a version number at the start
9937 of the changelog every time.
9938 * Makefile.maint: Sync from coreutils a bit better.
9939 (sc_trailing_blank): Renamed from sc_trailing_space.
9940 All uses changed.
9941 (sc_no_if_have_config_h, sc_require_config_h):
9942 (sc_prohibit_assert_without_use): New rules.
9943 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
9944 (sc_dd_max_sym_length): Fix leading spaces in rule.
9945 (sc_system_h_headers): Prefix with @.
9946 (sc_useless_cpp_parens, m4-check): Output line numbers.
9947 (changelog-check): Allow version only in head.
9948 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
9949 satisfy new Makefile.maint rule.
9950 * data/glr.c: Likewise.
9951 * data/glr.cc: Likewise.
9952 * data/lalr1.cc: Likewise.
9953 * data/yacc.c: Likewise.
9954 * lib/ebitsetv.c: Likewise.
9955 * lib/lbitset.c: Likewise.
9956 * lib/subpipe.c: Likewise.
9957 * lib/timevar.c: Likewise.
9958 * src/system.h: Likewise.
9959 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
9960 * djgpp/Makefile.maint: Add copyright notice.
9961 * djgpp/README.in: Likewise.
9962 * djgpp/config.bat: Likewise.
9963 * djgpp/config.site: Likewise.
9964 * djgpp/config_h.sed: Likewise.
9965 * djgpp/djunpack.bat: Likewise.
9966 * djgpp/config.sed: Fix copyright notice to match standard format.
9967 * djgpp/subpipe.h: Likewise.
9968 * lib/bitsetv-print.c: Likewise.
9969 * lib/bitsetv.c: Likewise.
9970 * lib/subpipe.h: Likewise.
9971 * lib/timevar.c: Likewise.
9972 * lib/timevar.h: Likewise.
9973 * djgpp/subpipe.c: Use standard recipe for config.h.
9974 * lib/abitset.c: Likewise.
9975 * lib/bitset.c: Likewise.
9976 * lib/bitset_stats.c: Likewise.
9977 * lib/bitsetv-print.c: Likewise.
9978 * lib/bitsetv.c: Likewise.
9979 * lib/ebitsetv.c: Likewise.
9980 * lib/get-errno.c: Likewise.
9981 * lib/lbitset.c: Likewise.
9982 * lib/subpipe.c: Likewise.
9983 * lib/timevar.c: Likewise.
9984 * lib/vbitset.c: Likewise.
9985 * tests/local.at: Likewise.
9986 * src/scan-gram.l: Don't include verify.h, since system.h does
9987 that for us.
9988 * .x-sc_require_config_h: New file.
9989 * .x-sc_unmarked_diagnostics: New file.
9990
287c78f6
PE
99912006-01-20 Paul Eggert <eggert@cs.ucla.edu>
9992
287c78f6
PE
9993 Be a bit more systematic about using 'abort'.
9994 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
9995 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
9996 Put 'default: abort ();' before some other case, to satisfy older
9997 pedantic compilers.
9998 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9999 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
10000 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
10001 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
10002 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
10003 (get_decision_str, get_orientation_str, get_node_alignment_str):
10004 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
10005 (get_linestyle_str, get_arrowstyle_str): Likewise.
10006 * src/conflicts.c (resolve_sr_conflict):
10007 Use a default case rather than one for the one remaining enum
10008 value, to catch invalid enum values as well.
10009 * src/lalr.c (set_goto_map, map_goto):
10010 Prefer "assert (FOO);" to "if (!FOO) abort ();".
10011 * src/nullable.c (nullable_compute, token_definitions_output):
10012 Likewise.
10013 * src/reader.c (packgram, reader): Likewise.
10014 * src/state.c (transitions_to, state_new, state_reduction_find):
10015 Likewise.
10016 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
10017 (symbol_pack): Likewise.
10018 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
10019 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
10020 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
10021 * src/system.h: Don't include <assert.h>.
10022 (assert): New macro.
10023
10024 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
10025 (Destructor Decl, Parser Function, Pure Calling):
10026 Describe rules for braces inside C code more carefully.
287c78f6 10027
c66dfadd
PE
100282006-01-19 Paul Eggert <eggert@cs.ucla.edu>
10029
c21493b8
PE
10030 Fix some porting glitches found by Nelson H. F. Beebe.
10031 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
10032 compilers that don't understand that abort () does not return.
10033 * src/state.c (transitions_to): Likewise.
10034 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
10035 that '#include <cstdlib>' works.
10036 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
10037 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
10038 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
10039 for the benefit of some pre-C99 compilers.
10040
b6e3facf
PE
10041 * bootstrap: Undo changes to gnulib files that autoreconf made.
10042
c66dfadd
PE
10043 Minor fixups to get 'make maintainer-check' to work.
10044 * configure.ac: Don't use -Wnested-externs, as it's incompatible
10045 with the new verify.h implementation.
10046 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
10047 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
10048 * data/yacc.c (YYUSE): Likewise.
10049 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
10050 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
10051 * src/parse-gram.y (declaration): Don't pass a string constant
10052 to a function that expects char *, since GCC might complain
10053 about the constant value.
10054 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
10055 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
10056 before #defining them.
10057 * tests/glr-regression.at
10058 (Incorrectly initialized location for empty right-hand side in GLR):
10059 In yyerror, use the msg arg.
10060 (Corrupted semantic options if user action cuts parse):
10061 (Incorrect lookahead during deterministic GLR):
10062 (Incorrect lookahead during nondeterministic GLR):
10063 Don't name a local var 'index'; it shadows string.h's 'index'.
10064
ed94ef2a
AD
100652006-01-19 Akim Demaille <akim@epita.fr>
10066
10067 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
10068 location, not just parts of it.
10069
e9ad4aec
PE
100702006-01-18 Paul Eggert <eggert@cs.ucla.edu>
10071
d6ca7905
PE
10072 * NEWS: Document the fact that multiple %unions are now allowed.
10073 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
10074 * TODO: This feature is now implemented, so remove it from
10075 the wishlist.
d6ca7905 10076
ef1b70e0
PE
10077 * Makefile.maint: Merge with coreutils Makefile.maint.
10078 (CVS_LIST): Use build-aux version if available.
10079 (VERSION_REGEXP): New macro.
10080 (syntax-check-rules): Add sc_no_if_have_config_h,
10081 sc_prohibit_assert_without_use, sc_require_config_h,
10082 sc_useless_cpp_parens.
10083 (sc_obsolete_symbols): Check for O_NDELAY.
10084 (sc_dd_max_sym_length): Track coreutils.
10085 (sc_unmarked_diagnostics): Look in all files, not just *.c.
10086 (sc_useless_cpp_parens): New rule.
10087 (news-date-check): Look for version or today's date.
10088 (changelog-check): Don't require version number near head.
10089 (copyright-check): Use current year instead of hardwiring 2005.
10090 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
10091 (announcement): Add --gpg-key-ID.
10092
10093 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
10094 with "file system".
10095
2073ce56 10096 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
10097 array. Problem reported by twlevo.
10098 * src/reader.c (packgram): Prepend a new sentinel before ritem.
10099 * src/lalr.c (build_relations): Rely on new sentinel.
10100 * src/gram.c (gram_free): Adjust to new sentinel.
10101
b7691f15
JD
101022006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
10103
10104 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
10105 yylookaheadNeeds. All uses updated.
10106 (yysplitStack): Rename local yynewLookaheadStatuses to
10107 yynewLookaheadNeeds.
10108 * data/glr-regression.at (Incorrect lookahead during nondeterministic
10109 GLR): In comments, change `lookahead status' to `lookahead need'.
10110
ddee1b06
PH
101112006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10112
10113 * data/glr.c (yysplitStack): A little stylistic rewrite.
10114
12f4614d
PH
101152006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10116
10117 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
10118
32c29292
JD
101192006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
10120
10121 * doc/bison.texinfo: Fix some typos.
10122 (GLR Semantic Actions): New subsection discussing special
10123 considerations because GLR semantic actions might be deferred.
10124 (Actions): Mention look-ahead usage of yylval.
10125 (Actions and Locations): Mention look-ahead usage of yylloc.
10126 (Special Features for Use in Actions): Add YYEOF entry and mention it
10127 in the yychar entry.
10128 In the yychar entry, remove mention of the local yychar case (pure
10129 parser) since this is irrelevant information when writing semantic
148d66d8 10130 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
10131 yychar is otherwise described as an external variable.
10132 In the yychar entry, don't call it the `current' look-ahead since it
10133 isn't when semantic actions are deferred.
10134 In the yychar and yyclearin entries, add note about deferred semantic
10135 actions.
10136 Add yylloc and yylval entries discussing look-ahead usage.
10137 (Look-Ahead Tokens): When discussing yychar, don't call it the
10138 `current' look-ahead, and do mention yylval and yylloc.
10139 (Error Recovery): Cross-reference `Action Features' when mentioning
10140 yyclearin.
148d66d8 10141 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
10142 look-ahead.
10143 In the yylloc and yylval entries, mention look-ahead usage.
10144
de366a2f 101452006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
10146
10147 * tests/glr-regression.at: Update copyright year to 2006.
10148
bf70fa87
JD
101492006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10150
10151 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
10152 use during nondeterministic operation to track which stacks have
10153 actually needed the current lookahead.
10154 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
10155 Allocate, deallocate, resize, and otherwise shuffle space for
10156 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
10157 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
10158 appropriately during nondeterministic operation.
10159 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
10160 members to store the current lookahead to be used by the deferred
10161 user action.
10162 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
10163 from which the RHS is taken. Set the lookahead members of the new
10164 yySemanticOption according to the lookahead status for stack yyk.
10165 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
10166 yyaddDeferredAction.
10167 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
10168 members of yySemanticOption before invoking yyuserAction, and then set
10169 them back to their current values afterward.
10170 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
10171 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
10172 * tests/glr-regression.at: Remove `.' from the ends of recent test case
10173 titles for consistency.
10174 (Leaked merged semantic value if user action cuts parse): In order to
10175 suppress lint warnings, use arguments in merge function, and assign
10176 char value < 128 in main.
10177 (Incorrect lookahead during deterministic GLR): New test case.
10178 (Incorrect lookahead during nondeterministic GLR): New test case.
10179
05449a2c
JD
101802006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10181
de366a2f 10182 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
10183 !yyvaluep as signal that no semantic value is available to print.
10184 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
10185 to print a semantic value.
10186
4158e0a1 101872006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 10188
4158e0a1
JD
10189 * tests/glr-regression.at: For consistency with my newer test cases,
10190 don't thank myself.
10191
d659304d
JD
101922006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
10193
10194 * data/glr.c (yyresolveValue): When merging semantic options, if at
10195 least one user action succeeds but a later one cuts the parse, then
10196 destroy the semantic value before returning rather than leaking it.
10197 (yyresolveStates): If a user action cuts the parse and thus
10198 yyresolveValue fails, ignore the (unset) semantic value rather than
10199 corrupting the yyGLRState, and empty the semantic options list since
10200 the user actions should have called all necessary destructors.
10201 Simplify code with YYCHK.
10202 * tests/glr-regression.at (Corrupted semantic options if user action
10203 cuts parse): New test case.
10204 (Undesirable destructors if user action cuts parse): New test case.
10205 Before applying any of this patch, this test case never actually failed
10206 for me... but only because the corrupted semantic options usually
10207 masked this bug.
10208 (Leaked merged semantic value if user action cuts parse): New test
10209 case.
10210
6ec2c0f2
AD
102112006-01-05 Akim Demaille <akim@epita.fr>
10212
10213 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
10214
1b9c21fb
PE
102152006-01-04 Paul Eggert <eggert@cs.ucla.edu>
10216
10217 * data/c.m4 (b4_c_modern): New macro, with a new provision for
10218 _MSC_VER. Problem reported by Cenzato Marco.
10219 (b4_c_function_def): Use it.
10220 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
10221 b4_c_modern.
10222 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
10223 than rolling our own.
10224
84866159
AD
102252006-01-04 Akim Demaille <akim@epita.fr>
10226
10227 Also warn about non-used mid-rule values.
10228 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
10229 member.
10230 (symbol_list_new): Adjust.
10231 * src/reader.c (symbol_typed_p): New.
10232 (grammar_rule_check): Use it.
10233 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
10234 Check its rule.
10235 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
10236 Use it.
10237 * tests/actions.at (Exotic Dollars): Adjust.
10238
378f4bd8
AD
102392006-01-04 Akim Demaille <akim@epita.fr>
10240
10241 * src/reader.c (grammar_midrule_action): If $$ is set in a
10242 mid-rule, move the `used' bit to its lhs.
10243 * tests/input.at (Unused values): New.
10244 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
10245
e2a21b6f
PE
102462006-01-03 Paul Eggert <eggert@cs.ucla.edu>
10247
54662697
PE
10248 * doc/bison.texinfo (Bison Options): Say more accurately what
10249 --yacc does.
10250 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
10251 about declarations in the grammar when in Yacc mode, as POSIX does
10252 not require a diagnostic when the grammar uses extensions.
10253
10254 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
10255
073f9288
PE
10256 Warn about dubious constructions like "%token T T".
10257 Reported by twlevo.
10258 * src/symtab.h (struct symbol.declared): New member.
10259 * src/symtab.c (symbol_new): Initialize it to false.
10260 (symbol_class_set): New arg DECLARING, specifying whether
10261 this is a declaration that we want to warn about, if there
10262 is more than one of them. All uses changed.
10263
1221b78a
PE
10264 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
10265 Allow multiple %union directives, whose contents concatenate.
10266 * src/parse-gram.y (grammar_declaration): Likewise.
10267 Use muscle_code_grow, so that we don't need stype_line any more.
10268 All uses changed.
10269
10270 * src/muscle_tab.c (muscle_grow): Fix comment.
10271
e2a21b6f
PE
10272 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
10273 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
10274 Update copyright year to 2006.
10275
8f7e3cf9
AD
102762006-01-03 Akim Demaille <akim@epita.fr>
10277
10278 Have glr.cc pass (some of) the calc.at tests.
10279 * data/glr.cc (b4_parse_param_orig): New.
10280 (b4_parse_param): Improve its definition, and bound it more
10281 clearly in the skeleton.
10282 (b4_epilogue): Append, instead of prepending, in order to keep
10283 #line consistency.
10284 Simplify the generation of auxiliary functions: locations and
10285 purity are mandated.
10286 (b4_global_tokens_and_yystype): Honor it.
10287 * data/location.cc (c++.m4): Don't include it.
10288 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
10289 and AT_SKEL_CC_IF.
10290 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
10291 AT_LALR1_CC_IF.
10292 Be sure to initialize the first position's filename.
10293 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
10294 mandated anyway.
10295 (AT_CHECK_CALC_GLR_CC): New.
10296 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
10297
3953ed88
AD
102982006-01-02 Akim Demaille <akim@epita.fr>
10299
10300 * src/output.c (output_skeleton): Don't hard wire the inclusion of
10301 c.m4.
0a96ba81 10302 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
10303 * data/glr.cc: Do not include stack.hh.
10304
9ecafbbf
AD
103052006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
10306
10307 * data/glr.c: Reformat whitespace with tabs.
10308 (b4_lpure_formals): Remove this unused m4 macro.
10309 * tests/cxx-type.at: Reformat whitespace with tabs.
10310 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
10311 since it's a member. Rename type to isNterm for clarity.
10312
c4d497a0
AD
103132005-12-29 Akim <akim@sulaco.local>
10314
10315 Let glr.cc catch up with symbol_value_print.
10316 * data/glr.cc (b4_yysymprint_generate): Replace by...
10317 (b4_yy_symbol_print_generate): this.
10318 (yy_symbol_print, yy_symbol_value_print): Declare them.
10319
4517da37
PE
103202005-12-28 Paul Eggert <eggert@cs.ucla.edu>
10321
10322 * src/location.h (boundary): Note that a line or column equal
10323 to INT_MAX indicates an overflow.
10324 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
10325 (rule_length_overflow, increment_rule_length, add_column_width):
10326 New functions.
10327 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
10328 (<SC_BRACED_CODE>"}"):
10329 Use increment_rule_length rather than incrementing it by hand.
10330 (adjust_location, handle_syncline): Diagnose overflow.
10331 (handle_action_dollar, handle_action_at):
10332 Fix bug with monstrosities like $-2147483648.
10333 Remove now-unnecessary checks.
10334 (scan_integer): Verify assumptions and remove now-unnecessary checks.
10335 (convert_ucn_to_byte): Verify assumptions.
10336 (handle_syncline): New arg LOC. All callers changed.
10337 Don't store through a value derived from char const * pointer.
10338
10339 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
10340 GCC warnings.
10341
e3233bf6
PE
103422005-12-27 Paul Eggert <eggert@cs.ucla.edu>
10343
10344 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
10345 Remove unnecessary forward static decls.
10346
8f3596a6
AD
103472005-12-27 Akim Demaille <akim@epita.fr>
10348
10349 * src/reader.c (grammar_current_rule_check): Also check that $$
10350 is used.
10351 Take the rule to check as argument, hence rename as...
10352 (grammar_rule_check): this.
10353 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
10354 Rename as...
10355 (grammar_rule_begin, grammar_rule_end): these, for consistency.
10356 (grammar_midrule_action, grammar_symbol_append): Now static.
10357 * tests/torture.at (input): Don't rely on the default action
10358 being always performed.
10359 * tests/calc.at: "Set" $$ even when the action is "cut" with
10360 YYERROR or other.
10361 * tests/actions.at (Exotic Dollars): Instead of using unused
10362 values, check that the warning is issued.
10363
721be13c
PE
103642005-12-22 Paul Eggert <eggert@cs.ucla.edu>
10365
10366 * NEWS: Improve wording for unused-value warnings.
10367
a0af42fc
AD
103682005-12-22 Akim Demaille <akim@epita.fr>
10369
10370 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
10371 (b4_yysymprint_generate): Rename as...
10372 (b4_yy_symbol_print_generate): this.
10373 Generate yy_symbol_print instead of yysymprint.
10374 Generate also yy_symbol_value_print, and use it.
10375
affac613
AD
103762005-12-22 Akim Demaille <akim@epita.fr>
10377
721be13c 10378 * NEWS: Warn about unused values.
affac613
AD
10379 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
10380 a `used' member.
10381 (symbol_list_n_get, symbol_list_n_used_set): New.
10382 (symbol_list_n_type_name_get): Use symbol_list_n_get.
10383 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
10384 * src/reader.c (grammar_current_rule_check): Check that values are
10385 used.
10386 * src/symtab.c (symbol_print): Accept 0.
10387 * tests/existing.at: Remove the type information.
10388 Empty the actions.
10389 Remove useless actions (beware of mid-rule actions: perl -000
10390 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
10391 * tests/actions.at (Exotic Dollars): Use unused values.
10392 * tests/calc.at: Likewise.
10393 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10394 Likewise.
10395
10396 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
10397 rule_useful_p.
10398
9d9b8b70
PE
103992005-12-21 Paul Eggert <eggert@cs.ucla.edu>
10400
8bb4c753
PE
10401 Undo 2005-12-01 tentative license wording change. The wording is
10402 still being reviewed by the lawyers, and we don't want to wait for
10403 them before publishing a test release. For now, revert to the
10404 previous wording.
10405 * NEWS: Undo 2005-12-01 change.
10406 * data/glr.c: Revert to previous license wording.
10407 * data/glr.cc: Likewise.
10408 * data/lalr1.cc: Likewise.
10409 * data/location.cc: Likewise.
10410 * data/yacc.c: Likewise.
10411
9d9b8b70
PE
10412 * NEWS: Reword %destructor vs YYABORT etc.
10413 * data/glr.c: Use American spacing, for consistency.
10414 * data/glr.cc: Likewise.
10415 * data/lalr1.cc: Likewise.
10416 * data/yacc.c: Likewise.
10417 * data/yacc.c: Reformat comments slightly.
10418 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
10419 for consistency. Fix some spelling errors and reword recently-included
10420 text slightly.
10421 * tests/cxx-type.at: Cast results of malloc, for C++.
10422
2c3b392a
AD
104232005-12-21 Joel E. Denny <address@hidden>
10424
10425 * tests/cxx-type.at: Construct a tree, count the parents of shared
10426 nodes, and free each node once and only once. Previously, the memory
10427 for semantic values was leaked instead.
10428
d6cff4dc
AD
104292005-12-21 Joel E. Denny <address@hidden>
10430
10431 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
10432 (yylval, yylloc): If pure, #define to yystackp->yyval and
10433 yystackp->yyloc similar to yychar and yynerrs.
10434 (yyparse): If pure, remove local yylval and yylloc. Add local
10435 yystackp to accommodate pure definitions of yylval and yylloc.
10436 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
10437 yylvalp and yyllocp to &yylval and &yylloc.
10438 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
10439 namespace. Previously, nerrs and char were missing, but lval and lloc
10440 weren't necessary.
10441 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
10442 yylvalp and yyllocp parameters since, if pure, these are now always
10443 accessible through yystackp. If not pure, they are still accessible
10444 globally.
10445 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
10446 `if (YYID (N))' to pacify lint.
10447
a85284cf
AD
104482005-12-21 Akim Demaille <akim@epita.fr>
10449
10450 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
10451 destroy the RHS symbols of a rule.
10452 * data/yacc.c (yylen): Initialize to 0.
10453 Keep its value to the number of items to possibly shift.
10454 In particular, a regular successful parse that ends on YYFINAL by
10455 a (internal) YYACCEPT must not have yylen != 0.
10456 (yyerrorlab, yyreturn): Pop the RHS.
10457 Reorder a bit to emphasize the `shifting' bits of code.
10458 (YYPOPSTACK): Now accept a number of items to pop.
10459 * data/lalr1.cc: Likewise.
10460 * data/glr.c: Formatting changes.
10461 Use goto instead of fall through.
10462 * doc/bison.texinfo (Destructor Decl): Complete.
10463
d508c281
JMG
104642005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10465
10466 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10467 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
10468 * djgpp/config.bat: Replace every occurence of the file name
10469 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10470 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10471 * djgpp/config.sed: Replace every occurence of the file name
10472 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10473 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10474 * djgpp/djunpack.bat: DJGPP specific file.
10475 * djgpp/fnchange.lst: DJGPP specific file.
10476 * djgpp/README.in: Add new information about how to unpack the bison
10477 source on MSDOS and other systems which have 8.3 file name restrictions
10478 using djunpack.bat and fnchange.lst.
10479
3e7a2cd9
PE
104802005-12-12 Paul Eggert <eggert@cs.ucla.edu>
10481
10482 * bootstrap (build_cvs_prefix): Remove; unused.
10483 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
10484 when getting gnulib.
10485
104862005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
10487
10488 * data/glr.c: Reorder typedef declarations for structs to match order
10489 of struct declarations.
10490 Rename yystack everywhere to yystackp except in yyparse where it's not
10491 a pointer.
10492 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
10493 consistency.
10494 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
10495 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
10496 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
10497 lint.
10498
877519f8
PE
104992005-12-09 Paul Eggert <eggert@cs.ucla.edu>
10500
0eca5a39
PE
10501 * tests/sets.at (Accept): Fix typos in regular expression used to
10502 sed out the final state number.
10503
2cec9080
PE
10504 Work around portability problem on Solaris 10: flex-generated
10505 files include <stdio.h> before <config.h>, which messes up
10506 because the latter defines __EXTENSIONS__. Address the problem
10507 by creating two new little files that include <config.h> first,
10508 then include the flex-generated files. Rewrite everyone else
10509 to include <config.h> first, as well.
10510 * lib/timevar.c: Always include "config.h".
10511 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
10512 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
10513 (EXTRA_bison_SOURCES): New macro.
10514 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
10515 * src/system.h: Don't include config.h.
10516 * src/LR0.c: Include <config.h> first.
10517 * src/assoc.c: Likewise.
10518 * src/closure.c: Likewise.
10519 * src/complain.c: Likewise.
10520 * src/conflicts.c: Likewise.
10521 * src/derives.c: Likewise.
10522 * src/files.c: Likewise.
10523 * src/getargs.c: Likewise.
10524 * src/gram.c: Likewise.
10525 * src/lalr.c: Likewise.
10526 * src/location.c: Likewise.
10527 * src/main.c: Likewise.
10528 * src/muscle_tab.c: Likewise.
10529 * src/nullable.c: Likewise.
10530 * src/output.c: Likewise.
10531 * src/parse-gram.y: Likewise.
10532 * src/print.c: Likewise.
10533 * src/print_graph.c: Likewise.
10534 * src/reader.c: Likewise.
10535 * src/reduce.c: Likewise.
10536 * src/relation.c: Likewise.
10537 * src/state.c: Likewise.
10538 * src/symlist.c: Likewise.
10539 * src/symtab.c: Likewise.
10540 * src/tables.c: Likewise.
10541 * src/uniqstr.c: Likewise.
10542 * src/vcg.c: Likewise.
10543
877519f8
PE
10544 * src/parse-gram.y: Fix minor problems uncovered by lint.
10545 (current_lhs, current_lhs_location): Now static.
10546 (current_assoc): Remove unused variable.
10547
10548 Cleanups so that Bison-generated parsers have less lint.
10549 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
10550 Prepend /*ARGSUSED*/, for lint's sake.
10551 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
10552 definition if 'lint' is defined.
10553 (YYID): New macro (or function, if lint).
10554 All uses of /*CONSTCOND*/0 replaced by YYID(0).
10555 * data/yacc.c: Likewise.
10556 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
10557 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
10558 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
10559 is C++ only.
10560 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
10561 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
10562 Use YYID(0) rather than 0, for lint.
10563 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
10564 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
10565
f5228370
PE
105662005-12-07 Paul Eggert <eggert@cs.ucla.edu>
10567
10568 * tests/glr-regression.at
10569 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10570 Close memory leak reported by twlevo.
10571
69ce078b
PE
105722005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
10573
6ff99711
PE
10574 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
10575 all stacks.
10576 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
10577 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10578 New test case.
10579 (Duplicated user destructor for lookahead): This test now is expected
10580 to succeed.
10581
af3412cd
PE
105822005-12-01 Paul Eggert <eggert@cs.ucla.edu>
10583
32b5b719 10584 * NEWS: Document the following change.
af3412cd
PE
10585 * data/yacc.c: Say "parser skeleton" rather than "file", since
10586 it's no longer just a file.
10587 * data/glr.c: Grant a special exception for C GLR parsers, that
10588 reads like the already-existing exception for C LALR(1) parsers.
10589 * data/glr.cc: Likewise.
10590 * data/lalr1.cc: Likewise.
10591 * data/location.cc: Likewise.
10592 * data/yacc.c: Reword the "written by" statement to clarify that
10593 it was the parser skeleton, not the entire output file.
10594 * data/glr.c: Written by Paul Hilfinger.
10595 * data/glr.cc: Written by Akim Demaille.
10596 * data/lalr1.cc: Likewise.
10597
035aa4a0
PE
105982005-11-18 Paul Eggert <eggert@cs.ucla.edu>
10599
d9963c85
PE
10600 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
10601 Fix typos in previous change that broke 'make check'.
10602 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
10603 supported in C.
10604 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
10605 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
10606 We can revert this once things settle down.
10607
035aa4a0
PE
10608 * src/conflicts.c (conflicts_print): Don't print file name twice
10609 when %expect fails because there were no conflicts.
10610 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
10611 change.
10612 * tests/conflicts.at (%expect not enough, %expect too much):
10613 (%expect with reduce conflicts): Adjust to new behavior.
10614
106152005-11-18 Akim Demaille <akim@epita.fr>
10616
10617 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
10618 errors.
10619 * NEWS: Document this.
10620 * doc/bison.texinfo (Expect Decl): Likewise.
10621
d1ff7a7c
AD
106222005-11-16 Akim Demaille <akim@epita.fr>
10623
10624 Generalize the display of semantic values and locations in traces.
10625 * data/glr.c (yy_reduce_print): Fix indices (again).
10626 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
10627 literal integers.
10628 * data/lalr1.cc (yyreduce_print): Rename as...
10629 (yy_reduce_print): this.
10630 Display values and locations.
10631 * data/yacc.c (yy_reduce_print): Likewise.
10632 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
10633 (yysymprint): Move higher to be visible from yy_reduce_print).
10634 (yyparse): Adjust.
10635 * tests/calc.at: Adjust the expected length of the traces.
10636
6de5398d
AD
106372005-11-14 Akim Demaille <akim@epita.fr>
10638
10639 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
10640 from 1 to N, while values and location start at 0.
10641 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
10642
a1373f55
AD
106432005-11-14 Akim Demaille <akim@epita.fr>
10644
10645 * data/glr.c (yy_reduce_print): Fix the $ number.
10646
613d8952
AD
106472005-11-14 Akim Demaille <akim@epita.fr>
10648
10649 "Use" parse parameters.
10650 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
10651 * data/glr.c, data/glr.cc: Use them.
10652 * data/glr.c (YYUSE): Have a C++ definition that supports
10653 non-pointer types.
10654
b2741627
AD
106552005-11-14 Akim Demaille <akim@epita.fr>
10656
10657 * data/glr.c (yyexpandGLRStack): Declare only if defined.
10658
5059b5c8
AD
106592005-11-14 Akim Demaille <akim@epita.fr>
10660
42249483
AD
10661 * data/glr.cc: New.
10662 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 10663
4626a15d
AD
106642005-11-12 Akim Demaille <akim@epita.fr>
10665
10666 Let position and location be PODs.
10667 * data/location.cc (position::initialize, location::initialize): New.
10668 (position::position, location::location): Define only if
10669 b4_location_constructors is defined.
10670 * data/lalr1.cc (b4_location_constructors): Define it for backward
10671 compatibility.
10672 * doc/bison.texinfo (Initial Action Decl): Use initialize.
10673
106742005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
10675
10676 * data/lalr1.cc: Move the body of the ctor and dtor into the
10677 parser file (instead of the header).
10678 Wrap the implementations in a "namespace yy".
10679
106802005-11-12 Akim Demaille <akim@epita.fr>
10681
10682 Have glr.c include its header file when created.
10683 * data/glr.c (b4_shared_declarations): New.
10684 Output them verbatim in the parser if !%defines, otherwise
10685 output then in the header file, and include it instead.
10686
1989d947
AD
106872005-11-11 Akim Demaille <akim@epita.fr>
10688
10689 * data/glr.c: Comment changes.
10690
106912005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
10692
10693 When yydebug, report semantic and location values for reductions.
10694 * data/glr.c (yy_reduce_print): Report the semantic values and the
10695 locations.
10696 (YY_REDUCE_PRINT): Adjust.
10697 (yyglrReduce): Use them.
10698 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
10699 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
10700 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
10701 traces.
10702
02998094
AD
107032005-11-10 Akim Demaille <akim@epita.fr>
10704
10705 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
10706 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
10707 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
10708
5210672f
PE
107092005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
10710
10711 * m4/cxx.m4, examples/Makefile.am: Don't build
10712 examples/calc++ if no C++ compiler is available. (trivial change)
10713
a8991a1d
AD
107142005-11-09 Akim Demaille <akim@epita.fr>
10715
10716 * src/scan-skel.l: Use a couple of asserts.
10717
36b5e963
AD
107182005-11-03 Akim Demaille <akim@epita.fr>
10719
10720 In some (weird) cases, the final state number is incorrect.
10721 Reported by Alexandre Duret-Lutz.
10722 * src/LR0.c (state_list_append): Remove the computation of
10723 final_state.
10724 (save_reductions): Do it here.
10725 (get_state): Alpha conversion.
10726 (generate_states): Use a for loop.
10727 * src/gram.h (item_number_is_rule_number)
10728 (item_number_is_symbol_number): New.
10729 * src/state.c: Use assert.
10730 * src/system.h: Include assert.h.
10731 * tests/sets.at (Accept): New.
10732
44e7ead1
PH
107332005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10734
10735 * data/glr.c (yyfill): Adjust comment.
36b5e963 10736 (yyresolveAction): Initialize default location properly
44e7ead1
PH
10737 for empty right-hand sides.
10738 (yydoAction): Ditto.
10739 Add comment explaining apparently dead code.
36b5e963
AD
10740 * tests/glr-regression.at
10741 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 10742 New test.
36b5e963 10743
e10a80ee
PE
107442005-10-30 Paul Eggert <eggert@cs.ucla.edu>
10745
10746 * bootstrap (cleanup_gnulib): New function. Use it to clean up
10747 gnulib when interrupted. This fixes some race conditions and
10748 works around some portability problems (one noted by Paul
10749 Hilfinger).
10750
067b32ee
AD
107512005-10-22 Akim <akim@epita.fr>
10752
10753 * Makefile.cfg: Adjust to config -> build-aux.
10754 Reported by twledo.
10755
4b367315
AD
107562005-10-21 Akim Demaille <akim@epita.fr>
10757
10758 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
10759 the %parse-params.
10760 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
10761 * data/yacc.c (b4_Pure_if): Rename as...
10762 (b4_yacc_pure_if): this.
10763 (YY_SYMBOL_PRINT, yyparse): Adjust.
10764 * doc/bison.texinfo: Formatting changes.
10765
24cc23d9
AD
107662005-10-21 Akim Demaille <akim@epita.fr>
10767
10768 Finish the transition config -> build-aux.
10769 * configure.ac, Makefile.am: Use build-aux.
10770 * config/prev-version, config/announce-gen, config/Makefile.am:
10771 Move to...
10772 * build-aux/prev-version, build-aux/announce-gen,
10773 * build-aux/Makefile.am: here.
10774
d4476375
AD
107752005-10-14 Akim Demaille <akim@epita.fr>
10776
10777 * examples/calc++/test: Use set -x only when VERBOSE.
10778
302c0aee
PE
107792005-10-13 Paul Eggert <eggert@cs.ucla.edu>
10780
10781 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
10782 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
10783
7625ec2c
AD
107842005-10-13 Akim Demaille <akim@epita.fr>
10785
10786 * src/scan-skel.l: Output the base name parts of the parser and
10787 header file names.
302c0aee 10788 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
10789 additional checks.
10790 Use this to exercise C++ outputs in subdirs.
10791 Reported by Oleg Smolsky.
10792
ba0fe3c7
PE
107932005-10-12 Paul Eggert <eggert@cs.ucla.edu>
10794
10795 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
10796 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
10797 Problem reported by John P. Hartmann.
10798 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
10799 already defined it.
10800
9b8a5ce0
AD
108012005-10-12 Akim Demaille <akim@epita.fr>
10802
10803 * src/parse-gram.y (version_check): Exit 63 to please missing
10804 (stands for "version mismatch).
10805 * tests/input.at, doc/bison.texinfo: Adjust.
10806
4f6e011e
PE
108072005-10-10 Paul Eggert <eggert@cs.ucla.edu>
10808
10809 Work around portability problems with Visual Age C compiler
10810 (xlc and xlC_r) reported by John P. Hartmann.
10811 * data/location.cc (initial_column, initial_line): Remove.
10812 All uses replaced by 0 and 1.
10813 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
10814 that xlc complains about.
10815 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 10816 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 10817 as __STDC__.
4d7aa45e
PE
10818 * data/yacc.c (YYMODERN_C): New macro, which also looks at
10819 __STDC_VERSION__. Use it everywhere instead of looking at
10820 __STDC__ and __cplusplus.
4f6e011e 10821
a1b3bf8c
AD
108222005-10-10 Akim Demaille <akim@epita.fr>
10823
10824 * examples/calc++/test: Be quiet unless VERBOSE.
10825
412e44aa
PE
108262005-10-05 Paul Eggert <eggert@cs.ucla.edu>
10827
2a4647a3
PE
10828 * data/c.m4 (yydestruct, yysymprint):
10829 Use YYUSE instead of casting to void.
10830 * data/glr.c (YYUSE): New macro.
10831 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10832 Use it instead of rolling our own.
10833 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10834 (YYCHK1):
10835 Use /*CONSTCOND*/ to suppress lint warnings.
10836 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10837 (YY_STACK_PRINT): Use 'false' not '0'.
10838 (YYUSE): New macro.
10839 (yysymprint_, yydestruct_): Use it instead of rolling our own.
10840 * data/yacc.c (YYUSE): New macro.
10841 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
10842 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
10843 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
10844
10845
412e44aa
PE
10846 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
10847 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
10848
88c6637f
PE
108492005-10-04 Paul Eggert <eggert@cs.ucla.edu>
10850
2f4f028d
PE
10851 Undo the parts of the unlocked-I/O change that substituted
10852 putc or puts for printf. This might hurt performance a bit,
10853 but some people prefer the printf style.
10854 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
10855 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
10856 All uses replaced by YYFPRINTF and YYDPRINTF.
10857 * data/yacc.c: Likewise.
10858 * lib/bitset.c (bitset_print): Likewise.
10859 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
10860 putc and puts.
10861 * lib/lbitset.c (debug_lbitset): Likewise.
10862 * src/closure.c (print_firsts, print_fderives): Likewise.
10863 * src/gram.c (grammar_dump): Likewise.
10864 * src/lalr.c (look_ahead_tokens_print): Likewise.
10865 * src/output.c (escaped_output): Likewise.
10866 (user_actions_output): Break apart two printfs.
10867 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
10868 * src/reduce.c (reduce_print): Likewise.
10869 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
10870 * src/system.h: Include unlocked-io.h rathe than stdio.h.
10871
88c6637f
PE
10872 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10873 Use assignments rather than casts-to-void to suppress
10874 unused-variable warnings. This pacifies 'lint'.
10875 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
10876 unused-variable warnings.
10877
fb32e373
JMG
108782005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10879
10880 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10881
edb8f44f
PE
108822005-10-02 Paul Eggert <eggert@cs.ucla.edu>
10883
fb9c0b33
PE
10884 Use unlocked I/O for a minor performance improvement on hosts like
10885 GNU/Linux and Solaris that support unlocked I/O. The basic idea
10886 is to use the gnlib unlocked-io module, and to prefer putc and
10887 puts to printf when either will work (since the latter doesn't
10888 come in an unlocked flavor).
10889 * bootstrap (gnulib_modules): Add unlocked-io.
10890 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
10891 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
10892 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
10893 and similarly for puts and putc and printf.
10894 * data/yacc.c: Likewise.
10895 * lib/bitset.c (bitset_print): Likewise.
10896 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
10897 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
10898 to printf.
10899 * lib/lbitset.c (debug_lbitset): Likewise.
10900 * src/closure.c (print_firsts, print_fderives): Likewise.
10901 * src/gram.c (grammar_dump): Likewise.
10902 * src/lalr.c (look_ahead_tokens_print): Likewise.
10903 * src/output.c (escaped_output): Likewise.
10904 (user_actions_output): Coalesce two printfs.
2f4f028d 10905 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
10906 * src/reduce.c (reduce_print): Likewise.
10907 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 10908 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 10909
edb8f44f
PE
10910 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
10911 this confuses xgettext.
10912
b50d2359
AD
109132005-10-02 Akim Demaille <akim@epita.fr>
10914
10915 * bootstrap (gnulib_modules): Add strverscmp.
10916 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
10917 * m4/.cvsignore: Add strverscmp.m4.
10918 * src/parse-gram.y (%require): New token, new rule.
10919 (version_check): New.
10920 * src/scan-gram.l (%require): Adjust.
10921 * tests/input.at (AT_REQUIRE): New.
10922 Use it.
10923 * doc/bison.texinfo (Require Decl): New.
10924 (Calc++ Parser): Use %require.
10925
21667f64
AD
109262005-10-02 Akim Demaille <akim@epita.fr>
10927
10928 * data/location.cc: New.
10929
2b81e969
AD
109302005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
10931 Akim Demaille <akim@epita.fr>
10932
10933 Make sure -odir/foo.cc creates dir/location.hh etc.
10934 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
10935 (spec_file_prefix, spec_verbose_file, spec_graph_file)
10936 (spec_defines_file): Now const.
10937 (dir_prefix): New.
10938 (short_base_name): Remove.
10939 * src/files.c: Adjust.
10940 (dirname.h): Include.
10941 (base_name): Don't prototype it.
10942 (finput): Remove, duplicates gram_in.
10943 (full_base_name, short_base_name): Replace by...
10944 (all_but_ext, all_but_tab_ext): these.
10945 (compute_base_names): Rename as...
10946 (compute_file_name_parts): this.
10947 Update to compute the new variables, including dir_prefix.
10948 Adjust dependencies.
10949 * src/output.c (prepare): Output them.
10950 * src/reader.c: Adjust to use gram_in, not finput.
10951 * src/scan-skel.l (@dir_prefix@): New.
10952
ad6a9b97
JMG
109532005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10954
10955 * lib/subpipe.c: New function end_of_output_subpipe() added
10956 to allow support for non-posix systems. This is a no-op function
10957 for posix systems.
10958
10959 * lib/subpipe.h: New function end_of_output_subpipe() added
10960 to allow support for non-posix systems. This is a no-op function
10961 for posix systems.
10962
10963 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
10964 handle the lack of pipe/fork functionality on non-posix systems.
10965
10966 * djgpp/Makefile.maint: DJGPP specific file.
10967
10968 * djgpp/README.in: DJGPP specific file.
10969
10970 * djgpp/config.bat: DJGPP specific configuration file.
10971
10972 * djgpp/config.sed: DJGPP specific configuration file.
10973
10974 * djgpp/config.site: DJGPP specific configuration file.
10975
10976 * djgpp/config_h.sed: DJGPP specific configuration file.
10977
10978 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
10979
10980 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
10981
fc695704
AD
109822005-10-02 Akim Demaille <akim@epita.fr>
10983
10984 * data/location.cc: New, extract from...
10985 * data/lalr1.cc: here.
10986 (location.hh): Include it after the user prologue, in case the
10987 filename type is defined by the user.
10988 Forward declation location and position before the pre-prologue.
10989 (yyresult_): Rename as...
10990 (yyresult): this, it's a local variable, not an attribute.
10991 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
10992
109932005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
10994
10995 * examples/extexi: Restore the #line generation.
10996
fb9712a9
AD
109972005-09-30 Akim Demaille <akim@epita.fr>,
10998 Alexandre Duret-Lutz <adl@gnu.org>
10999
11000 Move the token type and YYSTYPE in the parser class.
11001 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
11002 (parser::token): New, from the moved free definition of tokens.
11003 (parser::semantic_value): Now a full definition instead of an
11004 indirection to YYSTYPE.
11005 (b4_post_prologue): No longer included in the header file, but
11006 in the implementation file.
11007 * doc/bison.texi (C+ Language Interface): Update.
11008 * src/parse-gram.y: Support unary %define.
11009 * tests/actions.at: Define global_tokens_and_yystype for backward
11010 compatibility until we update the tests.
11011 * tests/calc.at: Idem.
11012 (first_line, first_column, last_line, last_column): Define for lalr1.cc
11013 to simplify the code.
11014
55f0c7b1
PE
110152005-09-29 Paul Eggert <eggert@cs.ucla.edu>
11016
11017 Port to SunOS 4.1.4, which lacks strtoul and strerror.
11018 Ah, the good old days! Problem reported by Peter Klein.
11019 * bootstrap (gnulib_modules): Add strerror, strtoul.
11020 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
11021 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
11022
fb9712a9 110232005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
11024
11025 * data/c.m4 (b4_error_verbose_if): New.
11026 * data/lalr1.cc: Use it.
11027 (YYERROR_VERBOSE_IF): Remove.
11028 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
11029 parser members, replaced by...
11030 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
11031 local variables.
11032 (yysyntax_error_): Takes the state number as argument.
11033 (yyreduce_print_): Use the argument yyrule, not the former
11034 attribute yyn_.
11035
8a6f72f3
PE
110362005-09-26 Paul Eggert <eggert@cs.ucla.edu>
11037
11038 * bootstrap (gnulib_modules): Add verify.
11039 * lib/.cvsignore: Add verify.h.
11040 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
11041 * src/system.h (verify): Remove.
11042 Include verify.h instead.
11043 * src/tables.c (tables_generate): Use new API for 'verify'.
11044
0d50976f
PE
110452005-09-21 Paul Eggert <eggert@cs.ucla.edu>
11046
ebc3737e
PE
11047 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
11048 local variables whose names begin with 'yy'.
11049 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
11050 Trivial changes from Joel E. Denny.
11051
0d50976f
PE
11052 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
11053 it itself.
11054 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
11055 don't use alloca any more.
11056
11057 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
11058 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 11059 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
11060 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
11061 to match yacc.c, to test more hosts.
11062
a05b79df
PE
110632005-09-20 Paul Eggert <eggert@cs.ucla.edu>
11064
55289366
PE
11065 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
11066 doesn't affect behavior.
11067 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
11068 Solaris, AIX, MSC.
11069 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
11070 This works a bit better with glibc, if user code has already included
11071 stdlib.h.
11072 * doc/bison.texinfo (Bison Parser): Document that users can't
11073 arbitrarily use malloc and free for other purposes. Document
11074 that <alloca.h> and <malloc.h> might be included.
11075 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
11076 user must declare alloca.
11077
a05b79df
PE
11078 * HACKING (release): Forwarn the Translation Project about
11079 stable releses.
11080
3ab2ca22
AD
110812005-09-20 Akim Demaille <akim@epita.fr>
11082
11083 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
11084
a9739e7c
PE
110852005-09-19 Paul Eggert <eggert@cs.ucla.edu>
11086
a702593e
PE
11087 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
11088 (YYSTACK_ALLOC_MAXIMUM): Use it.
11089 (yysyntax_error): New function.
11090 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
11091 multiple syntax errors are reported, and alloca is being used.
11092 Instead, reallocate buffers twice as big each time, so that
11093 we waste at most half the allocated memory. Start with a small
11094 (128-byte) buffer that will suffice in most cases anyway.
11095 Use yysyntax_error to do most of the work.
11096
11097 * doc/bison.texinfo (Error Reporting, Table of Symbols):
11098 yynerrs is the number of errors reported, not the number of
11099 errors encountered.
11100
a9739e7c
PE
11101 * tests/glr-regression.at (Duplicated user destructor for lookahead):
11102 Mark it as expected to fail.
11103 Cast result of malloc; problem reported by twlevo@xs4all.nl.
11104 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
11105 Don't start user-code symbols with "yy", to avoid name space problems.
11106
f479c6c6
AD
111072005-09-19 Akim Demaille <akim@epita.fr>
11108
11109 Remove the traits, failed experiment.
11110 It never proved useful, and anyway because of the current
11111 definition, it was not possible to have several specialization of
11112 this traits, making it useless.
11113 * data/lalr1.cc (yy:traits): Remove.
11114 Inline its definitions in the parser class.
11115
e2586f82
AD
111162005-09-19 Akim Demaille <akim@epita.fr>
11117
11118 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
11119 least Mac OSX with a /usr/local install of gettext.
11120
2e8cf949
AD
111212005-09-19 Akim Demaille <akim@epita.fr>
11122
11123 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
11124 and yytoken for similarity with the other skeletons.
11125
c7fb0b90
AD
111262005-09-19 Akim Demaille <akim@epita.fr>
11127
4e26c69e 11128 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 11129
1bd0deda
PE
111302005-09-16 Paul Eggert <eggert@cs.ucla.edu>
11131
11132 * NEWS: Version 2.1.
11133
11134 * NEWS: Remove notice of yytname change, since it was never in an
11135 official release.
11136 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
11137 diagnostic.
11138 * src/output.c (prepare): Likewise.
11139 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
11140 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
11141 is not defined. This is an awful hack, but it's enough for now.
11142 All callers changed.
11143 * tests/glr-regression-at (make_value): Args are const pointers now,
11144 to avoid GCC warning.
11145 (Duplicated user destructor for lookahead): New test. Currently
11146 skipped. It fails on my host but I'm not sure it'll always fail.
11147
111482005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
11149
11150 * src/symtab.h (struct symbol): Declare the printer and destructor
11151 as const, to avoid accidental calls to free.
11152 (symbol_destructor_set, symbol_printer_set): Adjust.
11153 * src/symtab.c: Adjust.
11154
1bd0deda 111552005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
11156
11157 * data/c.m4 (b4_token_enums): New.
11158 (b4_token_defines): Rename as...
11159 (b4_token_enums_defines): this.
11160 (b4_token_defines): New, output only the #defines.
11161 * data/yacc.c, data/glr.c: Adjust.
11162 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
11163 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
11164 as default values.
11165
dbcdae2d
AD
111662005-09-16 Akim Demaille <akim@epita.fr>
11167
11168 * data/lalr1.cc (yylex_): Remove, inline its code.
11169 (yyreport_syntax_error_): Remove, replaced by...
11170 (yysyntax_error_): this which returns a string and leaves to the
11171 caller the call to the users' error function.
11172 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
11173 Move from members of the parser object...
11174 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
11175 to local variables of the parse function.
11176
70d8f291
AD
111772005-09-16 Akim Demaille <akim@epita.fr>
11178
11179 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
11180 since it's in Bison's name space.
11181
b47dbebe
PE
111822005-09-15 Paul Eggert <eggert@cs.ucla.edu>
11183
ae199bf1
PE
11184 * data/glr.c (yyresolveValue): Add default case to pacify
11185 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
11186
b47dbebe
PE
11187 * NEWS: Document when yyparse started to return 2.
11188 * doc/bison.texinfo (Parser Function): Document when yyparse
11189 returns 2.
11190
11191 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
11192 (b4_filename_type): Renamed back from b4_file_name_type. All uses
11193 changed.
11194 (class position): file_name -> filename (reverting). All uses changed.
11195
111962005-09-14 Paul Eggert <eggert@cs.ucla.edu>
11197
11198 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
11199 do anything if $@ exists. This reverts part of the 2005-07-07
11200 patch.
11201
00292f66
PE
112022005-09-11 Paul Eggert <eggert@cs.ucla.edu>
11203
11204 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
11205 contains obsolete information and isn't worth distributing as a
11206 separate file anyway.
11207 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
11208 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
11209 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
11210 (yyparse): Abort if user code uses longjmp to throw an unexpected
11211 value.
11212
a420f962
PE
112132005-09-09 Paul Eggert <eggert@cs.ucla.edu>
11214
00292f66
PE
11215 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
11216 Suggested by twlevo@xs4all.nl.
11217
127287e9
PE
11218 * data/glr.c (YYCHK1): Do not assume YYE is in range.
11219 This avoids a diagnostic from gcc -Wswitch-enum.
11220 Problem reported by twlevo@xs4all.nl.
11221
a420f962
PE
11222 * doc/bison.texinfo: Don't use "filename", as per GNU coding
11223 standards. Use "file name" or "file" or "name", depending on
11224 the context.
11225 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
11226 not to hack/foo.tab.c.
11227 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
11228 * data/glr.c: b4_filename -> b4_file_name.
11229 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
11230 All uses changed.
11231 (class position): filename -> file_name. All uses changed.
11232 * data/yacc.c: b4_filename -> b4_file_name.
11233 * lib/bitset.h: filename -> file_name in local vars.
11234 * lib/bitset_stats.c: Likewise.
11235 * src/files.c: Likewise.
11236 * src/scan-skel.l ("@output ".*\n): Likewise.
11237 * src/files.c (file_name_split): Renamed from filename_split.
11238 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
11239
112402005-09-08 Paul Eggert <eggert@cs.ucla.edu>
11241
11242 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
11243 to accommodate latest gnulib.
11244
11245 * tests/glr-regression.at (Duplicate representation of merged trees):
11246 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
11247
11248 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
11249 needed.
11250
42a6501d
PE
112512005-08-26 Paul Eggert <eggert@cs.ucla.edu>
11252
11253 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
11254 All uses changed. Invoke user destructor after an error during a
11255 split parse (trivial change from Joel E. Denny).
11256
11257 * tests/glr-regression.at
11258 (User destructor after an error during a split parse): New test case.
11259 Problem reported by Joel E. Denny in:
11260 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
11261
ef9a1faf
PE
112622005-08-25 Paul Eggert <eggert@cs.ucla.edu>
11263
5b4aaf78
PE
11264 * README-cvs: Give URLs for recommended tools.
11265 Mention Gzip version problem, and bootstrapping issues.
11266 Remove troubleshooting section, as it's somewhat obsolete.
11267
b5240ba5
PE
11268 * bootstrap (no_cache): New var, to accommodate different wget
11269 variants. Use it instead of '-C off'. Problem reported by
11270 twlevo@xs4all.nl.
11271
ef9a1faf
PE
11272 * data/glr.c (yydestroyStackItem): New function.
11273 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
11274 debugging information. Problem reported by Joel E. Denny.
11275
e6efa9da
AD
112762005-08-25 Akim Demaille <akim@epita.fr>
11277
11278 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
11279
adc90f13
PE
112802005-08-24 Paul Eggert <eggert@cs.ucla.edu>
11281
11282 * data/glr.c (yyrecoverSyntaxError, yyreturn):
11283 Don't invoke destructor on unresolved entries.
11284 * tests/glr-regression.at
11285 (User destructor for unresolved GLR semantic value): New test case.
11286 Problem reported by Joel E. Denny in:
11287 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
11288
f9315de5
PE
112892005-08-21 Paul Eggert <eggert@cs.ucla.edu>
11290
15d29c1f
PE
11291 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
11292 Add strnlen.c.
11293 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
11294 lib-prefix.m4, po.m4.
11295
dd5f2af2
PE
11296 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
11297 in yydestruct diagnostic, since it might not be an error.
11298 Problem reported by Joel Denny near end of
11299 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 11300 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
11301 * data/yacc.c (yyreturn): Likewise.
11302 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
11303
11304 * src/files.c: Remove obsolete FIXME comment.
11305
11306 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
11307 with the other templates, and to fix bogus run-on messages such
11308 as the one reported at the end of
11309 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
11310 All callers changed to avoid the newline.
11311 (yyprocessOneStack): Output two lines rather than one, to accommodate
11312 the above change. This changes the debug output format slightly.
11313
f9315de5
PE
11314 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
11315 reported by Joel E. Denny in
11316 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
11317 (trivial change).
11318 * tests/glr-regression.at (Duplicate representation of merged trees):
11319 New test, from Joel E. Denny in:
11320 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
11321 * THANKS: Add Joel E. Denny.
11322
11323 * configure.ac (AC_INIT): Bump to 2.0c.
11324
04098407
PE
113252005-07-24 Paul Eggert <eggert@cs.ucla.edu>
11326
11327 * NEWS: Version 2.0b.
11328
ca5d2013
PE
11329 * Makefile.am (SUBDIRS): Put examples before tests, so that
11330 "make check" doesn't finish with "All 1 tests passed".
11331
3d54b576
PE
11332 * tests/regression.at (Token definitions): Don't rely on
11333 AT_PARSER_CHECK for data that contains backslashes. It currently
11334 uses 'echo', and 'echo' isn't portable if its argument contains
11335 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
11336 that the byte '\0xff' is not printable in the C locale; it is,
11337 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
11338 not printable, so use '\0x81' to test.
11339
d53ae497
PE
11340 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
11341 version of GCC, since the macro is used with non-GCC compilers.
11342
fc01665e
PE
11343 Fix core dump reported by Pablo De Napoli in
11344 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
11345 * tests/regression.at (Invalid inputs with {}): New test.
11346 * src/parse-gram.y (token_name): Translate type before using
11347 it as an index.
11348
04098407
PE
11349 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
11350 the user's name space. All uses changed to __attribute__
11351 ((__unused__)).
11352 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
11353 Add __attribute__ ((__noreturn__)).
11354
11355 * etc/clcommit: Remove. We weren't using it, and it failed
11356 "make maintainer-distcheck".
11357 * Makefile.maint: Merge from coreutils.
11358 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
11359 (syntax-check-rules): Change list of rules as described below.
11360 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
11361 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
11362 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
11363 (sc_trailing_space): New rules.
11364 (sc_xalloc_h_in_src): Remove.
11365 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
11366 (sc_space_tab, sc_error_exit_success, sc_changelog):
11367 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
11368 (makefile-check, po-check, author_mark_check):
11369 (makefile_path_separator_check, copyright-check):
11370 Use grep -n, to make it easier to find violations.
11371 Use CVS_LIST and CVS_LIST_EXCEPT.
11372 (header_regexp, h_re): Remove.
11373 (dd_c): New macro.
11374 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
11375 (my-distcheck): Use more-modern GCC flags.
11376 (signatures, %.asc): Remove.
11377 (rel-files, announcement): Remove signatures.
11378 Restore old updating code, even though we don't use it, so
11379 that we're the same as coreutils.
11380 (alpha, beta, major): Depend on news-date-check.
11381 Make the upload commands.
11382
11383 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
11384 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
11385 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
11386 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
11387 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
11388 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
11389 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
11390 * tests/sets.at: Likewise.
11391
11392 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
11393 we comment out the Autoconf version number.
11394 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
11395 it's error-prone and "make maintainer-distcheck" rejects it.
11396
11397 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
11398 Indent calls to "error" to pacify "make maintainer-distcheck",
11399 when the calls are not intended to be translated.
11400 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
11401
11402 * src/Makefile.am (DEFS): Use +=, to pacify
11403 "make maintainer-distcheck".
11404 (bison_SOURCES): Add scan-skel.h.
11405 (sc_tight_scope): New rule, from coreutils.
11406
11407 * src/files.c (src_extension, header_extension):
11408 Now static, not extern.
11409 * src/getargs.c (short_options): Likewise.
11410 * src/muscle_tab.c (muscle_table): Likewise.
11411 * src/parse-gram.y (current_class, current_type, current_prec):
11412 Likewise.
11413 * src/reader.c (grammar_end, previous_rule_end): Likewise.
11414 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
11415 * src/main.c (main): Cast bindtextdomain and textdomain calls to
11416 void, to avoid warning when NLS is disabled.
11417 * src/output.c: Include scan-skel.h.
11418 (scan_skel): Remove decl, since scan-skel.h does this.
11419 (output_skeleton):
11420 Indent calls to "error" to pacify "make maintainer-distcheck".
11421 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
11422 * src/reader.h (gram_end, gram_lineno): New decls to pacify
11423 "make maintainer-distcheck".
11424 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
11425 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
11426 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
11427 (skel_lex_destroy, scan_skel): Move these decls to...
11428 * src/scan-skel.h: New file.
11429 * src/uniqstr.c (uniqstr_assert):
11430 Indent calls to "error" to pacify "make maintainer-distcheck".
11431
11432 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
11433 not @VAR@.
11434
11435 * tests/torture.at: Revamp to avoid misuse of atoi that
11436 "make maintainer-distcheck" complained about.
11437
11438 * examples/extexi (message): Don't print a message more than once,
11439 and omit line-number decoration that makes Emacs compile think
11440 that informative messages are worth worrying about.
11441
114422005-07-22 Paul Eggert <eggert@cs.ucla.edu>
11443
11444 * configure.ac: Update version number.
11445
11446 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
11447 accidentally.
11448 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
11449 autogenerated by the maintainer.
11450 * examples/calc++/.cvsignore: Add *.yy.
11451
11452 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
11453 * lib/bitset_stats.c (bitset_stats_init): Likewise.
11454 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11455
11456 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
11457
11458 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
11459 from maintainer-distcheck about casting the argument of 'free'.
11460
11461 * NEWS: Mention recent yytname changes.
11462 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
11463
11464 * bootstrap: For translations that have not yet been upgraded to
11465 the new runtime-po domain, prime the pump by extracting the
11466 relevant strings from the obsolete translations. This code can be
11467 removed once the bison-runtime domain has been translated by each
11468 team.
11469
11470 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
11471 now that token names are already quoted.
11472
11473 Fix problem reported by Anthony Heading.
11474 * data/glr.c (YYTOKEN_TABLE): New macro.
11475 (yytname): Define if YYTOKEN_TABLE.
11476 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
11477 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
11478 (YYERROR_VERBOSE): Define the same way the other skeletons do.
11479 * src/output.c (prepare_symbols): Output token_table_flag.
11480
0ffda363
PE
114812005-07-21 Paul Eggert <eggert@cs.ucla.edu>
11482
11483 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
11484 again if the first call fails.
11485
11486 * data/glr.c (yytnamerr): New function.
11487 (yyreportSyntaxError): Use it to dequote most string literals.
11488 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
11489 with other skeletons. All uses changed.
11490 (yytnameerr_): New function.
11491 (yyreport_syntax_error): Use it to dequote most string literals.
11492 * data/yacc.c (yytnamerr): New function.
11493 (yyerrlab): Use it to decode most string literals.
11494 * doc/bison.texinfo (Decl Summary, Calling Convention):
11495 Clarify quoting convention of yytname.
11496 * src/output.c (prepare_symbols): Quote all names. This undoes
11497 the 2005-04-17 change, which is now accomplished (mostly) via
11498 changes in the parsers as described above.
11499 * tests/regression.at (Token definitions, Web2c Actions):
11500 Undo most 2005-04-17 change here, too.
11501
115022005-07-20 Paul Eggert <eggert@cs.ucla.edu>
11503
11504 Fix more problems reported by twlevo@xs4all.nl.
11505 * tests/cxx-type.at: Don't pipe output of ./types through sed to
11506 remove trailing spaces. This loses the exit status of ./types,
11507 and isn't needed since ./types shouldn't be emitting trailing
11508 spaces.
11509 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
11510 as the stack isn't valid in that case.
11511
11512 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
11513 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
11514 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
11515 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
11516 is used.
11517 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
11518 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
11519 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
11520 Likewise.
11521
11522 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
11523 overly-picky compilers that reject 'char *foo = "bar";'.
11524
11525 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
11526 to FILE * parameter, not to stderr. This fixes a typo introduced
11527 in the 2005-07-12 change.
11528
11529 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
11530 warnings from GCC 4.
11531
11532 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
11533 (yyglrShiftDefer, yysplitStack):
11534 Remove unused parameters b4_pure_formals. All uses changed.
11535 (yyglrShift): Remove unused parameters b4_user_formals.
11536 All uses changed.
11537 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
11538
6100a9aa
PE
115392005-07-18 Paul Eggert <eggert@cs.ucla.edu>
11540
258b75ca
PE
11541 Destructor cleanups and regularization among the three skeletons.
11542 * NEWS: Document the behavior changes.
11543 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
11544 stack before failing, as the cleanup code will do it for us now.
11545 * data/lalr1.cc (yyerrlab): Likewise.
11546 * data/glr.c (yyparse): Pop everything off the stack before
11547 freeing it, so that destructors get called properly.
11548 * data/lalr1.cc (yyreturn): Likewise.
11549 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
11550 This is more consistent.
11551 * doc/bison.texinfo (Destructor Decl): Mention more reasons
11552 why destructors might be called. 1.875 -> 2.1.
11553 (Destructor Decl, Decl Summary, Table of Symbols):
11554 Some English-language cleanups for %destructor.
11555 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11556 Add output line for destructor of start symbol.
11557 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
11558 because of that same extra output line.
11559
1a059451
PE
11560 * NEWS: Document minor wording changes in diagnostics of
11561 Bison-generated parsers.
11562 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
11563 Remove unused formals. All uses changed.
11564 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
11565 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
11566 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
11567 Rename yyoverflowab to yyexhaustedlab.
11568 When memory exhaustion occurs during syntax-error reporting,
11569 report it separately rather than in a single diagnostic; this
11570 eases translation.
11571 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
11572 (Memory Exhausted): Renamed from Parser Stack Overflow.
11573 Revamp wording slightly to prefer "memory exhaustion".
11574 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
11575
97460c78
PE
11576 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
11577
30757c8c
PE
11578 Add i18n support to the GLR skeleton. Partially fix the C++
11579 skeleton; a C++ expert needs to finish this. Remove debugging
11580 msgids; there's little point to having them translated, since they
11581 can be understood only by someone who can read the
11582 (English-language) source code.
11583
11584 Generate runtime-po/bison-runtime.pot automatically, so that we
11585 don't have to worry about garbage getting in that file. We'll
11586 make sure after the next official release that old msgids don't
11587 get lost. See
11588 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
11589
11590 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
11591 Now auto-generated.
11592 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
11593 Fix typos in explanations of the runtime file.
11594 * bootstrap: Change gettext keyword from YYI18N to YY_.
11595 Use standard Makefile.in.in in runtime-po, since we'll arrange
11596 for backward-compatible bison-runtime.po files in a different way.
11597 * data/glr.c (YY_): New macro, from yacc.c.
11598 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
11599 Translate messages intended for users.
11600 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
11601 the wording in the other skeletons. We don't know that the memory
11602 is virtual.
11603 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
11604 Use same method that yacc.c uses.
11605 Don't translate debugging messages.
11606 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
11607 it doesn't work (yet), and requires C++ expertise to fix.
11608 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
11609 Move defn to a more logical place, to be consistent with other
11610 skeletons.
11611 Don't translate debugging messages.
11612 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
11613 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
11614 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
11615 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
11616
ac8c5689
PE
11617 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
11618 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
11619 void, not int.
11620 * tests/glr-regression.at (Badly Collapsed GLR States):
11621 Likewise.
11622 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11623 yylex should return 0 at EOF rather than aborting.
11624
6100a9aa
PE
11625 Improve tests for stack overflow in GLR parser.
11626 Problem reported by twlevo@xs4all.nl.
11627 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
11628 All uses removed.
11629 (yyStackOverflow): Just longjmp, but with value 2 so that caller
11630 can handle the problem.
11631 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
11632 (yyparse): New local variable yyresult to record the result.
11633 Use result of setjmp to set it, rather than storing itinto
11634 struct.
11635 (yyDone): Remove label.
11636 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
11637 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
11638 if YYABORT is used).
11639 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
11640 yyparse status; put status > 1 into diagnostic.
11641 Check that status==2 works.
11642 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
11643 Use exit status 3 for failure to open (which shouldn't happen).
11644
15f40952
PE
116452005-07-17 Paul Eggert <eggert@cs.ucla.edu>
11646
67fd79c4
PE
11647 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
11648 1 on syntax error; just let yyparse do its thing.
11649 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
11650 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
11651 (Exploding the Stack Size with Alloca):
11652 (Exploding the Stack Size with Malloc):
11653 Expect exit status 2, not 1, since the parser is supposed to blow
11654 its stack. Problem reported by twlevo@xs4all.nl.
11655
15f40952
PE
11656 * data/glr.c (yyparse): Don't assume that the initial calls
11657 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
11658 Print a stack-overflow message and fail instead.
11659 Initialize the line-number information before creating the stack,
11660 so that the stack-overflow message can report line zero safely.
11661
f32c66b5
PE
116622005-07-14 Paul Eggert <eggert@cs.ucla.edu>
11663
a22ff96f 11664 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
11665 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
11666 (yyuserMerge): Provide a default case if b4_mergers is empty.
11667 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
11668 * tests/glr-regression.at
11669 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 11670 Add casts to pacify C++ compilers.
1beb0b24
PE
11671 * tests/glr-regression.at (Improper merging of GLR delayed action
11672 sets): Declare yylex before using it.
f32c66b5 11673 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
11674 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
11675 test for valgrind; valgrind is independent of g++.
11676 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
11677 for compatibility with POSIX 1003.1-2001 (if running coreutils).
11678 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
11679 Use a destructor, so that we can expand the stack. Change
11680 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 11681
d741bd1b
PE
116822005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11683
11684 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
11685 a valgrind failure. Problem reported by twlevo@xs4all.nl.
11686
0410a6e0
PE
116872005-07-13 Paul Eggert <eggert@cs.ucla.edu>
11688
11689 * PACKAGING: New file, suggested by Bruno Haible and taken from
11690 similar wording in gettext's PACKAGING file.
11691 * NEWS: Mention PACKAGING.
11692 * Makefile.am (EXTRA_DIST): Add PACKAGING.
11693
f7ab6a50
PE
116942005-07-12 Paul Eggert <eggert@cs.ucla.edu>
11695
baf785db 11696 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
11697 * bootstrap: Get runtime translations into runtime-po.
11698 Create runtime-po files automatically, if possible.
11699 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
11700 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
11701 does not infringe on the user's name space.
11702 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
11703 * doc/bison.texinfo (Internationalization): Revamp the English
11704 and Texinfo syntax a bit, to try to make it clearer.
11705 (Bison Options, Option Cross Key): Mention --print-localedir.
11706 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
11707 YYENABLE_NLS. Quote a bit more.
11708 * runtime-po/.cvsignore: New file.
11709 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
11710 * runtime-po/Rules-quot: Remove; now created by bootstrap.
11711 * runtime-po/quot.sed: Likewise.
11712 * runtime-po/boldquot.sed: Likewise.
11713 * runtime-po/en@quot.header: Likewise.
11714 * runtime-po/en@boldquot.header: Likewise.
11715 * runtime-po/insert-header.sin: Likewise.
11716 * runtime-po/remove-potcdate.sin: Likewise.
11717 * runtime-po/Makevars: Likewise.
11718 * runtime-po/LINGUAS: Likewise.
11719 * runtime-po/de.po: Likewise; we will rely on the translation project
11720 to maintain this, so "bootstrap" should get it.
0410a6e0 11721 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
11722 its value.
11723 * src/main.c (main): Bind the bison-runtime domain, too.
11724
117252005-07-12 Bruno Haible <bruno@clisp.org>
11726
11727 * data/yacc.c: Include <libintl.h> when NLS is enabled.
11728 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
11729 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
11730 * runtime-po: New directory.
11731 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
11732 $(DOMAIN).pot-update rule, so that old messages are never dropped.
11733 * runtime-po/Rules-quot: New file, copied from po/.
11734 * runtime-po/quot.sed: Likewise.
11735 * runtime-po/boldquot.sed: Likewise.
11736 * runtime-po/en@quot.header: Likewise.
11737 * runtime-po/en@boldquot.header: Likewise.
11738 * runtime-po/insert-header.sin: Likewise.
11739 * runtime-po/remove-potcdate.sin: Likewise.
11740 * runtime-po/Makevars: New file.
11741 * runtime-po/POTFILES.in: New file.
11742 * runtime-po/LINGUAS: New file.
11743 * runtime-po/bison-runtime.pot: New file.
11744 * runtime-po/de.po: New file.
11745 * m4/bison.m4: New file.
11746 * Makefile.am (SUBDIRS): Add runtime-po.
11747 (aclocaldir, aclocal_DATA): New variables.
11748 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
11749 Define aclocaldir.
11750 * src/getargs.c (usage): Document --print-localedir option.
11751 (PRINT_LOCALEDIR_OPTION): New enum item.
11752 (long_options): Add --print-localedir option.
11753 (getargs): Handle --print-localedir option.
11754 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
11755 (Internationalization): New section.
11756
22dda0f0
AD
117572005-07-12 Akim Demaille <akim@epita.fr>
11758
11759 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
11760 for consistency with the rest of the code.
11761 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
11762 Add separators.
11763
82b248ad
AD
117642005-07-12 Akim Demaille <akim@epita.fr>
11765
11766 * src/parse-gram.y: Use %printer instead of YYPRINT.
11767
fa0e9314
AD
117682005-07-12 Akim Demaille <akim@epita.fr>
11769
867a3e00
AD
11770 * src/symtab.h, src/symtab.c (symbol_print): New.
11771 * src/symlist.h, src/symlist.c (symbol_list_print): New.
11772 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
11773
117742005-07-12 Akim Demaille <akim@epita.fr>
11775
11776 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
11777 b4_at_dollar and b4_dollar_dollar.
11778
e054b190
PE
117792005-07-11 Paul Eggert <eggert@cs.ucla.edu>
11780
11781 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
11782 and Pennello's paper.
11783
34160ec4
PE
117842005-07-09 Paul Eggert <eggert@cs.ucla.edu>
11785
407d4a75
PE
11786 * data/yacc.c (yyparse): Undo previous patch. Instead,
11787 set yylsp[0] and yyvsp[0] only if the initial action
11788 sets yylloc and yylval, respectively.
11789
34160ec4
PE
11790 * data/yacc.c (yyparse): In the initial action, set
11791 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
11792 This avoids the use of undefined variables if the initial
11793 action does not set yylloc and/or yylval.
11794
c3d5a4a7
PE
117952005-07-07 Paul Eggert <eggert@cs.ucla.edu>
11796
b34d96c1
PE
11797 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
11798 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
11799 Remove from CVS. These files are automatically generated.
11800 * examples/extexi: Clarify that this file is now part of Bison,
11801 not GNU M4, and that it works with any POSIX-compatible Awk.
11802 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
11803 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
11804 so that we also get calc++-parser.yy. Geneate it.
11805 Use $(AWK), not gawk, since any conforming Awk will do.
11806 Put comment before action, since older 'make' can't handle comment
11807 in action.
11808 $(BUILT_SOURCES): List all built sources, not just some of them.
11809 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
11810 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
11811 $($(calc_sources_generated)): Remove unnecessary test for existence
11812 of target. (This had a shell syntax error anyway; a stray "x".)
11813 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
11814 calc++-parser.yy.
11815 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
11816
c3d5a4a7
PE
11817 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
11818 implied by the other modules.
11819
828c373b
AD
118202005-07-06 Akim Demaille <akim@epita.fr>
11821
11822 Bind examples/calc++ to the package.
11823 * examples/calc++/Makefile: Remove, replaced by...
11824 * examples/calc++/Makefile.am: ... this new file.
11825 * examples/calc++/test: Remove input.
11826 * examples/calc++/compile: Remove.
11827 * examples/Makefile.am: New.
11828 * configure.ac, Makefile.am: Adjust.
11829 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
11830
63cb01d6
PE
118312005-07-05 Paul Eggert <eggert@cs.ucla.edu>
11832
fd2df2ed
PE
11833 * data/glr.c (yyFail): Drastically simplify; since the format argument
11834 never had any % directives, we can simply pass it to yyerror.
11835 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
11836 be modified later, as that is the usual style in glr.c.
11837 Problems reported by Paul Hilfinger.
11838
63cb01d6
PE
11839 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
11840 and size overflow errors.
11841 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
11842 in case the user prolog sets feature-test macros like _GNU_SOURCE.
11843 (YYSIZEMAX): New macro.
11844 (yystpcpy): New function, taken from yacc.c.
11845 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
11846 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
11847 so that we don't have to maintain their signatures.
11848 (yyFail): Check for buffer overflow, by using vsnprintf rather
11849 than vsprintf. Allocate a bigger buffer if possible.
11850 Report an error if buffer allocation fails.
11851 (yyStackOverflow): New function.
11852 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
11853 the initialization was successful. It might fail if storage was
11854 exhausted.
11855 (yyexpandGLRStack): Add more checks for storage allocation failure.
11856 Use yyStackOverflow to report failures.
11857 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
11858 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
11859 Don't assume stack number fits in int.
11860 (yysplitStack): Check for storage allocation failure.
11861 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
11862 can print diagnostics on storage allocation failure. All callers
11863 changed.
11864 (yyresolveValue): Use yybool for boolean.
11865 (yyreportSyntaxError): Check for size-calculation overflow.
11866 This code is taken from yacc.c.
11867 (yyparse): Check for storage allocation errors when allocating
11868 the initial stack.
11869
1c59e0a1
AD
118702005-07-05 Akim Demaille <akim@epita.fr>
11871
11872 Extract calc++ from the documentation.
11873 * doc/bison.texinfo (Calc++): Add the extraction marks.
11874 * examples/extexi: New, from the aborted GNU Programming 2E.
11875 Separate the different paragraph of a file with empty lines.
11876 * examples/Makefile: Use it to extract the whole calc++ example.
11877
8a0adb01
AD
118782005-06-24 Akim Demaille <akim@epita.fr>
11879
11880 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
11881 class typedefs.
11882
12545799
AD
118832005-06-22 Akim Demaille <akim@epita.fr>
11884
11885 * doc/bison.texinfo (C++ Language Interface): First stab.
11886 (C++ Parsers): Remove.
11887
99be0235
AD
118882005-06-22 Akim Demaille <akim@epita.fr>
11889
11890 * data/lalr1.cc (yylex_): Honor %lex-param.
11891
0ffd4fd1
AD
118922005-06-22 Akim Demaille <akim@epita.fr>
11893
11894 Start a set of simple examples.
11895 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
11896 * examples/calc++/calc++-driver.hh,
11897 * examples/calc++/calc++-parser.yy,
11898 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
11899 * examples/calc++/compile, examples/calc++/test: New.
11900
0925ebb4
PE
119012005-06-09 Paul Eggert <eggert@cs.ucla.edu>
11902
11903 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
11904 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
11905 which stems from the 2005-05-27 patch.
11906
43d3b664
PH
119072005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11908
11909 * data/glr.c: Modify treatment of unused parameters to permit use
11910 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
11911
3062864d
PE
119122005-05-30 Paul Eggert <eggert@cs.ucla.edu>
11913
11914 Fix infringement on user name space reported by Janos Zoltan Szabo.
11915 * data/yacc.c (yyparse): strlen -> yystrlen.
11916
989b5b8e
AD
119172005-05-30 Akim Demaille <akim@epita.fr>
11918
11919 * data/lalr1.cc (_): New.
11920 Translate the various messages.
11921
bedf57f5
PE
119222005-05-27 Paul Eggert <eggert@cs.ucla.edu>
11923
11924 Fix infringement on user name space reported by Bruno Haible.
11925 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
11926 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
11927 the user's name space.
11928 (alloca): Include <stdlib.h> to get it, if it's not built in.
11929 (YYMALLOC, YYFREE): Define only if needed.
11930 (malloc, free): Declare, but only if needed, as this infringes on
11931 the user name space.
11932
4d1801f1
PE
119332005-05-25 Paul Eggert <eggert@cs.ucla.edu>
11934
11935 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
11936 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
11937 with %d format.
11938 * lib/ebitset.c (min, max): Undef before defining.
11939 * lib/vbitset.c (min, max): Likewise.
11940 * lib/subpipe.c (create_subpipe): Save local variables in case
11941 vfork clobbers them.
11942
119432005-05-24 Bruno Haible <bruno@clisp.org>
11944
11945 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
11946 error message syntax used by gcc-4.0.
11947
b94a9e1e
PE
119482005-05-23 Paul Eggert <eggert@cs.ucla.edu>
11949
85ac3861
PE
11950 * README: Mention m4 1.4.3. Remove obsolete advice about
11951 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
11952
b94a9e1e
PE
11953 * bootstrap: Remove workaround for problem I encountered with
11954 gettext 0.14.1; it seems to be fixed now.
11955
51c30d21
PE
119562005-05-22 Paul Eggert <eggert@cs.ucla.edu>
11957
009ce67d
PE
11958 * NEWS: Version 2.0a.
11959
f2a97c62
PE
11960 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
11961 the previous change.
11962
c8775f93
PE
11963 Various maintainer cleanups.
11964 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
11965 conftest*, for benefit of CVS commands run at the same time as
11966 "configure". Add build-aux, since "bootstrap" now creates it and
11967 its subfiles.
11968 * Makefile.cfg (move_if_change): Remove.
11969 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
11970 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
11971 (po_repo, do-po-update, po-update, wget_files, get-targets):
11972 (config.guess-url_prefix, config.sub-url_prefix):
11973 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
11974 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
11975 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
11976 Remove.
11977 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
11978 this is now the recommended name.
11979 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
11980 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
11981 ylwrap. These files now go into build-aux.
11982 * config/move-if-change: Remove.
11983 * config/prev-version.txt: Bump from 1.75 to 2.0.
11984
3ea5f0ec
PE
11985 * bootstrap: Add stdio-safer, unistd-safer modules.
11986 Remove m4/glibc2.m4 (introduced by latest gnulib, but
11987 we don't need it).
11988 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
11989 fopen-safer.c, stdio-safer.h, unistd-safer.h.
11990 * lib/subpipe.c: Include "unistd-safer.h".
11991 (create_subpipe): Make sure all the newly-created
11992 file descriptors are > 2, so that diagnostics don't
11993 get sent down them (which might cause Bison to hang, in theory).
11994 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
11995 * src/files.c (xfopen): Use fopen_safer, not fopen.
11996
51c30d21
PE
11997 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
11998 yesterday's yacc.c fix.
11999
cea1469d
PE
120002005-05-21 Paul Eggert <eggert@cs.ucla.edu>
12001
3ea5f0ec
PE
12002 * data/glr.c, data/lalr1.cc: Update copyright date.
12003
cea1469d
PE
12004 Fix a destructor bug reported by Wolfgang Spraul in
12005 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
12006 * data/yacc.c (yyabortlab): Don't call destructor, and
12007 don't set yychar to EMPTY.
12008 (yyoverflowlab): Don't call destructor.
12009 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
12010 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
12011 since we no longer output the message "discarding lookahead token
12012 end of input ()".
12013
5e6f62f2
PH
120142005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12015
12016 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
12017 fix a small glitch in debugging output.
12018 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
12019 after YY_SYMBOL_PRINT where needed.
12020
12021 (struct yyGLRState): Add some comments.
12022 (struct yySemanticOption): Add some comments.
12023 (union yyGLRStackItem): Add comment.
12024
12025 (yymergeOptionSets): Correct this to properly perform the union,
12026 avoiding infinite reported by Michael Rosien.
12027 Update comment.
12028
12029 * tests/glr-regression.at: Add test for GLR merging error reported
12030 by M. Rosien.
cea1469d 12031
0fb669f9
PE
120322005-05-13 Paul Eggert <eggert@cs.ucla.edu>
12033
12034 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
12035 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
12036 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
12037 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
12038 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
12039 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
12040 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
12041 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
12042 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
12043 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
12044 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
12045 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
12046 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
12047 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
12048 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
12049 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
12050 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
12051 src/derives.h, src/files.c, src/files.h, src/getargs.c,
12052 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
12053 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
12054 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
12055 src/output.h, src/parse-gram.c, src/parse-gram.h,
12056 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
12057 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
12058 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
12059 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
12060 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
12061 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
12062 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
12063 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
12064 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
12065 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
12066 tests/reduce.at, tests/regression.at, tests/sets.at,
12067 tests/synclines.at, tests/testsuite.at, tests/torture.at:
12068 Update FSF postal mail address.
12069
51f4735e
PE
120702005-05-11 Paul Eggert <eggert@cs.ucla.edu>
12071
12072 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
12073 Problem reported by Ralf Menzel.
12074
80ce3401
PE
120752005-05-01 Paul Eggert <eggert@cs.ucla.edu>
12076
12077 * tests/actions.at: Test that stack overflow invokes destructors.
12078 From Marcus Holland-Moritz.
12079 * data/yacc.c (yyerrlab): Move the code that destroys the stack
12080 from here....
12081 (yyreturn): to here. That way, destructors are called properly
12082 even if the stack overflows, or the user calls YYACCEPT or
12083 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
12084 (yyoverflowlab): Destroy the lookahead.
12085
120862005-04-24 Paul Eggert <eggert@cs.ucla.edu>
12087
12088 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
12089
72f000b0
PE
120902005-04-17 Paul Eggert <eggert@cs.ucla.edu>
12091
12092 * NEWS: Bison-generated C parsers no longer quote literal strings
12093 associated with tokens.
12094 * src/output.c (prepare_symbols): Don't escape strings,
12095 since users don't want to see C escapes.
12096 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
12097 in diagnostics.
c19683bb 12098 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
12099 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
12100
1094323f
PE
121012005-04-16 Paul Eggert <eggert@cs.ucla.edu>
12102
12103 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
12104 the data size is known to be too small and we can't increase it.
12105 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
12106
ca407bdf
PE
121072005-04-15 Paul Eggert <eggert@cs.ucla.edu>
12108
12109 * src/parse-gram.y: Include quotearg.h.
12110 (string_as_id): Quote $1 before using it as a key, since the
12111 lexer no longer quotes it for us.
12112 (string_content): Don't strip quotes, since lexer no longer
12113 quotes it for us.
12114 * src/scan-gram.l: Include quotearg.h.
12115 ("\""): Omit quote.
12116 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
12117 a key, since the rest of the lexer doesn't quote it.
12118 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
12119 * tests/regression.at (Token definitions): Check for backslashes
12120 in token strings.
12121
12122 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
12123 (YYSIZE_T): Define to unsigned long int when using an older compiler.
12124 (yyparse): Revamp code to generate long syntax error message, to
12125 make it easier to translate, and to avoid problems with arithmetic
12126 overflow. Change "virtual memory" to "memory" in diagnostic, since
12127 we don't know whether the memory is virtual.
12128
1ce59070
PE
121292005-04-13 Paul Eggert <eggert@cs.ucla.edu>
12130
12131 * NEWS: Bison-generated C parsers now use the _ macro to
12132 translate strings.
12133 * data/yacc.c (_) [!defined _]: New macro.
12134 All English strings wrapped inside this macro.
12135 * doc/bison.texinfo (Bison Parser): Document _.
12136 * po/POTFILES.in: Include src/parse-gram.c, since it now
12137 includes translateable strings that parse-gram.y doesn't.
12138
a749a695
PE
121392005-04-12 Paul Eggert <eggert@cs.ucla.edu>
12140
12141 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
12142 reverting the 2004-10-11 change to this function.
12143 (symbol_check_alias_consistency): Don't call symbol_type_set
12144 if the type name is already correct.
12145 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
12146
8fb1053b
PE
121472005-03-25 Paul Eggert <eggert@cs.ucla.edu>
12148
12149 * tests/regression.at (Token definitions): Don't use a token named
12150 c, as that generates a "#define c ..." that runs afoul of buggy
12151 stdlib.h that uses the identifier c as a member of struct
12152 drand48_data. Problem reported by Horst Wente.
12153
ff498c4a
PE
121542005-03-21 Paul Eggert <eggert@cs.ucla.edu>
12155
12156 * bootstrap: Change translation URL from
12157 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
12158 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
12159 redirection glitches. Problem reported by twlevo@xs4all.nl.
12160
65211d70
PE
121612005-03-20 Paul Eggert <eggert@cs.ucla.edu>
12162
12163 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
12164 after operands; POSIX says this isn't portable for the c99 command.
12165
9577fb1f
PE
121662005-03-18 Paul Eggert <eggert@cs.ucla.edu>
12167
12168 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
12169 immediately if a data overrun has occurred; this may help us track
12170 down what may be a spurious failure on MacOS.
12171
78b178f7
PE
121722005-03-17 Paul Eggert <eggert@cs.ucla.edu>
12173
a2599d0f
PE
12174 Respond to problems reported by twlevo@xs4all.nl.
12175
12176 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
12177
78b178f7
PE
12178 * src/vcg.h: Comment fix.
12179 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
12180 (G_CMAX): Change to -1 instead of INT_MAX.
12181
12182 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 12183
7296e729
PE
121842005-03-15 Paul Eggert <eggert@cs.ucla.edu>
12185
12186 * src/tables.c (state_number_to_vector_number): Put it inside an
12187 "#if 0", since it's not currently used. Problem reported by
12188 Roland McGrath.
12189
05ac60f3
PE
121902005-03-06 Paul Eggert <eggert@cs.ucla.edu>
12191
12192 * src/output.c (escaped_output): Renamed from
12193 escaped_file_name_output, since we now use it for symbol tags as
12194 well. All uses changed.
12195 (symbol_destructors_output, symbol_printers_output):
12196 Escape symbol tags too.
12197 Problem reported by Matyas Forstner in
12198 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
12199
12200 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
12201 not needed.
12202 * src/output.c (user_actions_output, token_definitions_output,
12203 symbol_destructors_output, symbol_printers_output): Likewise.
12204 * src/reader.c (prologue_augment): Likewise.
12205 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
12206
12207 * src/vcg.c (output_edge): Don't quote linestyle arg.
12208 Problem reported by twlevo@xs4all.nl.
12209
7eb453ac
PE
122102005-02-28 Paul Eggert <eggert@cs.ucla.edu>
12211
12212 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
12213 example, reported by Derek M Jones. Also, make the example even
12214 more outrageous, to better illustrate how bad the problem is.
12215
4c04c52a
PE
122162005-02-24 Paul Eggert <eggert@cs.ucla.edu>
12217
12218 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
12219 putsym. Typo reported by Sebastian Piping.
12220
a61e1620
PE
122212005-02-23 Paul Eggert <eggert@cs.ucla.edu>
12222
12223 * doc/bison.texinfo (Language and Grammar): some -> same
12224 (Epilogue): int he -> in the
12225 Typos reported by Sebastian Piping via Justin Pence.
12226
9ec93868
PE
122272005-02-07 Paul Eggert <eggert@cs.ucla.edu>
12228
12229 * tests/glr-regression.at (Improper handling of embedded actions
12230 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
12231 embedded actions and $-N in GLR parsers", work around an Autoconf bug
12232 with dollar signs in test names.
12233 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
12234 for a similar reason.
12235
73ce7e7e
PE
122362005-01-28 Paul Eggert <eggert@cs.ucla.edu>
12237
12238 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
12239 wants to redefine G_VIEW.
12240
2e72b98e
PE
122412005-01-27 Paul Eggert <eggert@cs.ucla.edu>
12242
12243 * src/vcg.c (get_view_str): Remove case for normal_view.
12244 Problem reported by twlevo@xs4all.nl.
12245
e0d634e5
PE
122462005-01-24 Paul Eggert <eggert@cs.ucla.edu>
12247
ccf830a4
PE
12248 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
12249 Problem reported by twlevo@xs4all.nl.
12250
e0d634e5
PE
12251 * doc/bison.texinfo: Change @dircategory from "GNU programming
12252 tools" to "Software development". Requested by Richard Stallman
12253 via Karl Berry.
12254
7bbc8cb0
PE
122552005-01-23 Paul Eggert <eggert@cs.ucla.edu>
12256
12257 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
12258 Problem reported by twlevo@xs4all.nl.
12259
08b770bc
PE
122602005-01-21 Paul Eggert <eggert@cs.ucla.edu>
12261
12262 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
12263 keyword; it's not needed with modern compilers, and it doesn't
12264 affect correctness with older compilers. Suggested by
12265 twlevo@xs4all.nl.
12266
95f22ad2
PE
122672005-01-17 Paul Eggert <eggert@cs.ucla.edu>
12268
12269 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
12270 gcc -Wswitch-default.
12271 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12272 * data/yacc.c (yyparse): Likewise.
12273
d229d15c
PE
122742005-01-12 Paul Eggert <eggert@cs.ucla.edu>
12275
12276 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
12277 already. Let config.h define any nonstandard values.
12278
ecadd90f
PE
122792005-01-10 Paul Eggert <eggert@cs.ucla.edu>
12280
12281 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
12282 for the benefit of slower hosts. Problem reported by
12283 Nelson H. F. Beebe.
12284
213744b5
PE
122852005-01-07 Paul Eggert <eggert@cs.ucla.edu>
12286
12287 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
12288 being defined and not used.
12289 * data/lalr1.cc (yyparse): Likewise.
12290 Use "if (false)" rather than "if (0)".
12291
249d3236
PE
122922005-01-05 Paul Eggert <eggert@cs.ucla.edu>
12293
12294 * TODO: Mention that we should allow NUL bytes in tokens.
12295
987cc1fb
PE
122962005-01-02 Paul Eggert <eggert@cs.ucla.edu>
12297
12298 * src/scan-skel.l (<<EOF>>): Don't close standard output.
12299 Problem reported by Hans Aberg.
12300
08fe02d9
PE
123012005-01-01 Paul Eggert <eggert@cs.ucla.edu>
12302
12303 * src/getargs.c (version): Happy new year; update overall
12304 program copyright date from 2004 to 2005.
12305
12306 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
12307 Problem reported by Hans Aberg.
12308 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
12309 (Output file names.): Add a test for the case when standard output
12310 is closed.
12311
010c0266
PE
123122004-12-26 Paul Eggert <eggert@cs.ucla.edu>
12313
12314 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
12315 to fix an oversight in the Bison 2.0 manual.
12316
da12206a
PE
123172004-12-25 Paul Eggert <eggert@cs.ucla.edu>
12318
12319 * NEWS: Version 2.0. Reformat the existing news items since
12320 1.875, so that related items are grouped together.
3a4734aa 12321 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
12322 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
12323
c935d934
PE
12324 * tests/torture.at (Exploding the Stack Size with Alloca): Set
12325 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
12326 otherwise, we're not testing alloca. Unfortunately there's no
12327 simple way to consult HAVE_ALLOCA here.
12328
da12206a
PE
12329 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
12330 for yymsg, too.
12331
12332 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
12333 hand. This avoids a warning about comparing int to size_t when
12334 GCC warnings are enabled.
12335
0a2c5137
PE
123362004-12-22 Paul Eggert <eggert@cs.ucla.edu>
12337
d7e14fc0
PE
12338 * NEWS: Bison-generated parsers no longer default to using the
12339 alloca function (when available) to extend the parser stack, due
12340 to widespread problems in unchecked stack-overflow detection.
12341 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
12342 responsibility to set it to a positive value. This lets the user
12343 specify a value that is not a preprocessor constant.
12344 * data/yacc.c (YYMAXDEPTH): Likewise.
12345 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
12346 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
12347 to be a compile-time constant. However, explain the constraints on it.
12348 Also, explain the constraints on YYINITDEPTH.
12349 (Table of Symbols): Explain that alloca is no longer the default.
12350 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
12351 to 1.
12352
0a2c5137
PE
12353 * doc/bison.texinfo (Location Default Action): Mention that n must
12354 be zero when k is zero. Suggested by Frank Heckenbach.
12355
e019c247
AD
123562004-12-22 Akim Demaille <akim@epita.fr>
12357
12358 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
12359 (parser::state_type, parser::semantic_type, parser::location_type):
12360 Private, not public.
12361 (parser::parse): Return ints, not bool.
12362 Returning a bool introduces a problem: 0 corresponds to false, and
12363 it seems weird to return false on success. Returning true changes
12364 the conventions for yyparse.
12365 Alternatively we could return void and send an exception.
12366 There is no clear consensus (yet?).
12367 (state_stack, semantic_stack, location_stack): Rename as...
12368 (state_stack_type, semantic_stack_type, location_stack_type): these.
12369 Private, not public.
12370 * tests/c++.at: New.
12371 * tests/testsuite.at, tests/Makefile.am: Adjust.
12372
72731bb7
AD
123732004-12-21 Akim Demaille <akim@epita.fr>
12374
12375 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
12376
9a0d8bec
AD
123772004-12-21 Akim Demaille <akim@epita.fr>
12378
12379 Don't impose std::string for filenames.
12380
12381 * data/lalr1.cc (b4_filename_type): New.
12382 (position::filename): Use it.
12383 (parser.hh): Move the inclusion of stack.hh and location.hh below
12384 the user code, so that needed headers for the filename type can be
12385 included first.
72731bb7
AD
12386 Forward declare them before the user code.
12387 * tests/Makefile.am (check-local, installcheck-local): Pass
12388 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 12389
99880de5
AD
123902004-12-20 Akim Demaille <akim@epita.fr>
12391
12392 Use more STL like names: my_class instead of MyClass.
12393
12394 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
12395 (SemanticStack, SemanticType, StateStack, StateType)
12396 (TokenNumberType, Stack, Slice, Traits, Parser::location)
12397 (Parser::value): Rename as...
12398 (location_stack, location_type, rhs_number_type, semantic_stack)
12399 (semantic_type, state_stack, state_type, token_number_type, stack)
12400 (slice, traits, parser::yylloc, parser::yylval): these.
12401
12402 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
12403
9bec482e
PE
124042004-12-19 Paul Eggert <eggert@cs.ucla.edu>
12405
12406 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
12407 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12408
f6fbd3da
PE
124092004-12-17 Paul Eggert <eggert@cs.ucla.edu>
12410
12411 Remove uses of 'short int' and 'unsigned short int'. This raises
12412 some arbitrary limits. It uses more memory but nowadays that's
12413 not much of an issue.
12414
12415 This change does not affect the generated parsers; that's a different
12416 task, as some users will want to conserve memory there.
12417
12418 Ideally we should use size_t to represent all object counts, and
12419 something like ptrdiff_t to represent signed differences of object
12420 counts; but that will require more code-cleanup than I have the
12421 time to do right now.
12422
12423 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
12424 Use size_t, not int or short int, to count objects.
12425 * src/closure.c (nritemset, closure): Likewise.
12426 * src/closure.h (nritemset, closure): Likewise.
12427 * src/nullable.c (nullable_compute): Likewise.
12428 * src/print.c (print_core): Likewise.
12429 * src/print_graph.c (print_core): Likewise.
12430 * src/state.c (state_compare, state_hash): Likewise.
12431 * src/state.h (struct state): Likewise.
12432 * src/tables.c (default_goto, goto_actions): Likewise.
12433
12434 * src/gram.h (rule_number, rule): Use int, not short int.
12435 * src/output.c (prepare_rules): Likewise.
12436 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
12437 errs, reductions): Likewise.
12438 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
12439 Likewise.
12440 * src/tables.c (vector_number, tally, action_number,
12441 ACTION_NUMBER_MINIMUM): Likewise.
12442 * src/output.c (muscle_insert_short_int_table): Remove.
12443
efeed023
AD
124442004-12-17 Akim Demaille <akim@epita.fr>
12445
12446 * data/lalr1.cc: Extensive Doxygenation.
12447 (error_): Rename as...
12448 (error): this, since it is visible to the user.
12449 Adjust callers.
12450 (Parser::message): Now an automatic variable from...
12451 (Parser::yyreport_syntax_error_): here.
12452 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
12453 Parser::error.
12454 * tests/input.at: Escape $.
12455
bc82c5a5
PE
124562004-12-16 Paul Eggert <eggert@cs.ucla.edu>
12457
12458 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
12459 Parenthesize rhs to avoid obscure problems with mistakes like
12460 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
12461 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12462 b4_rhs_location): Likewise.
12463 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12464 b4_rhs_location): Likewise.
12465
fd19f271
AD
124662004-12-16 Akim Demaille <akim@epita.fr>
12467
12468 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
12469 yacc.c: be sure to stay within yycheck_.
12470 * tests/actions.at: Re-enable C++ tests.
12471
10454ea4
AD
124722004-12-16 Akim Demaille <akim@epita.fr>
12473
12474 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
12475 real.
12476
c5b95ccf
AD
124772004-12-16 Akim Demaille <akim@epita.fr>
12478
12479 Use #define to handle the %name-prefix.
12480
12481 * data/glr.c, data/yacc.c: Comment changes.
12482 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
12483 so that one can refer to yylex in the parser file, and have it
12484 renamed, as is the case with other skeletons.
12485
617a8f12
AD
124862004-12-16 Akim Demaille <akim@epita.fr>
12487
12488 Move lalr1.cc internals into yy*.
12489
12490 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
12491 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
12492 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
12493 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
12494 (empty_, final_, terror_, errcode_, ntokens_)
12495 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
12496 (looka_, ilooka_, error_range_, nerrs_):
12497 Rename as...
12498 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
12499 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
12500 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
12501 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
12502 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
12503 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
12504 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
12505 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
12506 these.
12507
1e547e6e
PE
125082004-12-15 Paul Eggert <eggert@cs.ucla.edu>
12509
12510 Fix some problems reported by twlevo at xs4all.
12511 * src/symtab.c (symbol_new): Report an error if the input grammar
12512 contains too many symbols. This is better than calling abort() later.
12513 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
12514 (struct node, struct graph):
12515 Rename member expand to stretch. All uses changed.
12516 (struct graph): Remove member layoutalgorithm. All uses removed.
12517 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
12518 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
12519 All uses changed.
12520 (N_STRETCH): Rename from N_EXPAND. All uses changed.
12521
735d6bd4
AD
125222004-12-15 Akim Demaille <akim@epita.fr>
12523
12524 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
12525 Add more Doxygen comments.
12526 (symprint_, stack_print_, reduce_print_, destruct_, pop)
12527 (report_syntax_error_, translate_): Rename as...
12528 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
12529 (yypop_, yyreport_syntax_error_, yytranslate_): this.
12530
2e1f5829
AD
125312004-12-15 Akim Demaille <akim@epita.fr>
12532
12533 * data/lalr1.cc (lex_): Rename as...
12534 (yylex_): this.
12535 Move the trace here.
12536 Take the %name-prefix into account.
12537 Reported by Alexandre Duret-Lutz.
12538
a3cb6248
AD
125392004-12-15 Akim Demaille <akim@epita.fr>
12540
12541 Simplify the C++ parser constructor.
12542
12543 * data/lalr1.cc (debug_): Rename as...
12544 (yydebug_): so that the parser's internals are always in the yy*
12545 pseudo namespace.
12546 Adjust uses.
12547 (b4_parse_param_decl): Remove the leading comma as it is now only
12548 called as unique argument list.
12549 (Parser::Parser): Remove the constructor accepting a location and
12550 an initial debugging level.
12551 Remove from the other ctor the argument for the debugging level.
12552 (debug_level_type, debug_level, set_debug_level): New.
12553
12554 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
12555 constructor calls.
12556
07fed891
AD
125572004-12-15 Akim Demaille <akim@epita.fr>
12558
12559 Remove b4_root related material: failure experiment
a3cb6248 12560 (which goal was to allow to derive from a class).
07fed891
AD
12561
12562 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
12563 definitions and uses.
12564
e603eaa5
PE
125652004-12-14 Paul Eggert <eggert@cs.ucla.edu>
12566
12567 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
12568 not 2, since it's not portable to subtract 1 from the start of an
12569 array. The new item 0 is never set or used. All uses changed.
12570
12571 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
12572 the default definition of YYLLOC_DEFAULT. Problem reported
12573 by Frank Heckenbach.
12574
fafb007d
PE
125752004-12-12 Paul Eggert <eggert@cs.ucla.edu>
12576
12577 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
12578 the normal case and one for the error case. Just use the
12579 first one uniformly. Problem reported by Frank Heckenbach.
12580 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
12581 use exactly the same macro in both places.
12582 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
12583 so that the normal-case YYRHSLOC works for the error case too.
12584 All uses changed.
12585 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
12586 (YYLLOC_DEFAULT): Use the same macro as glr.c.
12587 * doc/bison.texinfo (Location Default Action): Don't claim that
12588 we have an array of locations. Use the same macro for both glr
12589 and lalr parsers. Mention YYRHSLOC. Mention what happens when
12590 the index is 0.
12591
48814dcd
PE
125922004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12593
a4e1a53b
PE
12594 * HACKING: Update email addresses to send announcements to.
12595
48814dcd
PE
12596 * configure.ac (AC_INIT): Bump version to 1.875f.
12597
337116ba
PE
125982004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12599
12600 * NEWS: Version 1.875e.
12601 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
12602
12603 * src/scan-skel.l: Include "complain.h", for "fatal".
12604
12605 * src/relation.h (relation_print, relation_digraph):
12606 Relation sizes are of type relation_node, not size_t (this is
12607 merely a doc fix, since the two types are equivalent).
12608 (relation_transpose): Relation sizes are of type relation_node,
12609 not int.
12610 * src/relation.c: Likewise.
12611 (top, infinity): Now of type relation_node, not int.
12612 (traverse, relation_transpose): Use relation_node, not int.
12613
12614 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
12615 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
12616 (yyparse): Remove unused local introduced in 2004-10-25 patch.
12617
12618 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 12619 specifying whether the test should be skipped. Use it tp
337116ba 12620 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 12621 fail on some hosts, and should be skipped.
337116ba 12622
da2a7671
PE
126232004-12-08 Paul Eggert <eggert@cs.ucla.edu>
12624
12625 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
12626 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
12627 unless otherwise specified below.
12628
12629 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
12630 to allocate kernel_base, kernel_items, kernel_size, since
12631 they needn't be initialized to 0.
12632 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
12633 * src/closure.c (new_closure): Likewise, for itemset.
12634 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
12635 * src/lalr.c (set_goto_map): Likewise, for temp_map.
12636 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
12637 (build_relations): Likewise for edge, states1, includes.
12638 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
12639 * src/reader.c (packgram): Likewise, for ritem, rules.
12640 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
12641 * src/relation.c (relation_digraph): Likewise for VERTICES.
12642 (relation_transpose): Likewise for new_R, end_R.
12643 * src/symtab.c (symbols_token_translations_init): Likewise for
12644 token_translations.
12645 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
12646 (token_actions): Likewise for yydefact, actrow, conflrow,
12647 conflict_list.
12648 (save_column): Likewise for froms[symno], tos[symno].
12649 (goto_actions): Likewise for state_count.
12650 (pack_table): Likewise for base, pos, check.
12651 (tables_generate): Likewise for width.
12652
12653 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
12654 for initial core. Just have a separate core, so we needn't worry
12655 about whether kernel_size and kernel_base are initialized.
12656
12657 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
12658 kernel_size, kernel_items): Remove unnecessary initialization.
12659 * src/conflicts.c (conflicts): Likewise.
12660 * src/derives.c (derives): Likewise.
12661 * src/muscle_tablc (muscle_insert): Likewise.
12662 * src/relation.c (relation_digraph): Likewise.
12663 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
12664 conflrow, conflict_table, conflict_list, table, check):
12665 Likewise.
12666
12667 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
12668 This is because all callers pass unsigned int.
12669 * src/closure.h (new_closure): Likewise.
12670
12671 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
12672 (build_relations): Initialize includes[i] in all cases.
12673 * src/reader.c (packgram): Always initialize rules[ruleno].prec
12674 and rules[ruleno].precsym. Initialize members in order.
12675 * src/relation.c (relation_transpose): Always initialize new_R[i]
12676 and end_R[i].
12677 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
12678
12679 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
12680 conflict_list[0] was always 0, but now it isn't initialized.
12681
12682 * src/table.c (table_grow): When conflict_table grew, the grown
12683 area wasn't cleared. Fix this.
12684
12685 * lib/.cvsignore: Add strdup.c, strdup.h.
12686 * m4/.cvsignore: Add strdup.m4.
12687
00baeeac
PE
126882004-12-07 Paul Eggert <eggert@cs.ucla.edu>
12689
12690 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
12691 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
12692 GOTO_NUMBER_MAXIMUM, since we occasionally compute
12693 ngotos + 1 without checking for overflow.
12694 (build_relations): Use END_NODE, not -1, to denote end of edges.
12695 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
12696 build_relations): Use goto_number, not int, for goto numbers.
12697 * src/tables.c (save_column, default_goto): Likewise.
12698
be3d9d42
AD
126992004-11-23 Akim Demaille <akim@epita.fr>
12700
12701 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
12702 of #defining from yystype.
12703 Don't typedef yystype, C++ does not need it.
12704 This lets it possible to forward declare it as union.
12705
78e526d5
PE
127062004-11-23 Paul Eggert <eggert@cs.ucla.edu>
12707
12708 * bootstrap (gnulib_modules): Add extensions.
12709 Problem reported by Jim Meyering.
12710
afbb696d
PE
127112004-11-22 Paul Eggert <eggert@cs.ucla.edu>
12712
12713 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
12714 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
12715 src/system.h, src/tables.c: XFREE -> free, to accommodate
12716 recent change to gnulib xalloc.h.
78e526d5 12717 Problem reported by Jim Meyering.
afbb696d 12718
c1f8f16a
AD
127192004-11-17 Akim Demaille <akim@epita.fr>
12720
12721 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
12722
db7e5eb5 127232004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
12724 Alexandre Duret-Lutz <adl@gnu.org>
12725
12726 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
12727 changes.
12728 (YYCDEBUG): Adjust.
12729 Use it instead of cdebug_.
12730 (Parser::debug_stream, Parser::set_debug_stream): New.
12731 (Parser::symprint_): Define cdebug_ for temporary backward
12732 compatibility.
12733 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
12734 debug_stream ().
12735
68e11668
AD
127362004-11-17 Akim Demaille <akim@epita.fr>
12737
12738 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
12739 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
12740 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
12741 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12742
97cbc73e
PE
127432004-10-27 Paul Eggert <eggert@cs.ucla.edu>
12744
12745 * data/glr.c (yyloc_default): Remove; not used.
12746 Problem reported by Frank Heckenbach.
12747
e342c3be
AD
127482004-10-25 Akim Demaille <akim@epita.fr>
12749
12750 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
12751 Introduce another definition to address simple location arrays.
12752 (yyGLRStack): New member: yyerror_range.
12753 (yyrecoverSyntaxError, yyparse): Update it.
12754 (yyrecoverSyntaxError): Use it when shifting the error token to
12755 have an accurate range, equivalent to the one computed by both
12756 yacc.c and lalr1.cc.
12757 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
12758 that column numbers start at column 0, as per GNU Coding
12759 Standards, the others tests, and the doc.
12760 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
12761 Adjust to the above change (first column is 0).
12762 And adjust the location of the "<error>", now covering the whole
12763 line.
12764
93602feb 127652004-10-22 Akim Demaille <akim@epita.fr>
04098407 12766 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
12767
12768 Remove some arbitrary limits on goto numbers and relations.
12769 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
12770 initial values, since they're never used.
12771 (set_goto_map): ngotos is now unsigned, so test for overflow
12772 by seeing whether it wraps around to zero.
12773 * src/lalr.h (goto_number): Now size_t, not short int.
12774 (GOTO_NUMBER_MAXIMUM): Remove.
12775 * src/relation.c (relation_print, traverse, relation_transpose):
12776 Check for END_NODE rather than looking at sign.
12777 * src/relation.h (END_NODE): New macro.
12778 (relation_node): Now size_t, not short int.
12779
dba08b04
PE
127802004-10-22 Paul Eggert <eggert@cs.ucla.edu>
12781
12782 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
12783 keyword, not an identifier. Problem reported by Baron Schwartz in
12784 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
12785
df09ef2e
AD
127862004-10-11 Akim Demaille <akim@epita.fr>
12787
12788 * src/symtab.c (symbol_check_alias_consistency): Also check
12789 type names, destructors, and printers.
12790 Reported by Alexandre Duret-Lutz.
12791 Recode the handling of associativity and precedence in terms
12792 of symbol_precedence_set.
12793 Accept no redeclaration at all, not even equal to the previous
12794 value.
12795 (redeclaration): New.
12796 Use it to factor redeclaration complaints.
12797 (symbol_make_alias): Don't set the type of the alias, let
12798 symbol_check_alias_consistency do it as for other features.
12799 * src/symtab.h (symbol): Add new member prec_location, and
12800 type_location.
12801 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
12802 * tests/input.at (Incompatible Aliases): New.
12803
146bc99d
PE
128042004-10-09 Paul Eggert <eggert@cs.ucla.edu>
12805
12806 .cvsignore fixes to accommodate gnulib changes,
12807 and the practice of naming build directories "_build".
12808 * .cvsignore: Add "_*". Sort.
12809 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
12810 * m4/.cvsignore: Add "*_gl.m4".
12811
e503aa60
AD
128122004-10-06 Akim Demaille <akim@epita.fr>
12813
12814 * src/parse-gram.y (add_param): Fix the truncation of trailing
12815 spaces.
12816
b4a20338
AD
128172004-10-05 Akim Demaille <akim@epita.fr>
12818
12819 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
12820 whether the reducion was empty or not. This leaves room to
12821 improve the use of YYLLOC_DEFAULT in such a case.
12822 lalr1.cc is still experimental, so changing this is acceptable.
12823 And finally, there are probably not many users who changed the
12824 handling of locations in GLR, so changing is admissible too.
12825
12826 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
12827 empty reduction, set @$ to an empty location ending the previously
12828 stacked symbol.
12829 Adjust uses to make sure the code is triggered on empty
12830 reductions.
12831 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
12832 expected output: empty reductions have empty locations.
12833
f85a5e6f
AD
128342004-09-29 Akim Demaille <akim@epita.fr>
12835
12836 * data/lalr1.cc: Move towards a more standard C++ coding style
12837 for templates: Class < T > -> Class<T>.
12838
b203fc2c
AD
128392004-09-29 Akim Demaille <akim@epita.fr>
12840
12841 * data/lalr1.cc: Reinstall the former ctor, for sake of
12842 compatibility, but warn it will be removed.
12843 Move towards a more standard C++ coding style (i.e., type *var ->
12844 type* var).
12845
5b7e1e73
PE
128462004-09-27 Paul Eggert <eggert@cs.ucla.edu>
12847
3fee967f
PE
12848 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
12849 since it's less likely to work if NULs are involved in the future.
5b7e1e73 12850
0dcca5c2
AD
128512004-09-27 Akim Demaille <akim@epita.fr>
12852
12853 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
12854
6dde1c82
AD
128552004-09-27 Akim Demaille <akim@epita.fr>
12856
12857 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 12858 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
12859 and argument names.
12860 (b4_cc_constructor_call): Likewise.
12861
b233d555
AD
128622004-09-24 Akim Demaille <akim@epita.fr>
12863
12864 * src/parse-gram.y (add_param): Strip the leading and trailing
12865 blanks from a formal argument declaration.
12866 (YY_LOCATION_PRINT): New.
12867
619404e3
AD
128682004-09-24 Akim Demaille <akim@epita.fr>
12869
12870 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
12871 after the location.
12872
dd8d9022
AD
128732004-09-24 Akim Demaille <akim@epita.fr>
12874
12875 * doc/bison.texinfo (Table of Symbols): Sort.
12876
0092f063
AD
128772004-09-21 Akim Demaille <akim@epita.fr>
12878
12879 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
12880 the useless parentheses.
12881 Suggested by Paul Eggert.
12882
451364ed
AD
128832004-09-20 Akim Demaille <akim@epita.fr>
12884
12885 Let the initial-action act on the look-ahead, and use it for the
12886 "initial push" (corresponding to an hypothetical beginning-of-file).
12887 And let lalr1.cc honor %initial-action.
12888
12889 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
12890 example.
12891 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
12892 (Parser::Parser): Remove the ctor that used to initialize it.
12893 (Parser::parse): Like in the other skeletons, issue the "starting
12894 parse" message before any action.
12895 Honor %initial-action.
12896 Initialize the stacks with the lookahead.
12897 * data/yacc.c: Let $$ and @$ in %initial-action designate the
12898 look-ahead.
12899 Push them in the stacks.
12900 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
12901
18d192f0
AD
129022004-09-20 Akim Demaille <akim@epita.fr>
12903
12904 * doc/bison.texinfo (Initial Action Decl): New.
12905
b8458aa5
AD
129062004-09-20 Akim Demaille <akim@epita.fr>
12907
12908 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
12909 clearer criterion to define it.
12910 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
12911 When reducing on an empty RHS, use the latest stacked location as
12912 location.
12913 yylloc is not always available.
12914 * data/glr.c: Likewise.
12915 Also, honor initial-actions.
12916
3fc16193
AD
129172004-09-20 Akim Demaille <akim@epita.fr>
12918
12919 * data/yacc.c (YY_LOCATION_PRINT): New.
12920 Define when we know YYLTYPE's structure, i.e., when the default
12921 YYLLOC_DEFAULT is used.
12922 * data/c.m4 (b4_yysymprint_generate): Use it.
12923 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
12924 value of the result.
12925 (error_start_): Replace with...
12926 (error_range_): this location array.
12927 This allows to replace code relying on the implementation of
12928 locations by portable code.
12929 * data/yacc.c (yylerrsp): Replace with...
12930 (yyerror_range): this.
12931 Every time a token is popped, update yyerror_range[0], to have an
12932 accurate location for the error token.
12933 * data/glr.c (YY_LOCATION_PRINT): New.
12934 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
12935 deference a pointer.
12936 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
12937 report the location in %printers.
12938
12939 * src/scan-skel.l: Instead of abort, report error messages to ease
12940 understanding skeleton scanning failures.
12941
ecfe33e7
AD
129422004-09-16 Akim Demaille <akim@epita.fr>
12943
12944 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
12945 (iterator, const_iterator): these, to be more in the C++ spirit.
12946 Also, return reverse iterators so that when displaying the stack
12947 we display its bottom first.
12948 (Parser::stack_print_, Parser::reduce_print_): Match the messages
12949 from yacc.c.
12950 We should probably use vector here though.
12951
1576d44d
AD
129522004-09-16 Akim Demaille <akim@epita.fr>
12953
12954 Have more complete shift traces.
12955
12956 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
12957 to report Shifts instead of ad hoc YYDPRINTF invocations,
12958 including for the error token.
12959 * data/lalr1.cc (symprint_): Output the location.
12960 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
12961 output the location within the %printer.
12962 Activate GLR tests, at least to make sure they compile properly.
12963 They still don't pass though.
12964 * tests/calc.at: Adjust expect verbose output, since now "Entering
12965 state..." is on a different line than the "Shifting" message.
12966
9c66f418
AD
129672004-09-08 Akim Demaille <akim@epita.fr>
12968
12969 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
12970 Bison directive from the Bison file to the invocation of this
12971 macro, so that these directives are passed to
12972 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
12973 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
12974 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
12975 the extra Bison directives instead of the whole series.
12976 Change the grammar so that there are recoverable errors, and
12977 unrecoverable errors. Now we can have the parser give up before
12978 consuming the whole input. As a result we now can observe that
12979 the lookahead is freed when needed.
12980 Change the parser source to parse argv[1] instead of a hard coded
12981 string.
12982 Simplify yylex, and give a value and location to EOF.
12983 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
12984 passed directives already coded in the file.
12985 Add some tests to check the location of "error".
12986 For some tests, the C++ parser is correct, and not yacc.c.
12987 For other tests, they provide different, but unsatisfying, values,
12988 so keep the C++ value so that at least one parser is "correct"
12989 according to the test suite.
12990 (Actions after errors): Remove, this is subsumed by the
12991 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
12992
52d5733f
AD
129932004-09-06 Akim Demaille <akim@epita.fr>
12994
12995 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 12996 (Parser::pop): New.
52d5733f
AD
12997 Use it.
12998
a0e68930
AD
129992004-09-06 Akim Demaille <akim@epita.fr>
13000
13001 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
13002 argument, an informative message.
13003 Call YY_SYMBOL_PRINT.
13004 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
13005 * data/lalr1.cc (destruct_): Likewise.
13006 In addition, no longer depend on b4_yysymprint_generate and
13007 b4_yydestruct_generate to generate these functions, do it "by
13008 hand".
13009
e757bb10
AD
130102004-09-03 Akim Demaille <akim@epita.fr>
13011
13012 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
13013 invoked, yydestruct the lookahead.
13014 * tests/calc.at (Calculator $1): Update the expected lengths of
13015 traces: there is an added line for the discarded lookahead.
13016 * doc/bison.texinfo (Destructor Decl): Some rewording.
13017 Define "discarded" symbols.
13018
0fe1f06d
AD
130192004-09-02 Akim Demaille <akim@epita.fr>
13020
13021 * data/lalr1.cc (translate_, destruct_): No reason to be static.
13022
284acc8b
AD
130232004-09-02 Akim Demaille <akim@epita.fr>
13024
13025 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
13026 (YYDSYMPRINTF): Rename as...
13027 (YY_SYMBOL_PRINT): this.
13028 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
13029 two.
13030 Use it instead of direct symprint_ calls.
13031 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
13032 one.
13033
a5eb1ed2
AD
130342004-09-02 Akim Demaille <akim@epita.fr>
13035
b7c72fe1
AD
13036 * data/lalr1.cc (b4_yysymprint_generate): New.
13037 (symprint_): New member function, defined when YYDEBUG.
13038 Use it consistently instead of token/nterm debugging output by
13039 hand.
a5eb1ed2
AD
13040 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
13041 %printer calls to use cdebug_ when using lalr1.cc.
13042
417141dd
AD
130432004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
13044
13045 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
13046 with #ifdef YYDEBUG.
13047
2fa09258
AD
130482004-08-26 Akim Demaille <akim@epita.fr>
13049
13050 * doc/bison.texinfo (Implementing Loops): Rename as...
13051 (Implementing Gotos/Loops): this.
13052
9378b508
PE
130532004-08-13 Paul Eggert <eggert@cs.ucla.edu>
13054
13055 Adjust to latest gnulib.
13056 * bootstrap (gnulib_modules): Add xalloc-die.
13057 Set LC_ALL=C so that file names sort consistently.
13058 Prefer the gnulib copies of gettext.m4, glibc21.m4,
13059 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
13060 uintmax_t.m4, ulonglong.m4.
13061 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
13062 po.m4 since we are now using _gl.m4 instead.
13063
87a8ad5c
PE
130642004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
13065
13066 * src/scan-action.l: Remove. Scanning of semantic actions is
13067 handled in scan-gram.l.
13068
dca81a78
PE
130692004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
13070
13071 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
13072
13073 * src/location.h (struct): The file member is a uniqstr.
13074 (equal_boundaries): Use UNIQSTR_EQ for comparison.
13075
c9cbf7c5
PE
130762004-07-22 Paul Eggert <eggert@cs.ucla.edu>
13077
13078 Fix bug with non-%union parsers that have printers or destructors,
13079 which led to a Bison core dump. Reported by Peter Fales in
13080 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 13081
c9cbf7c5
PE
13082 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
13083 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
13084 not to our own type.
13085 * src/output.c (symbol_destructors_output, symbol_printers_output):
13086 Don't assume %union.
13087 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
13088 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
13089 UNION-FLAG. All callers changed.
13090 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
13091 Use type char, not unsigned int, when declaring an array of char;
13092 this lets us remove a cast.
13093 (Printers and Destructors): Add non-%union test cases.
13094
fa7e68c3
PE
130952004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13096
13097 * doc/bison.texinfo: Minor editorial changes, mostly to the new
13098 GLR writeups. E.g., avoid frenchspacing and the future tense,
13099 change "lookahead" to "look-ahead", and change "wrt" to "with
13100 respect to".
2fa09258 13101
fa7e68c3
PE
131022004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13103
13104 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
13105 New sections, split off from the GLR Parsers section. Put the new
13106 Simple GLR Parser near the start of the GLR section, for clarity.
13107 Rewrite connective text.
13108
99a9344e
PE
131092004-06-21 Frank Heckenbach <frank@g-n-u.de>
13110
13111 * doc/bison.texinfo (Simple GLR Parsers): New section.
13112
8dd162d3
PE
131132004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13114
13115 * NEWS, TODO, doc/bison.texinfo:
13116 Use "look-ahead" instead of "lookahead", to be consistent.
13117 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
13118 while we're fixing "look-ahead".
13119 * src/conflicts.c (shift_set): Renamed from shiftset.
13120 (look_ahead_set): Renamed from lookaheadset.
13121 * src/print.c: Likewise.
13122 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
13123 name for "lookahead".
13124 (report_types, usage): Likewise.
13125 * src/getargs.h (report_look_ahead_tokens): Renamed from
13126 report_lookaheads.
13127 * src/lalr.c (compute_look_ahead_tokens): Renamed from
13128 compute_lookaheads.
13129 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
13130 (look_ahead_tokens_print): Renamed from lookaheads_print.
13131 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
13132 state_rule_lookaheads_print.
13133 * src/state.h: Likewise.
13134 (reductions.look_ahead_tokens): Renamed from lookaheads.
13135 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
13136 AT_DATA_LOOKAHEADS_GRAMMAR.
13137
57a90331
PE
131382004-06-03 Paul Eggert <eggert@cs.ucla.edu>
13139
13140 * README: Update location of patched M4 distribution.
13141
8ed3234a
PE
131422004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
13143
13144 Don't assume the C++ compiler takes the same arguments as the C compiler
13145 (trivial change).
13146 * configure.ac (O0CXXFLAGS): New var.
13147 * tests/atlocal.in (CXXFLAGS): Use it.
13148
07971983
PE
131492004-05-29 Paul Eggert <eggert@cs.ucla.edu>
13150
13151 Fix some "make check" problems with C++ reported by
13152 Albert Chin-A-Young for Tru64 C++ in this thread:
13153 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
13154
13155 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
13156 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13157 Output to a .cc file for C++, not to a .c file.
13158 * tests/calc.at (AT_CHECK_CALC): Likewise.
13159 * tests/regression.at (AT_CHECK_DANCER): Likewise.
13160 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
13161
29058652
PE
131622004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
13163
13164 * tests/calc.at, tests/actions.at: Workaround for SGI
13165 C++ compiler. (trivial change)
13166
62cb8a99
PE
131672004-05-27 Paul Eggert <eggert@cs.ucla.edu>
13168
fd418816
PE
13169 Spent a few hours checking out which prerequisite versions the
13170 current sources actually require. I went all the way back to
13171 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
13172 a seemingly endless set of combinations of versions more recent
13173 than that. The bottom line is that the current sources require
13174 fairly recent versions of the build tools, and it'll be some work
13175 to change this.
13176 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
13177 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
13178 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
13179 Add comments explaining why those particular versions are
13180 currently needed.
2fa09258 13181
62cb8a99
PE
13182 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
13183 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 13184 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
13185
13186 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
13187 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
13188
caa52c10
PE
131892004-05-26 Paul Eggert <eggert@cs.ucla.edu>
13190
13191 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
13192 0.11.5. Suggested by Bruno Haible.
13193 * bootstrap: Remove gettext version checking.
13194
13195 * doc/bison.texinfo (Decl Summary): Also mention that %union
13196 can depend on prerequisite types. Problem reported by Tim
13197 Van Holder.
13198
4bfd5e4e
PE
131992004-05-25 Paul Eggert <eggert@cs.ucla.edu>
13200
2cef3017
PE
13201 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
13202 * README-alpha: Don't tell people not to package this.
13203
b9c85d5c
PE
13204 * bootstrap: Don't assume $(...) works; use `...` instead.
13205 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
13206 gettext better.
13207
4bfd5e4e
PE
13208 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
13209 put into the -d output file, and mention what to do if YYSTYPE is
13210 defined as a macro.
13211
6a36ff94
PE
132122004-05-24 Paul Eggert <eggert@cs.ucla.edu>
13213
6712933e
PE
13214 Undo change made earlier today: it caused autopoint to not bring
13215 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
13216 autopoint's.
13217
13218 * bootstrap: Check that gettext version matches what's in
13219 configure.ac. Warn users to ignore robots.txt ERROR 404.
13220 * bootstrap: Undo today's earlier change (logged below).
13221 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 13222
6a36ff94
PE
13223 The gettext version checking is causing more trouble than it's
13224 curing; remove it. Problem reported by Paul Hilfinger.
13225
13226 * bootstrap: Issue a warning that one can expect a message
13227 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
13228 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
13229
209ea708
PE
132302004-05-23 Paul Eggert <eggert@cs.ucla.edu>
13231
13232 Ensure that the C++ compiler used for testing actually works on a
13233 simple test program; if not, skip the C++-related tests. Problem
13234 reported by Vin Shelton in:
161a71f3 13235 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
13236
13237 * m4/cxx.m4: New file.
13238 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
13239 * tests/atlocal.in (BISON_CXX_WORKS): Add.
13240 * tests/local.at (AT_COMPILE_CXX): Use it.
13241
41ca2549
PE
132422004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13243
383e69dc
PE
13244 * data/glr.c (yylloc): Output this macro even if locations are not
13245 being generated, as the GLR parser needs it even in that case.
13246 Problem reported by Troy A. Johnson
13247 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
13248
41ca2549
PE
13249 * configure.ac (AC_INIT): Update to 1.875e.
13250
e476c87d
PE
132512004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13252
13253 * NEWS: Version 1.875d.
13254 * configure.ac (AC_INIT): Likewise.
13255 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
13256
13257 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
13258 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
13259 lalr1.cc runs afoul of the first, and the last two are no longer
13260 supported by GCC 3.4.0.
13261 * README: Mention GNU m4 1.4 or later; mention m4 patches.
13262 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
13263
233a88ad
PE
132642004-05-06 Paul Eggert <eggert@cs.ucla.edu>
13265
13266 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
13267 unsigned int, for compatibility with latest gnulib hash module.
13268 * src/state.c (state_hash, state_hasher): Likewise.
13269 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
13270 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 13271
12ffdd28
PE
132722004-05-03 Paul Eggert <eggert@cs.ucla.edu>
13273
13274 * NEWS: Unescaped newlines are no longer allowed in char & strings.
13275
13276 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
13277 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
13278 character and string literals.
13279 (unexpected_end): New function.
13280 (unexpected_eof): Use it.
13281 (unexpected_newline): New function.
13282 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
13283 actions.
e476c87d 13284
12ffdd28
PE
13285 * NEWS: Document %expect-rr.
13286
13287 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
13288 Fix typo by replacing $1 with $option.
13289 Remove more 'intl'-related files.
9668e2be 13290 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
13291
13292 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
13293 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
13294 strtoul.c.
13295 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
13296 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
13297 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
13298 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
13299 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
13300 * src/.cvsignore: Add *.output.
13301
13302 * src/parse-gram.y: Put copyright notice inside %{ %} so it
13303 gets copied to the output file.
e476c87d 13304
1f65350a
PE
133052004-04-28 Paul Eggert <eggert@twinsun.com>
13306
13307 Get files from the gnulib and po repositories, instead of relying
13308 on them being in our CVS. Upgrade to latest versions of gnulib
13309 and Automake.
13310
13311 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
13312 * bootstrap: Bootstrap from gnulib and po repositories.
13313 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
13314 * README-cvs: Document these changes. Remove version numbers from
13315 mentions of build tools, since they change so often. Mention Flex.
13316
13317 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
13318 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
13319 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
13320 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 13321 does this for us.
12ffdd28
PE
13322 (AC_ISC_POSIX): Remove; we no longer support this
13323 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
13324 (AC_HEADER_STDC): Remove: we now assume C89 or better.
13325 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
13326 Do not check for C89 headers, except for locale.h which is used
13327 by the Yacc library and must port to K&R hosts.
13328 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
13329 Do not check for C89 functions, except for setlocale which is
13330 used by the Yacc library.
13331 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
13332 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
13333 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
13334 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
13335 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
13336 AM_GNU_GETTEXT): Remove; now done by:
13337 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
13338 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
13339 for us.
13340
13341 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
13342 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
13343 Define to empty, as gnulib.mk will do the rest for us.
13344 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
13345 for us.
13346 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
13347 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
13348
13349 * src/files.c: Include gnulib's xstrndup.h.
13350
13351 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
13352 (REALLOC): Use xnrealloc, for likewise.
13353 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
13354 (strnlen, memrchr): Remove decls; functions no longer used.
13355 Include <stpcpy.h>.
13356
13357 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
13358 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
13359 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
13360 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
13361 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
13362 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
13363 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
13364 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
13365 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
13366 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
13367 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
13368 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13369 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
13370 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
13371 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
13372 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
13373 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
13374 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
13375 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
13376 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
13377 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
13378 Remove, as these files are now generated automatically
13379 by bootstrap or automake.
13380
13381 * po/ChangeLog: Remove: all but one entry was a duplicate
13382 of this file, and I moved that 2000-11-02 entry here.
13383
13384 * config/.cvsignore: Add Makefile, depcomp, install-sh.
13385 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
13386 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
13387 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
13388 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
13389 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
13390 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
13391 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
13392 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
13393 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
13394 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
13395 xstrndup.h.
13396 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
13397 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
13398 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
13399 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
13400 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
13401 * src/.cvsignore: Remove *_.c.
13402
13403
13404 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
13405 support it. (The latest stable gzip doesn't.)
13406
134072004-04-27 Paul Eggert <eggert@twinsun.com>
13408
13409 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
13410 case, as stos_ is now used by destructors due to the 2004-02-09
13411 change.
13412
13413 Remove more K&R C support.
13414 * lib/libiberty.y (PARAMS): Remove. All uses removed.
13415 * lib/subpipe.c (errno): Remove decl.
13416 Include <stdlib.h> unconditionally.
13417 (EXIT_FAILURE): Remove macro.
13418 * src/complain.c (vfprintf, strerror): Remove.
13419 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
13420 unconditionally.
13421 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
13422 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
13423 (strchr, strspn, memchr): Remove decls.
13424 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
13425 unconditionally. Do not declare perror.
13426 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
13427 unconditionally.
13428
13429 * src/complain.c (_): Remove useless defn, as system.h defines this.
13430
13431 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
13432 with latest obstack.h.
13433 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
13434 to procedure types, as obstack.h now does that for us.
13435 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
13436
13437 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
13438 so that this include file can stand alone.
13439 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
13440 does this now. Include subpipe.h first after config.h, to
13441 test whether it can stand alone.
13442
13443 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
13444 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
13445 unused declaration.
13446
13447 * tests/synclines.at (%union synch line): Put a dummy member in
13448 the union, because empty unions aren't allowed in C. Caught
13449 by GCC 3.4.0.
13450
4f16766c
PE
134512004-04-13 Jim Meyering <jim@meyering.net>
13452
13453 * src/conflicts.c (conflicts_print): Correct format string typo:
13454 use `%%' to produce literal `%'. (trivial change)
13455
779e7ceb
PE
134562004-03-30 Paul Eggert <eggert@twinsun.com>
13457
13458 * src/getargs.c (version): Update copyright year to 2004.
13459
13460 * data/c.m4 (b4_int_type): Use 'short int' rather than
13461 'short', and similarly for 'long', 'unsigned', etc.
13462 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
13463 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
13464 yy_yypstack, yydumpstack): Likewise.
13465 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
13466 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
13467 Likewise.
13468 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
13469 yy_stack_print, yyparse): Likewise.
13470 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
13471 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
13472 * lib/bitset.c (bitset_print): Likewise.
13473 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
13474 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13475 * lib/bitsetv.c (bitsetv_dump): Likewise.
13476 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
13477 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
13478 Likewise.
13479 * src/LR0.c (allocate_itemsets): Likewise.
13480 * src/gram.h (rule_number, rule): Likewise.
13481 * src/lalr.h (goto_number): Likewise.
13482 * src/nullable.c (nullable_compute): Likewise.
13483 * src/output.c (prepare_rules): Likewise.
13484 * src/relation.c (relation_print, relation_digraph): Likewise.
13485 * src/relation.h (relation_node): Likewise.
13486 * src/state.h (state_number, transitions, errs, reductions,
13487 struct state): Likewise.
13488 * src/symtab.h (symbol_number, struct symbol): Likewise.
13489 * src/tables.c (vector_number, tally, action_number,
13490 default_goto, goto_actions): Likewise.
13491 * tests/existing.at (GNU Cim Grammar): Likewise.
13492 * tests/regression.at (Web2c Actions): Likewise.
13493
13494 * src/output.c (muscle_insert_short_int_table): Renamed from
13495 muscle_insert_short_table. All uses changed.
13496
d6328241
PH
134972004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
13498
13499 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
13500 (declaration): Replace expected_conflicts with expected_sr_conflicts.
13501 Add %expect-rr rule.
4f16766c 13502
d6328241
PH
13503 * src/scan-gram.l: Recognize %expect-rr.
13504
4f16766c 13505 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 13506 expected_conflicts.
4f16766c 13507 (expected_rr_conflicts): Declare.
d6328241
PH
13508
13509 * src/conflicts.c (expected_sr_conflicts): Rename from
13510 expected_conflicts.
13511 (expected_rr_conflicts): Define.
13512 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
13513 for GLR parsers.
13514 Use expected_sr_conflicts in place of expected_conflicts.
13515 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 13516
d6328241 13517 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 13518
1452af69
PE
135192004-03-08 Paul Eggert <eggert@gnu.org>
13520
13521 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 13522 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
13523
13524 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
13525 in lalr1.cc.
13526 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
13527 * src/scan-gram.l (scan_integer): New function.
13528 ({int}): Use it.
13529 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
13530 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
13531 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
13532 Say "long int", not "long", for uniformity with GNU style.
13533
006d217d
PE
135342004-02-25 Paul Eggert <eggert@twinsun.com>
13535
13536 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
13537 compilers. This fixes a problem with Intel's C++ compiler being
13538 chatty, reported by Guido Trentalancia in
161a71f3 13539 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 13540
c2729758
ADL
135412004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
13542
13543 Support %destructor and merge error locations in lalr1.cc.
13544
13545 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
13546 (Parser::stos_): Define unconditionally.
13547 (Parser::destruct_): New method. Generate its body with
13548 b4_yydestruct_generate.
13549 (Parser::error_start_): New attribute.
13550 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
13551 token which are discarded.
13552 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
13553 error_start_ when erroneous token are discarded.
13554 (Parser::parse) <yyerrlab1>: Compute the location of the error
13555 token so that it covers all the discarded tokens.
13556 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
13557 it can be called with `%skeleton "lalr1.cc"', and do that.
13558
dd0e0635
PE
135592004-02-02 Paul Eggert <eggert@twinsun.com>
13560
13561 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
13562 $(top_srcdir)/lib and ../lib. This fixes a bug reported
13563 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
13564 There's no need to mention top_builddir since Automake does that
13565 for us.
13566 (INCLUDES): Remove, as Automake says it's obsolescent.
13567 Contents migrated into AM_CPPFLAGS as described above.
13568 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
13569
135702004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13571
13572 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
13573 (yyreportSyntaxError): Handle case where lookahead token is
13574 YYEMPTY.
13575
be16239b
PH
135762004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13577
13578 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
13579 resulting parsers are compilable with C++.
13580
5fa90832
PE
135812003-12-23 Paul Eggert <eggert@twinsun.com>
13582
13583 * config/depcomp, config/install-sh: Sync with Automake 1.8.
13584 * src/output.c (output_skeleton): Rename local var.
13585 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
13586 Bison tokens, as this runs afoul of the 2003-10-07 change that
13587 disallowed NUL bytes in character constants or string literals.
13588
13589 * tests/local.at: Require Autoconf 2.59's Autotest.
13590 * tests/testsuite.at: Don't include local.at, since we now assume
13591 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
13592 including it.
13593 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
13594 multiple inclusion warnings.
dd0e0635 13595
b165c324
AD
135962003-12-02 Akim Demaille <akim@epita.fr>
13597
13598 * doc/bison.texinfo (How Can I Reset the Parser): More about start
13599 conditions.
13600 From Bruno Haible.
13601
26e06a21
ADL
136022003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
13603
13604 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
13605
92ac3705
PE
136062003-10-07 Paul Eggert <eggert@twinsun.com>
13607
6a5ecb38
PE
13608 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
13609 if testsuite doesn't exist.
13610
92ac3705
PE
13611 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
13612 literals, unfortunately.
13613 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
13614 Complain about NUL bytes in character constants or string literals.
13615
91d2c560
PE
136162003-10-05 Paul Eggert <eggert@twinsun.com>
13617
13618 * NEWS: Don't document %no-default-prec, as it's still
13619 too experimental.
13620 * doc/bison.texinfo: Document %no-default-prec only if
13621 the defaultprec flag is set. Normally it's not.
13622
0cc3da3a
PE
136232003-10-04 Paul Eggert <eggert@twinsun.com>
13624
13625 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
13626 non-modifiable lvalue, instead of a modifiable one.
13627 * doc/bison.texinfo (Actions): Document that $$ can
13628 be assigned to. Do not claim that $$ and $N are
13629 array element references: user code should not rely on this.
13630
22fccf95
PE
136312003-10-01 Paul Eggert <eggert@twinsun.com>
13632
13633 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
13634 (grammar_declaration): Use it.
13635 * src/scan-gram.l: New token %no-default-prec.
13636 * tests/conflicts.at: Revamp tests to use %no-default-prec.
13637 * NEWS, doc/bison.texinfo: Document the above.
13638
fc8f2965
AD
136392003-10-01 Akim Demaille <akim@epita.fr>
13640
13641 VCG no longer supports long_straight_phase.
13642
13643 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
13644 * src/print_graph.c (print_graph): Adjust.
13645
39a06c25
PE
136462003-09-30 Frank Heckenbach <frank@g-n-u.de>
13647 and Paul Eggert <eggert@twinsun.com>
13648
13649 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
13650 Table of Symbols): Document %default-prec.
13651 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
13652 (grammar_declaration): Set default_prec on %default-prec.
13653 * src/scan-gram.l (%default-prec): New token.
13654 * src/reader.h (default_prec): New flag.
13655 * src/reader.c: Likewise.
13656 (packgram): Handle it.
13657 * tests/conflicts.at (%default-prec without %prec,
13658 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 13659
39a06c25
PE
136602003-09-30 Paul Eggert <eggert@twinsun.com>
13661
13662 * tests/testsuite.at: Include local.at, not input.at, fixing
13663 a typo in the 2003-08-25 patch.
13664
62b6aef9
AD
136652003-08-27 Akim Demaille <akim@epita.fr>
13666
13667 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
13668 GCC warnings.
13669
89e1cc61
AD
136702003-08-26 Akim Demaille <akim@epita.fr>
13671
13672 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
13673 "<\#" to avoid magic from Gnus when posting parts of this script.
13674
a08460b0
AD
136752003-08-26 Akim Demaille <akim@epita.fr>
13676
13677 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
13678 (Parser::parse): here.
13679 Adjust: nerrs and errstatus is now replaced by...
13680 (Parser::nerrs_, Parser::errstatus_): New.
13681
603f1cfd
AD
136822003-08-25 Akim Demaille <akim@epita.fr>
13683
13684 * config/announce-gen, Makefile.cfg: New.
13685 * Makefile.am: Adjust.
13686 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
13687 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
13688
cd3684cf
AD
136892003-08-25 Akim Demaille <akim@epita.fr>
13690
13691 When reducing initial empty rules, Bison parser read an initial
13692 location that is not defined. This results in garbage, and that
13693 affects Bison's own parser. Therefore we need (i) to extend Bison
13694 to support a means to initialize this location, and (ii) to use
13695 this CVS Bison to fix CVS Bison's parser.
13696
13697 * src/reader.h, reader.c (epilogue_augment): Remove, replace
13698 with...
13699 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
13700 * src/parse-gram.y: Adjust.
13701 (%initial-action): New.
13702 (%error-verbose): Since we require CVS Bison, there is no reason
13703 not to use it.
13704 * src/scan-gram.l: Adjust.
13705 * src/Makefile.am (YACC): New, to make sure we use our own parser.
13706 * data/yacc.c (yyparse): Use b4_initial_action.
13707
4e03e201
AD
137082003-08-25 Akim Demaille <akim@epita.fr>
13709
13710 * doc/bison.texinfo: Don't promote stdout for error messages.
13711
8c182d05
AD
137122003-08-25 Akim Demaille <akim@epita.fr>
13713
13714 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
13715 From Alexandre Duret-Lutz.
13716
6a60c4cf
PE
137172003-08-25 Akim Demaille <akim@epita.fr>
13718
13719 Version 1.875c.
13720
25f66e1a
AD
137212003-08-25 Akim Demaille <akim@epita.fr>
13722
13723 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
13724 Use them.
13725
5348bfbe
AD
137262003-08-25 Akim Demaille <akim@epita.fr>
13727
13728 * data/lalr1.cc (Parser::reduce_print_): New.
13729 Use it.
13730
47301314
AD
137312003-08-25 Akim Demaille <akim@epita.fr>
13732
13733 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
13734 error recovery loops. This patch is based on
161a71f3 13735 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
13736 Also, augment the similarity between lalr1.cc and yacc.c.
13737 Note: the locations of error recovery rules are not correct yet.
13738
13739 * data/lalr1.cc: Comment changes to augment the similarity between
13740 lalr1.cc and yacc.c.
13741 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
13742 (yyerrlab1): Remove, but where it used to be (now the bottom part of
13743 yyerrlab), when hitting EOF, pop the whole stack here instead of
13744 merely falling thru the default error handling mechanism.
13745 (yyerrorlab): New label, with the old contents of YYERROR,
13746 plus the following change: pop the stack of rhs corresponding
13747 to the production that invoked YYERROR. That is how Yacc
13748 behaves (required by POSIX).
13749 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
13750 fail.
13751
1f7a61ff
AD
137522003-08-25 Akim Demaille <akim@epita.fr>
13753
13754 Tune local.at so that people can "autom4te -l autotest calc.at -o
13755 calc" for instance, to extract a sub test suite.
13756
13757 * tests/testsuite.at: Move the initialization, Autotest version
13758 requirement, and AT_TESTED invocation into...
13759 * tests/local.at: here.
13760 * tests/testsuite.at: Include it for compatibility with Autoconf
13761 2.57.
13762 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
13763 be ignore.
13764
327b5b56
PE
137652003-08-04 Paul Eggert <eggert@twinsun.com>
13766
13767 Rework code slightly to avoid gcc -Wtraditional warnings.
13768 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
13769 The returned value is now stored in *YY0. All callers changed.
13770 * src/output.c (merge_output): Adjust to the above change.
13771
0051e3ed
PE
137722003-07-26 Paul Eggert <eggert@twinsun.com>
13773
13774 * data/glr.c (YYASSERT): New macro.
13775 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
13776 yyresolveStates, yyprocessOneStack):
13777 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
13778 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 13779
137437c6
PE
137802003-07-25 Paul Eggert <eggert@twinsun.com>
13781
5b620e06
PE
13782 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
13783 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 13784 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
13785 by Frank Heckenbach, though I have omitted the structure-initialization
13786 part of his glr-knr.diff patch since I recall that the Portable
13787 C Compiler didn't require that change.
13788
137437c6
PE
13789 Let the user specify how to allocate and free memory.
13790 Derived from a suggestion by Frank Heckenbach in
161a71f3 13791 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
13792 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
13793 All uses of free, malloc, realloc changed to use these macros,
13794 and unnecessary casts removed.
13795 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
13796
ddb85ca5
PE
137972003-07-06 Matthias Mann <MatthiasMann@gmx.de>
13798
13799 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
13800 use s.empty() rather than s == "" to test for empty string; see
161a71f3 13801 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
13802 (trivial change)
13803
39910e09
AD
138042003-06-25 Akim Demaille <akim@epita.fr>
13805
13806 * config/depcomp, config/install-sh: Update from masters.
13807
0ae99356
PE
138082003-06-20 Paul Eggert <eggert@twinsun.com>
13809
13810 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
13811 and return properly parenthesized result.
13812 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
13813 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
13814 Remove unnecessary parentheses from uses.
13815 * doc/bison.texinfo (Location Default Action): Describe the
13816 conventions for parentheses.
13817
cd05d13c
PE
138182003-06-19 Paul Eggert <eggert@twinsun.com>
13819
81fd08ca
PE
13820 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
13821 yyreportTree): Do not assume that size_t is the same width as int,
13822 when printing sizes. Print sizes using an unsigned format.
13823 Problem reported by Frank Heckenbach in
161a71f3 13824 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 13825
cd05d13c
PE
13826 Port to Forte Developer 7 C compiler.
13827 * data/glr.c (struct YYLTYPE): If locations are not being used,
13828 declare a single dummy member, as empty structs do not conform
13829 to the C standard.
13830 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
13831 the Forte Developer 7 C compiler complains that end-of-loop
13832 code is not reached.
13833
4dcf140b
PE
138342003-06-17 Paul Eggert <eggert@twinsun.com>
13835
13836 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
13837 avoid warnings from picky compilers about redefinition of PARAMS.
13838
8dd76bee
PE
138392003-06-17 Paul Eggert <eggert@twinsun.com>
13840
13841 Version 1.875b.
13842
13843 * NEWS: Document 1.875b.
13844
13845 * lib/bbitset.h: Do not include config.h; that's the includer's job.
13846 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
13847 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
13848 Don't use 'index' in comments, as it's a builtin fn on some hosts.
13849 * lib/bitset_stats.c: Include gettext.h unconditionally, as
13850 per recent gettext manual's suggestion.
13851 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
13852 Use prototypes, not old-style definitions.
13853 * lib/lbitset.c (lbitset_unused_clear): Likewise.
13854 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
13855 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
13856 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
13857 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
13858 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
13859 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
13860 vbitset_or_and_cmp, vbitset_copy): Likewise.
13861
13862 * lib/libiberty.h: Do not include config.h; that's the includer's job.
13863 Do not include <stdlib.h>.
13864 (PARAMS): Define unconditionally for C89.
13865 (ATTRIBUTE_NORETURN): Remove.
13866 (ATTRIBUTE_UNUSED): Define unconditionally.
13867
13868 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 13869 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
13870 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
13871 * lib/vbitset.c, lib/vbitset.h: New files.
13872 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13873 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
13874 from libbitset.
13875
13876 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
13877 `How Can I Reset @code{yyparse}', since texinfo does not allow
13878 arbitrary @ in node names.
13879
13880 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
13881 shouldn't be needed according to the gettext 0.12.1 documentation
13882 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 13883 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 13884 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 13885 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 13886
8dd76bee
PE
13887 * lib/.cvsignore: Add stdbool.h.
13888 * m4/.cvsignore: Add nls.m4, po.m4.
13889
13890 Upgrade to CVS gnulib.
13891 * stdbool_.h: File renamed from stdbool.h.in.
13892 * configure.ac (AM_STDBOOL_H): Invoke this instead of
13893 AC_HEADER_STDBOOL.
13894 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
13895 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
13896 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
13897 (MOSTLYCLEANFILES): New var.
13898 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
13899 (stdbool.h): New rule.
13900 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
13901 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
13902 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
13903 m4/quote.m4: Upgrade to today's gnulib.
13904
13905 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
13906 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
13907 the tests right now.
13908 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
13909 yyerror are declared before use; C99 requires this.
13910
25005f6a
PH
139112003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13912
13913 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
13914 first.
13915 (yyrecoverSyntaxError): Correct the logic for setting and testing
13916 yyerrState.
13917 Correct comment on handling EOF.
13918 Allow states with only a default reduction, rather than failing
8dd76bee 13919 (I can't quite reconstruct why these were not allowed before).
25005f6a 13920
137437c6 13921 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 13922 buffer overruns, corrupting state.
8dd76bee
PE
13923
13924 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
13925 definition.
13926 * src/reader.h (max_left_semantic_context): New variable declaration.
13927 * src/scan-gram.l (max_left_semantic_context): Define.
13928 (handle_action_dollar): Update max_left_semantic_context.
13929 * data/glr.c (YYMAXLEFT): New definition.
13930 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
13931 (yyresolveAction): Ditto.
13932
13933 Fixes to problems with location handling in GLR parsers reported by
13934 Frank Heckenbach (2003/06/05).
13935
13936 * data/glr.c (YYLTYPE): Make trivial if locations not used.
13937 (YYRHSLOC): Add parentheses, and define only if locations used.
13938 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
13939 locations not used.
13940 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
13941 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 13942
25005f6a
PH
13943 * tests/cxx-type.at: Exercise location information; update tests
13944 to differentiate output with and without locations.
8dd76bee 13945 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
13946 because default YYLTYPE not yet defined.
13947 Change semantic actions to compute strings, rather than printing
13948 them directly (to test proper passing of semantics values). Change
13949 output to prefix notation and update test data and expected results.
13950 (yylex): Track locations.
13951 (stmtMerge): Return value rather than printing, and include arguments
13952 in value.
8dd76bee 13953
711f40b7
PE
139542003-06-03 Paul Eggert <eggert@twinsun.com>
13955
13956 Avoid warnings generated by GCC 2.95.4 when Bison is
13957 configured with --enable-gcc-warnings.
13958 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
13959 yy::]b4_parser_class_name[::translate_,
13960 yy::Stack::operator[] (unsigned),
13961 yy::Stack::operator[] (unsigned) const,
13962 yy::Slice::operator[] (unsigned),
13963 yy::Slice::operator[] (unsigned) const):
13964 Rename local vars to avoid warnings.
13965 * tests/glr-regression.at (Improper handling of embedded actions
13966 and $-N in GLR parsers): Remove unused local variable from yylex.
13967 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
13968 (void) as arg when not pure, since we now assume C89 when building
13969 Bison. Pacify GCC by using parameter.
13970
ac695f7d
PE
139712003-06-02 Paul Eggert <eggert@twinsun.com>
13972
13973 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
13974 yy::Location::lines, yy::Location::columns): Rename arguments
13975 to avoid shadowing; this removes a warning generated by GCC 3.3.
13976
26ec81e0
PE
139772003-06-01 Paul Eggert <eggert@twinsun.com>
13978
13979 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
13980 to g++, as GCC 3.3 complains if you do it.
13981 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
13982 everything that WARNING_CFLAGS has, except omit warnings
13983 not suitable for C++.
13984 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
13985 * tests/atlocal.in (CXXFLAGS): New var.
13986 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
13987
13988 Fix a GLR parser bug I reported in February; see
161a71f3 13989 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
13990 The problem was that GLR parsers did not conform to the C standard,
13991 because actions like { $1 = $2 + $3; } expanded to expressions
13992 that invoked YYFILL in separate subexpressions, and YYFILL assigned
13993 to a local variable. The C standard says that expressions
13994 like (var = f ()) + (var = f ()) have undefined behavior.
13995 Another problem was that GCC sometimes issues warnings that
13996 yyfill and its parameters are unused.
13997
13998 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
13999 as possibly unused.
14000 (yyfill): New function.
14001 (YYFILL): Use it.
14002 (yyuserAction): Change type of yynormal to bool, so that it matches
14003 the new yyfill signature. Mark it as possibly unused.
14004
14005
14006 Follow up on a bug I reported in February, where a Bison-generated
14007 parser can loop. Provide a test case and a fix for yacc.c. I
14008 don't have a fix for lalr1.cc or for glr.c, unfortunately.
14009 The original bug report is in:
161a71f3 14010 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
14011
14012 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
14013 macro's size was becoming unwieldy.
14014 (yyerrlab): Do not discard an empty lookahead symbol, as this
14015 might destroy garbage.
14016 (yyerrorlab): New label, with the old contents of YYERROR,
14017 plus the following change: pop the stack of rhs corresponding
14018 to the production that invoked YYERROR. That is how Yacc
14019 behaves, and POSIX requires this behavior.
14020 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
14021 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
14022 Define 'alarm' to do nothing if unistd.h is not available.
14023 Add a new rule "exp: '-' error;" to test the above change to
14024 data/yacc.c. Use 'alarm' to abort any test taking longer than
14025 10 seconds, as it's probably looping.
14026 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
14027 Also, the new yacc.c generates two fewer diagnostics for an
14028 existing test.
14029
d0829076
PE
140302003-05-24 Paul Eggert <eggert@twinsun.com>
14031
c6ae27df
PE
14032 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
14033 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
14034 This fixes a problem reported by John Bowman when the Compaq/HP
14035 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
14036 -ansi -Wall -gall).
14037 * data/yacc.c (union yyalloc): Likewise.
14038 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 14039
d0829076
PE
14040 Switch from 'int' to 'bool' where that makes sense.
14041
14042 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
14043 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
14044 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
14045 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
14046 Return or accept bool, not int. All callers changed.
14047 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
14048 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
14049 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
14050 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
14051 bitset_or_and_cmp_): Likewise.
14052 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
14053 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
14054 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
14055 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
14056 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
14057 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
14058 bitset_stats_or_and_cmp): Likewise.
14059 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
14060 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
14061 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
14062 ebitset_xor_cmp): Likewise.
14063 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
14064 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
14065 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
14066 lbitset_xor_cmp): Likewise.
14067 * lib/bbitset.h: Include <stdbool.h>.
14068 (struct bitset_vtable): The following members now return bool, not
14069 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
14070 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
14071 or_and_cmp).
14072 * src/conflicts.c (count_rr_conflicts): Likewise.
14073 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
14074 All uses changed.
14075 * lib/ebitset.c (ebitset_obstack_init): Likewise.
14076 * lib/lbitset.c (lbitset_obstack_init): Likewise.
14077 * src/getargs.c (debug_flag, defines_flag, locations_flag,
14078 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14079 graph_flag): Likewise.
14080 * src/getargs.h (debug_flag, defines_flag, locations_flag,
14081 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14082 graph_flag): Likewise.
14083 * src/output.c (error_verbose): Likewise.
14084 * src/output.h (error_verbose): Likewise.
14085 * src/reader.c (start_flag, typed): Likewise.
14086 * src/reader.h (typed): Likewise.
14087 * src/getargs.c (LOCATIONS_OPTION): New constant.
14088 (long_options, getargs): Use it.
14089 * src/lalr.c (build_relations): Use bool, not int.
14090 * src/nullable.c (nullable_compute): Likewise.
14091 * src/print.c (print_reductions): Likewise.
14092 * src/tables.c (action_row, pack_vector): Likewise.
14093 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
14094 * src/output.c (prepare): Use it.
14095 * src/output.c (token_definitions_output,
14096 symbol_destructors_output, symbol_destructors_output): Use string,
14097 not boolean integer, to keep track of whether to output separator.
14098 * src/print_graph.c (print_core): Likewise.
14099 * src/state.c (state_rule_lookaheads_print): Likewise.
14100
14101 * config/install-sh: Sync from automake 1.7.5.
14102
6b2584b7
PE
141032003-05-14 Paul Eggert <eggert@twinsun.com>
14104
14105 * src/parse-gram.y (rules_or_grammar_declaration): Require a
14106 semicolon after a grammar declaration, in the interest of possible
14107 future changes to the Bison input language.
14108 Do not allow a stray semicolon at the start of the grammar.
14109 (rhses.1): Allow one or more semicolons after any rule, including
14110 just before "|" as required by POSIX.
14111 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
14112 grammar.
14113
caf37a36
ADL
141142003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
14115
14116 %parse-param support for lalr1.cc.
14117
14118 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
14119 b4_cc_constructor_calls, b4_cc_constructor_call,
14120 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
14121 definitions.
14122 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
14123 parse-param arguments.
14124 (yy::b4_parser_class_name): Declare instance variables to
14125 hold parse-param arguments.
14126 * tests/calc.at: s/value/semantic_value/ because value clashes
14127 with a member of yy::b4_parser_class_name. Adjust C++ code
14128 to handle %parse-param. Enable %parse-param test in C++.
14129
3ab37077
PE
141302003-05-12 Paul Eggert <eggert@twinsun.com>
14131
14132 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
14133 English a bit. Fix fclose typo. Change "const char" to "char
14134 const", and use ANSI C rather than K&R for "main". Suggest
14135 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
14136 and suggest yy_switch_to_buffer.
14137
141382003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
14139
14140 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
14141 C89. This avoids a diagnostic on compilers that define __STDC__
14142 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 14143 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 14144
e743727f
PE
141452003-05-03 Paul Eggert <eggert@twinsun.com>
14146
14147 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
14148 Do not overrun array bounds.
14149 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 14150 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 14151
916708d5
AD
141522003-04-29 Akim Demaille <akim@epita.fr>
14153
14154 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
14155 * src/getargs.c, src/getargs.h: here, as bool, not int.
14156 (nondeterministic_parser): New.
14157 * src/parse-gram.y, src/scan-gram.l: Support
14158 %nondeterministic-parser.
14159 * src/output.c (prepare): Use nondeterministic_parser instead
14160 of glr_parser where appropriate.
14161 * src/tables.c (conflict_row, action_row, save_row)
14162 (token_actions, token_actions, pack_vector): Ditto.
14163
a06ea4aa
AD
141642003-04-29 Akim Demaille <akim@epita.fr>
14165
14166 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
14167
211074ca
AD
141682003-04-29 Akim Demaille <akim@epita.fr>
14169
14170 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
14171 with %pure-parser and %locations to exercise the patch from Yakov
14172 Markovitch below.
14173
6175ffe3
PE
141742003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
14175
14176 * data/yacc.c: (b4_lex_param): Corrected for the case where
14177 %lex-param is provided and %pure-parser isn't.
14178
b1e95857
PE
141792003-04-27 Paul Eggert <eggert@twinsun.com>
14180
14181 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 14182 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
14183 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
14184 if it is not defined.
14185 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
14186
acda9df6
PE
141872003-04-26 Paul Eggert <eggert@twinsun.com>
14188
3470c57b
PE
14189 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
14190 Declare to be of type suitable for the ninf value itself, not of
14191 type suitable for the corresponding table, since the latter might
14192 be unsigned but the ninf value might be negative. This fixes a
14193 bug reported by Alexandre Duret-Lutz in
161a71f3 14194 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 14195
acda9df6
PE
14196 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
14197 invokes it. We shouldn't invoke it twice because it will attempt
14198 to put error.o in the archive twice. This fixes a glitch reported
14199 by Martin Mokrejs in
161a71f3 14200 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 14201
b5250f26
PE
142022003-04-21 Paul Eggert <eggert@twinsun.com>
14203
14204 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
14205 to gnulib.
14206
089ac0f1
PE
142072003-04-21 Yakov Markovitch <Markovitch@iso.ru>
14208
14209 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
14210 Fix obvious typo that results in uncompilable GLR parsers
14211 when both %pure-parser and %locations are used. (trivial change)
14212
5ededac6
PE
142132003-04-17 Paul Eggert <eggert@twinsun.com>
14214
1b8f2fff
PE
14215 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
14216 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
14217 Do not insert the expected token via unput, as this runs afoul
14218 of a POSIX-compatibility bug in flex 2.5.31.
14219 All uses changed to BEGIN the parent state,
14220 since we no longer insert the expected token via unput.
14221 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
14222 that is no longer emitted after the above change.
14223
5ededac6
PE
14224 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
14225 the first one. This change is from Paul Hilfinger, and it fixes
14226 regression reported by Werner Lemberg in
161a71f3 14227 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
14228
14229 (resolve_sr_conflict): Don't invoke state_errs_set
14230 unless one or more tokens have been explicitly made errors.
14231 Otherwise, the above change causes Bison to abort.
14232
14233 * tests/existing.at (GNU pic Grammar): New test case, taken from
14234 Lemberg's email.
14235
b8be9132
AD
142362003-03-31 Akim Demaille <akim@epita.fr>
14237
14238 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
14239
d423d460
AD
142402003-03-31 Akim Demaille <akim@epita.fr>
14241
14242 * src/output.c (prepare_symbols): Avoid trailing spaces in the
14243 output.
14244
c7e441b4
AD
142452003-03-31 Akim Demaille <akim@epita.fr>
14246
14247 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
14248 From Paul Hilfinger.
14249
231897ad
AD
142502003-03-29 Akim Demaille <akim@epita.fr>
14251
14252 * m4/error.m4: Do not put under dynamic conditions some code which
14253 expansion is under static control.
14254
5b066063
AD
142552003-03-29 Akim Demaille <akim@epita.fr>
14256
14257 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
14258
22a74fec
AD
142592003-03-29 Akim Demaille <akim@epita.fr>
14260
14261 * doc/bison.texinfo (Strings are Destroyed): New.
14262
0eee27e7
PE
142632003-03-13 Paul Eggert <eggert@twinsun.com>
14264
14265 * .cvsignore: Add configure.lineno.
14266 * src/.cvsignore: Add yacc.
14267 * tests/.cvsignore: Add testsuite.log.
14268 * doc/fdl.texi: Sync with latest FSF version.
14269
f61aad93
PE
142702003-03-12 Paul Eggert <eggert@twinsun.com>
14271
537636c7
PE
14272 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
14273 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
14274 cursor, instead of leaving it undefined. This fixes a bug
14275 reported by Tim Van Holder in
161a71f3 14276 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
14277 * tests/input.at (Torturing the Scanner): Test the scanner on
14278 an empty input file, which was Tim Van Holder's test case.
14279
14280 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
14281 <sys/resource.h> can be included, include sys/time.h and
14282 sys/times.h first, if available. This works around the SunOS
14283 4.1.4 porting bug reported by Bruce Becker in
161a71f3 14284 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
14285
14286 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
14287 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
14288 AC_HEADER_SYS_WAIT.
14289
f61aad93
PE
14290 Merge changes from gnulib. This was prompted because the CVS
14291 snapshot didn't build on Solaris 7 due to strnlen problems.
14292
14293 These changes need to be merged back into gnulib:
14294 * lib/hash.c: Include <stdbool.h> unconditionally.
14295 * m4/onceonly.m4 (m4_quote): New macro.
14296 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
14297 Quote AC_FOREACH variable-expansions properly.
14298 The 2003-01-03 obstack.h change also needs merging.
14299 {end of changes requiring merging}
5b066063 14300
f61aad93
PE
14301 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
14302 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
14303 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
14304 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
14305 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
14306 New files, imported from gnulib.
14307 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
14308 above.
14309
14310 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
14311 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
14312 gnulib sources.
14313
14314 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
14315 Add.
14316 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
14317 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
14318 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
14319 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
14320 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
14321 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
14322 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
14323 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
14324 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
14325 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
14326 (jm_PREREQ_ARGMATCH): Remove.
14327 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
14328 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
14329
14330 * src/system.h: Include <stdbool.h> unconditionally.
14331
14332 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
14333 assuming at least C89 in the bitset code for some time now.
14334
d2ffe116
AD
143352003-03-03 Akim Demaille <akim@epita.fr>
14336
14337 * ro.po: New.
14338
052826fd
AD
143392003-03-02 Akim Demaille <akim@epita.fr>
14340
14341 * doc/bison.texinfo (Table of Symbols): Reactivate the
14342 documentation for %lex-param, and %parse-param.
14343
c4749565
AD
143442003-03-02 Akim Demaille <akim@epita.fr>
14345
14346 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
14347 generate verbose error messages.
14348 Use the number of tokens as an upper bound in yytname, as it
14349 cannot be a non terminal.
14350
d5286af1
AD
143512003-03-02 Akim Demaille <akim@epita.fr>
14352
14353 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
14354 message.
14355
22e304a6
AD
143562003-03-02 Akim Demaille <akim@epita.fr>
14357
22e304a6
AD
14358 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
14359 Use them to exercise yycheck overrun.
14360 Based on Andrew Suffield's grammar.
14361
67a25fed
AD
143622003-03-02 Akim Demaille <akim@epita.fr>
14363
14364 Create tests/local.at for Bison generic testing macros.
14365
14366 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
14367 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
14368 This new file.
14369 * tests/calc.at (AT_CHECK_CALC): Adjust.
14370 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
14371 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
14372 * tests/local.at: here.
14373 (AT_COMPILE_CXX): Tags the tests using it as c++.
14374 Ignore the test if CXX is not functional.
14375
9c2b381f
PE
143762003-03-01 Paul Eggert <eggert@twinsun.com>
14377
14378 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
14379 not loc->end, since loc->end might contain garbage and this leads
14380 to undefined behavior on some platforms.
14381 (id_loc, token_start): Use (IF_LINTed) initial values that do not
14382 depend on *loc, so that the reader doesn't give the the false
14383 impression that *loc is initialized.
14384 (<INITIAL>"%%"): Do not bother setting code_start, since its value
14385 does not survive the return.
14386
0433ba88
AD
143872003-03-01 Akim Demaille <akim@epita.fr>
14388
14389 * src/scan-gram.l (code_start): Always initialize it when entering
14390 into yylex, as SC_EPILOGUE is activated *before* the corresponding
14391 yylex invocation. An alternative would be making it static, but
14392 then it starts with the second %%'s beginning, instead of its end.
14393
b305ea69
PE
143942003-02-28 Paul Eggert <eggert@twinsun.com>
14395
14396 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
14397 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 14398 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 14399
c3d25e01
PE
144002003-02-26 Paul Eggert <eggert@twinsun.com>
14401
14402 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
14403 Remove Sequent/Pyramid discussion (nobody uses them any more).
14404 Merge VMS and MS-DOS discussion; these ports may well be dead
14405 but let's keep mentioning them for now. Put <> around email
14406 addresses. Add copyright notice.
14407
c267ffbc
PE
144082003-02-24 Paul Eggert <eggert@twinsun.com>
14409
14410 * data/glr.c (yy_reduce_print): yylineno -> yylno,
14411 to avoid collision with flex use of yylineno.
14412 Problem reported by Bruce Lilly in
161a71f3 14413 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
14414 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
14415 * data/yacc.c (yy_reduce_print): Likewise.
14416
14417 * config/depcomp: Sync with Automake 1.7.3.
14418
f939fc12
AD
144192003-02-21 Akim Demaille <akim@epita.fr>
14420
14421 * data/lalr1.cc: Use temporary variables instead of casts to
14422 change integer types.
14423 Suggested by Paul Eggert.
14424
95923bd6
AD
144252003-02-21 Akim Demaille <akim@epita.fr>
14426
14427 * doc/bison.texinfo: Use "location" consistently to refer to @n,
14428 to avoid confusions with lalr1.cc's notion of Position.
14429 Suggested by Paul Eggert.
14430
2cdc240e
AD
144312003-02-20 Akim Demaille <akim@epita.fr>
14432
14433 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
14434 before initial_columns.
14435 (location.hh): Use consistent variable names when defining the
14436 operator<<.
14437 Use "last" so that we subtract from Positions, not from unsigned.
14438
5d003116
AD
144392003-02-20 Akim Demaille <akim@epita.fr>
14440
14441 * data/lalr1.cc (position.hh): New subfile, including the extended
14442 and Doxygen'ed documentation of class Position.
14443 (location.hh): Use it.
14444 Document a` la Doxygen.
ba1ecc07 14445 With the help of Benoit Perrot.
5d003116 14446
d02b25f9
AD
144472003-02-20 Akim Demaille <akim@epita.fr>
14448
14449 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
14450 AT_YACC_IF.
14451 Redefine AT_YYERROR_SEES_LOC_IF using it.
14452 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
14453 not defined.
14454 Don't use the location in yy::Parser::error_ and
14455 yy::Parser::print_ when not %locations.
14456 Activate more lalr1.cc tests.
14457
0d1c3a04
AD
144582003-02-19 Akim Demaille <akim@epita.fr>
14459
14460 * data/lalr1.cc: When displaying a line number, be sure to make it
14461 an int.
14462
60a777aa
AD
144632003-02-19 Akim Demaille <akim@epita.fr>
14464
14465 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
14466 Remove, useless.
14467 (YYABORT, YYACCEPT, YYERROR): New.
14468 * tests/calc.at: Renable the lalr1.cc test.
14469
0b86fc41
AD
144702003-02-19 Akim Demaille <akim@epita.fr>
14471
14472 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
14473 error recovery, mixing with/without pops and discarding of the
14474 lookahead.
14475 Exercise YYERROR.
14476 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
14477
da99a5dc
PE
144782003-02-17 Paul Eggert <eggert@twinsun.com>
14479
14480 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
14481 * tests/testsuite.at (AT_COMPILE): Use them.
14482 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 14483 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 14484
93b8c255
PE
144852003-02-12 Paul Eggert <eggert@twinsun.com>
14486
14487 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
14488 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 14489 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
14490 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
14491 Check for malloc failure, for consistency with yacc.c.
14492 (yytname_size): Remove, for consistency with yacc.c.
14493
14494 The bug still remains in data/lalr1.cc, as I didn't have time
14495 to fix it there.
14496
7548fed2
AD
144972003-02-06 Akim Demaille <akim@epita.fr>
14498
14499 * configure.ac (GXX): Rename as...
14500 (CXX): this, to keep the original Autoconf semantics.
14501 Require 2.57.
14502 * data/lalr1.cc: Fix b4_copyright invocations.
14503 If YYDEBUG is not defined, don't depend upon name_ being defined.
14504 (location.hh): Include string and iostream.
14505 (Position::filename): New member.
14506 (Position::Position ()): New.
14507 (operator<< (Position)): New.
14508 (operator- (Position, int)): New.
14509 (Location::first, Location::last): Rename as...
14510 (Location::begin, Location::end): these, to mock the conventional
14511 iterator names.
14512 (operator<< (Location)): New.
14513 * tests/atlocal.in (CXX): New.
14514 * tests/testsuite.at (AT_COMPILE_CXX): New.
14515 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
14516 locations in a more synthetic way.
14517 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
14518 lalr1.cc is used.
14519 Adjust the C locations to match those from Emacs: first column is
14520 column 0.
14521 Change all the expected results.
14522 Conform to the GCS: simplify the locations when applicable.
14523 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
14524 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
14525 these CPP macros with the m4 macros new defined by...
14526 (AT_CHECK_PUSHDEFS): this, i.e.:
14527 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 14528 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
14529 New macros.
14530 (AT_CHECK_POPDEFS): Undefine them.
14531 (AT_CHECK_CALC_LALR1_CC): New.
14532 Use it for the first lalr1.cc test.
14533
43a176ef
AD
145342003-02-04 Akim Demaille <akim@epita.fr>
14535
14536 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
14537 Location as is defined.
14538
fc049e9c
AD
145392003-02-04 Akim Demaille <akim@epita.fr>
14540
14541 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
14542 name_ being defined.
14543
a737b216
PE
145442003-02-03 Paul Eggert <eggert@twinsun.com>
14545
14546 * src/gram.h (start_symbol): Remove unused decl.
14547
14548 Use more-consistent naming conventions for local vars.
14549
14550 * src/derives.c (derives_compute): Change type of local var from
14551 int to rule_number.
14552 * src/gram.c (grammar_rules_partial_print): Likewise.
14553 * src/print.c (print_core): Likewise.
14554 * src/reduce.c (reduce_grammar_tables): Likewise.
14555
14556 * src/gram.c (grammar_dump): Change name of item_number *
14557 local var from r to rp.
14558 * src/nullable.c (nullable_compute): Likewise.
14559
14560 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
14561
14562 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
14563 for symbol or symbol_number var.
14564 * src/reader.c (grammar_start_symbol_set): Likewise.
14565 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
14566 Likewise.
14567 * src/state.c (transitions_to): Likewise.
14568 * src/state.h: Likewise.
14569 * src/tables.c (symbol_number_to_vector_number): Likewise.
14570
14571 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
14572 char * var.
14573
14574 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
14575 var.
14576
14577 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
14578 var.
14579
14580 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
14581 Use str, not s, for char * var. Use ch, not c, for character var.
14582 Use size for size var.
14583
14584 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
14585 char * var.
14586 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
14587 uniqstr var.
14588 * src/uniqstr.h: Likewise.
14589
14590 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14591 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14592 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
14593 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
14594 param to have same name as that of enum, so that we don't use
14595 "s" to stand for a non-state.
14596
68e93ad5
AD
145972003-02-02 Akim Demaille <akim@epita.fr>
14598
14599 * src/scan-skel.l: Scan more than one inert character per yylex
14600 invocation.
14601
92898986
PE
146022003-02-01 Paul Eggert <eggert@twinsun.com>
14603
14604 Version 1.875a.
14605
1d9d5d71
PE
14606 * po/LINGUAS: Add ms.
14607
0435d061
AD
146082003-01-30 Akim Demaille <akim@epita.fr>
14609
14610 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
14611
6029a57f
PH
146122003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14613
14614 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
14615 of $1.
0435d061
AD
14616
14617 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 14618 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 14619 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 14620
6029a57f
PH
14621 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
14622 (b4_rhs_location): Ditto.
0435d061 14623 (yyfill): New function to copy from stack tree into array
6029a57f 14624 incrementally.
0435d061
AD
14625 (yyuserAction): Modify to allow incremental move of semantic values
14626 to rhs array when in GLR mode.
14627 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
14628 as needed.
14629 Remove dummy use of yystack, as there is now a guaranteed use.
14630 (yydoAction): Modify to allow incremental move of semantic values
14631 to rhs array when in GLR mode.
14632 (yyresolveAction): Ditto.
14633 (yyglrShiftDefer): Update comment.
0435d061 14634 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
14635 (yyglrReduce): Ditto.
14636 (yydoAction): Ditto
0435d061 14637
6029a57f
PH
14638 * tests/glr-regr1.at: Rename to ...
14639 * tests/glr-regression.at: Add new regression test for the problems
14640 described above (adapted from S. Eken).
14641 Update copyright notice.
14642 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
14643 * tests/Makefile.am: Ditto.
14644
6cee6297
PE
146452003-01-28 Paul Eggert <eggert@twinsun.com>
14646
14647 * data/lalr1.cc: Do not use @output_header_name@ unless
14648 b4_defines_flag is set. This fixes two bugs reported by
14649 Tim Van Holder in
161a71f3
PE
14650 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
14651 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 14652
b2a836b5
PE
146532003-01-21 Paul Eggert <eggert@twinsun.com>
14654
14655 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
14656 we don't need to worry about yyerrlab1 being reported as an
14657 "unused label" by non-GCC C compilers. The downside is that if
14658 locations are used then a couple of statements are duplicated each
14659 time YYERROR is invoked, but the upside is that the warnings
14660 should vanish.
14661 (yyerrlab1): Move code to YERROR.
14662 (yyerrlab2): Remove. Change uses back to yyerrlab1.
14663 This reverts some of the 2002-12-27 change.
14664
4196b931
PE
146652003-01-17 Paul Eggert <eggert@twinsun.com>
14666
14667 * src/output.c (symbol_printers_output): Fix typo that led
14668 to core dump. Problem reported by Antonio Rus in
161a71f3 14669 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 14670
3ae831b4
AD
146712003-01-13 Akim Demaille <akim@epita.fr>,
14672 Quoc Peyrot <chojin@lrde.epita.fr>,
14673 Robert Anisko <anisko_r@lrde.epita.fr>
14674
14675 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
14676 when the stacks contain one element, as the loop would otherwise
14677 free the last state, and then use the top state (the one we just
14678 popped). This means that the initial elements will not be freed
14679 explicitly, as is the case in yacc.c; it is not a problem, as
14680 these elements have fake values.
14681
e3aa65c5
PE
146822003-01-11 Paul Eggert <eggert@twinsun.com>
14683
14684 * NEWS: %expect-violations are now just warnings, reverting
14685 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
14686 bootstrapping problem reported by Matthias Klose; see
161a71f3 14687 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
14688 * src/conflicts.c (conflicts_print): Likewise.
14689 * tests/conflicts.at (%expect not enough, %expect too much,
14690 %expect with reduce conflicts): Likewise.
14691 * doc/bison.texinfo (Expect Decl): Document this. Also mention
14692 that the warning is enabled if the number of conflicts changes
14693 (not necessarily increases).
14694
14695 * src/getargs.c (version): Update copyright year.
14696
f0057011
AD
146972003-01-09 Akim Demaille <akim@epita.fr>
14698
14699 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
14700
1ee6d2a0
PE
147012003-01-08 Paul Eggert <eggert@twinsun.com>
14702
14703 * Makefile.maint (WGETFLAGS):
14704 New macro, containing "-C off" to disable proxy caches.
14705 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
14706 (rel-check): Use $(WGET) instead of wget.
14707
d4fd77c4
PE
147082003-01-06 Paul Eggert <eggert@twinsun.com>
14709
14710 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
14711 the GLR paper of Scott, Johnstone and Hussain.
14712
464c6927
PE
147132003-01-04 Paul Eggert <eggert@twinsun.com>
14714
d600ee67
PE
14715 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
14716 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
14717 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
14718 (EXTRA_LIBRARIES): New var, for liby.a.
14719 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
14720 (EXTRA_SCRIPTS): New var, for yacc.
14721
464c6927
PE
14722 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
14723 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
14724 Problem reported by Nelson H. F. Beebe.
14725
147262003-01-03 Paul Eggert <eggert@twinsun.com>
14727
14728 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
14729 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
14730 when compiling Bison 1.875's `bitset bset = obstack_alloc
14731 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
14732
14733 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
14734 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
14735 grow to a huge size with typical invocation.
d600ee67 14736
464c6927
PE
14737 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
14738 Use the pattern recommended by Autoconf 2.57, except also protect
14739 against double-definition.
14740 * src/system.h: Likewise.
14741 Portability issues reported by Nelson H. F. Beebe.
d600ee67 14742
464c6927
PE
14743 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
14744 All uses changed. Provide a definition in both C and C++.
14745 (yytrue, yyfalse): Define even if defined (__cplusplus).
14746
14747 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
14748 Reported by Nelson H. F. Beebe.
d600ee67 14749
464c6927
PE
14750 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
14751
0f42c7d5
PE
147522003-01-02 Paul Eggert <eggert@twinsun.com>
14753
14754 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
14755 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
14756 Bug reported by Nelson H. F. Beebe.
14757
dc546b0f
PE
147582003-01-01 Paul Eggert <eggert@twinsun.com>
14759
14760 * Version 1.875.
14761
2c09b6a7
PE
147622002-12-30 Paul Eggert <eggert@twinsun.com>
14763
14764 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
14765 Moved here from...
14766 (<INITIAL>","): Here. This causes stray "," to be treated
14767 more uniformly.
14768
dc546b0f 14769 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
14770 last brace in braced code when not in Yacc mode, for compatibility
14771 with Bison 1.35. This resurrects the 2001-12-15 patch to
14772 src/reader.c.
14773
14774 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
14775 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
14776
535c0f63
PE
147772002-12-28 Paul Eggert <eggert@twinsun.com>
14778
14779 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
14780 that of SYM's type. This fixes Debian bug 168069, reported by
14781 Thomas Olsson.
d600ee67 14782
963fcc17
PE
147832002-12-28 Paul Eggert <eggert@twinsun.com>
14784
14785 Version 1.75f.
14786
14787 Switch back to the Yacc style of conflict reports, undoing some
14788 of the 2002-07-30 change.
14789 * doc/bison.texinfo (Understanding): Use Yacc style for
14790 conflict reports. Also, use new way of locating rules.
14791 * src/conflicts.c (conflict_report):
14792 Renamed from conflict_report_yacc, removing the old
14793 'conflict_report'. Translate the entire conflict report at once,
14794 so that we don't assume that "," has the same interpretation in
14795 all languages.
14796 (conflicts_output): Use Yacc-style conflict report for each state,
14797 instead of our more-complicated style.
14798 (conflicts_print): Use Yacc-style conflict report, except print
14799 the input file name when not emulating Yacc.
14800 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
14801 Conflicted Reduction, %expect not enough, %expect too much,
14802 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
14803 * tests/existing.at (GNU Cim Grammar): Likewise.
14804 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
14805
14806 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
14807 fatal): Don't invoke fflush; it's not needed and it might even be
14808 harmful for stdout, as stdout might not be open.
14809 * src/reduce.c (reduce_print): Likewise.
14810
b1efe548
PE
148112002-12-27 Paul Eggert <eggert@twinsun.com>
14812
14813 Fix a bug where error locations were not being recorded correctly.
14814 This problem was originally reported by Paul Hilfinger in
161a71f3 14815 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
14816
14817 * data/yacc.c (yyparse): New local var yylerrsp, to record the
14818 top of the location stack's error locations.
14819 (yyerrlab): Set it. When discarding a token, push its location
14820 onto yylerrsp so that we don't lose track of the error's end.
14821 (yyerrlab1): Now is only the target of YYERROR, so that we can
14822 properly record the location of the action that failed. For GCC
14823 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
14824 GCC warning about yyerrlab1 being unused if YYERROR is unused.
14825 (yyerrlab2): New label, which yyerrlab now falls through to.
14826 Compute the error's location by applying YYLLOC_DEFAULT to
14827 the locations of all the symbols that went into the error.
14828 * doc/bison.texinfo (Location Default Action): Mention that
14829 YYLLOC_DEFAULT is also invoked for syntax errors.
14830 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
14831 Error locations include the locations of all the tokens that were
14832 discarded, not just the last token.
d600ee67 14833
983c5c2c
PE
148342002-12-26 Paul Eggert <eggert@twinsun.com>
14835
b1efe548
PE
14836 * src/files.c: Include quote.h.
14837 (compute_output_file_names): Warn if we detect conflicting
14838 outputs to the same file. This should catch the misunderstanding
14839 exemplified by Debian Bug 165349, reported by Bruce Stephens..
14840
14841 * src/conflicts.c (conflicts_print): If the user specifies
14842 "%expect N", report an error if there are any reduce/reduce
14843 conflicts. This is what the manual says should happen.
14844 This fixes Debian bug 130890, reported by Anthony DeRobertis.
14845 * tests/conflicts.at (%expect with reduce conflicts): New test.
14846
983c5c2c
PE
14847 Don't use m4_include on relative file names, as it doesn't work as
14848 desired if there happens to be a file with that name under ".".
d600ee67 14849
983c5c2c
PE
14850 * m4sugar/version.m4: Remove; it was included but it wasn't used.
14851 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
14852 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
14853 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
14854 * src/output.c (output_skeleton): Use full path names when
14855 specifying a file to include; don't rely on include path, as
14856 it's unreliable when the working file contains a file with
14857 that name.
d600ee67 14858
983c5c2c
PE
148592002-12-25 Paul Eggert <eggert@twinsun.com>
14860
14861 Remove obsolete references to bison.simple and bison.hairy.
14862 Problem mentioned by Aubin Mahe in
161a71f3 14863 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
14864 * data/glr.c: Comment fix.
14865 * doc/bison.1: Remove references. Also, mention "yacc".
14866
14867 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
14868 with -g option.
14869
14870 * src/parse-gram.y (declaration): Use enum "report_states" rather
14871 than its numeric value 1.
14872
14873 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
14874 opening a new one. This fixes Debian bug 165349, reported by
14875 Bruce Stephens.
14876
23f2d9dc
PE
148772002-12-24 Paul Eggert <eggert@twinsun.com>
14878
14879 Version 1.75e.
14880
14881 * Makefile.maint (cvs-update): Don't assume that the shell
14882 supports $(...), as Solaris sh doesn't.
14883
14884 * src/parse-gram.y (lloc_default): Remove test for empty
14885 nonterminals at the end, since it didn't change the result.
14886
148872002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
14888
14889 If the user does not define YYSTYPE as a macro, Bison now declares it
14890 using typedef instead of defining it as a macro. POSIX requires this.
14891 For consistency, YYLTYPE is also declared instead of defined.
14892
14893 %union directives can now have a tag before the `{', e.g., the
14894 directive `%union foo {...}' now generates the C code
14895 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
14896 The default union tag is `YYSTYPE', for compatibility with Solaris 9
14897 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
14898 instead of `yyltype'.
14899
14900 `yystype' and `yyltype' are now obsolescent macros instead of being
14901 typedefs or tags; they are no longer documented and will be
14902 withdrawn in a future release.
14903
14904 * data/glr.c (b4_location_type): Remove.
14905 (YYSTYPE): Renamed from yystype.
14906 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
14907 (struct YYLTYPE): Renamed from struct yyltype.
14908 (YYLTYPE): Renamed from yyltype.
14909 (yyltype, yystype): New (and obsolescent) macros,
14910 for backward compatibility.
14911 * data/yacc.c: Likewise.
14912
14913 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
14914 does not specify a union tag. This is for compatibility with
14915 Solaris 9 yacc.
14916
14917 * src/parse-gram.y (add_param): 2nd arg is now char * not char
14918 const *, since it is now modified by stripping surrounding { }.
14919 (current_braced_code): Remove.
14920 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
14921 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
14922 trailing " {...}". Now of type <chars>.
14923 (grammar_declaration): Adjust to bundled tokens.
14924 (code_content): Remove; stripping is now done by add_param.
14925 (print_token_value): Print contents of bundled tokens.
14926 (token_name): New function.
14927
14928 * src/reader.h (braced_code, current_braced_code): Remove.
14929 (token_name): New decl.
14930
14931 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
14932 token_type, not braced_code code_kind. All uses changed.
14933 (SC_PRE_CODE): New state, for scanning after a keyword that
14934 has (or usually has) an immediately-following braced code.
14935 (token_type): New local var, to keep track of which token type
14936 to return when scanning braced code.
14937 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 14938 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
14939 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
14940 instead of returning a token type immediately.
14941 (<INITIAL>"{"): Set token type.
14942 (<SC_BRACED_CODE>"}"): Use it.
14943 (handle_action_dollar, handle_action_at): Now returns bool
14944 indicating success. Fail if ! current_rule; this prevents a core dump.
14945 (handle_symbol_code_dollar, handle_symbol_code_at):
14946 Remove; merge body into caller.
14947 (handle_dollar, handle_at): Complain in invalid contexts.
14948
14949 * NEWS, doc/bison.texinfo: Document the above.
14950 * NEWS: Fix years and program names in copyright notice.
14951
879ca4f8
PE
149522002-12-17 Paul Eggert <eggert@twinsun.com>
14953
14954 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
14955 Reporting, Table of Symbols): Omit mentions of %lex-param and
14956 %parse-param from the documentation for now.
14957
1c5fe69d
PE
149582002-12-15 Paul Eggert <eggert@twinsun.com>
14959
14960 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
14961 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
14962 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
14963 disagreed with the Bison documentation. Bug
14964 reported by Andrew Walrond.
d600ee67 14965
1c5fe69d
PE
14966 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
14967 as the caller now does that.
14968 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
14969 (YYEMPTY): Parenthesize right hand side, since others use it.
14970 (yyparse): Don't assume that our generated code is the only code
14971 that sets yychar.
14972
d1de5372
PE
149732002-12-13 Paul Eggert <eggert@twinsun.com>
14974
14975 Version 1.75d.
14976
14977 POSIX requires a "yacc" command.
14978 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
14979 (MOSTLYCLEANFILES): Add yacc.
14980 (yacc): New rule.
1c5fe69d 14981 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
14982 as an alias for bison y.
14983
14984 * po/LINGUAS: Add da.
d600ee67 14985
d1de5372
PE
14986 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
14987 problem with latest <getopt.h>.
14988 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
14989
14990 * doc/fdl.texi: Upgrade to 1.2.
14991 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
14992 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
14993 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
14994 gnulib.
14995 * config/install-sh: Sync with autotools.
14996
14997 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 14998 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
14999 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
15000 locations are requested.
15001 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
15002 locations are requested.
15003
d0f3fe23
PE
150042002-12-12 Paul Eggert <eggert@twinsun.com>
15005
15006 Remove unportable casts and storage allocation tricks.
15007 While we're at it, remove almost all casts, since they
15008 usually aren't needed and are a sign of trouble.
15009
15010 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
15011
15012 * src/derives.c (derives_compute): Do not subtract NTOKENS from
15013 the pointer DSET returned by malloc; this isn't portable.
15014 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
15015 Similarly for DERIVES.
15016 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
15017 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
15018 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
15019
15020 * src/derives.c (derives_compute): Do not bother invoking
15021 int_of_rule_number, since rule numbers are integers.
15022
15023 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
15024 rather than XMALLOC (char, N).
15025
15026 * src/files.c (filename_split): Rewrite to avoid cast.
15027
15028 * src/gram.h (symbol_number_as_item_number,
15029 item_number_as_symbol_number, rule_number_as_item_number,
15030 item_number_as_rule_number):
15031 Now inline functions rather than macros, to avoid casts.
15032 * src/state.h (state_number_as_int): Likewise.
15033 * src/tables.c (state_number_to_vector_number,
15034 symbol_number_to_vector_number): Likewise.
15035
15036 * src/gram.h (int_of_rule_number): Remove; no longer used.
15037
15038 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
15039 since the resulting storage is always stored into.
15040
15041 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
15042 where it's needed.
15043
15044 * src/muscle_tab.c (muscle_m4_output):
15045 Now inline. Return bool, not int.
15046 * src/state.c (state_compare): Likewise.
15047 * src/symtab.c (symbol_check_defined,
15048 symbol_check_alias_consistency, symbol_pack, symbol_translation,
15049 hash_compare_symbol, hash_symbol):
15050 Likewise.
15051 * src/uniqstr.c (uniqstr_print): Likewise.
15052 * src/muscle_tab.c (muscle_m4_output_processor):
15053 New function, to avoid casts.
15054 * src/state.c (state_comparator, stage_hasher): Likewise.
15055 * src/symtab.c (symbol_check_defined_processor,
15056 symbol_check_alias_consistency_processor, symbol_pack_processor,
15057 symbol_translation_processor, hash_symbol_comparator,
15058 hash_symbol_hasher): Likewise.
15059 * src/uniqstr.c (uniqstr_print_processor): Likewise.
15060 * src/muscle_tab.c (muscles_m4_output):
15061 Use new functions instead of casting old functions unportably.
15062 * src/state.c (state_hash_new): Likewise.
15063 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
15064 symbols_token_translations_init):
15065 Likewise.
15066 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
15067
15068 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
15069 var instead of casting to long, to avoid casts.
15070 (prepare_states): Use MALLOC rather than alloca, so that we don't
15071 have to worry about alloca.
15072 * src/state.c (state_hash_lookup): Likewise.
15073
15074 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
15075 local var instead of casting to unsigned char, to avoid casts.
15076
15077 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
15078 STATE_ALLOC): Remove.
15079 (transitions_new, errs_new, reductions_new, state_new): Use malloc
15080 rather than calloc, and use offsetof to avoid allocating slightly
15081 too much storage.
15082 (state_new): Initialize all members.
15083
15084 * src/state.c (state_hash): Use unsigned accumulator, not signed.
15085
15086 * src/symtab.c (symbol_free): Remove; unused.
15087 (symbol_get): Remove cast in lhs of assignment.
15088 (symbols_do): Now static. Accept generic arguments, not
15089 hashing-related ones.
15090
15091 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
15092 (symbol_processor): Remove.
15093 (symbols_do): Remove decl; now static.
15094
15095 * src/system.h (alloca): Remove; decl no longer needed.
15096 (<stddef.h>): Include, for offsetof.
15097 (<inttypes.>, <stdint.h>): Include if available.
15098 (uintptr_t): New type, if system lacks it.
15099 (CALLOC, MALLOC, REALLOC): New macros.
15100 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
15101 new macros.
15102
15103 * src/tables.c (table_size): Now int, to pacify GCC.
15104 (table_grow, table_ninf_remap): Use signed table size.
15105 (save_row): Don't bother initializing locals when not needed.
15106 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
15107 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
15108
15109 * src/vcg.h: Correct misspellings.
15110
15111 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
15112
15113
15114 * src/getargs.c (getargs): Don't assume EOF == -1.
15115
26b4a969
PE
151162002-12-09 Paul Eggert <eggert@twinsun.com>
15117
15118 Change identifier spellings to avoid collisions with names
15119 that are reserved by POSIX.
15120
15121 Don't use names ending in _t, since POSIX reserves them.
15122 For consistency, remove _e and _s endings -- they're weren't
15123 needed to remove ambiguity. All uses changed.
15124 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
15125 turn was just renamed from struniq_t.
15126 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
15127 which in turn was just renamed from struniq_processor_t.
15128 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
15129 in turn was renamed from hash_compare_struniq_t.
15130 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
15131 (state_list): Renamed from state_list_t.
15132 * src/assoc.h (assoc): Renamed from assoc_t.
15133 * src/conflicts.c (enum conflict_resolution): Renamed from
15134 enum conflict_resolution_e.
15135 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
15136 (rule_list): Renamed from rule_list_t.
15137 * src/getargs.h (enum trace): Renamed from enum trace_e.
15138 (enum report): Renamed from enum report_e.
15139 * src/gram.h (item_number): Renamed from item_number_t.
15140 (rule_number): Renamed from rule_number_t.
15141 (struct rule_s): Remove the "rule_s" part; not used.
15142 (rule): Renamed from rule_t.
15143 (rule_filter): Renamed from rule_filter_t.
15144 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
15145 (goto_list): Renamed from goto_list_t.
15146 * src/lalr.h (goto_number): Renamed from goto_number_t.
15147 * src/location.h (location): Renamed from location_t.
15148 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
15149 and moved here from:
15150 * src/muscle_tab.h (muscle_entry_t): here.
15151 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
15152 (rule_list): Renamed from rule_list_t.
15153 * src/print_graph.c (static_graph): Renamed from graph.
15154 * src/reader.h (braced_code): Renamed from braced_code_t.
15155 Remove brace_code_e tag.
15156 * src/relation.h (relation_node): Renamed from relation_node_t.
15157 (relation_nodes): Renamed from relation_nodes_t.
15158 (relation): Renamed from relation_t.
15159 * src/state.h (state_number): Renamed from state_number_t.
15160 (struct state): Renamed from struct state_s.
15161 (state): Renamed from state_t.
15162 (transitions): Renamed from transitions_t. Unused (and
15163 misspelled) transtion_s tag removed.
15164 (errs): Renamed from errs_t. Unused errs_s tag removed.
15165 (reductions): Renamed from reductions_t. Unused tag
15166 reductions_s removed.
15167 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
15168 (struct symbol_list): Renamed from struct symbol_list_s.
15169 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
15170 (struct symbol): Renamed from struct symbol_s.
15171 (symbol): Renamed from symbol_t.
15172 * src/tables.c (vector_number): Renamed from vector_number_t.
15173 (action_number): Renamed from action_t.
15174 * src/tables.h (base_number): Renamed from base_t.
15175 * src/vcg.h (enum color): Renamed from enum color_e.
15176 (enum textmode): Renamed from enum textmode_e.
15177 (enum shape): Renamed from enum shape_e.
15178 (struct colorentry): Renamed from struct colorentry_s.
15179 (struct classname): Renamed from struct classname_s.
15180 (struct infoname): Renamed from struct infoname_s.
15181 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
15182 (enum decision): Renamed from enum decision_e.
15183 (enum orientation): Renamed from enum orientation_e.
15184 (enum alignment): Renamed from enum alignment_e.
15185 (enum arrow_mode): Renamed from enum arrow_mode_e.
15186 (enum crossing_type): Renamed from enum crossing_type_e.
15187 (enum view): Renamed from enum view_e.
15188 (struct node): Renamed from struct node_s.
15189 (node): Renamed from node_t.
15190 (enum linestyle): Renamed from enum linestyle_e.
15191 (enum arrowstyle): Renamed from enum arrowstyle_e.
15192 (struct edge): Renamed from struct edge.
15193 (edge): Renamed from edge_t.
15194 (struct graph): Renamed from struct graph_s.
15195 (graph): Renamed from graph_t.
15196 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
15197 Rename value_t -> value.
15198 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
15199 value_t_as_yystype -> value_as_yystype.
15200
15201 Don't include <errno.h> in the mainstream code, since it
15202 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
15203 * lib/get-errno.c, lib/get-errno.h: New files.
15204 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
15205 get-errno.c.
15206 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
15207 * src/output.c (output_skeleton): Likewise.
15208 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
15209 instead of errno.
15210 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
15211 Likewise.
15212 (handle_action_dollar, handle_action_at): Likewise.
15213 * src/system.h: Do not include <errno.h>.
15214 (TAB_EXT): Renamed from EXT_TAB.
15215 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
15216
15217 Avoid str[a-z]*, since <string.h> reserves that name space.
15218 Change all instances of "struniq" in names to "uniqstr", and
15219 likewise for "STRUNIQ" and "UNIQSTR".
15220 * src/uniqstr.c: Renamed from src/struniq.c.
15221 * src/uniqstr.h: Renamed from src/struniq.h.
15222 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
15223 * src/files.c (strsuffix): Remove; unused.
15224 (concat2): Renamed from stringappend. Now static.
15225 * src/files.h (strsuffix, stringappend): Remove; unused.
15226 * src/parse-gram.y (<chars>): Renamed from <string>.
15227 (<uniqstr>): Renamed from <struniq>.
15228 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
15229 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
15230 (struct graph_s.expand): Renamed from struct graph_s.stretch.
15231 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
15232 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
15233 (N_EXPAND): Renamed from N_STRETCH.
15234
15235 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
15236 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
15237 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
15238 Remove; unused.
15239 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
15240 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
15241 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
15242 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
15243 (BASE_MAXIMUM): Renamed from BASE_MAX.
15244 (BASE_MINIMUM): Renamed from BASE_MIN.
15245 (ACTION_MAX): Remove; unused.
15246 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
15247 Unnecessary casts removed from above defines.
15248
15249
15250 Fix misspelling in names.
15251 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
15252 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
15253 G_NODE_ALIGNEMENT.
15254
15255
15256 * lib/timevar.c (timevar_report): Renamed from time_report,
15257 for consistency with other names.
15258 * lib/timevar.h (timevar_report): New decl.
15259 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
15260
15261
15262 Sort include-file uses.
15263
15264 Reorder all include files under src to be in the order "system.h".
15265 then the ../lib include files in angle brackets (alphabetized),
15266 then the . include files in double-quotes (alphabetized). Fix
15267 dependency breakages encountered in this process, as follows:
15268 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
15269 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
15270 * src/state.h: Include "symtab.h".
15271
996b1c7e
PE
152722002-12-08 Paul Eggert <eggert@twinsun.com>
15273
15274 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
15275 since this causes problems when __file__ contains character
15276 sequences like "@" that are treated specially by src/scan-skel.l.
15277 Instead, just use the file's basename. This fixes the bug
15278 reported by Martin Mokrejs in
161a71f3 15279 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 15280
e19c4e5d
PE
152812002-12-06 Paul Eggert <eggert@twinsun.com>
15282
15283 Add support for rules that do not have trailing semicolons, as
15284 POSIX requires. Improve the quality of locations in Bison
15285 diagnostics.
26b4a969 15286
e19c4e5d
PE
15287 * src/location.c: Include <quotearg.h>.
15288 (empty_location): Now const.
15289 (location_print): New function. Follow the recommendation of the
15290 GNU Coding Standards for locations that span file boundaries.
15291 * src/location.h: Do not include <quotearg.h>; no longer needed.
15292 (boundary): New type.
15293 (location_t): Use it. This allows locations to span file boundaries.
15294 All member uses changed: file -> start.file or end.file (as needed),
15295 first_line -> start.line, first_column -> start.column,
15296 last_line -> end.line, last_column -> end.column.
15297 (equal_boundaries): New function.
15298 (LOCATION_RESET, LOCATION_STEP): Remove.
15299 (LOCATION_PRINT): Remove. All callers changed to use location_print.
15300 (empty_location): Now const.
15301 (location_print): New decl.
15302 * src/parse-gram.y (lloc_default): New function, which handles
15303 empty locations more accurately.
15304 (YYLLOC_DEFAULT): Use it.
15305 (%token COLON): Remove.
15306 (%token ID_COLON): New token.
26b4a969 15307 (rules): Use it.
e19c4e5d
PE
15308 (declarations, rules): Remove trailing semicolon.
15309 (declaration, rules_or_grammar_declaration):
15310 Allow empty (";") declaration.
15311 (symbol_def): Remove empty actions; no longer needed.
15312 (rules_or_grammar_declaration): Remove trailing semicolon.
15313 (semi_colon.opt): Remove.
15314 * src/reader.h: Include location.h.
15315 (scanner_cursor): New decl.
15316 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
15317 rolling our own.
15318 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
15319 of *loc.
15320 (STEP): Remove. No longer needed, now that adjust_location does
15321 the work. All uses removed.
15322 (scanner_cursor): New var.
15323 (adjust_location): Renamed from extend_location. It now sets
15324 *loc and adjusts the scanner cursor. All uses changed.
15325 Don't bother testing for CR.
15326 (handle_syncline): Remove location arg; now updates scanner cursor.
15327 All callers changed.
15328 (unexpected_end_of_file): Now accepts start boundary of token or
15329 comment, not location. All callers changed. Update scanner cursor,
15330 not the location.
15331 (SC_AFTER_IDENTIFIER): New state.
15332 (context_state): Renamed from c_context. All uses changed.
15333 (id_loc, code_start, token_start): New local vars.
15334 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
15335 processing of Yacc white space and equivalents here.
15336 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
15337 instead of returning ID immediately, since we need to search for
15338 a subsequent colon.
15339 (<INITIAL>"'", "\""): Save token_start.
15340 (<INITIAL>"%{", "{", "%%"): Save code_start.
15341 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
15342 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
15343 BEGIN context_state at end, not INITIAL.
15344 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
15345 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
15346 Return correct token start.
15347 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
15348 the start of a character, string or multiline comment is found.
15349 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
15350 Reduction): Adjust reported locations to match the more-precise
15351 results now expected.
15352 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
15353 * tests/reduce.at (Useless Rules, Reduced Automaton,
15354 Underivable Rules): Likewise.
15355 * tests/regression.at (Invalid inputs): No longer `expecting ";"
15356 or "|"' now that so many other tokens are allowed by the new grammar.
15357
15358 * src/complain.h (current_file): Remove duplicate decl;
15359 current_file is now owned by files.h.
15360 * src/complain.c, src/scan-gram.l: Include files.h.
15361
153622002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 15363
e19c4e5d
PE
15364 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
15365 promotes to int; it might be unsigned int.
15366 * data/yacc.c (yy_reduce_print): Likewise.
15367
15368 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
15369 be #defined in the prologue, not in the Bison declarations.
15370 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 15371
b64755e3
PE
153722002-12-02 Paul Eggert <eggert@twinsun.com>
15373
15374 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
15375 * lib/strtoul.c: New file, from gnulib.
15376 This fixes a porting bug reported by Peter Klein in
161a71f3 15377 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 15378
6e746484
PE
153792002-11-30 Paul Eggert <eggert@twinsun.com>
15380
b64755e3
PE
15381 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
15382 and put only a forward declaration in the prologue. This is for
15383 consistency with the other scanner helper functions.
15384
6ba55592
PE
15385 Type clashes now generate warnings, not errors, since it
15386 appears that POSIX may allow some grammars with type clashes.
15387 * src/reader.c (grammar_current_rule_check): Warn about
15388 type clashes instead of complaining.
15389 * tests/input.at (Type Clashes): Expect warnings, not complaints.
15390
6e746484
PE
15391 Add Yacc library, since POSIX requires it.
15392 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
15393 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
15394 * lib/main.c, lib/yyerror.c: New files.
15395
15396 gram_error can be static; it need not be extern.
15397 * src/reader.h (gram_error): Remove decl.
15398 * src/parse-gram.y (gram_error): Now static. Add static decl.
15399 (print_token_value): Omit parameter names from forward decl,
15400 for consistency.
15401
88510f9c
PE
154022002-11-29 Paul Eggert <eggert@twinsun.com>
15403
6e746484
PE
15404 * doc/bison.texinfo: Emphasize that yylex and yyerror must
15405 be declared before being used. E.g., one should typically
15406 declare them in the prologue. Use GNU coding style in examples.
15407 Put "const" consistently after the type it modifies. Mention
15408 that C99 supports "inline". Mention that yyerror traditionally
15409 returns "int".
15410
88510f9c
PE
15411 %parse-param and %lex-param now take just one argument, the
15412 declaration; the argument name is deduced from the declaration.
15413
15414 * doc/bison.texinfo (Parser Function, Pure Calling, Error
15415 Reporting, Table of Symbols): Document this.
15416 * src/parse-gram.y (add_param): New function.
15417 (COMMA): Remove.
15418 (declaration): Implement new rule for %parse-param and %lex-param.
15419 * src/scan-gram.l: "," now elicits a warning, rather than being
15420 a token; this is more compatible with byacc.
15421 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
15422
bb92250c
PE
154232002-11-27 Paul Eggert <eggert@twinsun.com>
15424
15425 Rename identifiers to avoid real and potential collisions.
15426
15427 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
15428 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 15429 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
15430 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
15431 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
15432 * src/parse-gram.y (print_token_value): Renamed from yyprint.
15433 All uses changed.
15434 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
15435 The name "yycontrol" violates the name space rules, and this stuff
15436 wasn't being used anyway.
15437 (input): Remove action; this stuff wasn't being used.
15438 (gram_error): Rename local variable yylloc -> loc.
15439 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
15440 (YY_DECL): Don't use "yy" at start of local variables.
15441 All uses changed, e.g., yylloc -> loc.
15442 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
15443 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
15444 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
15445 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
15446
15447 * src/parse-gram.y (gram_error): loc is now const *.
15448 * src/reader.h (gram_error): Likewise.
15449
3af4feb2
PE
154502002-11-24 Paul Eggert <eggert@twinsun.com>
15451
15452 Version 1.75c.
15453
15454 * tests/actions.at (Actions after errors): Use an output format
15455 more similar to that of the Printers and Destructors test.
15456 Test the position of the ';' token too.
15457 (Printers and Destructors): Likewise.
15458 (Printers and Destructors: %glr-parser): Remove for now, to avoid
15459 unnecessarily alarming people when the test fails.
15460
15461 * data/yacc.c (yyerrlab1): Move this label down, so that the
15462 parser does not discard the lookahead token if the user code
15463 invokes YYERROR. This change is required for POSIX conformance.
15464
15465 * lib/error.c: Sync with gnulib.
15466
154672002-11-22 Paul Eggert <eggert@twinsun.com>
15468
15469 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
15470 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
15471 * lib/xmalloc.c: Likewise.
26b4a969 15472
58004308
PE
154732002-11-20 Paul Eggert <eggert@twinsun.com>
15474
15475 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
15476
154772002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 15478
58004308
PE
15479 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
15480 should use `if (! x) abort ();' rather than `assert (x);', and
15481 anyway it's one less thing to worry about configuring.
15482
15483 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
15484 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
15485 and replace all instances of assert with abort.
15486 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
15487 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
15488
15489 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
15490 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
15491 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
15492 hash_find_entry, hash_rehash, hash_insert): Likewise.
15493 * src/conflicts.c (resolve_sr_conflict): Likewise.
15494 * src/lalr.c (set_goto_map, map_goto): Likewise.
15495 * src/nullable.c (nullable_compute): Likewise.
15496 * src/output.c (prepare_rules, token_definitions_output): Likewise.
15497 * src/reader.c (packgram, reader): Likewise.
15498 * src/state.c (state_new, state_free, state_transitions_set,
15499 state_reduction_find): Likewise.
15500 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
15501 symbol_pack): Likewise.
15502 * src/tables.c (conflict_row, pack_vector): Likewise.
15503 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
15504 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
15505 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
15506 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
15507
15508 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
15509 (ARGMATCH_CONSTRAINT): New macro.
15510 (ARGMATCH_ASSERT): Use it.
15511
15512 * src/system.h (verify): New macro.
15513 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
15514 rather than assert.
15515 * src/tables.c (tables_generate): Likewise.
15516
15517 * src/struniq.c (struniq_assert): Now returns void, and aborts
15518 if the assertion is false.
15519 (struniq_assert_p): Remove.
15520 * src/struniq.h: Likewise.
15521
76ae8198
PE
155222002-11-18 Paul Eggert <eggert@twinsun.com>
15523
15524 * data/glr.c (yygetLRActions): Replace `yyindex' with
15525 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
15526 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 15527 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 15528
d3c4e709
AD
155292002-11-18 Akim Demaille <akim@epita.fr>
15530
15531 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
15532 space.
15533 From Tim Van Holder.
15534
8d8a7238
PE
155352002-11-17 Paul Eggert <eggert@twinsun.com>
15536
15537 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
15538 to "SyntaxError" for consistency with my 2002-11-15 change.
15539
15540 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
15541 not define to {}, since this breaks the common use of `YYDPRINTF
15542 ((...));' if a single statement is desired (e.g. before `else').
15543 Work around GCC warnings by surrounding corresponding calls with
15544 {} if needed.
15545 (yyhasResolvedValue): Remove unused function.
15546 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
15547 loop body.
15548 (yyreportSyntaxError): Renamed from yyreportParseError.
15549 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
15550 All uses changed.
15551 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
15552 extern when possible. Remove unused initializations.
15553
b0937b22
AD
155542002-11-16 Akim Demaille <akim@epita.fr>
15555
15556 Augment the similarity between GLR and LALR traces.
15557
15558 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
15559 (YY_REDUCE_PRINT): New.
15560 (yyparse): Use them.
15561 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
15562 YYDPRINT here.
15563 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
15564 state reached after the reduction/recovery, since...
15565 (yyparse, yyprocessOneStack): Report the state we are entering in.
15566
c5e3e510
AD
155672002-11-16 Akim Demaille <akim@epita.fr>
15568
15569 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
15570 Add support for --trace=skeleton.
15571 * src/scan-skel.l: %option debug.
15572 Scan strings of non-@ or \n instead of character by character.
15573 (scan_skel): Handle trace_skeleton.
15574 (QPUTS): New.
15575 (@output_parser_name@, @output_header_name@): ``Restore'' their
15576 support (used to be M4 macros).
15577 * data/yacc.c: Quote larger chunks, a la glr.c.
15578 * data/lalr1.cc: Likewise.
15579 The header guards are no longer available, so use some other
15580 string than `YYLSP_NEEDED'.
15581
4c6cc1db
AD
155822002-11-16 Akim Demaille <akim@epita.fr>
15583
15584 Make the ``Printers and Destructors'' test more verbose, taking
15585 `yacc.c''s behavior as (possibly wrong) reference.
15586
15587 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
15588 instead of fprint on stdout.
15589 Set and report the last_line of the symbols.
15590 Consistently display values and locations.
15591
6d9e8019
PE
155922002-11-16 Paul Eggert <eggert@twinsun.com>
15593
15594 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
15595
6e649e65
PE
155962002-11-15 Paul Eggert <eggert@twinsun.com>
15597
b25d88f6
PE
15598 * tests/actions.at (Actions after errors): New test case.
15599
6e649e65
PE
15600 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
15601 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
15602 tests/action.at, tests/calc.at, tests/conflicts.at,
15603 tests/cxx-type.at, tests/regression.at:
15604 "parse error" -> "syntax error" for POSIX compatibility.
15605 "parsing stack overflow..." -> "parser stack overflow" so
15606 that code matches Bison documentation.
15607
0f39aab9
AD
156082002-11-15 Akim Demaille <akim@epita.fr>
15609
15610 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
15611 take two BRACED_CODE, not two string_content.
15612 Free the scanner's obstack when we are done.
15613 (code_content): New.
15614 * tests/calc.at: Adjust.
15615 * doc/bison.texinfo: Adjust.
15616 Also, make sure to include the `,' for these declarations.
15617
761c1926
AD
156182002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
15619
15620 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
15621 definition; avoids potential autoreconf problems.
15622
b0f98b10
AD
156232002-11-15 Akim Demaille <akim@epita.fr>
15624
15625 Always check the value returned by yyparse.
15626
15627 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
15628 returned by yyparse.
15629 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
15630 Adjust calls.
15631 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
15632 returned by yyparse.
15633
970785f1
PH
156342002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15635
15636 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
15637 on input.at test.
15638
8fcc7db1
PE
156392002-11-14 Paul Eggert <eggert@twinsun.com>
15640
7ec1b48e
PE
15641 * src/output.c (output_skeleton): Call xfopen instead of
15642 duplicating xfopen's body.
15643
cfff7583 15644 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 15645 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 15646
8fcc7db1
PE
15647 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
15648 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
15649 Group compiler. Instead, use "$CC -E bar.c". Include the .h
15650 file twice in the grammar, as an extra check.
15651
15652 * tests/input.at (Torturing the Scanner): Surround the
15653 backslash-newline tests with "#if 0", to make it less likely that
15654 we'll run into compiler bugs. Bring back solitary \ inside
15655 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 15656 test backslash-newline in C character constant.
8fcc7db1 15657
4e8d992c
AD
156582002-11-14 Akim Demaille <akim@epita.fr>
15659
15660 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
15661 status of the compiler.
f32b346d 15662 Calling `exit 1' is no longer needed.
4e8d992c
AD
15663 Reported by Nelson H. F. Beebe.
15664
9501dc6e
AD
156652002-11-14 Akim Demaille <akim@epita.fr>
15666
15667 * tests/atlocal.in (CPPFLAGS): We have config.h.
15668 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
15669 New.
15670 * tests/actions.at, tests/calc.at, tests/conflicts.at,
15671 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
15672 * tests/regression.at, tests/torture.at: Use them for all the
15673 grammars that are to be compiled.
15674 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
15675 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
15676 * doc/bison.texinfo (GLR Parsers): Document `inline'.
15677
18b519c0
AD
156782002-11-14 Akim Demaille <akim@epita.fr>
15679
15680 * doc/bison.texinfo: Various formatting changes (alignments in
15681 samples, additional @group/@end group, GCS in samples.
15682 Use @deffn instead of simple @table to define the directives,
15683 macros, variables etc.
15684
9a86cdb9
PE
156852002-11-13 Paul Eggert <eggert@twinsun.com>
15686
daa33def 15687 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 15688 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 15689
daa33def 15690 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 15691 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
15692 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
15693 * tests/headers.at (export YYLTYPE): Likewise.
15694
15695 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 15696 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 15697
9a86cdb9
PE
15698 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
15699 comments, since they're not portable. Use GNU coding style.
15700
9c1e26bd
AD
157012002-11-13 Akim Demaille <akim@epita.fr>
15702
15703 * data/yacc.c: Leave bigger chunks of quoted text.
15704 (YYDSYMPRINTF): New.
15705 Use it to report symbol activities.
15706 * data/glr.c (YYDSYMPRINTF): New.
15707 Use it.
15708
87f721cc
PE
157092002-11-12 Paul Eggert <eggert@twinsun.com>
15710
15711 Version 1.75b.
15712
15713 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
15714 (yyglrReduce): Return yyok, not 0.
15715 This should avoid the enumerated-type warnings reported
464c6927 15716 by Nelson H. F. Beebe in
161a71f3 15717 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
15718
15719 * lib/bbitset.h (BITSET_INLINE): Remove.
15720 * lib/bitset.h [! BITSET_INLINE]: Remove.
15721 (bitset_set, bitset_reset, bitset_test): Rename local vars
15722 to avoid shadowing warnings by GCC.
15723
15724 * data/glr.c (inline): Remove #define. It's the user's
15725 responsibility to #define it away, just like 'const'.
464c6927 15726 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 15727 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 15728
87f721cc
PE
15729 * Makefile.maint (po-check): Scan .l and .y files instead of the
15730 .c and the .h files that they generate. This fixes the bug
15731 reported by Tim Van Holder in:
161a71f3 15732 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
15733 Look for N_ as well as for _. Try to avoid matching #define for
15734 N_ and _.
15735 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
15736 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
15737 * src/scan-gram.l: Revamp regular expressions so that " and '
15738 do not confuse xgettext.
15739
15740 * src/struniq.h (struniq_new): Do not declare the return type
15741 to be 'const'; this violates the C standard.
15742 * src/struniq.c (struniq_new): Likewise.
15743
be14ade5
AD
157442002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
15745
15746 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
15747 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
15748 linker.
15749
05291fbc
AD
157502002-11-12 Akim Demaille <akim@epita.fr>
15751
15752 * Makefile.maint: Sync with Autoconf:
15753 (local_updates): New.
15754
1f5fd52e
AD
157552002-11-12 Akim Demaille <akim@epita.fr>
15756
15757 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
15758
283f1e64
AD
157592002-11-12 Akim Demaille <akim@epita.fr>
15760
15761 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
15762 locations.
15763
886b69d1
AD
157642002-11-12 Akim Demaille <akim@epita.fr>
15765
15766 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
15767 not yyvalue.
15768
3df37415
AD
157692002-11-12 Akim Demaille <akim@epita.fr>
15770
15771 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
15772 Use it to test the GLR parser.
15773
7bd6c77e
AD
157742002-11-12 Akim Demaille <akim@epita.fr>
15775
15776 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
15777 defines it.
15778 * data/glr.c (yystos): New.
15779 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
15780 (YYDSYMPRINT): New.
15781 (yyval): Don't define it, it is handled via M4.
15782 (yyrecoverParseError): Free verbosely the discarded symbols.
15783 * data/yacc.c (yysymprint): Remove, rather...
15784 (b4_yysymprint_generate): invoke.
15785 * data/c.m4 (b4_yysymprint_generate): New.
15786 Accept pointers as arguments, as opposed to the version from
15787 yacc.c.
15788 (b4_yydestruct_generate): Likewise.
15789 * tests/cations.at (Printers and Destructors): Use Bison directives
15790 instead of CPP macros.
15791 Don't rely on internal details.
15792
b0400cc6
AD
157932002-11-12 Akim Demaille <akim@epita.fr>
15794
15795 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
15796 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
15797 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
15798 it against YYEMPTY and so forth), work on yytoken (i.e., set
15799 it to YYEMPTY etc.).
15800 (yydestruct): Replace with a b4_yydestruct_generate invocation.
15801 (b4_symbol_actions): Remove.
15802 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
15803 for 0, end-of-input.
15804
72f889cc
AD
158052002-11-12 Akim Demaille <akim@epita.fr>
15806
15807 * doc/bison.texinfo (Destructor Decl): New.
15808
b1ae9233
AD
158092002-11-12 Akim Demaille <akim@epita.fr>
15810
15811 * src/tables.c (tables_generate): Use free for pointers that
15812 cannot be NULL, not XFREE.
15813 (pack_vector): Use assert, not fatal, for bound violations.
15814 * src/state.c (state_new): Likewise.
15815 * src/reader.c (reader): Likewise.
15816 * src/lalr.c (set_goto_map): Likewise.
72f889cc 15817 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
15818 the file name.
15819
7ec2d4cd
AD
158202002-11-12 Akim Demaille <akim@epita.fr>
15821
15822 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
15823 Restore.
15824 * src/scan-gram.l (last_string): Is global to the file, not to
15825 yylex.
15826 * src/parse-gram.y (input): Don't append the epilogue here,
15827 (epilogue.opt): do it here, and free the scanner's obstack.
15828 * src/reader.c (epilogue_set): Rename as...
15829 (epilogue_augment): this.
15830 * data/c.m4 (b4_epilogue): Defaults to empty.
15831
573a6cd3
AD
158322002-11-12 Akim Demaille <akim@epita.fr>
15833
15834 * src/getargs.c (long_options): Remove duplicates.
15835 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
15836 Remove.
15837 * doc/bison.rnh: Remove.
15838 * doc/bison.texinfo (VMS Invocation): Remove.
15839
95612cfa
AD
158402002-11-12 Akim Demaille <akim@epita.fr>
15841
15842 * src/struniq.h, src/struniq.c (struniq_t): Is const.
15843 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
15844
15845 Use struniq for symbols.
15846
15847 * src/symtab.h (symbol_t): The tag member is a struniq.
15848 (symbol_type_set): Adjust.
15849 * src/symtab.c (symbol_new): Takes a struniq.
15850 (symbol_free): Don't free the tag member.
15851 (hash_compare_symbol_t, hash_symbol_t): Rename as...
15852 (hash_compare_symbol, hash_symbol): these.
15853 Use the fact that tags as struniqs.
15854 (symbol_get): Use struniq_new.
15855 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
15856 Returns a strniq.
15857 * src/reader.h (merger_list, grammar_currentmerge_set): The name
15858 and type members are struniqs.
15859 * src/reader.c (get_merge_function)
15860 (grammar_current_rule_merge_set): Adjust.
15861 (TYPE, current_type): Are struniq.
15862
15863 Use struniq for file names.
15864
15865 * src/files.h, src/files.c (infile): Split into...
15866 (grammar_file, current_file): these.
15867 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
15868 * src/reduce.c (reduce_print): Likewise.
15869 * src/getargs.c (getargs): Likewise.
15870 * src/complain.h, src/complain.c: Likewise.
15871 * src/main.c (main): Call struniqs_new early enough to use it for
15872 file names.
15873 Don't free the input file name.
15874
3e6656f9
AD
158752002-11-12 Akim Demaille <akim@epita.fr>
15876
15877 * src/symtab.c (symbol_free): Remove dead deactivated code:
15878 type_name are properly removed.
15879 Don't use XFREE to free items that cannot be NULL.
15880 * src/struniq.h, src/struniq.c: New.
15881 * src/main.c (main): Initialize/free struniqs.
15882 * src/parse-gram.y (%union): Add astruniq member.
15883 (yyprint): Adjust.
15884 * src/scan-gram.l (<{tag}>): Return a struniq.
15885 Free the obstack bit that used to store it.
15886 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
15887
7672019c
PE
158882002-11-11 Paul Eggert <eggert@twinsun.com>
15889
15890 Revamp to fix many (but not all) of the C- and M4-related quoting
15891 problems. Among other things, this fixes the Bison bug reported
15892 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 15893 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
15894
15895 Use new @ escapes consistently. Represent brackets with @{ and @}
15896 rather than @<:@ and @:>@, since this works a bit better with dumb
15897 editors like vi. Represent @ with @@, since @ is now consistently
15898 an escape. Use @oline@ and @ofile@ rather than __oline__ and
15899 __ofile__, to avoid unexpected expansions. Similarly, use @output
15900 rather than #output.
15901
15902 * data/c.m4 (b4_copyright): Omit file name from comment, since
15903 the file name could contain "*/".
15904 (b4_synclines_flag): Don't quote the 2nd argument; it should already
15905 be quoted. All uses changed.
15906
15907 * data/glr.c: Use new @ escapes consistently.
15908 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
15909 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
15910 Remove, since they couldn't handle arbitrary characters in file
15911 names.
15912 * data/lalr1.cc: Likewise.
15913 * data/yacc.c: Likewise.
15914
15915 * src/files.c (output_infix): Remove; all uses removed.
15916 * src/files.h: Likewise.
15917
15918 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
15919 mishandled funny characters in file names, and anyway it isn't
15920 needed any more.
15921 * data/yacc.c: Likewise.
15922 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
15923
15924 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
15925 * data/yacc.c: Likewise.
15926
15927 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
15928 strings now.
15929 (muscle_init): Quote filename as a C string.
15930 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
15931 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
15932 * src/output.c (escaped_file_name_output): New function.
15933 (prepare_symbols): Quote tokens for M4.
15934 (prepare): Don't insert output_infix, output_prefix,
15935 output_parser_name, output_header_name; this is now down by scan-skel.
15936 Insert skeleton as a C string.
15937
15938 * src/output.c (user_actions_output, symbol_destructors_output,
15939 symbol_printers_output): Quote filenames for C and M4.
15940 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15941
15942 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
15943 escapes other than \\ and \'; this simplifies the code.
15944 (<SC_STRING>): Likewise, for \\ and \".
15945 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
15946 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
15947 Use new escapes @{ and @} for [ and ].
15948
15949 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
15950 them with auto vars.
15951 Switch to new escape scheme, where @ is the escape character uniformly.
15952 Abort if a stray escape character is found. Avoid unbounded input
15953 buffer when parsing non-escaped text.
15954
15955 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
15956 __oline__, #output, $@, and @{ do not have unintended meanings.
15957
acea4f3b
PE
159582002-11-09 Paul Eggert <eggert@twinsun.com>
15959
15960 Fix the test failure due to GCC warnings described in
161a71f3 15961 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
15962 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
15963 evaluate to 0 if it's impossible for NINF to be in the respective
15964 table.
15965 (yygetLRActions, yyrecoverParseError): Use them.
15966
15967 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
15968 counted in the token inserted at end of file. Now takes
15969 location_t *, not location_t, so that the location can be
15970 adjusted. All uses changed.
15971
15972 * tests/regression.at (Invalid inputs): Adjust wording in
15973 diagnostic to match the new behavior.
15974
15975 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
15976 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
15977 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
15978 abort ();'. This reduces the runtime of the "Many lookaheads"
15979 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
15980 GCC 3.2.
15981
20ef1ad5
PE
159822002-11-07 Paul Eggert <eggert@twinsun.com>
15983
15984 * src/parse-gram.y (CHARACTER): Remove unused token.
15985 All uses removed.
15986
15987 * src/scan-gram.l: Remove stack option. We no longer use the
15988 stack, since the stack was never deeper than 1; instead, use the
15989 new auto var c_context to record the stacked value.
15990
15991 Remove nounput option. At an unexpected end of file, we now unput
15992 the minimal input necessary to end cleanly; this simplifies the
15993 code.
15994
15995 Avoid unbounded token sizes where this is easy.
15996
15997 (unexpected_end_of_file): New function.
15998 Use it to systematize the error message on unexpected EOF.
15999 (last-string): Now auto, not static.
16000 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
16001 (scanner_last_string_free): Remove; not used.
16002 (percent_percent_count): Move decl to just before use.
16003 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
16004 not the (never otherwised-used) CHARACTER.
16005
93724f13
AD
160062002-11-07 Akim Demaille <akim@epita.fr>
16007
16008 Let yyerror always receive the msg as last argument, so that
16009 yyerror can be variadic.
16010
16011 * data/yacc.c (b4_yyerror_args): New.
16012 Use it when calling yyerror.
16013 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
16014 Use it when calling yyerror.
16015 * doc/bison.texinfo (Error Reporting): Adjust.
16016 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
16017 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
16018
6e40b4eb
AD
160192002-11-06 Akim Demaille <akim@epita.fr>
16020
16021 #line should have quoted strings.
16022 Ideally, this should be done by m4_quotearg.
16023
16024 * src/scan-skel.l: Include quotearg.h.
16025 Quote __ofile__.
16026 * src/output.c (symbol_printers_output)
16027 (symbol_destructors_output): Quote the file name.
16028
2dfbfc12
AD
160292002-11-06 Akim Demaille <akim@epita.fr>
16030
16031 * tests/regression.at (Invalid inputs): Adjust to the recent
16032 messages.
16033
437c2d80
AD
160342002-11-06 Akim Demaille <akim@epita.fr>
16035
16036 Restore --no-lines.
16037 Reported by Jim Kent.
16038
16039 * data/c.m4 (b4_syncline): New.
16040 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
16041 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
16042 * src/output.c (user_actions_output): Likewise.
16043 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 16044 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 16045
900c5db5
AD
160462002-11-06 Akim Demaille <akim@epita.fr>
16047
16048 * src/main.c (main): Free `infile'.
16049 * src/scan-gram.l (handle_syncline): New.
16050 Recognize `#line'.
16051 * src/output.c (user_actions_output, symbol_destructors_output)
16052 (symbol_printers_output): Use the location's file name, not
16053 infile.
16054 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16055
e183b123 160562002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 16057
e183b123 16058 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 16059 either has GLR conflict entries.
e183b123 16060
193eb6b7
PE
160612002-11-05 Paul Eggert <eggert@twinsun.com>
16062
e183b123
PE
16063 * src/scan-gram.l: Use more accurate diagnostics, e.g.
16064 "integer out of range" rather than "invalid value".
16065 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
16066 accordingly.
16067
193eb6b7
PE
16068 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
16069 Also, remove one static variable in the scanner.
16070
16071 * src/scan-gram.l (braces_level): Now auto, not static.
16072 Initialize to zero if the compiler is being picky.
16073 (INITIAL): Clear braces_level instead of incrementing it.
16074 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
16075 as POSIX 1003.1-2001 requires.
16076 * src/system.h (IF_LINT): New macro, taken from coreutils.
16077 * configure.ac: Define "lint" if --enable-gcc-warnings.
16078
29c01725
AD
160792002-11-05 Akim Demaille <akim@epita.fr>
16080
16081 * src/scan-gram.l: When it starts with `%', complain about the
16082 whole directive, not just that `invalid character: %'.
16083
8aeac3ca
AD
160842002-11-04 Akim Demaille <akim@epita.fr>
16085
16086 * Makefile.maint: Update from Autoconf.
16087 (update, cvs-update, po-update, do-po-update): New.
16088
793a58bb
AD
160892002-11-04 Akim Demaille <akim@epita.fr>
16090
16091 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
16092 and yyerror.
16093 Have yyerror `use' its arguments.
16094 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
16095 returns true when location & yacc & pure & parse-param.
16096 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
16097
c4d720cd
AD
160982002-11-04 Akim Demaille <akim@epita.fr>
16099
16100 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
16101 clashes.
16102 * src/scan-gram.l: Use [\'] instead of ['] to pacify
16103 font-lock-mode.
16104 Use complain_at.
16105 Use quote, not quote_n since LOCATION_PRINT no longer uses the
16106 slot 0.
16107
613a0dc5
PE
161082002-11-03 Paul Eggert <eggert@twinsun.com>
16109
16110 * src/reader.c (get_merge_function, grammar_current_rule_check):
16111 Use consistent diagnostics for reporting type name clashes.
16112 Quote the types with <>, for consistency with Yacc.
16113 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
16114
2a8d363a
AD
161152002-11-03 Akim Demaille <akim@epita.fr>
16116
16117 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
16118 New.
16119 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
16120 (b4_parse_param): Remove.
16121 Use b4_identification.
16122 Propagate b4_pure_args where needed to pass them to yyerror.
16123 * data/glr.m4 (b4_parse_param): Remove.
16124 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
16125 (b4_lpure_formals): New.
16126 Use b4_identification.
16127 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
16128 b4_user_formals and b4_user_args.
16129 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
16130 (yyreportAmbiguity): When using a pure parser, also need
16131 the location, and the parse-params.
16132 Adjust callers.
16133 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
16134 When using a pure parser, also need the parse-params.
16135 Adjust callers.
16136 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
16137 (%pure-parser + %parse-param) LALR and GLR parsers.
16138 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
16139 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
16140 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
16141 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
16142 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
16143 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
16144 * doc/bison.texinfo: Untabify the whole file.
16145 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
16146 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
16147 (Error Reporting): Adjust to these new directives.
16148 Document %error-verbose, deprecate YYERROR_VERBOSE.
16149
9e32add8
AD
161502002-11-03 Akim Demaille <akim@epita.fr>
16151
16152 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
16153 AT_CHECK_CALC_GLR invocations to use % directives, instead of
16154 command line options.
16155 * tests/cxx-type.at: Formatting changes.
16156
b02d90a5
PE
161572002-11-03 Paul Eggert <eggert@twinsun.com>
16158
16159 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
16160 to count columns correctly, and to check for invalid inputs.
9e32add8 16161
b02d90a5
PE
16162 Use mbsnwidth to count columns correctly. Account for tabs, too.
16163 Include mbswidth.h.
16164 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
16165 (extend_location): New function.
16166 (YY_LINES): Remove.
16167
16168 Handle CRLF in C code rather than in Lex code.
16169 (YY_INPUT): New macro.
16170 (no_cr_read): New function.
16171
16172 Scan UCNs, even though we don't fully handle them yet.
16173 (convert_ucn_to_byte): New function.
16174
16175 Handle backslash-newline correctly in C code.
16176 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
16177 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
16178 all uses changed.
16179 (tag, splice): New EREs. Do not allow NUL or newline in tags.
16180 Use {splice} wherever C allows backslash-newline.
16181 YY_STEP after space, newline, vertical-tab.
16182 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 16183
b02d90a5
PE
16184 (letter, id): Don't assume ASCII; e.g., spell out a-z.
16185
16186 ({int}, handle_action_dollar, handle_action_at): Check for integer
16187 overflow.
9e32add8 16188
b02d90a5
PE
16189 (YY_STEP): Omit trailing semicolon, so that it's more like C.
16190
16191 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
16192 as well as \000. Check for UCHAR_MAX, not 255.
16193 Allow \x with an arbitrary positive number of digits, as in C.
16194 Check for overflow here.
16195 Allow \? and UCNs, for compatibility with C.
16196
16197 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
16198 with quote slot used by complain_at.
16199
16200 * tests/input.at: Add tests for backslash-newline, m4 quotes
16201 in symbols, long literals, and funny escapes in strings.
16202
16203 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
16204 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
16205 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
16206 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
16207 * m4/mbswidth.m4: New file, from GNU coreutils.
16208
16209 * doc/bison.texinfo (Grammar Outline): Document // comments.
16210 (Symbols): Document that trigraphs have no special meaning in Bison,
16211 nor is backslash-newline allowed.
16212 (Actions): Document that trigraphs have no special meaning.
16213
16214 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
16215 no longer used.
16216
162172002-11-02 Paul Eggert <eggert@twinsun.com>
16218
16219 * src/reader.c: Don't include quote.h; not needed.
16220 (get_merge_function): Reword warning to be consistent with
16221 type clash diagnostic in grammar_current_rule_check.
16222
16223 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
16224 bug in trigraph handling.
16225
16226 * src/output.c (prepare_symbols): When printing token names,
16227 escape "[" as "@<:@" and likewise for "]".
16228
16229 * src/system.h (errno): Remove declaration, as we are now
16230 assuming C89 or better, and C89 guarantees errno.
16231
762b212b
PE
162322002-10-30 Paul Eggert <eggert@twinsun.com>
16233
16234 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
16235 Check for close failures.
16236 * src/files.h (xfclose): Return void, not int, since it always
16237 returned zero.
16238 * src/files.c (xfclose): Likewise. Report I/O error if ferror
16239 indicates one.
16240 * src/output.c (output_skeleton): Use xfclose rather than fclose
16241 and ferror. xfclose now checks ferror.
16242
16243 * data/glr.c (YYLEFTMOST_STATE): Remove.
16244 (yyreportTree): Use a stack-based leftmost state. This avoids
16245 our continuing battles with bogus warnings about initializers.
16246
56100c60
AD
162472002-10-30 Akim Demaille <akim@epita.fr>
16248
16249 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
16250 #if.
16251
51b4a04c
PH
162522002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16253
16254 * tests/glr-regr1.at: New test for reported regressions.
16255 * tests/testsuite.at: Add glr-regr1.at test.
16256 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 16257
bf1ebda2
PE
162582002-10-24 Paul Eggert <eggert@twinsun.com>
16259
5c16c6b1
PE
16260 Version 1.75a.
16261
bf1ebda2
PE
16262 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
16263 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
16264 we use malloc. Don't assume 'A' through 'Z' are contiguous.
16265 Don't assume strdup exists; POSIX says its an XSI extension.
16266 Check for buffer overflow on input.
16267
b526ee61
AD
162682002-10-24 Akim Demaille <akim@epita.fr>
16269
16270 * src/output.c (output_skeleton): Don't disable M4sugar comments
16271 too soon: it results in comments being expanded.
16272 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
16273 first output.
16274
f1886bb2
AD
162752002-10-24 Akim Demaille <akim@epita.fr>
16276
16277 * data/yacc.c (m4_int_type): New.
16278 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
16279 char' as only yacc.c wants K&R portability.
16280 * data/glr.c (yysigned_char): Remove.
16281 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
16282 Reported by Quoc Peyrot.
16283
c5576256
PE
162842002-10-23 Paul Eggert <eggert@twinsun.com>
16285
16286 * src/main.c (main): With --trace=time, report times even if a
16287 non-fatal error occurs. Formerly, the times were reported in some
16288 such cases but not in others.
16289 * src/reader.c (reader): Just return if a complaint has been issued,
16290 instead of exiting, so that 'main' can report times.
16291
27b0ffea
AD
162922002-10-22 Akim Demaille <akim@epita.fr>
16293
16294 * src/system.h: Include sys/types.
16295 Reported by Bert Deknuydt.
16296
223a7883
PE
162972002-10-23 Paul Eggert <eggert@twinsun.com>
16298
16299 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
16300 Suggested by Art Haas.
16301
163022002-10-22 Paul Eggert <eggert@twinsun.com>
16303
16304 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
16305 decl; not needed any more.
16306 * src/main.c (main): Use return to exit, undoing yesterday's change.
16307 The last OS that we could find where this wouldn't work is
16308 SunOS 3.5, and that's too old to worry about now.
16309
16310 * data/glr.c (struct yyltype): Define members even when not
16311 doing locations. This is more consistent with yacc.c, and it
16312 works around the following bug reports:
161a71f3
PE
16313 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
16314 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 16315
223a7883
PE
16316 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
16317 @acronym consistently. Standardize on "Yacc" instead of "YACC",
16318 "Algol" instead of "ALGOL". Give a bit more history about BNF.
16319
8b76775a
AD
163202002-10-22 Akim Demaille <akim@epita.fr>
16321
16322 * data/README: New.
16323
6db10d14
PE
163242002-10-21 Paul Eggert <eggert@twinsun.com>
16325
16326 Be consistent about 'bool'; the old code used an enum in one
16327 module and an int in another, and this violates the C standard.
16328 * m4/stdbool.m4: New file, from coreutils 4.5.3.
16329 * configure.ac (AC_HEADER_STDBOOL): Add.
16330 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
16331 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
16332 * src/symtab.c (hash_compare_symbol_t): Likewise.
16333 * src/system.h (bool, false, true): Use a definition consistent
16334 with ../lib/hash.c. All uses changed.
16335
16336 * src/complain.c (warning_issued): Renamed from warn_message_count,
16337 so that we needn't worry about integer overflow (!).
16338 Now of type bool. All uses changed.
16339 (complaint_issued): Renamed from complain_message_count; likewise.
16340
16341 * src/main.c (main): Use exit to exit with failure.
27b0ffea 16342
6db10d14
PE
16343 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
16344 rather than 1 and 0.
16345 * src/main.c (main): Likewise.
16346 * src/getargs.c (getargs): Likewise.
16347 * src/reader.c (reader): Likewise.
16348
16349 * src/getarg.c (getargs): Remove duplicate code for
16350 "Try `bison --help'".
16351
16352 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
16353 What was that "2" for?
16354
16355 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
16356 * src/getargs.c (usage): Likewise.
16357
16358 * src/getargs.c (getargs): When there are too few operands, report
16359 the last one. When there are too many, report the first extra
16360 one. This is how diffutils does it.
16361
92a060fd
PE
163622002-10-20 Paul Eggert <eggert@twinsun.com>
16363
16364 Remove K&R vestiges.
16365 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
16366 * src/complain.c (VA_START): Remove. Assume prototypes.
16367 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
16368 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
16369 fatal): Assume prototypes.
16370 * src/complain.h: Assume prototypes.
16371 * src/system.h (PARAMS): Remove.
16372 Include <limits.h> unconditionally, since it's guaranteeed even
16373 for a freestanding C89 compiler.
16374 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
16375 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 16376
e7cb57c0
AD
163772002-10-20 Akim Demaille <akim@epita.fr>
16378
16379 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
16380 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
16381 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
16382 (yyresolveStates, yyresolveAction, yyresolveStack)
16383 (yyprocessOneStack): Use them.
16384 (yy_reduce_print): New.
16385 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
16386
0245f82d
AD
163872002-10-20 Akim Demaille <akim@epita.fr>
16388
16389 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
16390 arguments and output `void'.
16391 (b4_c_function): Rename as...
16392 (b4_c_function_def): this.
16393 (b4_c_function_decl, b4_c_ansi_function_def)
16394 (b4_c_ansi_function_decl): New.
16395 Change the interpretation of the arguments: before `int, foo', now
16396 `int foo, foo'.
16397 * data/yacc.c (yyparse): Prototype and define thanks to these.
16398 Adjust b4_c_function_def uses.
16399 * data/glr.c (yyparse): Likewise, but ANSI only.
16400
39912f52
AD
164012002-10-20 Akim Demaille <akim@epita.fr>
16402
16403 * src/output.c (prepare): Move the definition of `tokens_number',
16404 `nterms_number', `undef_token_number', `user_token_number_max'
16405 to...
16406 (prepare_tokens): Here.
16407 (prepare_tokens): Rename as...
16408 (prepare_symbols): this.
16409 (prepare): Move the definition of `rules_number' to...
16410 (prepare_rules): here.
16411 (prepare): Move the definition of `last', `final_state_number',
16412 `states_number' to...
16413 (prepare_states): here.
16414 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
16415
20c1e2ad
AD
164162002-10-20 Akim Demaille <akim@epita.fr>
16417
16418 * src/tables.h, src/tables.c, src/output.c: Comment changes.
16419
21964f43
AD
164202002-10-20 Akim Demaille <akim@epita.fr>
16421
16422 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
16423 * data/c.m4: here.
16424
66d30cd4
AD
164252002-10-20 Akim Demaille <akim@epita.fr>
16426
16427 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
16428 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
16429 `pair'.
16430 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
16431 `name' to...
16432 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
16433 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
16434 These.
16435
95f2c9fe
PE
164362002-10-19 Paul Eggert <eggert@twinsun.com>
16437
16438 Do not create a temporary file, as that involves security and
16439 cleanup headaches. Instead, use a pair of pipes.
16440 Derived from a suggestion by Florian Krohm.
16441 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
16442 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
16443 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
16444 (BISON_PREREQ_SUBPIPE): Add.
16445 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
16446 Add subpipe.h, subpipe.c.
16447 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
16448 * po/POTFILES.in: Add lib/subpipe.c.
16449 * src/output.c: Include "subpipe.h".
16450 (m4_invoke): Remove decl.
16451 (scan_skel): New decl.
16452 (output_skeleton): Use pipe rather than temporary file for m4 input.
16453 Check that m4sugar.m4 is readable, to avoid deadlock.
16454 Check for pipe I/O error.
16455 * src/scan-skel.l (readpipe): Remove decl.
16456 (scan_skel): New function, to be used in place of m4_invoke.
16457 Read from stream rather than file.
66d30cd4 16458
95f2c9fe
PE
16459 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
16460 float, as this generates a warning on Solaris 8 + GCC 3.2 with
16461 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
16462 this generates a more-accurate value anyway.
16463
16464 * lib/timevar.c (timervar_accumulate): Rename locals to
16465 avoid confusion with similarly-named more-global.
16466 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
16467
16468 * src/output.c (prepare): Use xstrdup to convert char const *
16469 to char *, to avoid GCC warning.
16470
c19988b7
AD
164712002-10-19 Akim Demaille <akim@epita.fr>
16472
16473 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
16474 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
16475 Use them to have `calc.y' ready for %pure-parser.
16476 * data/yacc.c (YYLEX): Pass a yylex return type to
16477 b4_c_function_call.
16478
ae7453f2
AD
164792002-10-19 Akim Demaille <akim@epita.fr>
16480
16481 Prototype support of %lex-param and %parse-param.
16482
16483 * src/parse-gram.y: Add the definition of the %lex-param and
16484 %parse-param tokens, plus their rules.
16485 Drop the `_' version of %glr-parser.
16486 Add the "," token.
16487 * src/scan-gram.l (INITIAL): Scan them.
16488 * src/muscle_tab.c: Comment changes.
16489 (muscle_insert, muscle_find): Rename `pair' as `probe'.
16490 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
16491 (muscle_entry_s): The `value' member is no longer const.
16492 Adjust all dependencies.
16493 * src/muscle_tab.c (muscle_init): Adjust: use
16494 MUSCLE_INSERT_STRING.
16495 Initialize the obstack earlier.
16496 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
16497 (muscle_pair_list_grow): New.
16498 * data/c.m4 (b4_c_function_call, b4_c_args): New.
16499 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
16500 * tests/calc.at: Use %locations, not --locations.
16501 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
16502
0e575721
AD
165032002-10-19 Akim Demaille <akim@epita.fr>
16504
16505 * src/getargs.c (usage): Take status as argument and exit
16506 accordingly.
16507 Report the traditional `Try ... --help' message when status != 0.
16508 (usage, version): Don't take a FILE * as arg, it is pointless.
16509 (getargs): When there is an incorrect number of arguments, make it
16510 an error, and report it GNUlically thanks to `usage ()'.
16511
724ce7f5
PE
165122002-10-18 Paul Eggert <eggert@twinsun.com>
16513
3a781eb2
PE
16514 * data/glr.c (yyreportParseError): Don't assume that sprintf
16515 yields the length of the printed string, as this is not true
16516 on SunOS 4.1.4. Reported by Peter Klein.
16517
724ce7f5
PE
16518 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
16519 * tests/conflicts.at (%nonassoc and eof): Likewise.
16520 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
16521
473d0a75
AD
165222002-10-17 Akim Demaille <akim@epita.fr>
16523
16524 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
16525 * src/getargs.c (trace_types, trace_args): Adjust.
16526 * src/reader.c (grammar_current_rule_prec_set)
16527 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
16528 Standardize error messages.
16529 And s/@prec/%prec/!
16530 (reader): Use trace_flag to enable scanner/parser debugging,
16531 instead of an adhoc scheme.
16532 * src/scan-gram.l: Remove trailing debugging code.
16533
e76d2469
PE
165342002-10-16 Paul Eggert <eggert@twinsun.com>
16535
93e2236a
PE
16536 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
16537 MUSCLE_TAB_H.
16538
e76d2469
PE
16539 * NEWS: Officially drop support for building Bison with K&R C,
16540 since it didn't work anyway and it's not worth worrying about.
16541 * Makefile.maint (wget_files): Remove ansi2knr.c.
16542 (ansi2knr.c-url_prefix): Remove.
16543 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
16544 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16545 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16546
5bd1c419
PE
165472002-10-15 Paul Eggert <eggert@twinsun.com>
16548
16549 Stop using the "enum_" trick for K&R-style function definitions;
16550 it confused me, and I was the author! Instead, assume that people
16551 who want to use K&R C compilers (when using these modules in GCC,
16552 perhaps?) will run ansi2knr.
16553
16554 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
16555 All uses of "enum_" changed to "enum ".
16556 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16557 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 16558
5bd1c419
PE
16559 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
16560 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
16561 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
16562 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
16563 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
16564 abitset_not, abitset_ones, abitset_or, abitset_or_and,
16565 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
16566 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
16567 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
16568 Use function prototypes; this removes the need for declaring
16569 static functions simply to provide their prototypes.
16570 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
16571 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
16572 bitset_count_, bitset_create, bitset_dump, bitset_first,
16573 bitset_free, bitset_init, bitset_last, bitset_next,
16574 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
16575 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
16576 bitset_print, bitset_release_memory, bitset_toggle_,
16577 bitset_type_choose, bitset_type_get, bitset_type_name_get,
16578 debug_bitset): Likewise.
16579 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
16580 * lib/bitset_stats.c (bitset_log_histogram_print,
16581 bitset_percent_histogram_print, bitset_stats_and,
16582 bitset_stats_and_cmp, bitset_stats_and_or,
16583 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
16584 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
16585 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
16586 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
16587 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
16588 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
16589 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
16590 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
16591 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
16592 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
16593 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
16594 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
16595 bitset_stats_zero): Likewise.
16596 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16597 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16598 bitsetv_dump, debug_bitsetv): Likewise.
16599 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
16600 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
16601 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
16602 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
16603 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
16604 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
16605 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
16606 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
16607 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
16608 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
16609 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
16610 Likewise.
16611 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
16612 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
16613 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
16614 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
16615 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
16616 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
16617 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
16618 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
16619 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
16620 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
16621 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 16622
ae26e1f0
AD
166232002-10-14 Akim Demaille <akim@epita.fr>
16624
16625 Version 1.75.
16626
d43baf71
AD
166272002-10-14 Akim Demaille <akim@epita.fr>
16628
16629 * tests/Makefile.am (maintainer-check-posix): New.
16630
7ebc83e3
AD
166312002-10-14 Akim Demaille <akim@epita.fr>
16632
16633 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
16634 member.
16635
05846dae
AD
166362002-10-14 Akim Demaille <akim@epita.fr>
16637
16638 * src/tables.c (table_ninf_remap): base -> tab.
16639 Reported by Matt Rosing.
16640
1318e37d
PE
166412002-10-14 Paul Eggert <eggert@twinsun.com>
16642
447fbb17
PE
16643 * tests/action.at, tests/calc.at, tests/conflicts.at,
16644 tests/cxx-type.at, tests/headers.at, tests/input.at,
16645 tests/regression.at, tests/synclines.at, tests/torture.at:
16646 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
16647 so that the tests still work even if POSIXLY_CORRECT is set.
16648 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 16649
1318e37d
PE
16650 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
16651 for portability to K&R hosts. Fix typo: signed char is guaranteed
16652 only to 127, not to 128.
16653 * data/glr.c (yysigned_char): New type.
16654 * data/yacc.c (yysigned_char): Likewise.
16655 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
16656
cc0f0794
PE
166572002-10-13 Paul Eggert <eggert@twinsun.com>
16658
5038f418
PE
16659 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
16660 true due to limited range of data type" warning from GCC.
16661
cc0f0794
PE
16662 * data/c.m4 (b4_token_defines): Protect against double-inclusion
16663 by wrapping enum yytokentype's definition inside #ifndef
16664 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
16665
6fed0802
AD
166662002-10-13 Akim Demaille <akim@epita.fr>
16667
16668 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
16669 Un yy- yyrhs to avoid the name clash with the global YYRHS.
16670
32f0598d
AD
166712002-10-13 Akim Demaille <akim@epita.fr>
16672
16673 * Makefile.maint: Update from Autoconf 2.54.
16674 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
16675
7ea9a33f
AD
166762002-10-13 Akim Demaille <akim@epita.fr>
16677
16678 * src/print.c (print_state): Separate the list of solved conflicts
16679 from the other items.
16680 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
16681
ea99527d
AD
166822002-10-13 Akim Demaille <akim@epita.fr>
16683
16684 Let nondeterministic skeletons be usable with deterministic
16685 tables.
16686
16687 With the patch, GAWK compiled by GCC without -O2 passes its test
16688 suite using a GLR parser driven by LALR tables. It fails with -O2
16689 because `struct stat' gives two different answers on my machine:
16690 88 (definition of an auto var) and later 96 (memset on this var).
16691 Hence the stack is badly corrumpted. The headers inclusion is to
16692 blame: if I move the awk.h inclusion before GLR's system header
16693 inclusion, the two struct stat have the same size.
16694
16695 * src/tables.c (pack_table): Always create conflict_table.
16696 (token_actions): Always create conflict_list.
16697 * data/glr.c (YYFLAG): Remove, unused.
16698
f377f69f
AD
166992002-10-13 Akim Demaille <akim@epita.fr>
16700
16701 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
16702 (O0FLAGS): New.
16703 (VALGRIND, GXX): New.
16704 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
16705 * tests/bison.in: Run $PREBISON a pre-command.
16706 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
16707 (maintainer-check-g++): New.
16708 * Makefile.am (maintainer-check): New.
16709
2a1fe6ed
AD
167102002-10-13 Akim Demaille <akim@epita.fr>
16711
16712 * data/glr.c: Formatting changes.
16713 Tweak some trace messages to match yacc.c's.
16714
f50adbbd
AD
167152002-10-13 Akim Demaille <akim@epita.fr>
16716
16717 GLR parsers sometimes raise parse errors instead of performing the
16718 default reduction.
16719 Reported by Charles-Henry de Boysson.
16720
16721 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 16722 check the length of the traces when %glr.
f50adbbd
AD
16723 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
16724 GLR's traces.
16725 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
16726 Test GLR parsers.
16727 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
16728 (yyltype): Remove the yy prefix from the member names.
16729 (yytable): Complete its comment.
16730 (yygetLRActions): Map error action number from YYTABLE from
16731 YYTABLE_NINF to 0.
16732 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
16733 (which was a bug: it should have been YYTABEL_NINF, and yet it was
16734 not satisfying as we could compare an YYACTION computed from
16735 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
16736 only value for error actions.
16737 (yyreportParseError): In verbose parse error messages, don't issue
16738 `error' in the list of expected tokens.
16739 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
16740 next action to perform to match glr.c's decoding.
16741 (yytable): Complete its comment.
16742
bcbad5b9
PE
167432002-10-13 Paul Eggert <eggert@twinsun.com>
16744
16745 Fix problem reported by Henrik Grubbstroem in
161a71f3 16746 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
16747 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
16748 because the Bison parser reads the second action before reducing
16749 the first one.
16750 * src/scan-gram.l (rule_length): New static var.
16751 Use it to keep track of the rule length in the scanner, since
16752 we can't expect the parser to be in lock-step sync with the scanner.
16753 (handle_action_dollar, handle_action_at): Use this var.
16754 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 16755
14904b89
PE
167562002-10-12 Paul Eggert <eggert@twinsun.com>
16757
1fe611e5
PE
16758 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
16759 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
16760 Include <sys/time.h> when checking for clock_t and struct tms.
16761 Use same include order as source.
16762 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 16763 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 16764
1fe611e5
PE
16765 * lib/timevar.c: Update copyright date and clarify comments.
16766 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 16767
1fe611e5
PE
16768 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
16769 GCC version as of today, then merge Bison's changes.
16770 Change "GCC" to "Bison" in copyright notice. timevar.def's
16771 author is Akim, so change that too.
16772
98194095
PE
16773 * src/reader.c (grammar_current_rule_check):
16774 Don't worry about the default action if $$ is untyped.
16775 Prevents bogus warnings reported by Jim Gifford in
161a71f3 16776 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 16777
14904b89
PE
16778 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
16779 * data/glr.c, data/lalr1.cc, data/yacc.c:
16780 Output token definitions before the first part of user declarations.
16781 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 16782 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 16783
ff6dca18
PE
167842002-10-11 Paul Eggert <eggert@twinsun.com>
16785
16786 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
16787 (yyparse): here. This undoes some of the 2002-07-25 change.
16788 Compatibility problem reported by Ralf S. Engelschall with
16789 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
16790
eb714592
AD
167912002-10-11 Akim Demaille <akim@epita.fr>
16792
16793 * tests/regression.at Characters Escapes): New.
16794 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
16795 characters.
16796 Reported by Jan Nieuwenhuizen.
16797
b7195100
AD
167982002-10-11 Akim Demaille <akim@epita.fr>
16799
16800 * po/id.po: New.
16801
f28a0f2d
PE
168022002-10-10 Paul Eggert <eggert@twinsun.com>
16803
16804 Portability fixes for bitsets; this also avoids several GCC
16805 warnings.
16806
16807 * lib/abitset.c: Include <stddef.h>, for offsetof.
16808 * lib/lbitset.c: Likewise.
16809
16810 * lib/abitset.c (abitset_bytes): Return a size that is aligned
16811 properly for vectors of objects. Do not assume that adding a
16812 header size to a multiple of a word size yields a value that is
16813 properly aligned for the whole union.
16814 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16815
16816 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
16817 unique names for structures.
16818 * lib/ebitset.c (ebitset_bytes): Likewise.
16819 * lib/lbitset.c (lbitset_bytes): Likewise.
16820
16821 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
16822 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
16823 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
16824 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
16825 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
16826 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
16827 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
16828 to improve the type-checking that GCC can do.
16829 * lib/bitset.c (bitset_op4_cmp): Likewise.
16830 * lib/bitset_stats.c (bitset_stats_count,
16831 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
16832 bitset_stats_copy, bitset_stats_disjoint_p,
16833 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
16834 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
16835 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
16836 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
16837 bitset_stats_and_or_cmp, bitset_stats_andn_or,
16838 bitset_stats_andn_or_cmp, bitset_stats_or_and,
16839 bitset_stats_or_and_cmp): Likewise.
16840 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
16841 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
16842 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
16843 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
16844
16845 * lib/abitset.h: Include bitset.h, not bbitset.h.
16846 * lib/ebitset.h: Likewise.
16847 * lib/lbitset.h: Likewise.
16848
16849 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
16850 All instances of parameters of type enum bitset_opts are now of
16851 type enum_bitset_opts, to conform to the C Standard, and similarly
16852 for enum_bitset_type.
16853 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16854 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
16855
16856 Do not use "struct bitset_struct" to mean different things in
16857 different modules. Not only is this confusing, it violates
16858 the C Standard, which requires that structure types in different
16859 modules must be compatible if one is to be passed to the other.
16860 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
16861 All instances of "struct bitset_struct *" replaced with "bitset".
16862 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
16863 (union bitset_union, struct abitset_struct, struct ebitset_struct,
16864 struct lbitset_struct, struct bitset_stats_struct): New types.
16865 All uses of struct bitset_struct changed to union bitset_union,
16866 etc.
ba0fe3c7 16867 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
16868 struct bitset_struct): Remove.
16869 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
16870 struct bitset_struct): Remove.
16871 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
16872 bitset_struct): Remove.
16873 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
16874 Likewise.
16875
16876 Do not call a function of type T using a call that assumes the
16877 function is of a different type U. Standard C requires that a
16878 function must be called with a type that is compatible with its
16879 definition.
16880 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16881 New decls.
16882 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16883 New functions.
16884 * lib/ebitset.c (PFV): Remove.
16885 * lib/lbitset.c (PFV): Likewise.
16886 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
16887 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
16888 decls.
16889 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
16890 (ebitset_vtable): Use them.
16891 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
16892 lbitset_xor): New functions.
16893 (lbitset_vtable): Use them.
16894
16895 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
16896 Declare.
16897
16898 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
16899 GCC warning.
16900 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
16901 Use offsetof, for simplicity.
16902
6fbe4984
PE
169032002-10-06 Paul Eggert <eggert@twinsun.com>
16904
16905 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
16906 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 16907 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
16908 which was inadvertently undone by the 2002-09-30 patch.
16909 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
16910 the same width as int.
16911
420f93c8
PE
169122002-10-04 Paul Eggert <eggert@twinsun.com>
16913
16914 Version 1.50.
16915
16916 * configure.ac (AC_INIT), NEWS: Increment version number.
16917
16918 * doc/bison.texinfo: Minor spelling, grammar, and white space
16919 fixes.
16920 (Symbols): Mention that any negative value returned from yylex
16921 signifies end-of-input. Warn about negative chars. Mention
16922 the portable Standard C character set.
16923
16924 The GNU coding standard says CFLAGS and YFLAGS are reserved
16925 for the installer to set.
16926 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
16927 * src/Makefile.am (AM_CFLAGS): Likewise.
16928 (AM_YFLAGS): Renamed from YFLAGS.
16929
16930 Fix some MAX and MIN problems.
16931 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
16932 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
16933 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
16934 * src/reader.c (reader): Use it.
16935
16936 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
16937 POSIX 1003.1-2001 has removed fgrep.
16938
169392002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
16940
16941 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
16942 interpreted as signed.
16943 * lib/ebitset.c (ebitset_list): Fix bug.
16944
ff68026d
PE
169452002-10-01 Paul Eggert <eggert@twinsun.com>
16946
16947 More fixes for 64-bit hosts and large bitsets.
16948
16949 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
16950 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
16951 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
16952 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
16953 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
16954 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
16955 bitset_count_): Likewise.
16956 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
16957 bitset_first, bitset_last): Likewise.
16958 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
16959 bitset_stats_list_reverse, bitset_stats_size,
16960 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
16961 Likewise.
16962 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16963 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16964 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16965 bitsetv_reflexive_transitive_closure): Likewise.
16966 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
16967 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
16968 Likewise.
16969 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
16970 Likewise.
420f93c8 16971
ff68026d
PE
16972 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
16973 Use size_t, not unsigned int, to count bytes.
16974 * lib/abitset.h (abitset_bytes): Likewise.
16975 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
16976 Likewise.
16977 * lib/bitset.h (bitset_bytes): Likewise.
16978 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
16979 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
16980 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16981 * lib/ebitset.c (ebitset_bytes): Likewise.
16982 * lib/ebitset.h (ebitset_bytes): Likewise.
16983 * lib/lbitset.c (lbitset_bytes): Likewise.
16984 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 16985
ff68026d
PE
16986 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
16987 abitset_subset_p, abitset_disjoint_p, abitset_and,
16988 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
16989 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
16990 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
16991 abitset_or_and, abitset_or_and_cmp):
16992 Use bitset_windex instead of unsigned int.
16993 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16994 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
16995 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
16996 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
16997 Likewise.
16998 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 16999
ff68026d
PE
17000 * lib/bitset.c (bitset_print):
17001 Use proper printf formats for widths of integer types.
17002 * lib/bitset_stats.c (bitset_percent_histogram_print,
17003 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
17004 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17005 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17006 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 17007
ff68026d
PE
17008 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
17009 BITSET_SIZE_MAX): New macros.
17010 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
17011 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
17012 to BITSET_WINDEX_MAX.
17013
17014 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
17015 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
17016 since we now return the bitset_bindex type (not int).
17017
17018 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
17019 when computing sizes.
17020 * lib/ebitset.c (ebitset_elts_grow): Likewise.
17021
17022 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
17023 and avoid cast to unsigned.
17024
6aa452a6
AD
170252002-09-30 Akim Demaille <akim@epita.fr>
17026
17027 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
17028 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
17029 Updates from Michael Hayes.
17030
927f7817
AD
170312002-09-30 Art Haas <ahaas@neosoft.com>
17032
17033 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
17034 invocations.
17035 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
17036 defined.
17037
9738f41e
AD
170382002-09-27 Akim Demaille <akim@epita.fr>
17039
17040 Version 1.49c.
17041
a5c75d7f
AD
170422002-09-27 Akim Demaille <akim@epita.fr>
17043
17044 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
17045 (Because of AC_LIBSOURCE).
17046
8280e179
AD
170472002-09-27 Akim Demaille <akim@epita.fr>
17048
17049 Playing with Autoscan.
17050
17051 * configure.ac: Remove the old LIBOBJ tweaks.
17052 (AC_REPLACE_FUNCS): Add strrchr and strtol.
17053 * lib/strrchr.c: New.
17054 * lib/strtol.c: New, from the Coreutils 4.5.1.
17055
ae64af35
AD
170562002-09-27 Akim Demaille <akim@epita.fr>
17057
17058 Playing with Autoscan.
17059
17060 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
17061 * lib/Makefile.am (libbison_a_SOURCES): No longer include
17062 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
17063 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
17064 Coreutils 4.5.1.
17065
d1a1114f
AD
170662002-09-24 Akim Demaille <akim@epita.fr>
17067
17068 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
17069 (Frequently Asked Questions, Parser Stack Overflow): New.
17070
b906441c
AD
170712002-09-13 Akim Demaille <akim@epita.fr>
17072
17073 Playing with autoscan.
17074
17075 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
17076 * src/files.c (skeleton_find): Remove, unused.
17077 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
17078 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
17079
bd701811
AD
170802002-09-13 Akim Demaille <akim@epita.fr>
17081
17082 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
17083 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
17084
e0a13e7b
AD
170852002-09-13 Akim Demaille <akim@epita.fr>
17086
17087 * configure.ac: Require 2.54.
17088 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
17089 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
17090 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
17091 Remove, provided by Autoconf macros.
17092
c97011bf
AD
170932002-09-12 Akim Demaille <akim@epita.fr>
17094
17095 * m4/prereq.m4: Update, from Coreutils 4.5.1.
17096
d862b1be
AD
170972002-09-12 Akim Demaille <akim@epita.fr>
17098
17099 * m4/prereq.m4: Update, from Fileutils 4.1.5.
17100 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
17101 Reported by Martin Mokrejs.
17102
3d38c03a
AD
171032002-09-10 Akim Demaille <akim@epita.fr>
17104
17105 * src/parse-gram.y: Associate a human readable string to each
17106 token type.
17107 * tests/regression.at (Invalid inputs): Adjust.
17108
b6347355
AD
171092002-09-10 Gary V. Vaughan <gary@gnu.org>
17110
17111 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
17112 with an Autoconf-2.5x style configure.ac.
17113
09ba4ab2
PE
171142002-09-06 Paul Eggert <eggert@twinsun.com>
17115
17116 * doc/bison.texinfo (Conditions): Make explicit that the GPL
17117 exception applies only to yacc.c. This is a modification of a
17118 patch originally suggested by Akim Demaille.
17119
21846f69
AD
171202002-09-06 Akim Demaille <akim@epita.fr>
17121
09ba4ab2
PE
17122 * data/c.m4 (b4_copyright): Move the GPL exception comment from
17123 here to...
17124 * data/yacc.c: here.
17125
21846f69
AD
17126 * data/lalr1.cc (struct yyltype): Don't define it, since we use
17127 LocationType.
17128 (b4_ltype): Default to yy::Location from location.hh.
17129
c0ad8bf3
AD
171302002-09-04 Jim Meyering <jim@meyering.net>
17131
17132 * data/yacc.c: Guard the declaration of yytoknum also with
17133 `#ifdef YYPRINT', so it is declared only when used.
17134
3a93251e
AD
171352002-09-04 Akim Demaille <akim@epita.fr>
17136
17137 * configure.in: Rename as...
17138 * configure.ac: this.
17139 Bump to 1.49c.
17140
427c0dda
AD
171412002-09-04 Akim Demaille <akim@epita.fr>
17142
17143 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
17144 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
17145 translate maintainer only messages.
17146
6a254321
PE
171472002-08-12 Paul Eggert <eggert@twinsun.com>
17148
645e30d1
PE
17149 Version 1.49b.
17150
6a254321
PE
17151 * Makefile.am (SUBDIRS): Remove intl.
17152 (DISTCLEANFILES): Remove.
17153 * NEWS: Mention that GNU M4 is now required. Clarify what is
17154 meant by "larger grammars". Mention the pt_BR translation.
17155 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
17156 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
17157 Bump version from 0.11.2 to 0.11.5.
17158 (BISON_PREREQ_STAGE): Remove.
17159 (AM_GNU_GETTEXT): Use external gettext.
17160 (AC_OUTPUT): Remove intl/Makefile.
17161
17162 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
17163
17164 * data/glr.c: Include string.h, for strlen.
17165 (yyreportParseError): Use size_t for yysize.
17166 (yy_yypstack): No longer nested inside yypstates, as nested
17167 functions are not portable. Do not assume size_t is the
17168 same width as int.
17169 (yypstates): Do not assume that ptrdiff_t is the same width
17170 as int, and similarly for yyposn and YYINDEX.
17171
17172 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
17173
17174 * lib/Makefile.am (INCLUDES): Do not include from the intl
17175 directory, which has been removed.
17176 * src/Makefile.am (INCLUDES): Likewise.
17177
17178 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
17179 (bitsets_sources, additional_bitsets_sources, timevars_sources):
17180 New vars.
17181
17182 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
17183 * tests/Makefile.am (EXTRA_DIST): Likewise.
17184
17185 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
17186 Do not assume that bitset_windex is the same width as unsigned.
17187
17188 * lib/abitset.c (abitset_unused_clear): Do not assume that
17189 bitset_word is the same width as int.
17190 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
17191 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
17192 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
17193 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
17194 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
17195
17196 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
17197 portability to one's complement hosts!).
17198 * lib/ebitset.c (ebitset_op1): Likewise.
17199 * lib/lbitset.c (lbitset_op1): Likewise.
17200
17201 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
17202 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
17203 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
17204 Sync with fileutils.
17205 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
17206 lib/gettext.h: Sync with diffutils.
17207
17208 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
17209 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
17210
17211 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
17212 PROTOTYPES to check for prototypes, and "defined __STDC__" to
17213 check for void *.
17214
17215 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
17216 size_t; the old version tried to do this but casted improperly.
17217 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
17218 (bitset_test): Now returns int, not unsigned long.
17219
17220 * lib/bitset_stats.c: Include "gettext.h".
17221 (_): New macro.
17222 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
17223 name locals "index", as it generates unnecessary warnings on some
17224 hosts that have an "index" function.
17225
17226 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
17227 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
17228 they need translation.
17229 * src/LR0.c (state_list_append, new_itemsets, get_state,
17230 append_states, generate_states): Likewise.
17231 * src/assoc.c (assoc_to_string): Likewise.
17232 * src/closure.c (print_closure, set_firsts, closure): Likewise.
17233 * src/gram.c (grammar_dump): Likewise.
17234 * src/injections.c (injections_compute): Likewise.
17235 * src/lalr.c (lookaheads_print): Likewise.
17236 * src/relation.c (relation_transpose): Likewise.
17237 * src/scan-gram.l: Likewise.
17238 * src/tables.c (table_grow, pack_vector): Likewise.
17239
17240 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
17241 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
17242 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
17243 * m4/mbstate_t.m4: Sync with fileutils.
17244 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
17245
17246 * po/LINGUAS: Add pt_BR.
17247 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
17248 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
17249 lib/timevar.c.
17250 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
17251 manual recommends.
17252 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
17253
17254 * src/complain.c (strerror_r): Remove decl; not needed.
17255 (strerror): Use same pattern as ../lib/error.c.
17256
17257 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
17258
17259 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
17260
17261 * src/main.c (main): Cast result of bindtextdomain and textdomain
17262 to void, to avoid a GCC warning when --disable-nls is in effect.
17263
17264 * src/scan-gram.l: Use strings rather than escapes when possible,
17265 to minimize the number of warnings from xgettext.
17266 (handle_action_dollar, handle_action_at): Don't use isdigit,
17267 as it mishandles negative chars and it may not work as expected
17268 outside the C locale.
17269
17270 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
17271 this is a GCC extension and is not portable to other compilers.
17272
17273 * src/system.h (alloca): Use same pattern as ../lib/error.c.
17274 Do not include <ctype.h>; no longer needed.
17275 Do not include <malloc.h>; no longer needed (and generates
17276 warnings on OpenBSD 3.0).
17277
17278 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
17279 it's not portable.
17280
17281 * tests/regression.at: Do not use 'cc -c input.c -o input';
17282 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
17283
17284 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
17285 exit status as failure, not just exit status 1. Sun C exits
17286 with status 2 sometimes.
17287
17288 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
17289 Use it for the two large tests.
17290
c8f002c7
AD
172912002-08-02 Akim Demaille <akim@epita.fr>
17292
17293 * src/conflicts.c (conflicts_output): Don't output rules never
17294 reduced here, since anyway that computation doesn't work.
17295 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
17296 (rule_useless_p, rule_never_reduced_p): New.
17297 (grammar_rules_partial_print): Use a filter instead of a range.
17298 Display the title only if needed.
17299 (grammar_rules_print): Adjust.
17300 (grammar_rules_never_reduced_report): New.
17301 * src/tables.c (action_row): Move the computation of rules never
17302 reduced to...
17303 (token_actions): here.
17304 * src/main.c (main): Make the parser before making the report, so
17305 that rules never reduced are computed.
17306 Call grammar_rules_never_reduced_report.
17307 * src/print.c (print_results): Report rules never reduced.
17308 * tests/conflicts.at, tests/reduce.at: Adjust.
17309
cd08e51e
AD
173102002-08-01 Akim Demaille <akim@epita.fr>
17311
17312 Instead of attaching lookaheads and duplicating the rules being
17313 reduced by a state, attach the lookaheads to the reductions.
17314
17315 * src/state.h (state_t): Remove the `lookaheads',
17316 `lookaheads_rule' member.
17317 (reductions_t): Add a `lookaheads' member.
17318 Use a regular array for the `rules'.
17319 * src/state.c (reductions_new): Initialize the lookaheads member
17320 to 0.
17321 (state_rule_lookaheads_print): Adjust.
17322 * src/state.h, src/state.c (state_reductions_find): New.
17323 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
17324 (count_rr_conflicts): Adjust.
17325 * src/lalr.c (LArule): Remove.
17326 (add_lookback_edge): Adjust.
17327 (state_lookaheads_count): New.
17328 (states_lookaheads_initialize): Merge into...
17329 (initialize_LA): this.
17330 (lalr_free): Adjust.
17331 * src/main.c (main): Don't free nullable and derives too early: it
17332 is used by --verbose.
17333 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
17334
bb0027a9
AD
173352002-08-01 Akim Demaille <akim@epita.fr>
17336
17337 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
17338 `rule_number_t**'.
17339 (set_derives, free_derives): Rename as...
17340 (derives_compute, derives_free): this.
17341 Adjust all dependencies.
17342 * src/nullable.c (set_nullable, free_nullable): Rename as...
17343 (nullable_compute, nullable_free): these.
17344 (rule_list_t): Store rule_t *, not rule_number_t.
17345 * src/state.c (state_rule_lookaheads_print): Directly compare rule
17346 pointers, instead of their numbers.
17347 * src/main.c (main): Call nullable_free, and derives_free earlier,
17348 as they were lo longer used.
17349
3325ddc4
AD
173502002-08-01 Akim Demaille <akim@epita.fr>
17351
17352 * lib/timevar.c (get_time): Include children time.
17353 * src/lalr.h (LA, LArule): Don't export them: used with the
17354 state_t.
17355 * src/lalr.c (LA, LArule): Static.
17356 * src/lalr.h, src/lalr.c (lalr_free): New.
17357 * src/main.c (main): Call it.
17358 * src/tables.c (pack_vector): Check whether loc is >= to the
17359 table_size, not >.
17360 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
17361 (tables_generate): do it, since that's also it which allocates
17362 them.
17363 Don't free LA and LArule, main does.
17364
c6f1a33c
AD
173652002-07-31 Akim Demaille <akim@epita.fr>
17366
17367 Separate parser tables computation and output.
17368
17369 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
17370 (conflict_list, conflict_list_cnt, table, check, table_ninf)
17371 (yydefgoto, yydefact, high): Move to...
17372 * src/tables.h, src/tables.c: here.
17373 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17374 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17375 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
17376 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
17377 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
17378 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
17379 (action_row, save_row, token_actions, save_column, default_goto)
17380 (goto_actions, sort_actions, matching_state, pack_vector)
17381 (table_ninf_remap, pack_table, prepare_actions): Move to...
17382 * src/tables.c: here.
17383 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
17384 * src/output.c (token_actions, output_base, output_conflicts)
17385 (output_check): Merge into...
17386 (prepare_actions): this.
17387 (actions_output): Rename as...
17388 (user_actions_output): this.
17389 * src/main.c (main): Call tables_generate and tables_free.
17390
1509d42f
AD
173912002-07-31 Akim Demaille <akim@epita.fr>
17392
17393 Steal GCC's --time-report support.
17394
17395 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
17396 stolen/adjusted from GCC.
17397 * m4/stage.m4: Remove time related checks.
17398 * m4/timevar.m4: New.
17399 * configure.in: Adjust.
17400 * src/system.h: Adjust to using timevar.h.
17401 * src/getargs.h, src/getargs.c: Support trace_time for
17402 --trace=time.
17403 * src/main.c (stage): Remove.
17404 (main): Replace `stage' invocations with timevar calls.
17405 * src/output.c: Insert pertinent timevar calls.
17406
273a74fa
AD
174072002-07-31 Akim Demaille <akim@epita.fr>
17408
17409 Let --trace have arguments.
17410
17411 * src/getargs.h (enum trace_e): New.
17412 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
17413 (long_options, short_options): --trace/-T takes an optional
17414 argument.
17415 Change all the uses of trace_flag to reflect the new flags.
17416 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
17417
17418 Strengthen `stage' portability.
17419
17420 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
17421 * configure.in: Use it.
17422 Don't check for malloc.h and sys/times.h.
17423 * src/system.h: Include them when appropriate.
17424 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
17425 times and struct tms are available.
17426
217598da
AD
174272002-07-30 Akim Demaille <akim@epita.fr>
17428
17429 In verbose parse error message, don't report `error' as an
17430 expected token.
17431 * tests/actions.at (Printers and Destructors): Adjust.
17432 * tests/calc.at (Calculator $1): Adjust.
17433 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
17434 error message, do not report the parser accepts the error token in
17435 that state.
17436
52489d44
AD
174372002-07-30 Akim Demaille <akim@epita.fr>
17438
17439 Normalize conflict related messages.
17440
17441 * src/complain.h, src/complain.c (warn, complain): New.
17442 * src/conflicts.c (conflicts_print): Use them.
17443 (conflict_report_yacc): New, extracted from...
17444 (conflicts_print): here.
17445 * tests/conflicts.at, tests/existing.at: Adjust.
17446
e8832397
AD
174472002-07-30 Akim Demaille <akim@epita.fr>
17448
17449 Report rules which are never reduced by the parser: those hidden
17450 by conflicts.
17451
17452 * src/LR0.c (save_reductions): Don't make the final state too
17453 different: save its reduction (accept) instead of having a state
17454 without any action (no shift or goto, no reduce).
17455 Note: the final state is now a ``regular'' state, i.e., the
17456 parsers now contain `reduce 0' as default reduction.
17457 Nevertheless, since they decide to `accept' when yystate =
17458 final_state, they still will not reduce rule 0.
17459 * src/print.c (print_actions, print_reduction): Adjust.
17460 * src/output.c (action_row): Track reduced rules.
17461 (token_actions): Report rules never reduced.
17462 * tests/conflicts.at, tests/regression.at: Adjust.
17463
caf23d24
AD
174642002-07-30 Akim Demaille <akim@epita.fr>
17465
17466 `stage' was accidently included in a previous patch.
17467 Initiate its autoconfiscation.
17468
17469 * configure.in: Look for malloc.h and sys/times.h.
17470 * src/main.c (stage): Adjust.
17471 Report only when trace_flag.
17472
640748ee
AD
174732002-07-29 Akim Demaille <akim@epita.fr>
17474
17475 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
17476 state_number_t.
17477 (errs_t): symbol_t*, not symbol_number_t.
17478 (reductions_t): rule_t*, not rule_number_t.
17479 (FOR_EACH_SHIFT): New.
17480 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
17481 * src/print.c, src/print_graph.c: Adjust.
17482
88bce5a2
AD
174832002-07-29 Akim Demaille <akim@epita.fr>
17484
17485 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
17486
17487 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
17488 (endtoken, accept): these.
17489 * src/reader.c (reader): Set endtoken's default tag to "$end".
17490 Set undeftoken's tag to "$undefined" instead of "$undefined.".
17491 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
17492 Adjust.
17493
1bfb97db
AD
174942002-07-29 Akim Demaille <akim@epita.fr>
17495
17496 * src/reduce.c (reduce_grammar): When the language is empty,
17497 complain about the start symbol, not the axiom.
17498 Use its location.
17499 * tests/reduce.at (Empty Language): New.
17500
fc5734fe
AD
175012002-07-26 Akim Demaille <akim@epita.fr>
17502
17503 * src/reader.h, src/reader.c (gram_error): ... can't get
17504 yycontrol without making too strong assumptions on the parser
17505 itself.
17506 * src/output.c (prepare_tokens): Use the real 0th value of
17507 token_translations instead of `0'.
17508 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
17509 visible here.
17510 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
17511 for the time being: %locations ought to provide it to yyerror.
17512
3650b4b8
AD
175132002-07-25 Akim Demaille <akim@epita.fr>
17514
17515 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
17516 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
17517 * tests/regression.at (Web2c Actions): Adjust.
17518
4b3d3a8e
AD
175192002-07-25 Akim Demaille <akim@epita.fr>
17520
17521 Stop storing rules from 1 to nrules + 1.
17522
17523 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
17524 * src/nullable.c, src/output.c, src/print.c, src/reader.c
17525 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
17526 Iterate from 0 to nrules.
17527 Use rule_number_as_item_number and item_number_as_rule_number.
17528 Adjust to `derive' now containing possibly 0.
17529 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
17530 Handle the `- 1' part in rule numbers from/to item numbers.
17531 * src/conflicts.c (log_resolution): Fix the message which reversed
17532 shift and reduce.
17533 * src/output.c (action_row): Initialize default_rule to -1.
17534 (token_actions): Adjust.
17535 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
17536 expected output.
17537 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
17538
4a2a22f4
AD
175392002-07-25 Akim Demaille <akim@epita.fr>
17540
17541 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
17542 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
17543 (b4_c_knr_arg_decl): New.
17544 * data/yacc.c: Use it to define yysymprint, yydestruct, and
17545 yyreport_parse_error.
17546
b8df3223
AD
175472002-07-25 Akim Demaille <akim@epita.fr>
17548
17549 * data/yacc.c (yyreport_parse_error): New, extracted from...
17550 (yyparse): here.
17551 (yydestruct, yysymprint): Move above yyparse.
17552 Be K&R compliant.
17553
a762e609
AD
175542002-07-25 Akim Demaille <akim@epita.fr>
17555
17556 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
17557 replace...
17558 (b4_sint_type, b4_uint_type): these.
17559 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
17560 * tests/regression.at (Web2c Actions): Adjust.
17561
12b0043a
AD
175622002-07-25 Akim Demaille <akim@epita.fr>
17563
17564 * src/gram.h (TIEM_NUMBER_MAX): New.
17565 (item_number_of_rule_number, rule_number_of_item_number): Rename
17566 as...
17567 (rule_number_as_item_number, item_number_as_rule_number): these.
17568 Adjust dependencies.
17569 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17570 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17571 (symbol_number_to_vector_number): New.
17572 (order): Of vector_number_t* type.
17573 (base_t, BASE_MAX, BASE_MIN): New.
17574 (froms, tos, width, pos, check): Of base_t type.
17575 (action_number_t, ACTION_MIN, ACTION_MAX): New.
17576 (actrow): Of action_number_t type.
17577 (conflrow): Of unsigned int type.
17578 (table_ninf, base_ninf): New.
17579 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
17580 (muscle_insert_int_table, muscle_insert_base_table)
17581 (muscle_insert_rule_number_table): New.
17582 (prepare_tokens): Output `toknum' as int_table.
17583 (action_row): Returns a rule_number_t.
17584 Use ACTION_MIN, not SHRT_MIN.
17585 (token_actions): yydefact is rule_number_t*.
17586 (table_ninf_remap): New.
17587 (pack_table): Use it for `base' and `table'.
17588 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
17589 replaced with...
17590 (YYPACT_NINF, YYTABLE_NINF): these.
17591 (yypact, yytable): Compute their types instead of hard-coded
17592 `short'.
17593 * tests/regression.at (Web2c Actions): Adjust.
17594
5dde258a
AD
175952002-07-19 Akim Demaille <akim@epita.fr>
17596
17597 * src/scan-gram.l (id): Can start with an underscore.
17598
a945ec39
AD
175992002-07-16 Akim Demaille <akim@epita.fr>
17600
17601 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
17602 Adjust all former `associativity' dependencies.
17603 * src/symtab.c (symbol_new): Default associativity is `undef', not
17604 `right'.
17605 (symbol_check_alias_consistence): Adjust.
17606
fae437e8
AD
176072002-07-09 Akim Demaille <akim@epita.fr>
17608
17609 * doc/bison.texinfo: Properly set the ``header'' part.
17610 Use @dircategory ``GNU programming tools'' as per Texinfo's
17611 documentation.
17612 Use @copying.
17613
1a715ef2
AD
176142002-07-09 Akim Demaille <akim@epita.fr>
17615
17616 * lib/quotearg.h: Protect against multiple inclusions.
17617 * src/location.h (location_t): Add a `file' member.
17618 (LOCATION_RESET, LOCATION_PRINT): Adjust.
17619 * src/complain.c (warn_at, complain_at, fatal_at): Drop
17620 `error_one_per_line' support.
17621
a5d50994
AD
176222002-07-09 Akim Demaille <akim@epita.fr>
17623
17624 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
17625 * src/reader.c (lineno): Remove.
17626 Adjust all dependencies.
17627 (get_merge_function): Take a location and use complain_at.
17628 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
17629 * tests/regression.at (Invalid inputs, Mixing %token styles):
17630 Adjust.
17631
b275314e
AD
176322002-07-09 Akim Demaille <akim@epita.fr>
17633
17634 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
17635 recovery rule, and forbid extensions when --yacc.
17636 (gram_error): Use complain_at.
17637 * src/reader.c (reader): Exit if there were parse errors.
17638
865b9df1
AD
176392002-07-09 Akim Demaille <akim@epita.fr>
17640
17641 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
17642 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
17643 Reported by R Blake <blakers@mac.com>.
17644
c76e14da
AD
176452002-07-09 Akim Demaille <akim@epita.fr>
17646
17647 * data/yacc.c: Output the copyright notive in the header.
17648
7db2ed2d
AD
176492002-07-03 Akim Demaille <akim@epita.fr>
17650
17651 * src/output.c (froms, tos): Are state_number_t.
17652 (save_column): sp, sp1, and sp2 are state_number_t.
17653 (prepare): Rename `final' as `final_state_number', `nnts' as
17654 `nterms_number', `nrules' as `rules_number', `nstates' as
17655 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
17656 unused.
17657 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
17658 * data/lalr1.cc (nsym_): Remove, unused.
17659
e68e0410
AD
176602002-07-03 Akim Demaille <akim@epita.fr>
17661
17662 * src/lalr.h, src/lalr.c (goto_number_t): New.
17663 * src/lalr.c (goto_list_t): New.
17664 Propagate them.
17665 * src/nullable.c (rule_list_t): New.
17666 Propagate.
17667 * src/types.h: Remove.
17668
e1a4f3a4
AD
176692002-07-03 Akim Demaille <akim@epita.fr>
17670
17671 * src/closure.c (print_fderives): Use rule_rhs_print.
17672 * src/derives.c (print_derives): Use rule_rhs_print.
17673 (rule_list_t): New, replaces `shorts'.
17674 (set_derives): Add comments.
17675 * tests/sets.at (Nullable, Firsts): Adjust.
17676
536545f3
AD
176772002-07-03 Akim Demaille <akim@epita.fr>
17678
17679 * src/output.c (prepare_actions): Free `tally' and `width'.
17680 (prepare_actions): Allocate and free `order'.
17681 * src/symtab.c (symbols_free): Free `symbols'.
17682 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
17683 * src/output.c (m4_invoke): Move to...
17684 * src/scan-skel.l: here.
17685 (<<EOF>>): Close yyout, and free its name.
17686
8b752b00
AD
176872002-07-03 Akim Demaille <akim@epita.fr>
17688
17689 Fix some memory leaks, and fix a bug: state 0 was examined twice.
17690
17691 * src/LR0.c (new_state): Merge into...
17692 (state_list_append): this.
17693 (new_states): Merge into...
17694 (generate_states): here.
17695 (set_states): Don't ensure a proper `errs' state member here, do it...
17696 * src/conflicts.c (conflicts_solve): here.
17697 * src/state.h, src/state.c: Comment changes.
17698 (state_t): Rename member `shifts' as `transitions'.
17699 Adjust all dependencies.
17700 (errs_new): For consistency, also take the values as argument.
17701 (errs_dup): Remove.
17702 (state_errs_set): New.
17703 (state_reductions_set, state_transitions_set): Assert that no
17704 previous value was assigned.
17705 (state_free): New.
17706 (states_free): Use it.
17707 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
17708 temporary storage: use `errs' and `nerrs' as elsewhere.
17709 (set_conflicts): Allocate and free this `errs'.
17710
613f5e1a
AD
177112002-07-02 Akim Demaille <akim@epita.fr>
17712
17713 * lib/libiberty.h: New.
17714 * lib: Update the bitset implementation from upstream.
17715 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
17716 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
17717 * src/main.c: Adjust bitset stats calls.
17718
26e0cadc
PE
177192002-07-01 Paul Eggert <eggert@twinsun.com>
17720
17721 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
17722 char, so that negative chars don't collide with $.
17723
1154cced
AD
177242002-06-30 Akim Demaille <akim@epita.fr>
17725
17726 Have the GLR tests be `warning' checked, and fix the warnings.
17727
17728 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
17729 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
17730 (yyremoveDeletes): `yyi' and `yyj' are size_t.
17731 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
17732 (yyaddDeferredAction): static.
17733 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
17734 (yyreportParseError): yyprefix is const.
17735 yytokenp is used only when verbose.
17736 (yy__GNUC__): Replace with __GNUC__.
17737 (yypdumpstack): yyi is size_t.
17738 (yypreference): Un-yy local variables and arguments, to avoid
17739 clashes with `yyr1'. Anyway, we are not in the user name space.
17740 (yytname_size): be an int, as is compared with ints.
17741 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
17742 Use them.
17743 * tests/cxx-gram.at: Use quotation to protect $1.
17744 Use AT_COMPILE to enable warnings hunts.
17745 Prototype yylex and yyerror.
17746 `Use' argc.
17747 Include `string.h', not `strings.h'.
17748 Produce and prototype stmtMerge only when used.
17749 yylex takes a location.
17750
97650f4e
AD
177512002-06-30 Akim Demaille <akim@epita.fr>
17752
17753 We spend a lot of time in quotearg, in particular when --verbose.
17754
17755 * src/symtab.c (symbol_get): Store a quoted version of the key.
17756 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
17757 Adjust all callers.
17758
d2576365
AD
177592002-06-30 Akim Demaille <akim@epita.fr>
17760
17761 * src/state.h (reductions_t): Rename member `nreds' as num.
17762 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
17763 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
17764
ccaf65bc
AD
177652002-06-30 Akim Demaille <akim@epita.fr>
17766
17767 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
17768 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
17769 (shifts_to): Rename as...
17770 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
17771 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
17772 (TRANSITION_IS_DISABLED, transitions_to): these.
17773
87675353
AD
177742002-06-30 Akim Demaille <akim@epita.fr>
17775
17776 * src/print.c (print_shifts, print_gotos): Merge into...
17777 (print_transitions): this.
17778 (print_transitions, print_errs, print_reductions): Align the
17779 lookaheads columns.
17780 (print_core, print_transitions, print_errs, print_state,
17781 print_grammar): Output empty lines separator before, not after.
17782 (state_default_rule_compute): Rename as...
17783 (state_default_rule): this.
17784 * tests/conflicts.at (Defaulted Conflicted Reduction),
17785 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
17786 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
17787
ce4ccb4b
AD
177882002-06-30 Akim Demaille <akim@epita.fr>
17789
17790 Display items as we display rules.
17791
17792 * src/gram.h, src/gram.c (rule_lhs_print): New.
17793 * src/gram.c (grammar_rules_partial_print): Use it.
17794 * src/print.c (print_core): Likewise.
17795 * tests/conflicts.at (Defaulted Conflicted Reduction),
17796 (Unresolved SR Conflicts): Adjust.
17797 (Unresolved SR Conflicts): Adjust and rename as...
17798 (Resolved SR Conflicts): this, as was meant.
17799 * tests/regression.at (Web2c Report): Adjust.
17800
bc933ef1
AD
178012002-06-30 Akim Demaille <akim@epita.fr>
17802
17803 * src/print.c (state_default_rule_compute): New, extracted from...
17804 (print_reductions): here.
17805 Pessimize, but clarify the code.
17806 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
17807
53d4308d
AD
178082002-06-30 Akim Demaille <akim@epita.fr>
17809
17810 * src/output.c (action_row): Let default_rule be always a rule
17811 number.
17812
574fb2d5
AD
178132002-06-30 Akim Demaille <akim@epita.fr>
17814
17815 * src/closure.c (print_firsts, print_fderives, closure):
17816 Use BITSET_EXECUTE.
17817 * src/lalr.c (lookaheads_print): Likewise.
17818 * src/state.c (state_rule_lookaheads_print): Likewise.
17819 * src/print_graph.c (print_core): Likewise.
17820 * src/print.c (print_reductions): Likewise.
17821 * src/output.c (action_row): Likewise.
17822 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
17823
05811fd7
AD
178242002-06-30 Akim Demaille <akim@epita.fr>
17825
17826 * src/print_graph.c: Use report_flag.
17827
0e4d5753
AD
178282002-06-30 Akim Demaille <akim@epita.fr>
17829
17830 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
17831 to...
17832 * src/relation.h, src/relation.c (traverse, relation_digraph)
17833 (relation_print, relation_transpose): New.
17834
24c7d800
AD
178352002-06-30 Akim Demaille <akim@epita.fr>
17836
17837 * src/state.h, src/state.c (shifts_to): New.
17838 * src/lalr.c (build_relations): Use it.
17839
9222837b
AD
178402002-06-30 Akim Demaille <akim@epita.fr>
17841
17842 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
17843 (item_number_of_rule_number, rule_number_of_item_number): New.
17844 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
17845 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17846 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
17847 Propagate their use.
17848 Much remains to be done, in particular wrt `shorts' from types.h.
17849
260008e5
AD
178502002-06-30 Akim Demaille <akim@epita.fr>
17851
17852 * src/symtab.c (symbol_new): Initialize the `printer' member.
17853
8a731ca8
AD
178542002-06-30 Akim Demaille <akim@epita.fr>
17855
17856 * src/LR0.c (save_reductions): Remove, replaced by...
17857 * src/state.h, src/state.c (state_reductions_set): New.
17858 (reductions, errs): Rename as...
17859 (reductions_t, errs_t): these.
17860 Adjust all dependencies.
17861
32e1e0a4
AD
178622002-06-30 Akim Demaille <akim@epita.fr>
17863
17864 * src/LR0.c (state_list_t, state_list_append): New.
17865 (first_state, last_state): Now symbol_list_t.
17866 (this_state): Remove.
17867 (new_itemsets, append_states, save_reductions): Take a state_t as
17868 argument.
17869 (set_states, generate_states): Adjust.
17870 (save_shifts): Remove, replaced by...
17871 * src/state.h, src/state.c (state_shifts_set): New.
17872 (shifts): Rename as...
17873 (shifts_t): this.
17874 Adjust all dependencies.
17875 * src/state.h (state_t): Remove the `next' member.
17876
e5fb6710
AD
178772002-06-30 Akim Demaille <akim@epita.fr>
17878
17879 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
17880 escaped in slot 0.
17881
c7ca99d4
AD
178822002-06-30 Akim Demaille <akim@epita.fr>
17883
17884 Use hash.h for the state hash table.
17885
17886 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
17887 (allocate_storage): Use state_hash_new.
17888 (free_storage): Use state_hash_free.
17889 (new_state, get_state): Adjust.
17890 * src/lalr.h, src/lalr.c (states): Move to...
17891 * src/states.h (state_t): Remove the `link' member, no longer
17892 used.
17893 * src/states.h, src/states.c: here.
17894 (state_hash_new, state_hash_free, state_hash_lookup)
17895 (state_hash_insert, states_free): New.
17896 * src/states.c (state_table, state_compare, state_hash): New.
17897 * src/output.c (output_actions): Do not free states now, since we
17898 still need to know the final_state number in `prepare', called
17899 afterwards. Do it...
17900 * src/main.c (main): here: call states_free after `output'.
17901
df0e7316
AD
179022002-06-30 Akim Demaille <akim@epita.fr>
17903
17904 * src/state.h, src/state.c (state_new): New, extracted from...
17905 * src/LR0.c (new_state): here.
17906 * src/state.h (STATE_ALLOC): Move to...
17907 * src/state.c: here.
17908 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
17909 * src/state.h, src/state.c: here.
17910
39f41916
AD
179112002-06-30 Akim Demaille <akim@epita.fr>
17912
17913 * src/reader.c (gensym): Rename as...
17914 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
17915 (getsym): Rename as...
17916 (symbol_get): this.
17917
d57650a5
AD
179182002-06-30 Akim Demaille <akim@epita.fr>
17919
17920 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
17921 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
17922 * src/output.c, src/print.c, src/print_graph.c: Propagate.
17923 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
17924
5a08f1ce
AD
179252002-06-30 Akim Demaille <akim@epita.fr>
17926
17927 Make the test suite pass with warnings checked.
17928
17929 * tests/actions.at (Printers and Destructors): Improve.
17930 Avoid unsigned vs. signed issues.
17931 * tests/calc.at: Don't exercise the scanner here, do it...
17932 * tests/input.at (Torturing the Scanner): here.
17933
720623af
PH
179342002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17935
88e7e941 17936 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
17937 reorganize first lines parallel to yacc.c.
17938
fb8135fa
AD
179392002-06-28 Akim Demaille <akim@epita.fr>
17940
17941 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
17942 (b4_token_enum, b4_token_defines): New, factored from...
17943 * data/lalr1.cc, data/yacc.c, glr.c: here.
17944
41442480
AD
179452002-06-28 Akim Demaille <akim@epita.fr>
17946
17947 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
17948 unused variables.
17949 * src/output.c (merger_output): static.
17950
e0e5bf84
AD
179512002-06-28 Akim Demaille <akim@epita.fr>
17952
ba0fe3c7 17953 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
17954 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
17955 pacify GCC.
17956 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 17957
676385e2
PH
179582002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17959
17960 Accumulated changelog for new GLR parsing features.
17961
6a254321 17962 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
17963 conflicts_total_count.
17964 * src/conflicts.h: Ditto.
17965 * src/output.c (token_actions): Use the new name.
17966 (output_conflicts): Change conflp => conflict_list_heads, and
17967 confl => conflict_list for better readability.
17968 * data/glr.c: Use the new names.
17969 * NEWS: Add self to GLR announcement.
e0e5bf84 17970
676385e2
PH
17971 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
17972
17973 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
17974 Akim Demaille.
17975
17976 * data/bison.glr: Change name to glr.c
17977 * data/glr.c: Renamed from bison.glr.
17978 * data/Makefile.am: Add glr.c
e0e5bf84
AD
17979
17980 * src/getargs.c:
17981
676385e2 17982 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 17983 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 17984
676385e2
PH
17985 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17986
17987 * data/bison.glr: Be sure to restore the
17988 current #line when returning to the skeleton contents after having
17989 exposed the input file's #line.
17990
17991 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17992
17993 * data/bison.glr: Bring up to date with changes to bison.simple.
17994
17995 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17996
17997 * data/bison.glr: Correct definitions that use b4_prefix.
17998 Various reformatting.
17999 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
18000 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
18001 yytokenp argument; now part of stack.
18002 (yychar): Define to behave as documented.
18003 (yyclearin): Ditto.
e0e5bf84 18004
676385e2
PH
18005 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18006
18007 * src/reader.h: Add declaration for free_merger_functions.
18008
18009 * src/reader.c (merge_functions): New variable.
18010 (get_merge_function): New function.
18011 (free_merger_functions): New function.
18012 (readgram): Check for %prec that is not followed by a symbol.
18013 Handle %dprec and %merge declarations.
18014 (packgram): Initialize dprec and merger fields in rules array.
18015
18016 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
18017 conflict_list_cnt, conflict_list_free): New variables.
18018 (table_grow): Also grow conflict_table.
e0e5bf84 18019 (prepare_rules): Output dprec and merger tables.
676385e2 18020 (conflict_row): New function.
e0e5bf84 18021 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
18022 default reduction in conflicted states for GLR parser so that there
18023 are spaces for the conflict lists.
18024 (save_row): Also save conflict information.
18025 (token_actions): Allocate conflict list.
18026 (merger_output): New function.
18027 (pack_vector): Pack conflict table, too.
18028 (output_conflicts): New function to output yyconflp and yyconfl.
18029 (output_check): Allocate conflict_tos.
18030 (output_actions): Output conflict tables, also.
18031 (output_skeleton): Output b4_mergers definition.
18032 (prepare): Output b4_max_rhs_length definition.
18033 Use 'bison.glr' as default skeleton for GLR parsers.
18034
18035 * src/gram.c (glr_parser): New flag.
18036 (grammar_free): Call free_merger_functions.
18037
18038 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
18039 all pairs of conflicting reductions, rather than just all tokens
18040 causing conflicts. Needed to size conflict tables.
e0e5bf84 18041 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
18042 interface.
18043 (conflicts_print): Ditto.
18044 (count_total_conflicts): New function.
18045
18046 * src/reader.h (merger_list): New type.
18047 (merge_functions): New variable.
18048
18049 * src/lex.h (tok_dprec, tok_merge): New token types.
18050
18051 * src/gram.h (rule_s): Add dprec and merger fields.
18052 (glr_parser): New flag.
18053
18054 * src/conflicts.h (count_total_conflicts): New function.
18055
18056 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
18057
18058 * doc/bison.texinfo (Generalized LR Parsing): New section.
18059 (GLR Parsers): New section.
18060 (Language and Grammar): Mention GLR parsing.
18061 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
18062 Correct typo ("tge" -> "the").
18063
18064 * data/bison.glr: New skeleton for GLR parsing.
18065
18066 * tests/cxx-gram.at: New tests for GLR parsing.
18067
18068 * tests/testsuite.at: Include cxx-gram.at.
18069
18070 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 18071
676385e2
PH
18072 * src/parse-gram.y:
18073
18074 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
18075
18076 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 18077
b5480d74 180782002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
18079
18080 * src/options.h, src/options.c: Remove.
18081 * src/getargs.c (short_options, long_options): New.
18082
60491a94
AD
180832002-06-27 Akim Demaille <akim@epita.fr>
18084
18085 * data/bison.simple, data/bison.c++: Rename as...
18086 * data/yacc.c, data/lalr1.cc: these.
18087 * doc/bison.texinfo (Environment Variables): Remove.
18088
9be0c25b
AD
180892002-06-25 Raja R Harinath <harinath@cs.umn.edu>
18090
18091 * src/getargs.c (report_argmatch): Initialize strtok().
18092
1ae72863
AD
180932002-06-20 Akim Demaille <akim@epita.fr>
18094
18095 * data/bison.simple (b4_symbol_actions): New, replaces...
18096 (b4_symbol_destructor, b4_symbol_printer): these.
18097 (yysymprint): Be sure to call YYPRINT only for tokens, and using
18098 user token numbers.
18099
87542d29
AD
181002002-06-20 Akim Demaille <akim@epita.fr>
18101
18102 * data/bison.simple (yydestructor): Rename as...
18103 (yydestruct): this.
18104
1a31ed21
AD
181052002-06-20 Akim Demaille <akim@epita.fr>
18106
18107 * src/symtab.h, src/symtab.c (symbol_type_set)
18108 (symbol_destructor_set, symbol_precedence_set): The location is
18109 the last argument.
18110 Adjust all callers.
18111
e776192e
AD
181122002-06-20 Akim Demaille <akim@epita.fr>
18113
18114 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
18115 internals.
18116 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
18117 Takes a location.
18118 * src/symtab.h, src/symtab.c (symbol_class_set)
18119 (symbol_user_token_number_set): Likewise.
18120 Adjust all callers.
18121 Promote complain_at.
18122 * tests/input.at (Type Clashes): Adjust.
18123
5c1180b3
AD
181242002-06-20 Akim Demaille <akim@epita.fr>
18125
18126 * data/bison.simple (YYLEX): Fix the declaration when
18127 %pure-parser.
18128
e3170060
AD
181292002-06-20 Akim Demaille <akim@epita.fr>
18130
18131 * data/bison.simple (yysymprint): Don't print the token number,
18132 just its name.
18133 * tests/actions.at (Destructors): Rename as...
18134 (Printers and Destructors): this.
18135 Also exercise %printer.
18136
253862fd
AD
181372002-06-20 Akim Demaille <akim@epita.fr>
18138
18139 * data/bison.simple (YYDSYMPRINT): New.
18140 Use it to remove many of the #if YYDEBUG/if (yydebug).
18141
366eea36
AD
181422002-06-20 Akim Demaille <akim@epita.fr>
18143
18144 * src/symtab.h, src/symtab.c (symbol_t): printer and
18145 printer_location are new members.
18146 (symbol_printer_set): New.
18147 * src/parse-gram.y (PERCENT_PRINTER): New token.
18148 Handle its associated rule.
18149 * src/scan-gram.l: Adjust.
18150 (handle_destructor_at, handle_destructor_dollar): Rename as...
18151 (handle_symbol_code_at, handle_symbol_code_dollar): these.
18152 * src/output.c (symbol_printers_output): New.
18153 (output_skeleton): Call it.
18154 * data/bison.simple (yysymprint): New. Cannot be named yyprint
18155 since there are already many grammar files with a user `yyprint'.
18156 Replace the calls to YYPRINT to calls to yysymprint.
18157 * tests/calc.at: Adjust.
18158 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
18159 taking advantage of parser very internal details (stack size!).
18160
4f25ebb0
AD
181612002-06-20 Akim Demaille <akim@epita.fr>
18162
18163 * src/scan-gram.l: Complete the scanner with the missing patterns
18164 to pacify Flex.
18165 Use `quote' and `symbol_tag_get' where appropriate.
18166
93b68a0e
AD
181672002-06-19 Akim Demaille <akim@epita.fr>
18168
18169 * tests/actions.at (Destructors): Augment to test locations.
18170 * data/bison.simple (yydestructor): Pass it the current location
18171 if locations are enabled.
18172 Prototype only when __STDC__ or C++.
18173 Change the argument names to move into the yy name space: there is
18174 user code here.
18175
58612f1d
AD
181762002-06-19 Akim Demaille <akim@epita.fr>
18177
74310291
AD
18178 * data/bison.simple (b4_pure_if): New.
18179 Use it instead of #ifdef YYPURE.
18180
181812002-06-19 Akim Demaille <akim@epita.fr>
18182
18183 * data/bison.simple (b4_location_if): New.
58612f1d
AD
18184 Use it instead of #ifdef YYLSP_NEEDED.
18185
f25bfb75
AD
181862002-06-19 Akim Demaille <akim@epita.fr>
18187
18188 Prepare @$ in %destructor, but currently don't bind it in the
18189 skeleton, as %location use is not cleaned up yet.
18190
18191 * src/scan-gram.l (handle_dollar, handle_destructor_at)
18192 (handle_action_at): New.
18193 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
18194 a braced_code_t and a location as additional arguments.
18195 (handle_destructor_dollar): Instead of requiring `b4_eval', just
18196 unquote one when outputting `b4_dollar_dollar'.
18197 Adjust callers.
18198 * data/bison.simple (b4_eval): Remove.
18199 (b4_symbol_destructor): Adjust.
18200 * tests/input.at (Invalid @n): Adjust.
18201
c732d2c6
AD
182022002-06-19 Zack Weinberg <zack@codesourcery.com>
18203
18204 * doc/bison.texinfo: Document ability to have multiple
18205 prologue sections.
18206
8c165d89
AD
182072002-06-18 Akim Demaille <akim@epita.fr>
18208
18209 * src/files.c (compute_base_names): When computing the output file
18210 names from the input file name, strip the directory part.
18211
ca98bf57
AD
182122002-06-18 Akim Demaille <akim@epita.fr>
18213
18214 * data/bison.simple.new: Comment changes.
18215 Reported by Andreas Schwab.
18216
0bfb02ff
AD
182172002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
18218
18219 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
18220 there are no `label `yyoverflowlab' defined but not used' warnings
18221 when yyoverflow is defined.
18222
24c0aad7
AD
182232002-06-18 Akim Demaille <akim@epita.fr>
18224
18225 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
18226 new member.
18227 (symbol_destructor_set): Adjust.
18228 * src/output.c (symbol_destructors_output): Output the destructor
18229 locations.
18230 Output the symbol name.
18231 * data/bison.simple (b4_symbol_destructor): Adjust.
18232
5719c109
AD
182332002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
18234 and Akim Demaille <akim@epita.fr>
18235
18236 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
18237 what's left on the stack when the error recovery hits EOF.
18238 * tests/actions.at (Destructors): Complete to exercise this case.
18239
9280d3ef
AD
182402002-06-17 Akim Demaille <akim@epita.fr>
18241
18242 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
18243 arguments is really empty, not only equal to `[]'.
18244 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
18245 member.
18246 (symbol_destructor_set): New.
18247 * src/output.c (symbol_destructors_output): New.
18248 * src/reader.h (brace_code_t, current_braced_code): New.
18249 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
18250 (handle_dollar): Rename as...
18251 (handle_action_dollar): this.
18252 (handle_destructor_dollar): New.
18253 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
18254 (grammar_declaration): Use it.
18255 * data/bison.simple (yystos): Is always defined.
18256 (yydestructor): New.
18257 * tests/actions.at (Destructors): New.
18258 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
18259
dafdc66f
AD
182602002-06-17 Akim Demaille <akim@epita.fr>
18261
18262 * src/symlist.h, src/symlist.c (symbol_list_length): New.
18263 * src/scan-gram.l (handle_dollar, handle_at): Compute the
18264 rule_length only when needed.
18265 * src/output.c (actions_output, token_definitions_output): Output
18266 the full M4 block.
18267 * src/symtab.c: Don't access directly to the symbol tag, use
18268 symbol_tag_get.
18269 * src/parse-gram.y: Use symbol_list_free.
18270
56c47203
AD
182712002-06-17 Akim Demaille <akim@epita.fr>
18272
18273 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
18274 (symbol_list_prepend, get_type_name): Move to...
18275 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
18276 (symbol_list_prepend, symbol_list_n_type_name_get): here.
18277 Adjust all callers.
18278 (symbol_list_free): New.
18279 * src/scan-gram.l (handle_dollar): Takes a location.
18280 * tests/input.at (Invalid $n): Adjust.
18281
1e0bab92
AD
182822002-06-17 Akim Demaille <akim@epita.fr>
18283
18284 * src/reader.h, src/reader.c (symbol_list_new): Export it.
18285 (symbol_list_prepend): New.
18286 * src/parse-gram.y (%union): `list' is a new member.
18287 (symbols.1): New, replaces...
18288 (terms_to_prec.1, nterms_to_type.1): these.
18289 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
18290 Take a location as additional argument.
18291 Adjust all callers.
18292
04e60654
AD
182932002-06-15 Akim Demaille <akim@epita.fr>
18294
18295 * src/parse-gram.y: Move %token in the declaration section so that
18296 we don't depend upon CVS Bison.
18297
10e5b8bd
AD
182982002-06-15 Akim Demaille <akim@epita.fr>
18299
18300 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
18301 * src/print.c (print_core): Use it.
18302
9801d40c
AD
183032002-06-15 Akim Demaille <akim@epita.fr>
18304
18305 * src/conflicts.c (log_resolution): Accept the rule involved in
18306 the sr conflicts instead of the lookahead number that points to
18307 that rule.
18308 (flush_reduce): Accept the current lookahead vector as argument,
18309 instead of the index in LA.
18310 (resolve_sr_conflict): Accept the current number of lookahead
18311 bitset to consider for the STATE, instead of the index in LA.
18312 (set_conflicts): Adjust.
18313 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
18314
c0263492
AD
183152002-06-15 Akim Demaille <akim@epita.fr>
18316
18317 * src/state.h (state_t): Replace the `lookaheadsp' member, a
18318 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
18319 Adjust all dependencies.
18320 * src/lalr.c (initialize_lookaheads): Split into...
18321 (states_lookaheads_count, states_lookaheads_initialize): these.
18322 (lalr): Adjust.
18323
9757c359
AD
183242002-06-15 Akim Demaille <akim@epita.fr>
18325
18326 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
18327 out of...
18328 (grammar_rules_print): here.
18329 * src/reduce.c (reduce_output): Use it.
18330 * tests/reduce.at (Useless Rules, Reduced Automaton)
18331 (Underivable Rules): Adjust.
18332
6b98e4b5
AD
183332002-06-15 Akim Demaille <akim@epita.fr>
18334
18335 Copy BYacc's nice way to report the grammar.
18336
18337 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
18338 New.
18339 Don't print the rules' location, it is confusing and useless.
18340 (rule_print): Use grammar_rhs_print.
18341 * src/print.c (print_grammar): Use grammar_rules_print.
18342
6b98e4b5
AD
183432002-06-15 Akim Demaille <akim@epita.fr>
18344
18345 Complete and rationalize `useless thing' warnings.
18346
18347 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
18348 (symbol_tag_print): New.
18349 Use them everywhere in place of accessing directly the tag member.
18350 * src/gram.h, src/gram.c (rule_print): New.
18351 Use it where a rule used to be printed `by hand'.
18352 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
18353 (reduce_grammar_tables): Report the useless rules.
18354 (reduce_print): Useless things are a warning, not an error.
18355 Report it as such.
18356 * tests/reduce.at (Useless Nonterminals, Useless Rules):
18357 (Reduced Automaton, Underivable Rules): Adjust.
18358 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
18359 * tests/conflicts.at (Unresolved SR Conflicts)
18360 (Solved SR Conflicts): Adjust.
18361
ee000ba4
AD
183622002-06-15 Akim Demaille <akim@epita.fr>
18363
18364 Let symbols have a location.
18365
18366 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
18367 (getsym): Adjust.
18368 Adjust all callers.
18369 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
18370 Use location_t, not int.
18371 * src/symtab.c (symbol_check_defined): Take advantage of the
18372 location.
18373 * tests/regression.at (Invalid inputs): Adjust.
18374
8efe435c
AD
183752002-06-15 Akim Demaille <akim@epita.fr>
18376
18377 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
18378 (input): Don't try to initialize yylloc here, do it in the
18379 scanner.
18380 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
18381 * src/gram.h (rule_t): Change line and action_line into location
18382 and action_location, of location_t type.
18383 Adjust all dependencies.
18384 * src/location.h, src/location.c (empty_location): New.
18385 * src/reader.h, src/reader.c (grammar_start_symbol_set)
18386 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
18387 (grammar_current_rule_symbol_append)
18388 (grammar_current_rule_action_append): Expect a location as argument.
18389 * src/reader.c (grammar_midrule_action): Adjust to attach an
18390 action's location as dummy symbol location.
18391 * src/symtab.h, src/symtab.c (startsymbol_location): New.
18392 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
18393 the line numbers.
18394
1921f1d7
AD
183952002-06-14 Akim Demaille <akim@epita.fr>
18396
18397 Grammar declarations may be found in the grammar section.
18398
18399 * src/parse-gram.y (rules_or_grammar_declaration): New.
18400 (declarations): Each declaration may end with a semicolon, not
18401 just...
18402 (grammar_declaration): `"%union"'.
18403 (grammar): Branch to rules_or_grammar_declaration.
18404
4515534c
AD
184052002-06-14 Akim Demaille <akim@epita.fr>
18406
18407 * src/main.c (main): Invoke scanner_free.
18408
f958596b
AD
184092002-06-14 Akim Demaille <akim@epita.fr>
18410
18411 * src/output.c (m4_invoke): Extracted from...
18412 (output_skeleton): here.
18413 Free tempfile.
18414
2c569025
AD
184152002-06-14 Akim Demaille <akim@epita.fr>
18416
18417 * src/parse-gram.y (directives, directive, gram)
18418 (grammar_directives, precedence_directives, precedence_directive):
18419 Rename as...
18420 (declarations, declaration, grammar, grammar_declaration)
18421 (precedence_declaration, precedence_declarator): these.
18422 (symbol_declaration): New.
18423
592e8d4d
AD
184242002-06-14 Akim Demaille <akim@epita.fr>
18425
18426 * src/files.c (action_obstack): Remove, unused.
18427 (output_obstack): Remove it, and all its dependencies, as it is no
18428 longer needed.
18429 * src/reader.c (epilogue_set): Build the epilogue in the
18430 muscle_obstack.
18431 * src/output.h, src/output.c (muscle_obstack): Move to...
18432 * src/muscle_tab.h, src/muscle_tab.h: here.
18433 (muscle_init): Initialize muscle_obstack.
18434 (muscle_free): New.
18435 * src/main.c (main): Call it.
18436
0c15323d
AD
184372002-06-14 Akim Demaille <akim@epita.fr>
18438
18439 * src/location.h: New, extracted from...
18440 * src/reader.h: here.
18441 * src/Makefile.am (noinst_HEADERS): Merge into
18442 (bison_SOURCES): this.
18443 Add location.h.
18444 * src/parse-gram.y: Use location_t instead of Bison's.
18445 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
18446 Use location_t instead of ints.
18447
e96c9728
AD
184482002-06-14 Akim Demaille <akim@epita.fr>
18449
18450 * data/bison.simple, data/bison.c++: Be sure to restore the
18451 current #line when returning to the skeleton contents after having
18452 exposed the input file's #line.
18453
75d1fe16
AD
184542002-06-12 Akim Demaille <akim@epita.fr>
18455
18456 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
18457 eager.
18458 * tests/actions.at (Exotic Dollars): New.
18459
6c35d22c
AD
184602002-06-12 Akim Demaille <akim@epita.fr>
18461
18462 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
18463 ['"/] too eagerly.
18464 * tests/input.at (Torturing the Scanner): New.
18465
1d6412ad
AD
184662002-06-11 Akim Demaille <akim@epita.fr>
18467
18468 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
18469 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
18470 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
18471 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
18472 * src/reader.c (reader): Use it.
18473
4cdb01db
AD
184742002-06-11 Akim Demaille <akim@epita.fr>
18475
18476 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
18477 Adjust all callers.
18478 (scanner_last_string_free): New.
18479
44995b2e
AD
184802002-06-11 Akim Demaille <akim@epita.fr>
18481
18482 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
18483 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
18484 (last_string, YY_OBS_FREE): New.
18485 Use them when returning an ID.
18486
e9955c83
AD
184872002-06-11 Akim Demaille <akim@epita.fr>
18488
18489 Have Bison grammars parsed by a Bison grammar.
18490
18491 * src/reader.c, src/reader.h (prologue_augment): New.
18492 * src/reader.c (copy_definition): Remove.
18493
18494 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
18495 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
18496 (grammar_current_rule_prec_set, grammar_current_rule_check)
18497 (grammar_current_rule_symbol_append)
18498 (grammar_current_rule_action_append): Export.
18499 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
18500 (symbol_list_action_append): Remove.
18501 Hook the routines from reader.
18502 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
18503 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
18504
18505 * src/reader.c (read_declarations): Remove, unused.
18506
18507 * src/parse-gram.y: Handle the epilogue.
18508 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
18509 (grammar_start_symbol_set): this.
18510 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
18511 * src/reader.c (readgram): Remove, unused.
18512 (reader): Adjust to insert eoftoken and axiom where appropriate.
18513
18514 * src/reader.c (copy_dollar): Replace with...
18515 * src/scan-gram.h (handle_dollar): this.
18516 * src/parse-gram.y: Remove `%thong'.
18517
18518 * src/reader.c (copy_at): Replace with...
18519 * src/scan-gram.h (handle_at): this.
18520
18521 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
18522 New.
18523
18524 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
18525 time being.
18526
18527 * src/reader.h, src/reader.c (grammar_rule_end): New.
18528
18529 * src/parse.y (current_type, current_class): New.
18530 Implement `%nterm', `%token' support.
18531 Merge `%term' into `%token'.
18532 (string_as_id): New.
18533 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
18534 type name.
18535
18536 * src/parse-gram.y: Be sure to handle properly the beginning of
18537 rules.
18538
18539 * src/parse-gram.y: Handle %type.
18540 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
18541
18542 * src/parse-gram.y: More directives support.
18543 * src/options.c: No longer handle source directives.
18544
18545 * src/parse-gram.y: Fix %output.
18546
18547 * src/parse-gram.y: Handle %union.
18548 Use the prologue locations.
18549 * src/reader.c (parse_union_decl): Remove.
18550
18551 * src/reader.h, src/reader.c (epilogue_set): New.
18552 * src/parse-gram.y: Use it.
18553
18554 * data/bison.simple, data/bison.c++: b4_stype is now either not
18555 defined, then default to int, or to the contents of %union,
18556 without `union' itself.
18557 Adjust.
18558 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
18559
18560 * src/output.c (actions_output): Don't output braces, as they are
18561 already handled by the scanner.
18562
18563 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
18564 characters to themselves.
18565
18566 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
18567 that the epilogue has a proper #line.
18568
18569 * src/parse-gram.y: Handle precedence/associativity.
18570
18571 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
18572 a terminal.
18573 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
18574 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
18575 at all to define terminals that cannot be emitted.
18576
18577 * src/scan-gram.l: Escape M4 characters.
18578
18579 * src/scan-gram.l: Working properly with escapes in user
18580 strings/characters.
18581
18582 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
18583 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
18584 grammar.
18585 Use more modest sizes, as for the time being the parser does not
18586 release memory, and therefore the process swallows a huge amount
18587 of memory.
18588
18589 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
18590 stricter %token grammar.
18591
18592 * src/symtab.h (associativity): Add `undef_assoc'.
18593 (symbol_precedence_set): Do nothing when passed an undef_assoc.
18594 * src/symtab.c (symbol_check_alias_consistence): Adjust.
18595
18596 * tests/regression.at (Invalid %directive): Remove, as it is now
18597 meaningless.
18598 (Invalid inputs): Adjust to the new error messages.
18599 (Token definitions): The new grammar doesn't allow too many
18600 eccentricities.
18601
18602 * src/lex.h, src/lex.c: Remove.
18603 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
18604 (copy_character, copy_string2, copy_string, copy_identifier)
18605 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
18606 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
18607 (parse_action): Remove.
18608 * po/POTFILES.in: Adjust.
18609
2e047461
AD
186102002-06-11 Akim Demaille <akim@epita.fr>
18611
cd05d13c 18612 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
18613 rule's action member: return the action as a string.
18614 Don't require `rule_length' as an argument: compute it.
18615 (grammar_current_rule_symbol_append)
18616 (grammar_current_rule_action_append): New, eved out from
18617 (readgram): here.
18618 Remove `action_flag', `rulelength', unused now.
18619
9af3fbce
AD
186202002-06-11 Akim Demaille <akim@epita.fr>
18621
18622 * src/reader.c (grammar_current_rule_prec_set).
18623 (grammar_current_rule_check): New, eved out from...
18624 (readgram): here.
18625 Remove `xaction', `first_rhs': useless.
18626 * tests/input.at (Type clashes): New.
18627 * tests/existing.at (GNU Cim Grammar): Adjust.
18628
1485e106
AD
186292002-06-11 Akim Demaille <akim@epita.fr>
18630
18631 * src/reader.c (grammar_midrule_action): New, Eved out from
18632 (readgram): here.
18633
da4160c3
AD
186342002-06-11 Akim Demaille <akim@epita.fr>
18635
18636 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
18637 New.
18638 (readgram): Use them as replacement of inlined code, crule and
18639 crule1.
18640
f6d0f937
AD
186412002-06-11 Akim Demaille <akim@epita.fr>
18642
18643 * src/reader.c (grammar_end, grammar_symbol_append): New.
18644 (readgram): Use them.
18645 Make the use of `p' as local as possible.
18646
69078d4b
AD
186472002-06-10 Akim Demaille <akim@epita.fr>
18648
18649 GCJ's parser requires the tokens to be defined before the prologue.
18650
18651 * data/bison.simple: Output the token definition before the user's
18652 prologue.
18653 * tests/regression.at (Braces parsing, Duplicate string)
18654 (Mixing %token styles): Check the output from bison.
18655 (Early token definitions): New.
18656
5e424082
AD
186572002-06-10 Akim Demaille <akim@epita.fr>
18658
18659 * src/symtab.c (symbol_user_token_number_set): Don't complain when
18660 assigning twice the same user number to a token, so that we can
18661 use it in...
18662 * src/lex.c (lex): here.
18663 Also use `symbol_class_set' instead of hand written code.
18664 * src/reader.c (parse_assoc_decl): Likewise.
18665
44536b35
AD
186662002-06-10 Akim Demaille <akim@epita.fr>
18667
18668 * src/symtab.c, src/symtab.c (symbol_class_set)
18669 (symbol_user_token_number_set): New.
18670 * src/reader.c (parse_token_decl): Use them.
18671 Use a switch instead of ifs.
18672 Use a single argument.
18673
8b9f2372
AD
186742002-06-10 Akim Demaille <akim@epita.fr>
18675
18676 Remove `%thong' support as it is undocumented, unused, duplicates
18677 `%token's job, and creates useless e-mail traffic with people who
18678 want to know what it is, why it is undocumented, unused, and
18679 duplicates `%token's job.
18680
18681 * src/reader.c (parse_thong_decl): Remove.
18682 * src/options.c (option_table): Remove "thong".
18683 * src/lex.h (tok_thong): Remove.
18684
3ae2b51f
AD
186852002-06-10 Akim Demaille <akim@epita.fr>
18686
18687 * src/symtab.c, src/symtab.c (symbol_type_set)
18688 (symbol_precedence_set): New.
18689 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
18690 (value_components_used): Remove, unused.
18691
2f1afb73
AD
186922002-06-09 Akim Demaille <akim@epita.fr>
18693
18694 Move symbols handling code out of the reader.
18695
18696 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
18697 (axiom): Move to...
18698 * src/symtab.h, src/symtab.c: here.
18699
18700 * src/gram.c (start_symbol): Remove: use startsymbol->number.
18701 * src/reader.c (startval): Rename as...
18702 * src/symtab.h, src/symtab.c (startsymbol): this.
18703 * src/reader.c: Adjust.
18704
18705 * src/reader.c (symbol_check_defined, symbol_make_alias)
18706 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18707 (token_translations_init)
18708 Move to...
18709 * src/symtab.c: here.
18710 * src/reader.c (packsymbols): Move to...
18711 * src/symtab.h, src/symtab.c (symbols_pack): here.
18712 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
18713 argument.
18714
e9bca3ad
AD
187152002-06-03 Akim Demaille <akim@epita.fr>
18716
18717 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
18718 then statements.
18719
86eff183
AD
187202002-06-03 Akim Demaille <akim@epita.fr>
18721
18722 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
18723 structs with non literals.
18724 * src/scan-skel.l: never-interactive.
18725 * src/conflicts.c (enum conflict_resolution_e): No trailing
18726 comma.
18727 * src/getargs.c (usage): Split long literal strings.
18728 Reported by Hans Aberg.
18729
717be197
AD
187302002-05-28 Akim Demaille <akim@epita.fr>
18731
18732 * data/bison.c++: Use C++ ostreams.
18733 (cdebug_): New member.
18734
670ddffd
AD
187352002-05-28 Akim Demaille <akim@epita.fr>
18736
18737 * src/output.c (output_skeleton): Be sure to allocate enough room
18738 for `/' _and_ for `\0' in full_skeleton.
18739
769b430f
AD
187402002-05-28 Akim Demaille <akim@epita.fr>
18741
18742 * data/bison.c++: Catch up with bison.simple:
18743 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18744 and Paul Eggert <eggert@twinsun.com>: `error' handing.
18745 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
18746 and popping traces.
18747
7067cb36
PH
187482002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18749
18750 * src/output.c (output_skeleton): Put an explicit path in front of
18751 the skeleton file name, rather than relying on the -I directory,
18752 to partially alleviate effects of having a skeleton file lying around
18753 in the current directory.
769b430f 18754
4a713ec2
PH
187552002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18756
769b430f 18757 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
18758 obstack_printf should be obstack_fgrow1.
18759
b408954b
AD
187602002-05-26 Akim Demaille <akim@epita.fr>
18761
18762 * src/state.h (state_t): `solved_conflicts' is a new member.
18763 * src/LR0.c (new_state): Set it to 0.
18764 * src/conflicts.h, src/conflicts.c (print_conflicts)
18765 (free_conflicts, solve_conflicts): Rename as...
18766 (conflicts_print, conflicts_free, conflicts_solve): these.
18767 Adjust callers.
18768 * src/conflicts.c (enum conflict_resolution_e)
18769 (solved_conflicts_obstack): New, used by...
18770 (log_resolution): this.
18771 Adjust to attach the conflict resolution to each state.
18772 Complete the description with the precedence/associativity
18773 information.
18774 (resolve_sr_conflict): Adjust.
18775 * src/print.c (print_state): Output its solved_conflicts.
18776 * tests/conflicts.at (Unresolved SR Conflicts)
18777 (Solved SR Conflicts): Exercise --report=all.
18778
a49aecd5
AD
187792002-05-26 Akim Demaille <akim@epita.fr>
18780
18781 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18782 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18783 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
18784 (token_number_t, item_number_as_token_number)
18785 (token_number_as_item_number, muscle_insert_token_number_table):
18786 Rename as...
18787 (symbol_number_t, item_number_as_symbol_number)
18788 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
18789 these, since it is more appropriate.
18790
5504898e
AD
187912002-05-26 Akim Demaille <akim@epita.fr>
18792
18793 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
18794 `Error:' lines.
18795 * data/bison.simple (yystos) [YYDEBUG]: New.
18796 (yyparse) [YYDEBUG]: Display the symbols which are popped during
18797 error recovery.
18798 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
18799
ec3bc396
AD
188002002-05-25 Akim Demaille <akim@epita.fr>
18801
18802 * doc/bison.texinfo (Debugging): Split into...
18803 (Tracing): this new section, its former contents, and...
18804 (Understanding): this new section.
18805 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
18806 by...
18807 (report_flag): this.
18808 Adjust all dependencies.
18809 (report_args, report_types, report_argmatch): New.
18810 (usage, getargs): Report/support -r, --report.
18811 * src/options.h
18812 (struct option_table_struct): Rename as..,
18813 (struct option_table_s): this.
18814 Rename the `set_flag' member to `flag' to match with getopt_long's
18815 struct.
18816 * src/options.c (option_table): Split verbose into an entry for
18817 %verbose, and another for --verbose.
18818 Support --report/-r, so remove -r from the obsolete --raw.
18819 * src/print.c: Attach full item sets and lookaheads reports to
18820 report_flag instead of trace_flag.
18821 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
18822
78df8250
PE
188232002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18824 and Paul Eggert <eggert@twinsun.com>
769b430f 18825
78df8250
PE
18826 * data/bison.simple (yyparse): Correct error handling to conform to
18827 POSIX and yacc. Specifically, after syntax error is discovered,
18828 do not reduce further before shifting the error token.
18829 Clean up the code a bit by removing the labels yyerrdefault,
18830 yyerrhandle, yyerrpop.
18831 * NEWS: Document the above.
18832
c0c9ea05
PH
188332002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18834
18835 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
18836 type; it isn't always big enough, since it doesn't necessarily
18837 include non-terminals.
769b430f 18838 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
18839 the latter can be removed.
18840 (yy_token_number_type): Remove, only one use.
18841 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
18842 don't use TokenNumberType as element type.
769b430f 18843
c0c9ea05
PH
18844 * tests/regression.at: Modify expected output to agree with change
18845 to yyr1 and yytranslate.
769b430f 18846
6390a83f
FK
188472002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
18848
18849 * src/reader.c (parse_action): Use copy_character instead of
18850 obstack_1grow.
18851
db7c8e9a
AD
188522002-05-13 Akim Demaille <akim@epita.fr>
18853
18854 * tests/regression.at (Token definitions): Prototype yylex and
18855 yyerror.
18856
fcc61800
PH
188572002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18858
158c687b 18859 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
18860 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
18861 32-bit arithmetic.
18862 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
18863
5683e9b2
AD
188642002-05-07 Akim Demaille <akim@epita.fr>
18865
18866 * tests/synclines.at: Be sure to prototype yylex and yyerror to
18867 avoid GCC warnings.
18868
0c2d3f4c
AD
188692002-05-07 Akim Demaille <akim@epita.fr>
18870
18871 Kill GCC warnings.
18872
18873 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
18874 over the RHS of each rule.
18875 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
18876 * src/state.h (state_t): Member `nitems' is unsigned short.
18877 * src/LR0.c (get_state): Adjust.
18878 * src/reader.c (packgram): Likewise.
18879 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
18880 `Type'.
18881 (muscle_insert_int_table): Remove, unused.
18882 (prepare_rules): Remove `max'.
18883
1565b720
AD
188842002-05-06 Akim Demaille <akim@epita.fr>
18885
18886 * src/closure.c (print_firsts): Display of the symbol tags.
18887 (bitmatrix_print): Move to...
18888 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
18889 here.
18890 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
18891
cfaee611
AD
188922002-05-06 Akim Demaille <akim@epita.fr>
18893
18894 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
18895 hash_do_for_each.
18896
458be8e0
AD
188972002-05-06 Akim Demaille <akim@epita.fr>
18898
18899 * src/LR0.c (new_state, get_state): Instead of using the global
18900 `kernel_size' and `kernel_base', have two new arguments:
18901 `core_size' and `core'.
18902 Adjust callers.
18903
a900a624
AD
189042002-05-06 Akim Demaille <akim@epita.fr>
18905
18906 * src/reader.c (packgram): No longer end `ritem' with a 0
18907 sentinel: it is not used.
18908
d4e7d3a1
AD
189092002-05-05 Akim Demaille <akim@epita.fr>
18910
18911 New experimental feature: display the lookaheads in the report and
18912 graph.
18913
18914 * src/print (print_core): When --trace-flag, display the rules
18915 lookaheads.
18916 * src/print_graph.c (print_core): Likewise.
18917 Swap the arguments.
18918 Adjust caller.
18919
39ceb25b
AD
189202002-05-05 Akim Demaille <akim@epita.fr>
18921
18922 * tests/torture.at (Many lookaheads): New test.
18923
5372019f
AD
189242002-05-05 Akim Demaille <akim@epita.fr>
18925
18926 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
18927 (GENERATE_MUSCLE_INSERT_TABLE): this.
18928 (output_int_table, output_unsigned_int_table, output_short_table)
18929 (output_token_number_table, output_item_number_table): Replace with...
18930 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
18931 (muscle_insert_short_table, muscle_insert_token_number_table)
18932 (muscle_insert_item_number_table): these.
18933 Adjust all callers.
18934 (prepare_tokens): Don't free `translations', since...
18935 * src/reader.h, src/reader.c (grammar_free): do it.
18936 Move to...
18937 * src/gram.h, src/gram.c (grammar_free): here.
18938 * data/bison.simple, data/bison.c++: b4_token_number_max is now
18939 b4_translate_max.
18940
5df5f6d5
AD
189412002-05-05 Akim Demaille <akim@epita.fr>
18942
18943 * src/output.c (output_unsigned_int_table): New.
18944 (prepare_rules): `i' is unsigned.
18945 `prhs', `rline', `r2' are unsigned int.
18946 Rename muscle `rhs_number_max' as `rhs_max'.
18947 Output muscles `prhs_max', `rline_max', and `r2_max'.
18948 Free rline and r1.
18949 * data/bison.simple, data/bison.c++: Adjust to use these muscles
18950 to compute types instead of constant types.
18951 * tests/regression.at (Web2c Actions): Adjust.
18952
b87f8b21
AD
189532002-05-04 Akim Demaille <akim@epita.fr>
18954
18955 * src/symtab.h (SALIAS, SUNDEF): Rename as...
18956 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
18957 Adjust dependencies.
18958 * src/output.c (token_definitions_output): Be sure not to output a
18959 `#define 'a'' when fed with `%token 'a' "a"'.
18960 * tests/regression.at (Token definitions): New.
18961
8bb936e4
PE
189622002-05-03 Paul Eggert <eggert@twinsun.com>
18963
18964 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
18965 for K&R C.
18966
189672002-05-03 gettextize <bug-gnu-gettext@gnu.org>
18968
18969 * Makefile.am (SUBDIRS): Remove intl.
18970 (EXTRA_DIST): Add config/config.rpath.
18971
53c71a12
AD
189722002-05-03 Akim Demaille <akim@epita.fr>
18973
18974 * data/bison.simple (m4_if): Don't output empty enums.
18975 And actually, output valid enum definitions :(.
18976
289dd0cf
AD
189772002-05-03 Akim Demaille <akim@epita.fr>
18978
18979 * configure.bat: Remove, completely obsolete.
18980 * Makefile.am (EXTRA_DIST): Adjust.
18981 Don't distribute config.rpath...
18982 * config/Makefile.am (EXTRA_DIST): Do it.
18983
db85e524
AD
189842002-05-03 Akim Demaille <akim@epita.fr>
18985
18986 * configure.in (GETTEXT_VERSION): New.
18987 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
18988
83ccf991
AD
189892002-05-03 Akim Demaille <akim@epita.fr>
18990
18991 * data/bison.simple (b4_token_enum): New.
18992 (b4_token_defines): Use it to output tokens both as #define and
18993 enums.
18994 Suggested by Paul Eggert.
18995 * src/output.c (token_definitions_output): Don't output spurious
18996 white spaces.
18997
1f418995
AD
189982002-05-03 Akim Demaille <akim@epita.fr>
18999
19000 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19001
45119f04
RA
190022002-05-02 Robert Anisko <robert@lrde.epita.fr>
19003
19004 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
19005 Update the stack class, give a try to deque as the default container.
19006
b2d52318
AD
190072002-05-02 Akim Demaille <akim@epita.fr>
19008
19009 * data/bison.simple (yyparse): Do not implement @$ = @1.
19010 (YYLLOC_DEFAULT): Adjust to do it.
19011 * doc/bison.texinfo (Location Default Action): Fix.
19012
3a8b4109
AD
190132002-05-02 Akim Demaille <akim@epita.fr>
19014
19015 * src/reader.c (parse_braces): Merge into...
19016 (parse_action): this.
19017
84614e13
AD
190182002-05-02 Akim Demaille <akim@epita.fr>
19019
19020 * configure.in (ALL_LINGUAS): Remove.
19021 * po/LINGUAS, hr.po: New.
19022
fdbcd8e2
AD
190232002-05-02 Akim Demaille <akim@epita.fr>
19024
19025 Remove the so called hairy (semantic) parsers.
19026
19027 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
19028 * src/gram.h, src/gram.c (semantic_parser): Remove.
19029 (rule_t): Remove the guard and guard_line members.
19030 * src/lex.h (token_t): remove tok_guard.
19031 * src/options.c (option_table): Remove %guard and %semantic_parser
19032 support.
19033 * src/output.c, src/output.h (guards_output): Remove.
19034 (prepare): Adjust.
19035 (token_definitions_output): Don't output the `T'
19036 tokens (???).
19037 (output_skeleton): Don't output the guards.
19038 * src/files.c, src/files.c (attrsfile): Remove.
19039 * src/reader.c (symbol_list): Remove the guard and guard_line
19040 members.
19041 Adjust dependencies.
19042 (parse_guard): Remove.
19043 * data/bison.hairy: Remove.
19044 * doc/bison.texinfo (Environment Variables): Remove occurrences of
19045 BISON_HAIRY.
19046
82b6cb3f
AD
190472002-05-02 Akim Demaille <akim@epita.fr>
19048
19049 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
19050 (parse_guard): Rename the formal argument `stack_offset' as
19051 `rule_length', which is more readable.
19052 Adjust callers.
19053 (copy_at, copy_dollar): Instead of outputting the hard coded
19054 values of $$, $n and so forth, output invocation to b4_lhs_value,
19055 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
19056 Note: this patch partially drops `semantic-parser' support: it
19057 always does `rule_length - n', where semantic parsers ought to
19058 always use `-n'.
82b6cb3f
AD
19059 * data/bison.simple, data/bison.c++ (b4_lhs_value)
19060 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
19061
6cbfbcc5
AD
190622002-05-02 Akim Demaille <akim@epita.fr>
19063
19064 * configure.in (AC_INIT): Bump to 1.49b.
19065 (AM_INIT_AUTOMAKE): Short invocation.
19066
b8548114
AD
190672002-05-02 Akim Demaille <akim@epita.fr>
19068
19069 Version 1.49a.
19070
c20cd1fa
AD
190712002-05-01 Akim Demaille <akim@epita.fr>
19072
19073 * src/skeleton.h: Remove.
19074
8a9566d4
AD
190752002-05-01 Akim Demaille <akim@epita.fr>
19076
19077 * src/skeleton.h: Fix the #endif.
19078 Reported by Magnus Fromreide.
19079
8c6d399a
PE
190802002-04-26 Paul Eggert <eggert@twinsun.com>
19081
19082 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
19083 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 19084 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 19085
2b7ed18a
RA
190862002-04-25 Robert Anisko <robert@lrde.epita.fr>
19087
19088 * src/scan-skel.l: Postprocess quadrigraphs.
19089
19090 * src/reader.c (copy_character): New function, used to output
19091 single characters while replacing `[' and `]' with quadrigraphs, to
19092 avoid troubles with M4 quotes.
19093 (copy_comment): Output characters with copy_character.
19094 (read_additionnal_code): Likewise.
19095 (copy_string2): Likewise.
19096 (copy_definition): Likewise.
19097
19098 * tests/calc.at: Exercise M4 quoting.
19099
34a89c50
AD
191002002-04-25 Akim Demaille <akim@epita.fr>
19101
19102 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
19103 between `!' and the command.
19104 Reported by Paul Eggert.
19105
0dd1580a
RA
191062002-04-24 Robert Anisko <robert@lrde.epita.fr>
19107
19108 * tests/calc.at: Exercise prologue splitting.
19109
19110 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
19111 `b4_post_prologue' instead of `b4_prologue'.
19112
19113 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
19114 muscles.
19115 (output): Free pre_prologue_obstack and post_prologue_obstack.
19116 * src/files.h, src/files.c (attrs_obstack): Remove.
19117 (pre_prologue_obstack, post_prologue_obstack): New.
19118 * src/reader.c (copy_definition): Add a parameter to specify the
19119 obstack to fill, instead of using attrs_obstack unconditionally.
19120 (read_declarations): Pass pre_prologue_obstack to copy_definition if
19121 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
19122
83c1796f
PE
191232002-04-23 Paul Eggert <eggert@twinsun.com>
19124
19125 * data/bison.simple: Remove unnecessary commentary and white
19126 space differences from 1_29-branch.
19127 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
19128
19129 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
19130 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
19131 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
19132 constructors or destructors.
19133
19134 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
19135
1207eeac
AD
191362002-04-23 Akim Demaille <akim@epita.fr>
19137
19138 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
19139 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
19140 location with columns.
19141 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
19142 All reported by Paul Eggert.
19143
78ab8f67
AD
191442002-04-22 Akim Demaille <akim@epita.fr>
19145
19146 * src/reduce.c (dump_grammar): Move to...
19147 * src/gram.h, src/gram.c (grammar_dump): here.
19148 Be sure to separate long item numbers.
19149 Don't read the members of a rule's prec if its nil.
19150
133c20e2
AD
191512002-04-22 Akim Demaille <akim@epita.fr>
19152
19153 * src/output.c (table_size, table_grow): New.
19154 (MAXTABLE): Remove, replace uses with table_size.
19155 (pack_vector): Instead of dying when the table is too big, grow it.
19156
9515e8a7
AD
191572002-04-22 Akim Demaille <akim@epita.fr>
19158
19159 * data/bison.simple (yyr1): Its type is that of a token number.
19160 * data/bison.c++ (r1_): Likewise.
19161 * tests/regression.at (Web2c Actions): Adjust.
19162
23c5a174
AD
191632002-04-22 Akim Demaille <akim@epita.fr>
19164
19165 * src/reader.c (token_translations_init): 256 is now the default
19166 value for the error token, i.e., it will be assigned another
19167 number if the user assigned 256 to one of her tokens.
19168 (reader): Don't force 256 to error.
19169 * doc/bison.texinfo (Symbols): Adjust.
19170 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
19171 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
19172 etc. instead of 10, 20, 30 (which was used to `jump' over error
19173 (256) and undefined (2)).
19174
5fbb0954
AD
191752002-04-22 Akim Demaille <akim@epita.fr>
19176
19177 Propagate more token_number_t.
19178
19179 * src/gram.h (token_number_as_item_number)
19180 (item_number_as_token_number): New.
19181 * src/output.c (GENERATE_OUTPUT_TABLE): New.
19182 Use it to create output_item_number_table and
19183 output_token_number_table.
19184 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
19185 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
19186 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
19187 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
19188
4f940944
AD
191892002-04-22 Akim Demaille <akim@epita.fr>
19190
19191 * src/output.h, src/output.c (get_lines_number): Remove.
19192
3ded9a63
AD
191932002-04-19 Akim Demaille <akim@epita.fr>
19194
19195 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
19196 as Lex/Flex'.
19197 (Debugging): More details about enabling the debugging features.
19198 (Table of Symbols): Describe $$, $n, @$, and @n.
19199 Suggested by Tim Josling.
19200
e0c471a9
AD
192012002-04-19 Akim Demaille <akim@epita.fr>
19202
19203 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
19204
fecc10cd
AD
192052002-04-10 Akim Demaille <akim@epita.fr>
19206
19207 * src/system.h: Rely on HAVE_LIMITS_H.
19208 Suggested by Paul Eggert.
19209
51dec47b
AD
192102002-04-09 Akim Demaille <akim@epita.fr>
19211
19212 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
19213 full stderr, and strip it according to the bison options, instead
19214 of composing the error message from different bits.
19215 This makes it easier to check for several error messages.
19216 Adjust all the invocations.
19217 Add an invocation exercising the error token.
19218 Add an invocation demonstrating a stupid error message.
19219 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
19220 Adjust the tests.
19221 Error message are for stderr, not stdout.
19222
007a50a4
AD
192232002-04-09 Akim Demaille <akim@epita.fr>
19224
19225 * src/gram.h, src/gram.c (error_token_number): Remove, use
19226 errtoken->number.
19227 * src/reader.c (reader): Don't specify the user token number (2)
19228 for $undefined, as it uselessly prevents using it.
19229 * src/gram.h (token_number_t): Move to...
19230 * src/symtab.h: here.
19231 (state_t.number): Is a token_number_t.
19232 * src/print.c, src/reader.c: Use undeftoken->number instead of
19233 hard coded 2.
19234 (Even though this 2 is not the same as above: the number of the
19235 undeftoken remains being 2, it is its user token number which
19236 might not be 2).
19237 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
19238 `user_token_number_max'.
19239 Output `undef_token_number'.
19240 * data/bison.simple, data/bison.c++: Use them.
19241 Be sure to map invalid yylex return values to
19242 `undef_token_number'. This saves us from gratuitous SEGV.
19243
19244 * tests/conflicts.at (Solved SR Conflicts)
19245 (Unresolved SR Conflicts): Adjust.
19246 * tests/regression.at (Web2c Actions): Adjust.
19247
06446ccf
AD
192482002-04-08 Akim Demaille <akim@epita.fr>
19249
19250 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
19251 Adding #line.
19252 Remove the duplicate `typedefs'.
19253 (RhsNumberType): Fix the declaration and various other typos.
19254 Use __ofile__.
19255 * data/bison.simple: Use __ofile__.
19256 * src/scan-skel.l: Handle __ofile__.
19257
62a3e4f0
AD
192582002-04-08 Akim Demaille <akim@epita.fr>
19259
19260 * src/gram.h (item_number_t): New, the type of item numbers in
19261 RITEM. Note that it must be able to code symbol numbers as
19262 positive number, and the negation of rule numbers as negative
19263 numbers.
19264 Adjust all dependencies (pretty many).
19265 * src/reduce.c (rule): Remove this `short *' pointer: use
19266 item_number_t.
19267 * src/system.h (MINSHORT, MAXSHORT): Remove.
19268 Include `limits.h'.
19269 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
19270 (shortcpy): Remove.
19271 (MAXTABLE): Move to...
19272 * src/output.c (MAXTABLE): here.
19273 (prepare_rules): Use output_int_table to output rhs.
19274 * data/bison.simple, data/bison.c++: Adjust.
19275 * tests/torture.at (Big triangle): Move the limit from 254 to
19276 500.
19277 * tests/regression.at (Web2c Actions): Ajust.
19278
19279 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
19280 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
19281 passes, but produces negative #line number, once fixed, GCC is
19282 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
19283 C), it passes.
19284 * src/state.h (state_h): Code input lines on ints, not shorts.
19285
bb88b0fc
AD
192862002-04-08 Akim Demaille <akim@epita.fr>
19287
19288 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
19289 and then the grammar.
19290
9a636f47
AD
192912002-04-08 Akim Demaille <akim@epita.fr>
19292
19293 * src/system.h: No longer using strndup.
19294
680e8701
AD
192952002-04-07 Akim Demaille <akim@epita.fr>
19296
19297 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
19298 * src/output.c (output_table_data): Return the longest number.
19299 (prepare_tokens): Output `token_number_max').
19300 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
19301 New.
19302 Use them to define yy_token_number_type/TokenNumberType.
19303 Use this type for yytranslate.
19304 * tests/torture.at (Big triangle): Push the limit from 124 to
19305 253.
19306 * tests/regression.at (Web2c Actions): Adjust.
19307
817e9f41
AD
193082002-04-07 Akim Demaille <akim@epita.fr>
19309
19310 * tests/torture.at (Big triangle): New.
19311 (GNU AWK Grammar, GNU Cim Grammar): Move to...
19312 * tests/existing.at: here.
19313
5123689b
AD
193142002-04-07 Akim Demaille <akim@epita.fr>
19315
19316 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
19317 nritems.
19318 Adjust dependencies.
19319
f3849179
AD
193202002-04-07 Akim Demaille <akim@epita.fr>
19321
19322 * src/reader.c: Normalize increments to prefix form.
19323
bd02036a
AD
193242002-04-07 Akim Demaille <akim@epita.fr>
19325
19326 * src/reader.c, symtab.c: Remove debugging code.
19327
db8837cb
AD
193282002-04-07 Akim Demaille <akim@epita.fr>
19329
19330 Rename all the `bucket's as `symbol_t'.
19331
19332 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
19333 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
19334 * src/symtab.c, src/symtab.h (bucket): Rename as...
19335 (symbol_t): this.
19336 (symbol_list_new, bucket_check_defined, bucket_make_alias)
19337 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
19338 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19339 (buckets_new, buckets_free, buckets_do): Rename as...
19340 (symbol_list_new, symbol_check_defined, symbol_make_alias)
19341 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
19342 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
19343 (symbols_new, symbols_free, symbols_do): these.
19344
72a23c97
AD
193452002-04-07 Akim Demaille <akim@epita.fr>
19346
19347 Use lib/hash for the symbol table.
19348
19349 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
19350 EOF.
19351 * src/lex.c (lex): Set the `number' member of new terminals.
19352 * src/reader.c (bucket_check_defined, bucket_make_alias)
19353 (bucket_check_alias_consistence, bucket_translation): New.
19354 (reader, grammar_free, readgram, token_translations_init)
19355 (packsymbols): Adjust.
19356 (reader): Number the predefined tokens.
19357 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
19358 for predefined tokens.
19359 * src/symtab.h (bucket): Remove all the hash table related
19360 members.
19361 * src/symtab.c (symtab): Replace by...
19362 (bucket_table): this.
19363 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19364 (buckets_new, buckets_do): New.
19365
280a38c3
AD
193662002-04-07 Akim Demaille <akim@epita.fr>
19367
19368 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
19369 (start_symbol, max_user_token_number, semantic_parser)
19370 (error_token_number): Initialize.
19371 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
19372 Initialize.
19373 (reader): Don't.
19374 (errtoken, eoftoken, undeftoken, axiom): Extern.
19375
03b31c0c
AD
193762002-04-07 Akim Demaille <akim@epita.fr>
19377
19378 * src/gram.h (rule_s): prec and precsym are now pointers
19379 to the bucket giving the priority/associativity.
19380 Member `associativity' removed: useless.
19381 * src/reduce.c, src/conflicts.c: Adjust.
19382
8b3df748
AD
193832002-04-07 Akim Demaille <akim@epita.fr>
19384
19385 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
19386 Properly escape the symbols' TAG when outputting them.
19387
e601aa1d
AD
193882002-04-07 Akim Demaille <akim@epita.fr>
19389
19390 * src/lalr.h (LA): Is a bitsetv, not bitset*.
19391
b0299a2e
AD
193922002-04-07 Akim Demaille <akim@epita.fr>
19393
19394 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
19395 (LArule): this, which is an array to rule_t*.
19396 * src/print.c, src/conflicts.c: Adjust.
19397
d7e1f00c
AD
193982002-04-07 Akim Demaille <akim@epita.fr>
19399
19400 * src/gram.h (rule_t): Rename `number' as `user_number'.
19401 `number' is a new member.
19402 Adjust dependencies.
19403 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
19404
cc9305dd
AD
194052002-04-07 Akim Demaille <akim@epita.fr>
19406
19407 As a result of the previous patch, it is no longer needed
19408 to reorder ritem itself.
19409
19410 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
19411
b0940840
AD
194122002-04-07 Akim Demaille <akim@epita.fr>
19413
19414 Be sure never to walk through RITEMS, but use only data related to
19415 the rules themselves. RITEMS should be banished.
19416
19417 * src/output.c (output_token_translations): Rename as...
19418 (prepare_tokens): this.
19419 In addition to `translate', prepare the muscles `tname' and
19420 `toknum', which were handled by...
19421 (output_rule_data): this.
19422 Remove, and move the remainder of its outputs into...
19423 (prepare_rules): this new routines, which also merges content from
19424 (output_gram): this.
19425 (prepare_rules): Be sure never to walk through RITEMS.
19426 (output_stos): Rename as...
19427 (prepare_stos): this.
19428 (output): Always invoke prepare_states, after all, just don't use it
19429 in the output if you don't need it.
19430
643a5994
AD
194312002-04-07 Akim Demaille <akim@epita.fr>
19432
19433 * src/LR0.c (new_state): Display `nstates' as the name of the
19434 newly created state.
19435 Adjust to initialize first_state and last_state if needed.
19436 Be sure to distinguish the initial from the final state.
19437 (new_states): Create the itemset of the initial state, and use
19438 new_state.
19439 * src/closure.c (closure): Now that the initial state has its
19440 items properly set, there is no need for a special case when
19441 creating `ruleset'.
19442
19443 As a result, now the rule 0, reducing to $axiom, is visible in the
19444 outputs. Adjust the test suite.
19445
19446 * tests/conflicts.at (Solved SR Conflicts)
19447 (Unresolved SR Conflicts): Adjust.
19448 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
19449 * tests/conflicts.at (S/R in initial): New.
19450
b4c4ccc2
AD
194512002-04-07 Akim Demaille <akim@epita.fr>
19452
19453 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
19454 the RHS of the rules.
19455 * src/output.c (output_gram): Likewise.
19456
bba97eb2
AD
194572002-04-07 Akim Demaille <akim@epita.fr>
19458
19459 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
19460 bucket.
19461 Adjust all dependencies.
19462 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
19463 `number' of the buckets too.
19464 * src/gram.h: Include `symtab.h'.
19465 (associativity): Move to...
19466 * src/symtab.h: here.
19467 No longer include `gram.h'.
19468
c3b407f4
AD
194692002-04-07 Akim Demaille <akim@epita.fr>
19470
19471 * src/gram.h, src/gram.c (rules_rhs_length): New.
19472 (ritem_longest_rhs): Use it.
19473 * src/gram.h (rule_t): `number' is a new member.
19474 * src/reader.c (packgram): Set it.
19475 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
19476 the end of `rules', and count them out of `nrules'.
19477 (reduce_output, dump_grammar): Adjust.
19478 * src/print.c (print_grammar): It is no longer needed to check for
19479 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
19480 * tests/reduce.at (Reduced Automaton): New test.
19481
11652ab3
AD
194822002-04-07 Akim Demaille <akim@epita.fr>
19483
19484 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
19485 lacking `+ 1' to nrules, Bison reported as useless a token if it
19486 was used solely to set the precedence of the last rule...
19487
26b23c1a
AD
194882002-04-07 Akim Demaille <akim@epita.fr>
19489
19490 * data/bison.c++, data/bison.simple: Don't output the current file
19491 name in #line, to avoid useless diffs between two identical
19492 outputs under different names.
19493
18bcecb0
AD
194942002-04-07 Akim Demaille <akim@epita.fr>
19495
19496 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
19497 Normalize loops to using `< nrules + 1', not `<= nrules'.
19498
fa770c86
AD
194992002-04-07 Akim Demaille <akim@epita.fr>
19500
19501 * TODO: Update.
19502
d9b739c3
AD
195032002-04-07 Akim Demaille <akim@epita.fr>
19504
19505 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
19506 bucket.value as bucket.number.
19507
99013900
AD
195082002-04-07 Akim Demaille <akim@epita.fr>
19509
19510 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
19511 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19512 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
19513 RHS, instead of being an index in RITEMS.
19514
e966383b
PE
195152002-04-04 Paul Eggert <eggert@twinsun.com>
19516
19517 * doc/bison.texinfo: Update copyright date.
19518 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
19519 (Symbols): Warn about running Bison in one character set,
19520 but compiling and/or running in an incompatible one.
19521 Warn about character code 256, too.
19522
195232002-04-03 Paul Eggert <eggert@twinsun.com>
19524
19525 * src/bison.data (YYSTACK_ALLOC): Depend on whether
19526 YYERROR_VERBOSE is nonzero, not whether it is defined.
19527
19528 Merge changes from bison-1_29-branch.
c307773e 19529
8d6c48b9
PE
195302002-03-20 Paul Eggert <eggert@twinsun.com>
19531
19532 Merge fixes from Debian bison_1.34-1.diff.
19533
19534 * configure.in (AC_PREREQ): 2.53.
19535
e53c6322
AD
195362002-03-20 Akim Demaille <akim@epita.fr>
19537
19538 * src/conflicts.c (log_resolution): Argument `resolution' is const.
19539
9ffbeca7
PE
195402002-03-19 Paul Eggert <eggert@twinsun.com>
19541
21db0b2a
PE
19542 * src/bison.simple (YYCOPY): New macro.
19543 (YYSTACK_RELOCATE): Use it.
19544 Remove Type arg; no longer needed. All callers changed.
19545 (yymemcpy): Remove; no longer needed.
19546
9ffbeca7
PE
19547 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
19548 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
19549
642cb8f8
AD
195502002-03-19 Akim Demaille <akim@epita.fr>
19551
19552 Test and fix the #line outputs.
19553
19554 * tests/atlocal.at (GCC): New.
19555 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 19556 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
19557 (Action synch line, Epilogue synch line): New tests.
19558 * src/reader.c (parse_union_decl): Define the muscle stype_line.
19559 * data/bison.simple, data/bison.c++: Use it.
19560
3c31a486
AD
195612002-03-19 Akim Demaille <akim@epita.fr>
19562
19563 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
19564 (Solved SR Conflicts, %expect not enough, %expect right)
19565 (%expect too much): Move to...
19566 * tests/conflicts.at: this new file.
19567
0d8bed56
AD
195682002-03-19 Akim Demaille <akim@epita.fr>
19569
19570 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19571 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
19572 that we can move to enums for instance.
19573 * src/output.c (token_definitions_output): Output a list of
19574 `token-name, token-number' instead of the #define.
19575 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
19576
9208d17f
AD
195772002-03-14 Akim Demaille <akim@epita.fr>
19578
19579 Use Gettext 0.11.1.
19580
af27eacb
RA
195812002-03-09 Robert Anisko <robert@lrde.epita.fr>
19582
19583 * data/bison.c++: Make the user able to add members to the generated
19584 parser by subclassing.
19585
9101a310
RA
195862002-03-05 Robert Anisko <robert@lrde.epita.fr>
19587
19588 * src/reader.c (read_additionnal_code): `c' should be an integer, not
19589 a character.
19590 Reported by Nicolas Tisserand and Nicolas Burrus.
19591
fff9bf0b
RA
195922002-03-04 Robert Anisko <robert@lrde.epita.fr>
19593
19594 * src/reader.c: Warn about lacking semi-colons, do not complain.
19595
64dba31e
RA
195962002-03-04 Robert Anisko <robert@lrde.epita.fr>
19597
19598 * data/bison.c++: Remove a debug line.
19599
374f5a14
RA
196002002-03-04 Robert Anisko <robert@lrde.epita.fr>
19601
19602 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
19603 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
19604 provide a default implementation.
19605
bfcf1f3a
AD
196062002-03-04 Akim Demaille <akim@epita.fr>
19607
19608 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
19609 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
19610 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
19611 * tests/semantic.at (Parsing Guards): Similarly.
19612 * src/reader.at (readgram): Complain if the last rule is not ended
19613 with a semi-colon.
19614
65ccf9fc
AD
196152002-03-04 Akim Demaille <akim@epita.fr>
19616
19617 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
19618 * src/closure.c: here.
19619 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
19620 RTC.
19621 * src/warshall.h, src/warshall.c: Remove.
19622 * tests/sets.at (Broken Closure): Adjust.
19623
d0039cbc
AD
196242002-03-04 Akim Demaille <akim@epita.fr>
19625
19626 * src/output.c (output_skeleton): tempdir is const.
19627 bytes_read is unused.
19628
345cea78
AD
196292002-03-04 Akim Demaille <akim@epita.fr>
19630
19631 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19632 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
19633 Update.
19634 From Michael Hayes.
19635
564801f7
AD
196362002-03-04 Akim Demaille <akim@epita.fr>
19637
19638 * src/closure.c (closure): `r' is unused.
19639
e5352bc7
AD
196402002-03-04 Akim Demaille <akim@epita.fr>
19641
19642 * tests/sets.at (Broken Closure): Add the ending `;'.
19643 * src/reader.at (readgram): Complain if a rule is not ended with a
19644 semi-colon.
19645
914feea9
AD
196462002-03-04 Akim Demaille <akim@epita.fr>
19647
19648 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
19649 (count_sr_conflicts): Use bitset_count.
19650 * src/reduce.c (inaccessable_symbols): Ditto.
19651 (bits_size): Remove.
19652 * src/warshall.h, src/warshall.c: Convert to bitsetv.
19653
f0250de6
AD
196542002-03-04 Akim Demaille <akim@epita.fr>
19655
19656 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
19657 * src/reduce.c: Remove the `bitset_zero's following the
19658 `bitset_create's, as now it is performed by the latter.
19659
ef017502
AD
196602002-03-04 Akim Demaille <akim@epita.fr>
19661
19662 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
19663 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
19664 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
19665 latest sources from Michael.
19666
76514394
AD
196672002-03-04 Akim Demaille <akim@epita.fr>
19668
19669 * src/output.c (output): Don't free the grammar.
19670 * src/reader.c (grammar_free): New.
19671 * src/main.c (main): Call it and don't free symtab here.
19672
55024580
AD
196732002-03-04 Akim Demaille <akim@epita.fr>
19674
19675 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
19676 before returning.
19677 Reported by Benoit Perrot.
19678
f9abaa2c
AD
196792002-03-04 Akim Demaille <akim@epita.fr>
19680
19681 Use bitset operations when possible, not loops over bits.
19682
19683 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
19684 bitset_or.
19685 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
19686 * src/reduce.c (useless_nonterminals): Formatting changes.
19687 * src/warshall.c (TC): Use bitset_or.
19688
0e721e75
AD
196892002-03-04 Akim Demaille <akim@epita.fr>
19690
19691 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
19692 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
19693 Ditto.
19694
0fb1ffb1
AD
196952002-03-04 Akim Demaille <akim@epita.fr>
19696
19697 * src/lalr.c (F): Now a bitset*.
19698 Adjust all dependencies.
19699
b86796bf
AD
197002002-03-04 Akim Demaille <akim@epita.fr>
19701
19702 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
19703 Adjust all dependencies.
19704
602bbf31
AD
197052002-03-04 Akim Demaille <akim@epita.fr>
19706
19707 * src/L0.c, src/LR0.h (nstates): Be size_t.
19708 Adjust comparisons (signed vs unsigned).
19709 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
19710 bitset*.
19711 Adjust all dependencies.
19712
d8a0245c
AD
197132002-03-04 Akim Demaille <akim@epita.fr>
19714
19715 * src/closure.c (firsts): Now, also a bitset.
19716 Adjust all dependencies.
19717 (varsetsize): Remove, now unused.
19718 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
19719
34ba9743
AD
197202002-03-04 Akim Demaille <akim@epita.fr>
19721
19722 * src/print.c: Convert to use bitset.h, not hand coded iterations
19723 over ints.
19724
ed86e78c
AD
197252002-03-04 Akim Demaille <akim@epita.fr>
19726
19727 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
19728
dfdb1797
AD
197292002-03-04 Akim Demaille <akim@epita.fr>
19730
19731 * src/closure.c (ruleset): Be a bitset.
19732 (rulesetsize): Remove.
19733
7086e707
AD
197342002-03-04 Akim Demaille <akim@epita.fr>
19735
19736 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19737 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
19738 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
19739 * src/closure.c (fderives): Be an array of bitsets.
19740
98254360
RA
197412002-02-28 Robert Anisko <robert@lrde.epita.fr>
19742
19743 * data/bison.c++: Merge the two generated headers. Insert a copyright
19744 notice in each output file.
19745
a75c057f
AD
197462002-02-28 Akim Demaille <akim@epita.fr>
19747
19748 * data/bison.c++: Copy the prologue of bison.simple to fetch
19749 useful M4 definitions, such as b4_header_guard.
19750
06b00abc
AD
197512002-02-25 Akim Demaille <akim@epita.fr>
19752
19753 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
19754 translator friendly scheme for the bgr
19755 copyright notice.
06b00abc 19756
70e7d534
AD
197572002-02-25 Akim Demaille <akim@epita.fr>
19758
19759 * src/output.c (header_output): Remove, now handled completely via
19760 M4.
19761
abe017f6
AD
197622002-02-25 Akim Demaille <akim@epita.fr>
19763
19764 * m4/m4.m4: New, from CVS Autoconf.
19765 * configure.in: Invoke it.
19766 * src/output.c (output_skeleton): Use its result instead of the
19767 hard coded name.
19768
381fb12e
AD
197692002-02-25 Akim Demaille <akim@epita.fr>
19770
19771 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
19772 Fileutils 4.1.5.
19773 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
19774 * src/output.c (output_skeleton): Use mkstemp to create a real
19775 temporary file.
19776 Move the filling of `skeleton' and its muscle to...
19777 (prepare): here.
19778 (output): Move the definition of the prologue muscle to...
19779 (prepare): here.
19780 * src/system.h (DEFAULT_TMPDIR): New.
19781
6f38107f
PE
197822002-02-14 Paul Eggert <eggert@twinsun.com>
19783
19784 Remove the support for C++ namespace cleanliness; it was
19785 causing more problems than it was curing, since it didn't work
19786 properly on some nonstandard C++ compilers. This can wait
19787 for a proper C++ parser.
19788
19789 * NEWS: Document this.
19790 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
19791 of C++, as it's treated like C now.
19792 * src/bison.simple (YYSTD): Remove.
19793 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
19794 Treat C++ just like Standard C instead of trying to support
19795 namespace cleanliness.
19796
80cce3da
AD
197972002-02-14 Akim Demaille <akim@epita.fr>
19798
19799 * tests/regression.at (else): Adjust to Andreas' change.
19800
842e8679
AD
198012002-02-14 Akim Demaille <akim@epita.fr>
19802
19803 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
19804
4bda3f10
AD
198052002-02-13 Andreas Schwab <schwab@suse.de>
19806
19807 * src/output.c (output_rule_data): Don't output NULL, it might
19808 not be defined yet.
19809
4162fa07 198102002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 19811
4162fa07
RA
19812 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
19813 (Copyright notice): Update.
b418ecd8 19814
bd16a5dc
AD
198152002-02-11 Akim Demaille <akim@epita.fr>
19816
19817 * tests/regression.at (%nonassoc and eof): Don't include
19818 nonportable headers.
19819
8d69a1a3
RA
198202002-02-08 Robert Anisko <robert@lrde.epita.fr>
19821
19822 * data/bison.c++: Correct error recovery. Make the user able to
19823 initialize the starting location.
19824
9b2d0677
AD
198252002-02-07 Akim Demaille <akim@epita.fr>
19826
19827 * tests/input.at: New.
19828
69e2658b
RA
198292002-02-07 Robert Anisko <robert@lrde.epita.fr>
19830
19831 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 19832 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
19833 directives around tables only needed for debugging.
19834
4aacc3a7
RA
198352002-02-07 Robert Anisko <robert@lrde.epita.fr>
19836
19837 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
19838 C++ parsers.
19839 (yy::b4_name::parse): Use print_.
19840
762a801e
RA
198412002-02-07 Robert Anisko <robert@lrde.epita.fr>
19842
19843 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
19844
4bb2bc3f
RA
198452002-02-07 Robert Anisko <robert@lrde.epita.fr>
19846
19847 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
19848 C++ parsers.
19849 (yy::b4_name::parse): Build verbose error messages, and use error_.
19850
6b45a3ca
RA
198512002-02-06 Robert Anisko <robert@lrde.epita.fr>
19852
19853 * data/bison.c++: Fix m4 quoting in comments.
19854
50997c6e
RA
198552002-02-06 Robert Anisko <robert@lrde.epita.fr>
19856
19857 * data/bison.c++: Adjust the parser code. Fix some muscles that were
19858 not expanded by m4.
19859
3f3eed27
AD
198602002-02-05 Akim Demaille <akim@epita.fr>
19861
19862 * data/bison.c++: Adjust to the M4 back end.
19863 More is certainly needed.
19864
be2a1a68
AD
198652002-02-05 Akim Demaille <akim@epita.fr>
19866
19867 Give a try to M4 as a back end.
19868
19869 * lib/readpipe.c: New, from wdiff.
19870 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
19871 BISON_HAIRY.
19872 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
19873 specific values. Now it is m4 that performs the lookup.
19874 * src/parse-skel.y: Remove.
19875 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
19876 * src/output.c (actions_output, guards_output)
19877 (token_definitions_output): No longer keeps track of the output
19878 line number, hence remove the second argument.
19879 (guards_output): Check against the guard member of a rule, not the
19880 action member.
19881 Adjust callers.
19882 (output_skeleton): Don't look for the skeleton location, let m4 do
19883 that.
19884 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
19885 file will be used.
19886 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
19887 (prepare): Given that for the time being changesyntax is not
19888 usable in M4, rename the muscles using `-' to `_'.
19889 Define `defines_flag', `output_parser_name' and `output_header_name'.
19890 * src/output.h (actions_output, guards_output)
19891 (token_definitions_output): Adjust prototypes.
19892 * src/scan-skel.l: Instead of scanning the skeletons, it now
19893 processes the output of m4: `__oline__' and `#output'.
19894 * data/bison.simple: Adjust to be used by M4(sugar).
19895 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
19896 to date.
19897 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
19898 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
19899 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
19900 shamelessly stolen from CVS Autoconf.
19901
beda758b
AD
199022002-02-05 Akim Demaille <akim@epita.fr>
19903
19904 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
19905 * configure.in: Check for the declarations of free and malloc.
19906 * src/muscle_tab.c: Adjust.
19907
5ece6d43
AD
199082002-02-05 Akim Demaille <akim@epita.fr>
19909
19910 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
19911 which have no values.
19912
5bb18f9a
AD
199132002-02-05 Akim Demaille <akim@epita.fr>
19914
19915 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
19916 * data/: here.
19917
894dd62e
PE
199182002-01-29 Paul Eggert <eggert@twinsun.com>
19919
19920 * src/bison.simple (YYSIZE_T): Do not define merely because
19921 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
19922 On some platforms, <alloca.h> does not declare YYSTD (size_t).
19923
82841af7
AD
199242002-01-27 Akim Demaille <akim@epita.fr>
19925
19926 Fix `%nonassoc and eof'.
19927
19928 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
19929 which were not properly copied! Replace
19930 memcpy (res->errs, src->errs, src->nerrs);
19931 with
19932 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
19933 !!!
19934 * tests/regression.at (%nonassoc and eof): Adjust to newest
19935 Autotest: `.' is not in the PATH.
19936
318b76e9
AD
199372002-01-27 Akim Demaille <akim@epita.fr>
19938
19939 * tests/sets.at (AT_EXTRACT_SETS): New.
19940 (Nullable): Use it.
19941 (Firsts): New.
19942
30d2f3d5
AD
199432002-01-26 Akim Demaille <akim@epita.fr>
19944
19945 * tests/actions.at, tests/calc.at, tests/headers.at,
19946 * tests/torture.at: Adjust to the newest Autotest which no longer
19947 forces `.' in the PATH.
19948
30f8c395
AD
199492002-01-25 Akim Demaille <akim@epita.fr>
19950
19951 * tests/regression.at (%nonassoc and eof): New.
19952 Suggested by Robert Anisko.
19953
29ae55f1
AD
199542002-01-24 Akim Demaille <akim@epita.fr>
19955
19956 Bison dumps core when trying to complain about broken input files.
19957 Reported by Cris van Pelt.
19958
19959 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
19960 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
19961 into...
19962 (Invalid inputs): Strengthen: exercise parse_percent_token.
19963
2b548aa6
RA
199642002-01-24 Robert Anisko <robert.anisko@epita.fr>
19965
19966 * src/Makefile.am: Add bison.c++.
19967 * src/bison.c++: New skeleton.
19968
bb0146c2
AD
199692002-01-21 Paolo Bonzini <bonzini@gnu.org>
19970
19971 * po/it.po: New.
19972
bec30531
AD
199732002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
19974
19975 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
19976
fc6edc45
MA
199772002-01-20 Marc Autret <marc@gnu.org>
19978
19979 * src/files.c (compute_output_file_names): Fix
19980
5e5d5415
MA
199812002-01-20 Marc Autret <marc@gnu.org>
19982
19983 * tests/output.at: New test.
19984 * src/files.c (compute_base_names): Don't map extensions when
19985 the YACC flag is set, use defaults.
19986 Reported by Evgeny Stambulchik.
19987
44ea3fbd
MA
199882002-01-20 Marc Autret <marc@gnu.org>
19989
ba0fe3c7
PE
19990 * src/system.h: Need to define __attribute__ away for non-GCC
19991 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
19992 Suggested by Albert Chin-A-Young.
19993
338963d1
TVH
199942002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
19995
19996 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
19997 canonical definition.
19998 * src/system.h: Use the canonical definition for PARAMS (avoids
19999 a conflict with the macro from lib/hash.h).
20000
c57b2479
AD
200012002-01-11 Akim Demaille <akim@epita.fr>
20002
20003 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 20004 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 20005
b85810ae
AD
200062002-01-09 Akim Demaille <akim@epita.fr>
20007
20008 * src/files.c, src/files.h (output_infix): New.
20009 (tab_extension): Remove.
20010 (compute_base_names): Compute the former, drop the latter.
20011 * src/output.c (prepare): Insert the muscles `output-infix', and
20012 `output-suffix'.
20013 * src/parse-skel.y (string, string.1): New.
20014 (section.header): Use it.
20015 (section.yacc): Remove.
20016 (prefix): Remove too.
20017 * src/scan-skel.l: Adjust.
20018 * src/bison.simple, src/bison.hairy: Adjust.
20019
cae60122
AD
200202002-01-09 Akim Demaille <akim@epita.fr>
20021
20022 * configure.in (WERROR_CFLAGS): Compute it.
20023 * src/Makefile.am (CFLAGS): Pass it.
20024 * tests/atlocal.in (CFLAGS): Idem.
20025 * src/files.c: Fix a few warnings.
20026 (get_extension_index): Remove, unused.
20027
ae404801
AD
200282002-01-08 Akim Demaille <akim@epita.fr>
20029
20030 * src/getargs.c (AS_FILE_NAME): New.
20031 (getargs): Use it to convert DOSish file names.
20032 * src/files.c (base_name): Rename as full_base_name to avoid
20033 clashes with `base_name ()'.
20034 (filename_split): New.
20035 (compute_base_names): N-th rewrite, using filename_split.
20036
22312b71
AD
200372002-01-08 Akim Demaille <akim@epita.fr>
20038
20039 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
20040 New, stolen from the Fileutils 4.1.
20041 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20042 * configure.in: Check for the presence of memrchr, and of its
20043 prototype.
20044
a67cef01
TVH
200452002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
20046
20047 * lib/hash.h (__P): Added definition for this macro.
20048 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
20049 BUILT_SOURCES, to ensure they are generated first.
20050 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
20051 %error-verbose to allow bootstrapping with bison 1.30x.
20052
2b25d624
AD
200532002-01-06 Akim Demaille <akim@epita.fr>
20054
20055 * src/reader.c (parse_braces): Don't fetch the next char, the
20056 convention is to fetch on entry.
20057 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
20058 'switch' without a following semicolon.
20059 * tests/regression.at (braces parsing): New.
20060
3460813b
AD
200612002-01-06 Akim Demaille <akim@epita.fr>
20062
20063 Bison is dead wrong in its RR conflict reports.
20064
20065 * tests/torture.at (GNU Cim Grammar): New.
20066 * src/conflicts.c (count_rr_conflicts): Fix.
20067
73784c64
AD
200682002-01-06 Akim Demaille <akim@epita.fr>
20069
20070 Creating package.m4 from configure.ac causes too many problems.
20071
20072 * tests/Makefile.am (package.m4): Create it by hand,
20073 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
20074
25d81090
AD
200752002-01-06 Akim Demaille <akim@epita.fr>
20076
20077 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
20078 skeleton.h.
20079
a9b8959e
PE
200802002-01-04 Paul Eggert <eggert@twinsun.com>
20081
20082 * doc/bison.texinfo (Debugging):
20083 Remove YYSTDERR; it's no longer defined or used.
20084 Also, s/cstdio.h/cstdio/.
20085
25d81090
AD
200862002-01-03 Akim Demaille <akim@epita.fr>
20087
20088 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
20089
1109455c
AD
200902002-01-03 Akim Demaille <akim@epita.fr>
20091
20092 * src/parse-skel.y (process_skeleton): Don't bind the parser's
20093 tracing code to --trace, wait for a better --trace option, with
20094 args.
20095
7ea5e977
AD
200962002-01-03 Akim Demaille <akim@epita.fr>
20097
20098 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
20099 The ISO C++ standard is extremely clear about it: stderr is
20100 considered a macro, not a regular symbol (see table 94 `Header
20101 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
20102 Therefore std:: does not apply to it. It still does with fprintf.
20103 Also, s/cstdio.h/cstdio/.
20104
fab5b110
AD
201052002-01-03 Akim Demaille <akim@epita.fr>
20106
20107 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
20108 for non system headers.
20109
aed7fd9b
AD
201102002-01-02 Akim Demaille <akim@epita.fr>
20111
20112 Equip the skeleton chain with location tracking, runtime trace,
20113 pure parser and scanner.
20114
20115 * src/parse-skel.y: Request a pure parser, locations, and prefix
20116 renaming.
20117 (%union): Having several members with the same type does not help
20118 type mismatches, simplify.
20119 (YYPRINT, yyprint): New.
20120 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
20121 (skel_error): this.
20122 Handle locations.
20123 * src/scan-skel.l: Adjust to these changes.
20124 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
20125 (LOCATION_PRINT, skel_control_t): New.
20126
24fad99e
AD
201272001-12-30 Akim Demaille <akim@epita.fr>
20128
20129 * src/parse-skel.y: Get rid of the shift/reduce conflict:
20130 replace `gb' with BLANKS.
20131 * src/scan-skel.l: Adjust.
20132
a4b36db4
AD
201332001-12-30 Akim Demaille <akim@epita.fr>
20134
20135 * src/system.h: We don't need nor want bcopy.
20136 Throw away MS-DOS crap: we don't need getpid.
20137 * configure.in: We don't need strndup. It was even causing
20138 problems: because Flex includes the headers *before* us,
20139 _GNU_SOURCE is not defined by config.h, and therefore strndup was
20140 not visible.
20141 * lib/xstrndup.c: New.
20142 * src/scan-skel.l: Use it.
20143 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
20144 * src/parse-skel.y: Use %directives instead of #defines.
20145
1239777d
AD
201462001-12-30 Akim Demaille <akim@epita.fr>
20147
20148 * src/skeleton.h: New.
20149 * src/output.c (output_parser, output_master_parser): Remove, dead
20150 code.
20151 * src/output.h (get_lines_number, actions_output, guards_output)
20152 (token_definitions_output): Prototype them.
20153 * src/parse-skel.y: Add the license notice.
20154 Include output.h and skeleton.h.
20155 (process_skeleton): Returns void, and takes a single parameter.
20156 * src/scan-skel.l: Add the license notice.
20157 Include skeleton.h.
20158 Don't use %option yylineno: it seems that then Flex imagines
20159 REJECT has been used, and therefore it won't reallocate its
20160 buffers (which makes no other sense to me than a bug). It results
20161 in warnings for `unused: yy_flex_realloc'.
20162
9b3add5b
RA
201632001-12-30 Robert Anisko <robert.anisko@epita.fr>
20164
20165 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20166 (MUSCLE_INSERT_PREFIX): ...to there.
20167 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20168 (MUSCLE_INSERT_PREFIX): Move from here...
20169
20170 * src/bison.hairy: Add a section directive. Put braces around muscle
20171 names. This parser skeleton is still broken, but Bison should not
20172 choke on a bad muscle 'syntax'.
20173 * src/bison.simple: Add a section directive. Put braces around muscle
20174 names.
20175
20176 * src/files.h (strsuffix, stringappend): Add declarations.
20177 (tab_extension): Add declaration.
20178 (short_base_name): Add declaration.
20179
20180 * src/files.c (strsuffix, stringappend): No longer static. These
20181 functions are used in the skeleton parser.
20182 (tab_extension): New.
20183 (compute_base_names): Use the computations done in this function
fab5b110 20184 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
20185 names.
20186 (short_base_name): No longer static.
20187
20188 * src/output.c (output_skeleton): New.
20189 (output): Disable call to output_master_parser, and give a try to
20190 a new skeleton handling system.
20191 (guards_output, actions_output): No longer static.
20192 (token_definitions_output, get_lines_number): No longer static.
20193
20194 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
20195
fab5b110 20196 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
20197 parse-skel.y.
20198
20199 * src/parse-skel.y: New file.
20200 * src/scan-skel.l: New file.
20201
b5b61c61
AD
202022001-12-29 Akim Demaille <akim@epita.fr>
20203
20204 %name-prefix is broken.
20205
20206 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
20207 Adjust all dependencies.
20208 * tests/headers.at (export YYLTYPE): Strengthen this test: use
20209 %name-prefix.
20210
20211 Renaming yylval but not yylloc is not consistent. Now we do.
20212
20213 * src/bison.simple: Prefix yylloc if used.
20214 * doc/bison.texinfo (Decl Summary): Document that.
20215
8c9a50be
AD
202162001-12-29 Akim Demaille <akim@epita.fr>
20217
20218 * doc/bison.texinfo: Promote `%long-directive' over
20219 `%long_directive'.
20220 Remove all references to fixed-output-files, yacc is enough.
20221
d99361e6
AD
202222001-12-29 Akim Demaille <akim@epita.fr>
20223
20224 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
20225 user prologue. These are defaults.
20226 * tests/actions.at (Mid-rule actions): Make sure the user can
20227 define YYDEBUG and YYERROR_VERBOSE.
20228
b9cecb91
AD
202292001-12-29 Akim Demaille <akim@epita.fr>
20230
20231 * src/output.c (header_output): Don't forget to export YYLTYPE and
20232 yylloc.
20233 * tests/headers.at (export YYLTYPE): New, make sure it does.
20234 * tests/regression.at (%union and --defines, Invalid CPP headers):
20235 Move to...
20236 * tests/headers.at: here.
20237
aea13e97
AD
202382001-12-29 Akim Demaille <akim@epita.fr>
20239
20240 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
20241
931394cb
AD
202422001-12-29 Akim Demaille <akim@epita.fr>
20243
20244 * tests/actions.at (Mid-rule actions): Output on a single line
20245 instead of several.
20246
704a47c4
AD
202472001-12-29 Akim Demaille <akim@epita.fr>
20248
20249 * doc/bison.texinfo: Formatting changes.
20250
091e20bb
AD
202512001-12-29 Akim Demaille <akim@epita.fr>
20252
20253 Don't store the token defs in a muscle, just be ready to output it
20254 on command. Now possible via `symbols'. Fixes a memory leak.
20255
20256 * src/output.c (token_definitions_output): New.
20257 (output_parser, header_output): Use it.
20258 * src/reader.c (symbols_save): Remove.
20259
cce71710
AD
202602001-12-29 Akim Demaille <akim@epita.fr>
20261
20262 * src/bison.simple: Do not provide a default for YYSTYPE and
20263 YYLTYPE before the user's prologue. Otherwise it's hardly... a
20264 default.
20265
82c035a8
AD
202662001-12-29 Akim Demaille <akim@epita.fr>
20267
20268 Mid-rule actions are simply... ignored!
20269
20270 * src/reader.c (readgram): Be sure to attach mid-rule actions to
20271 the empty-rule associated to the dummy symbol, not to the host
20272 rule.
20273 * tests/actions.at (Mid-rule actions): New.
20274
8419d367
AD
202752001-12-29 Akim Demaille <akim@epita.fr>
20276
20277 Memory leak.
20278
20279 * src/reader.c (reader): Free grammar.
20280
375d5806
AD
202812001-12-29 Akim Demaille <akim@epita.fr>
20282
20283 Memory leak.
20284
20285 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
20286 since it allocates it for each state, although only one is needed.
20287 (allocate_storage): Do it here.
20288
f51cb8ff
AD
202892001-12-29 Akim Demaille <akim@epita.fr>
20290
20291 * src/options.h, src/options.c (create_long_option_table): Rename
20292 as...
20293 (long_option_table_new): this, with a clearer prototype.
20294 (percent_table): Remove, unused,
20295 * src/getargs.c (getargs): Adjust.
20296
29e88316
AD
202972001-12-29 Akim Demaille <akim@epita.fr>
20298
20299 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
20300 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
20301 as states.
20302
b9f71f19
AD
203032001-12-29 Akim Demaille <akim@epita.fr>
20304
20305 * src/lalr.c (build_relations): Rename `states' as `states1'.
20306 Sorry, I don't understand exactly what it is, no better name...
20307
1a2b5d37
AD
203082001-12-29 Akim Demaille <akim@epita.fr>
20309
20310 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
20311 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
20312 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
20313 as rules.
20314
1cca533e
AD
203152001-12-29 Akim Demaille <akim@epita.fr>
20316
20317 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
20318 ago.
20319
c03ae966
AD
203202001-12-29 Akim Demaille <akim@epita.fr>
20321
20322 * src/reader.c, src/reader.h (user_toknums): Remove.
20323 Adjust all users to use symbols[i]->user_token_number.
20324
5a670b1e
AD
203252001-12-29 Akim Demaille <akim@epita.fr>
20326
20327 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
20328 Adjust all users to use symbols[i]->prec or ->assoc.
20329
ad949da9
AD
203302001-12-29 Akim Demaille <akim@epita.fr>
20331
20332 * src/reader.c, src/reader.h (tags): Remove.
20333 Adjust all users to use symbols[i]->tag.
20334
0e78e603
AD
203352001-12-29 Akim Demaille <akim@epita.fr>
20336
20337 * src/gram.h, src/gram.c (symbols): New, similar to state_table
20338 and rule_table.
20339 * src/reader.c (packsymbols): Fill this table.
20340 Drop sprec.
20341 * src/conflicts.c (resolve_sr_conflict): Adjust.
20342 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
20343 single table.
20344 Use symbols[i]->tag instead of tags[i].
20345
213e640e
AD
203462001-12-29 Akim Demaille <akim@epita.fr>
20347
20348 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
20349 In addition, put a comment in there, to replace...
20350 * tests/regression.at (%union and C comments): Remove.
20351
e7b8bef1
AD
203522001-12-29 Akim Demaille <akim@epita.fr>
20353
20354 * tests/regression.at (Web2c Actions): Blindly move the actual
20355 output as expected output. The contents *seem* right to me, but I
20356 can't pretend reading perfectly parser tables... Nonetheless, all
20357 the other tests pass correctly, the table look OK, even though the
20358 presence of `$axiom' is to be noted: AFAICS it is useless (but
20359 harmless).
20360
b68e7744
AD
203612001-12-29 Akim Demaille <akim@epita.fr>
20362
20363 * src/reader.c (readgram): Don't add the rule 0 if there were no
20364 rules read. In other words, add it _after_ having performed
20365 grammar sanity checks.
20366 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
20367
78d5bae9
AD
203682001-12-29 Akim Demaille <akim@epita.fr>
20369
20370 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
20371 visible, and some states have now a different number.
20372
ff442794
AD
203732001-12-29 Akim Demaille <akim@epita.fr>
20374
20375 * src/reader.c (readgram): Bind the initial rule's lineno to that
20376 of the first rule.
20377 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
20378 (Solved SR Conflicts): Adjust rule 0's line number.
20379
610ab194
AD
203802001-12-29 Akim Demaille <akim@epita.fr>
20381
20382 Fix the `GAWK Grammar' failure.
20383
20384 * src/LR0.c (final_state): Initialize to -1 so that we do compute
20385 the reductions of the first state which was mistakenly confused
20386 with the final state because precisely final_state was initialized
20387 to 0.
20388 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
20389 now noticed by Bison.
20390 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
20391 have a reduction on $default.
20392
29d29c8f
AD
203932001-12-29 Akim Demaille <akim@epita.fr>
20394
20395 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
20396 rule line numbers.
20397 * src/closure.c (print_closure): Likewise.
20398 * src/derives.c (print_derives): Likewise.
20399 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
20400 now.
20401
7c6b64d0
AD
204022001-12-29 Akim Demaille <akim@epita.fr>
20403
20404 * src/lalr.c (lookaheads_print): New.
20405 (lalr): Call it when --trace-flag.
20406 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
20407 are dumped.
20408
3d4daee3
AD
204092001-12-29 Akim Demaille <akim@epita.fr>
20410
20411 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
20412 when walking through ritem, even via rule->rhs.
20413 * src/reduce.c (dump_grammar, useful_production, reduce_output)
20414 (useful_production, useless_nonterminals): Likewise.
20415 (reduce_grammar_tables): Likewise, plus update nritems.
20416 * src/nullable.c (set_nullable): Likewise.
20417 * src/lalr.c (build_relations): Likewise.
20418 * tests/sets.at (Nullable): Adjust.
20419 Fortunately, now, the $axiom is no longer nullable.
20420
9e7f6bbd
AD
204212001-12-29 Akim Demaille <akim@epita.fr>
20422
20423 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
20424 the 0-sentinel.
20425 * src/gram.c (ritem_longest_rhs): Likewise.
20426 * src/reduce.c (nonterminals_reduce): Likewise.
20427 * src/print_graph.c (print_graph): Likewise.
20428 * src/output.c (output_rule_data): Likewise.
20429 * src/nullable.c (set_nullable): Likewise.
20430
255ef638
AD
204312001-12-29 Akim Demaille <akim@epita.fr>
20432
20433 * src/output.c: Comment changes.
20434
0d8a7363
AD
204352001-12-27 Paul Eggert <eggert@twinsun.com>
20436
20437 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
20438 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
20439 Sparc, as they were causing more porting problems than the
20440 (minor) performance improvement was worth.
20441
20442 Also, catch up with 1.31's YYSTD.
20443
3db472b9
AD
204442001-12-27 Akim Demaille <akim@epita.fr>
20445
20446 * src/output.c (output_gram): Rely on nritems, not the
20447 0-sentinel. See below.
20448 Use -1 as separator, not 0.
20449 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
20450 Rely on -1 as separator in yyrhs, instead of 0.
20451 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
20452 twice `Now at end of input', therefore there are two lines less to
20453 expect.
20454
b365aa05
AD
204552001-12-27 Akim Demaille <akim@epita.fr>
20456
20457 * tests/regression.at (Unresolved SR Conflicts):
20458 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
20459 below.
20460
30171f79
AD
204612001-12-27 Akim Demaille <akim@epita.fr>
20462
20463 * src/LR0.c (new_state): Recognize the final state by the fact it
20464 is reached by eoftoken.
20465 (insert_start_shifting_state, insert_eof_shifting_state)
20466 (insert_accepting_state, augment_automaton): Remove, since now
20467 these states are automatically computed from the initial state.
20468 (generate_states): Adjust.
20469 * src/print.c: When reporting a rule number to the user, substract
20470 1, so that the axiom rule is rule 0, and the first user rule is 1.
20471 * src/reduce.c: Likewise.
20472 * src/print_graph.c (print_core): For the time being, just as for
20473 the report, depend upon --trace-flags to dump the full set of
20474 items.
20475 * src/reader.c (readgram): Once the grammar read, insert the rule
20476 0: `$axiom: START-SYMBOL $'.
20477 * tests/set.at: Adjust: rule 0 is now displayed, and since the
20478 number of the states has changed (the final state is no longer
20479 necessarily the last), catch up.
20480
75142d45
AD
204812001-12-27 Akim Demaille <akim@epita.fr>
20482
20483 Try to make the use of the eoftoken valid. Given that its value
20484 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
20485 is used instead of > 0 where appropriate, (ii), depend upon nritems
20486 instead of the 0-sentinel.
20487
20488 * src/gram.h, src/gram.c (nritems): New.
20489 Expected to be duplication of nitems, but for the time being...
20490 * src/reader.c (packgram): Assert nritems and nitems are equal.
20491 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
20492 * src/closure.c (print_closure, print_fderives): Likewise.
20493 * src/gram.c (ritem_print): Likewise.
20494 * src/print.c (print_core, print_grammar): Likewise.
20495 * src/print_graph.c: Likewise.
20496
b7c49edf
AD
204972001-12-27 Akim Demaille <akim@epita.fr>
20498
20499 * src/main.c (main): If there are complains after grammar
20500 reductions, then output the report anyway if requested, then die.
20501 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
20502 * src/reader.c (eoftoken): New.
20503 (parse_token_decl): If the token being defined has value `0', it
20504 is the eoftoken.
20505 (packsymbols): No longer hack `tags' to insert `$' by hand.
20506 Be sure to preserve the value of the eoftoken.
20507 (reader): Make sure eoftoken is defined.
20508 Initialize nsyms to 0: now eoftoken is created just like the others.
20509 * src/print.c (print_grammar): Don't special case the eof token.
20510 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
20511 lie anyway, albeit pleasant.
20512 * tests/calc.at: Exercise error messages with eoftoken.
20513 Change the grammar so that empty input is invalid.
20514 Adjust expectations.
20515 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
20516
ec2da99f
AD
205172001-12-27 Akim Demaille <akim@epita.fr>
20518
20519 * configure.in: Check the protos of strchr ans strspn.
20520 Replace strchr if needed.
20521 * src/system.h: Provide the protos of strchr, strspn and memchr if
20522 missing.
20523 * lib/strchr.c: New.
20524 * src/reader.c (symbols_save): Use strchr.
20525
8adfa272
AD
205262001-12-27 Akim Demaille <akim@epita.fr>
20527
20528 * src/print.c, src/print_graph.c (escape): New.
20529 Use it to quote the TAGS outputs.
20530 * src/print_graph.c (print_state): Now errors are in red, and
20531 reductions in green.
20532 Prefer high to wide: output the state number on a line of its own.
20533
80dac38c
AD
205342001-12-27 Akim Demaille <akim@epita.fr>
20535
20536 * src/state.h, src/state.c (reductions_new): New.
20537 * src/LR0.c (set_state_table): Let all the states have a
20538 `reductions', even if reduced to 0.
20539 (save_reductions): Adjust.
20540 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
20541 * src/print.c (print_reductions, print_actions): Adjust.
20542 * src/output.c (action_row): Adjust.
20543
2cec70b9
AD
205442001-12-27 Akim Demaille <akim@epita.fr>
20545
20546 * src/state.h, src/state.c (errs_new, errs_dup): New.
20547 * src/LR0.c (set_state_table): Let all the states have an errs,
20548 even if reduced to 0.
20549 * src/print.c (print_errs, print_reductions): Adjust.
20550 * src/output.c (output_actions, action_row): Adjust.
20551 * src/conflicts.c (resolve_sr_conflict): Adjust.
20552
13ca549a
AD
205532001-12-27 Akim Demaille <akim@epita.fr>
20554
20555 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
20556
5092aba5
AD
205572001-12-27 Akim Demaille <akim@epita.fr>
20558
20559 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
20560 * src/print.c: here.
20561 (lookaheadset, shiftset): New, used as additional storage by
20562 print_reductions.
20563 (print_results): Adjust.
20564 (print_shifts, print_gotos, print_errs): New, extracted from...
20565 (print_actions): here.
20566 * src/print_graph.c (print_actions): Remove dead code.
20567
11e2beca
AD
205682001-12-27 Akim Demaille <akim@epita.fr>
20569
20570 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
20571 `$n' and `@n'.
20572
dac3c910
AD
205732001-12-27 Akim Demaille <akim@epita.fr>
20574
20575 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
20576 (build_relations): Adjust.
20577
d0b0fefa
AD
205782001-12-27 Akim Demaille <akim@epita.fr>
20579
20580 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
20581 duplication.
20582
adc8c848
AD
205832001-12-27 Akim Demaille <akim@epita.fr>
20584
20585 * src/reader.c (packgram): Catch nitems overflows.
20586
14d293ac
AD
205872001-12-27 Akim Demaille <akim@epita.fr>
20588
20589 * src/files.c, src/files.h (guard_obstack): Remove.
20590 * src/output.c (output): Adjust.
20591 * src/reader.c (parse_braces): New, factoring...
20592 (copy_action, copy_guard): these two which are renamed as...
20593 (parse_action, parse_guard): these.
20594 As a voluntary consequence, using braces around guards is now
20595 mandatory.
20596
f499b062
AD
205972001-12-27 Akim Demaille <akim@epita.fr>
20598
20599 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
20600 * src/reader.c (symbol_list): `guard' and `guard_line' are new
20601 members.
20602 (symbol_list_new): Adjust.
20603 (copy_action): action_line is the first line, not the last.
20604 (copy_guard): Just as for actions, store the `action' only, not
20605 the switch/case/break flesh.
20606 Don't parse the user action that might follow the guard, let...
20607 (readgram): do it, i.e., now, there can be an action after a
20608 guard.
20609 In other words the guard is just explicitly optional.
20610 (packgram): Adjust.
20611 * src/output.c (guards_output): New.
20612 (output_parser): Call it when needed.
20613 (output): Also free the guard and attrs obstacks.
20614 * src/files.c, src/files.h (obstack_save): Remove.
20615 (output_files): Remove.
20616 As a result, if one needs the former `.act' file, using an
20617 appropriate skeleton which requires actions and guards is now
20618 required.
20619 * src/main.c (main): Adjust.
20620 * tests/semantic.at: New.
20621 * tests/regression.at: Use `input.y' as input file name.
20622 Avoid 8+3 problems by requiring input.c when the test needs the
20623 parser.
20624
d945f5cd
AD
206252001-12-27 Akim Demaille <akim@epita.fr>
20626
20627 * src/reader.c (symbol_list_new): Be sure to initialize all the
20628 fields.
20629
d200e455
AD
206302001-12-27 Akim Demaille <akim@epita.fr>
20631
20632 All the hacks using a final pseudo state are now useless.
20633
20634 * src/LR0.c (set_state_table): state_table holds exactly nstates.
20635 * src/lalr.c (nLA): New.
20636 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
20637 instead of lookaheadsp from the pseudo state (nstate + 1).
20638
f9507c28
AD
206392001-12-27 Akim Demaille <akim@epita.fr>
20640
20641 * src/output.c (action_row, token_actions): Use a state_t instead
20642 of a integer, and nlookaheads instead of the following state's
20643 lookaheadsp.
20644
065fbd27
AD
206452001-12-27 Akim Demaille <akim@epita.fr>
20646
20647 * src/conflicts.c (log_resolution, flush_shift)
20648 (resolve_sr_conflict, set_conflicts, solve_conflicts)
20649 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
20650 (conflicts_print, print_reductions): Use a state_t instead of an
20651 integer when referring to a state.
20652 As much as possible, depend upon nlookaheads, instead of the
20653 `lookaheadsp' member of the following state (since lookaheads of
20654 successive states are successive, the difference between state n + 1
20655 and n served as the number of lookaheads for state n).
20656 * src/lalr.c (add_lookback_edge): Likewise.
20657 * src/print.c (print_core, print_actions, print_state)
20658 (print_results): Likewise.
20659 * src/print_graph.c (print_core, print_actions, print_state)
20660 (print_graph): Likewise.
20661 * src/conflicts.h: Adjust.
20662
1b177bd7
AD
206632001-12-27 Akim Demaille <akim@epita.fr>
20664
20665 * src/bison.hairy: Formatting/comment changes.
20666 ANSIfy.
20667 Remove `register' indications.
20668 Add plenty of `static'.
20669
7742ddeb
AD
206702001-12-27 Akim Demaille <akim@epita.fr>
20671
20672 * src/output.c (prepare): Drop the muscle `ntbase' which
20673 duplicates ntokens.
20674 * src/bison.simple: Formatting/comment changes.
20675 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
20676 is an undocumented synonym.
20677
1fa14068
AD
206782001-12-22 Akim Demaille <akim@epita.fr>
20679
20680 * src/output.c (output_table_data): Change the prototype to use
20681 `int' for array ranges: some invocations do pass an int, not a
20682 short.
20683 Reported by Wayne Green.
20684
b9752825
AD
206852001-12-22 Akim Demaille <akim@epita.fr>
20686
20687 Some actions of web2c.y are improperly triggered.
20688 Reported by Mike Castle.
20689
20690 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
20691 * tests/regression.at (Web2c): Rename as...
20692 (Web2c Report): this.
20693 (Web2c Actions): New.
20694
776209d6
AD
206952001-12-22 Akim Demaille <akim@epita.fr>
20696
20697 Reductions in web2c.y are improperly reported.
20698 Reported by Mike Castle.
20699
20700 * src/conflicts.c (print_reductions): Fix.
20701 * tests/regression.at (Web2c): New.
20702
275fc3ad
AD
207032001-12-18 Akim Demaille <akim@epita.fr>
20704
20705 Some host fail on `assert (!"foo")', which expands to
20706 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
20707 Reported by Nelson Beebee.
20708
20709 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
20710 `#define it_succeeded 0' and `assert (it_succeeded)'.
20711
897668ee
MA
207122001-12-17 Marc Autret <autret_m@epita.fr>
20713
20714 * src/bison.simple: Don't hard code the skeleton line and filename.
20715 * src/output.c (output_parser): Rename 'line' as 'output_line'.
20716 New line counter 'skeleton_line' (skeleton-line muscle).
20717
ab3399e0
PE
207182001-12-17 Paul Eggert <eggert@twinsun.com>
20719
20720 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
20721 YYDEBUG must be defined to a nonzero value.
20722
20723 * src/bison.simple (yytname): Do not assume that the user defines
20724 YYDEBUG to a properly parenthesized expression.
20725
3877f72b
AD
207262001-12-17 Akim Demaille <akim@epita.fr>
20727
20728 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
20729 nlookaheads is a new member.
20730 Adjust all users.
20731 * src/lalr.h (nlookaheads): Remove this orphan declaration.
20732 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
20733 state.
776209d6 20734
331dbc1b
AD
207352001-12-17 Akim Demaille <akim@epita.fr>
20736
20737 * src/files.h, src/files.c (open_files, close_files): Remove.
20738 * src/main.c (main): Don't open/close files, nor invoke lex_free,
20739 let...
20740 * src/reader.c (reader): Do it.
776209d6 20741
be750e4c
AD
207422001-12-17 Akim Demaille <akim@epita.fr>
20743
20744 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 20745
709ae8c6
AD
207462001-12-17 Akim Demaille <akim@epita.fr>
20747
20748 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
20749 (flush_reduce): New.
20750 (resolve_sr_conflict): Adjust.
776209d6 20751
f87685c3
AD
207522001-12-17 Akim Demaille <akim@epita.fr>
20753
20754 * src/output.c (output_obstack): Be static and rename as...
20755 (format_obstack): this, to avoid any confusion with files.c's
20756 output_obstack.
20757 * src/reader.h (muscle_obstack): Move to...
20758 * src/output.h: here, since it's defined in output.c.
20759
837491d8
AD
207602001-12-17 Akim Demaille <akim@epita.fr>
20761
20762 * src/output.c (action_row, save_column, default_goto)
20763 (sort_actions, matching_state, pack_vector): Better variable
20764 locality.
20765
796d61fb
AD
207662001-12-17 Akim Demaille <akim@epita.fr>
20767
20768 * src/output.c: Various formatting changes.
776209d6 20769
64d15509
AD
207702001-12-17 Akim Demaille <akim@epita.fr>
20771
20772 * src/files.c (output_files): Free the output_obstack.
20773 * src/main.c (main): Call print and print_graph conditionally.
20774 * src/print.c (print): Work unconditionally.
20775 * src/print_graph.c (print_graph): Work unconditionally.
20776 * src/conflicts.c (log_resolution): Output only if verbose_flag.
20777
fbc8ecb7
MA
207782001-12-16 Marc Autret <autret_m@epita.fr>
20779
20780 * src/output.c (actions_output): Fix. When we use %no-lines,
20781 there is one less line per action.
20782
f0440388
MA
207832001-12-16 Marc Autret <autret_m@epita.fr>
20784
20785 * src/bison.simple: Remove a useless #line directive.
20786 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
20787 * src/output.c (get_lines_number): New.
776209d6 20788 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
20789 output muscles.
20790 Fix line numbering.
20791 (actions_output): Computes the number of lines taken by actions.
20792 (output_master_parser): Insert new skeleton which is the name of
20793 the output parser file name.
20794
a79986b8
MA
207952001-12-15 Marc Autret <autret_m@epita.fr>
20796
20797 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
20798
4ec8e00f
MA
207992001-12-15 Marc Autret <autret_m@epita.fr>
20800
20801 * src/output.c (output_gram): Keep track of the hairy one.
20802
1a4648ff
AD
208032001-12-15 Akim Demaille <akim@epita.fr>
20804
20805 Make `make distcheck' work.
20806
20807 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
20808 system.h which uses libgettext.h.
20809
9c2c67e6
AD
208102001-12-15 Akim Demaille <akim@epita.fr>
20811
20812 * src/nullable.c (set_nullable): Useless rules must be skipped,
20813 otherwise, since we range over their symbols, we might look at a
20814 nonterminal which no longer ``exists'', i.e., it is not counted in
20815 `nvars', hence we overflow our arrays.
20816
93ede233
AD
208172001-12-15 Akim Demaille <akim@epita.fr>
20818
20819 The header can also be produced directly, without any obstack!
20820 Yahoo!
20821
20822 * src/files.c, src/files.h (defines_obstack): Remove.
20823 (compute_header_macro): Global.
20824 (defines_obstack_save): Remove.
20825 * src/reader.c (parse_union_decl): No longer output to
20826 defines_obstack: its content can be found in the `stype' muscle
20827 anyway.
20828 (output_token_translations): Merge into...
20829 (symbols_output): this.
20830 Rename as...
20831 (symbols_save): this.
20832 (reader): Adjust.
20833 * src/output.c (header_output): New.
20834 (output): Call it.
20835
2666f928
AD
208362001-12-15 Akim Demaille <akim@epita.fr>
20837
20838 * src/reader.c (parse_union_decl): Instead of handling two obstack
20839 simultaneously, use one to define the `stype' muscle, and use the
20840 value of the latter to fill defines_obstack.
20841 (copy_comment): Remove.
20842 (copy_comment2): Work for a single obstack.
20843 Rename as...
20844 (copy_comment): this.
20845
428046f8
AD
208462001-12-15 Akim Demaille <akim@epita.fr>
20847
20848 * src/lex.c, src/lex.h (xgetc): No longer static.
20849 * src/reader.c (parse_union_decl): Revamp.
20850
ea52d706
AD
208512001-12-15 Akim Demaille <akim@epita.fr>
20852
20853 Still making progress in separating Bison into (i) input, (ii)
20854 process, (iii) output: now we can directly output the parser file
20855 without using table_obstack at all.
20856
20857 * src/files.c, src/files.h (table_obstack): Bye bye.
20858 (parser_file_name): New.
20859 * src/files.c (compute_output_file_names): Compute it.
20860 * src/output.c (actions_output, output_parser)
20861 (output_master_parser): To a file instead of an obstack.
20862
3f96f4dc
AD
208632001-12-15 Akim Demaille <akim@epita.fr>
20864
20865 Attach actions to rules, instead of pre-outputting them to
20866 actions_obstack.
20867
20868 * src/gram.h (rule_t): action and action_line are new members.
20869 * src/reader.c (symbol_list): Likewise.
20870 (copy_action): Save the actions within the rule.
20871 (packgram): Save them in rule_table.
20872 * src/output.c (actions_output): New.
20873 (output_parser): Use it on `%%actions'.
20874 (output_rule_data): Don't free rule_table.
20875 (output): Do it.
20876 (prepare): Don't save the `action' muscle.
20877 * src/bison.simple: s/%%action/%%actions/.
20878
51576fb3
AD
208792001-12-15 Akim Demaille <akim@epita.fr>
20880
20881 * src/reader.c (copy_action): When --yacc, don't append a `;'
20882 to the user action: let it fail if lacking.
dee049eb 20883 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 20884
2648a72d
AD
208852001-12-14 Akim Demaille <akim@epita.fr>
20886
20887 * src/lex.c (literalchar): Simply return the char you decoded, non
20888 longer mess around with obstacks and int pointers.
20889 Adjust all callers.
20890
92790e5b
AD
208912001-12-14 Akim Demaille <akim@epita.fr>
20892
20893 * src/lex.c (literalchar): Don't escape the special characters,
20894 just decode them, and keep them as char (before, eol was output as
20895 the 2 char string `\n' etc.).
20896 * src/output.c (output_rule_data): Use quotearg to output the
20897 token strings.
20898
927c1557
PE
208992001-12-13 Paul Eggert <eggert@twinsun.com>
20900
20901 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
20902 Do not infringe on the global user namespace when using C++.
20903 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
20904 All uses of `fprintf' and `stderr' changed.
20905
20906 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
20907
ed8e1f68
AD
209082001-12-13 Akim Demaille <akim@epita.fr>
20909
20910 The computation of nullable is broken: it doesn't handle empty
20911 RHS's properly.
20912
20913 * tests/torture.at (GNU AWK Grammar): New.
20914 * tests/sets.at (Nullable): New.
20915 * src/nullable.c (set_nullable): Instead of blindly looping over
20916 `ritems', loop over the rules, and then over their rhs's.
20917
20918 Work around Autotest bugs.
20919
20920 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
20921 frame, because Autotest understand lines starting with a `+' as
20922 traces from the shell. Then, they are not processed properly.
20923 Admittedly an Autotest bug, but we don't have time to wait for
20924 Autotest to catch up.
20925 * tests/regression.at (Broken Closure): Adjust to the new table
20926 frames.
20927 Move to...
20928 * tests/sets.at: here.
20929
cb581495
AD
209302001-12-13 Akim Demaille <akim@epita.fr>
20931
20932 * src/closure.c (closure): Use nrules instead of playing tricks
20933 with BITS_PER_WORD.
20934
2e729273
AD
209352001-12-13 Akim Demaille <akim@epita.fr>
20936
20937 * src/print.c (print_actions): Output the handling of `$' as the
20938 traces do: shifting the token EOF. Before EOF was treated as a
20939 nonterminal.
20940 * tests/regression.at: Adjust some tests.
20941 * src/print_graph.c (print_core): Complete the set of items via
20942 closure. The next-to-final and final states are still unsatisfying,
20943 but that's to be addressed elsewhere.
20944 No longer output the rule numbers, but do output the state number.
20945 A single loop for the shifts + gotos is enough, but picked a
20946 distinct color for each.
20947 (print_graph): Initialize and finalize closure.
20948
107f7dfb
AD
209492001-12-13 Akim Demaille <akim@epita.fr>
20950
20951 * src/reader.c (readgram): Remove dead code, an strip useless
20952 braces.
20953 (get_type): Remove, unused.
20954
9b53a24f
AD
209552001-12-12 Akim Demaille <akim@epita.fr>
20956
20957 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
20958 on that of lib/error.c.
20959
dbfb6dcd
AD
209602001-12-12 Akim Demaille <akim@epita.fr>
20961
20962 Some hosts don't like `/' in includes.
20963
20964 * src/system.h: Include libgettext.h without qualifying the path.
20965 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
20966 $(top_srcdir).
20967
c25fb648
MA
209682001-12-11 Marc Autret <autret_m@epita.fr>
20969
20970 * src/output.c (output_parser): Remove useless muscle.
20971
710ddc4f
MA
209722001-12-11 Marc Autret <autret_m@epita.fr>
20973
20974 * src/bison.simple: Remove #line just before %%epilogue. It
20975 is now handled in ...
20976 * src/reader.c (read_additionnal_code): Add the output of a
20977 #line for the epilogue.
20978
e83d80b8
MA
209792001-12-10 Marc Autret <autret_m@epita.fr>
20980
927c1557 20981 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
20982 replace precedent remove.
20983 * src/bison.simple: Remove #line before %%prologue because
20984 %%input-line is wrong at this time.
20985
971d5158
MA
209862001-12-10 Marc Autret <autret_m@epita.fr>
20987
20988 * src/reader.c (symbols_output): Clean up.
927c1557 20989 * src/output.c (output_gram, output): Clean up.
971d5158 20990
5edafffd
AD
209912001-12-10 Akim Demaille <akim@epita.fr>
20992
20993 * src/lalr.c (initialize_lookaheads): New. Extracted from...
20994 * src/LR0.c (set_state_table): here.
20995 * src/lalr.c (lalr): Call it.
20996
0279f8e9
AD
209972001-12-10 Akim Demaille <akim@epita.fr>
20998
20999 * src/state.h (shifts): Remove the `number' member: shifts are
21000 attached to state, hence no longer need to be labelled with a
21001 state number.
21002
190c4f5f
AD
210032001-12-10 Akim Demaille <akim@epita.fr>
21004
21005 Now that states have a complete set of members, the linked list of
21006 shifts is useless: just fill directly the state's shifts member.
21007
21008 * src/state.h (shifts): Remove the `next' member.
21009 * src/LR0.c (first_state, last_state): Remove.
21010 Adjust the callers.
21011 (augment_automaton): Don't look for the shifts that must be added
21012 a shift on EOF: it is those of the state we looked for! But now,
21013 since shifts are attached, it is no longer needed to looking
21014 merely by its id: its number.
21015
2a73b93d
AD
210162001-12-10 Akim Demaille <akim@epita.fr>
21017
21018 * src/LR0.c (augment_automaton): Better variable locality.
21019 Remove an impossible branch: if there is a state corresponding to
21020 the start symbol being shifted, then there is shift for the start
21021 symbol from the initial state.
21022
74392f6a
AD
210232001-12-10 Akim Demaille <akim@epita.fr>
21024
21025 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
21026 only when appropriate: when insert_start_shifting_state' is not
21027 invoked.
21028 * tests/regression.at (Rule Line Numbers): Adjust.
21029
37c82725
AD
210302001-12-10 Akim Demaille <akim@epita.fr>
21031
21032 * src/LR0.c (augment_automaton): Now that all states have shifts,
21033 merge the two cases addition shifts to the initial state.
21034
6a164e0c
AD
210352001-12-10 Akim Demaille <akim@epita.fr>
21036
21037 * src/lalr.c (set_state_table): Move to...
21038 * src/LR0.c: here.
21039 * src/lalr.c (lalr): Don't call it...
21040 * src/LR0.c (generate_states): do it.
21041 * src/LR0.h (first_state): Remove, only the table is used.
21042
7215de24
AD
210432001-12-10 Akim Demaille <akim@epita.fr>
21044
21045 * src/LR0.h (first_shift, first_reduction): Remove.
21046 * src/lalr.c: Don't use first_shift: find shifts through the
21047 states.
21048
80e25d4d
AD
210492001-12-10 Akim Demaille <akim@epita.fr>
21050
21051 * src/LR0.c: Attach shifts to states as soon as they are
21052 computed.
21053 * src/lalr.c (set_state_table): Instead of assigning shifts to
21054 state, just assert that the mapping was properly done.
21055
0ab3728b
AD
210562001-12-10 Akim Demaille <akim@epita.fr>
21057
21058 * src/LR0.c (insert_start_shift): Rename as...
21059 (insert_start_shifting_state): this.
21060 (insert_eof_shifting_state, insert_accepting_state): New.
21061 (augment_automaton): Adjust.
21062 Better locality of the variables.
21063 When looking if the start_symbol is shifted from the initial
21064 state, using `while (... symbol != start_symbol ...)' sounds
21065 better than `while (... symbol < start_symbol ...)': If fail
21066 to see how the order between symbols could be relevant!
21067
78af9bbc
AD
210682001-12-10 Akim Demaille <akim@epita.fr>
21069
21070 * src/getargs.h: Don't declare `spec_name_prefix' and
21071 `spec_file_prefix', declared by src/files.h.
21072 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
21073 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
21074 * src/output.c (prepare): Adjust.
21075 * src/reader.c (symbols_output): Likewise.
21076 * src/vmsgetargs.c: Vaguely adjust, but who cares?
21077
bdef2a41
AD
210782001-12-10 Akim Demaille <akim@epita.fr>
21079
21080 * src/muscle_tab.c (muscle_init): NULL is a better default than
21081 `"0"'.
21082
3735969c
AD
210832001-12-10 Akim Demaille <akim@epita.fr>
21084
21085 * src/reader.c (reader): Calling symbols_output once is enough.
21086
49701457
AD
210872001-12-10 Akim Demaille <akim@epita.fr>
21088
21089 Now that states have a complete set of members, the linked list of
21090 reductions is useless: just fill directly the state's reductions
21091 member.
21092
21093 * src/state.h (struct reductions): Remove member `number' and
21094 `next'.
21095 * src/LR0.c (first_reduction, last_reduction): Remove.
21096 (save_reductions): Don't link the new reductions, store them in
21097 this_state.
21098 * src/lalr.c (set_state_table): No need to attach reductions to
21099 states, it's already done.
21100 * src/output.c (output_actions): No longer free the shifts, then
21101 the reductions, then the states: free all the states and their
21102 members.
21103
0edad749
AD
211042001-12-10 Akim Demaille <akim@epita.fr>
21105
21106 * src/options.c (OPTN, DRTV, BOTH): New.
21107 (option_table): Use them.
21108
0edad749
AD
21109 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
21110 the job of system.h.
21111 * src/options.c: Don't include stdio.h and xalloc.h for the same
21112 reasons.
21113
5449dd0f
AD
211142001-12-10 Akim Demaille <akim@epita.fr>
21115
21116 * src/output.c (output, prepare): Make sure the values of the
21117 muscles `action' and `prologue' are 0-terminated.
21118
a870c567
AD
211192001-12-10 Akim Demaille <akim@epita.fr>
21120
21121 Clean up GCC warnings.
21122
21123 * src/reader.c (copy_action): `buf' is not used.
21124 (parse_skel_decl): Be static.
21125 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
21126 * src/options.h (create_long_option_table): Have a real prototype.
21127 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
21128 (hash_delete_at): Return const void *.
21129 Adjust casts to preserve the const.
21130
80df8768
AD
211312001-12-10 Akim Demaille <akim@epita.fr>
21132
21133 * configure.in: Require 2.52g.
21134 M4 is not needed, but AUTOM4TE is.
21135 * m4/m4.m4: Remove.
21136 * tests/Makefile.am: Adjust.
21137
f693ad14
AD
211382001-12-10 Akim Demaille <akim@epita.fr>
21139
21140 One structure for states is enough, even though theoretically
21141 there are LR(0) states and LALR(1) states.
21142
21143 * src/lalr.h (state_t): Remove.
21144 (state_table): Be state_t **, not state_t *.
21145 * src/state.h (core, CORE_ALLOC): Rename as...
21146 (state_t, STATE_ALLOC): this.
21147 Add the LALR(1) members: shifts, reductions, errs.
21148 * src/LR0.c (state_table): Rename as...
21149 (state_hash): this, to avoid name clashes with the global
21150 `state_table'.
21151 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
21152 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
21153
74ffbcb6
AD
211542001-12-10 Akim Demaille <akim@epita.fr>
21155
21156 Bison dumps core on bash.y.
21157 Reported by Pascal Bart.
21158
21159 * src/warshall.c (bitmatrix_print): New.
21160 (TC): Use it.
ba0fe3c7 21161 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
21162 j must be the outer loop.
21163 * tests/regression.at (Broken Closure): New.
21164
07708e19
AD
211652001-12-05 Akim Demaille <akim@epita.fr>
21166
21167 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
21168 its argument.
ba1ecc07 21169 Reported by Peter Hamorsky.
07708e19 21170
92b16366
AD
211712001-12-05 Akim Demaille <akim@epita.fr>
21172
21173 * src/conflicts.c (err_table): Remove.
21174 (resolve_sr_conflict): Adjust.
21175 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
21176 Rename as...
21177 (state_t.reductions, state_t.shifts): this.
21178
076ab033
AD
211792001-12-05 Akim Demaille <akim@epita.fr>
21180
21181 * src/reduce.c (reduce_grammar_tables): No longer disable the
21182 removal of useless rules via CPP but via `if (0)', so that the
21183 compiler still check the code is valid.
21184 For instance, it should have noticed `rline' no longer exists: use
21185 the `line' member of rule_t.
21186 * src/gram.c (dummy, rline): Remove, unused.
21187
3843c413
AD
211882001-12-05 Akim Demaille <akim@epita.fr>
21189
21190 * src/output.c (pack_vector): Use assert, not berror.
21191 * src/main.c (berror): Remove, unused.
21192
43168960
AD
211932001-12-05 Akim Demaille <akim@epita.fr>
21194
21195 New experimental feature: if --verbose --trace output all the
21196 items of a state, not only its kernel.
21197
21198 * src/print.c (print_core): If `trace_flag', then invoke closure
21199 before outputting the items of the state (print_core is no longer
21200 a correct name them).
21201 (print_results): Invoke new_closure/free_closure if needed.
21202
b2872512
AD
212032001-12-05 Akim Demaille <akim@epita.fr>
21204
21205 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
21206 * src/closure.c, src/closure.h (itemsetsize): Rename as...
21207 (nitemset): for consistency with the rest of the project.
21208
23cbcc6c
AD
212092001-12-05 Akim Demaille <akim@epita.fr>
21210
21211 * src/closure.c (print_closure): Improve.
21212 (closure): Use it for printing input and output.
21213
03ec521c
AD
212142001-12-05 Akim Demaille <akim@epita.fr>
21215
21216 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
21217 indexed by nonterminals.
21218
3a7456dd
AD
212192001-12-05 Akim Demaille <akim@epita.fr>
21220
21221 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
21222 what it was!).
21223 * src/warshall.h: Remove accidental duplication of the content.
21224
1cbcf2e7
AD
212252001-12-05 Akim Demaille <akim@epita.fr>
21226
21227 * src/closure.c (set_fderives): De-obfuscate.
21228
84182270
AD
212292001-12-05 Akim Demaille <akim@epita.fr>
21230
21231 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
21232
3f6f053c
AD
212332001-12-05 Akim Demaille <akim@epita.fr>
21234
21235 * src/closure.c (set_firsts): De-obfuscate.
21236
7a5350ba
AD
212372001-12-05 Akim Demaille <akim@epita.fr>
21238
21239 * src/output.c (action_row): De-obfuscate
21240 using the good o' techniques: arrays not pointers, variable
21241 locality, BITISSET, RESETBIT etc.
21242
d954473d
AD
212432001-12-05 Akim Demaille <akim@epita.fr>
21244
21245 Pessimize the code to simplify it: from now on, all the states
21246 have a valid SHIFTS, which NSHIFTS is possibly 0.
21247
21248 * src/LR0.c (shifts_new): Be global and move to..
21249 * src/state.c, src/state.h: here.
21250 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
21251 * src/print_graph: Adjust.
21252
9839bbe5
AD
212532001-12-05 Akim Demaille <akim@epita.fr>
21254
21255 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
21256 * src/conflicts.c: Use it.
21257 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
21258 incorrectly ``simplified''.
21259
9f136c07
AD
212602001-12-05 Akim Demaille <akim@epita.fr>
21261
21262 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
21263 using the good o' techniques: arrays not pointers, variable
21264 locality, BITISSET, RESETBIT etc.
21265
b608206e
AD
212662001-12-05 Akim Demaille <akim@epita.fr>
21267
21268 * src/state.h (SHIFT_SYMBOL): New.
21269 * src/conflicts.c: Use it to deobfuscate.
21270
52afa962
AD
212712001-12-05 Akim Demaille <akim@epita.fr>
21272
21273 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
21274 (print_reductions): De-obfuscate using the good o' techniques:
21275 arrays not pointers, variable locality, BITISSET.
21276
e74dc321
AD
212772001-12-05 Akim Demaille <akim@epita.fr>
21278
21279 * src/conflicts.c (print_reductions): Arrays, not pointers.
21280 Use BITISSET.
21281
768fca83
AD
212822001-12-05 Akim Demaille <akim@epita.fr>
21283
21284 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21285
a17e599f
AD
212862001-12-05 Akim Demaille <akim@epita.fr>
21287
21288 * src/conflicts.c (print_reductions): Improve variable locality.
21289
a04bc341
AD
212902001-12-05 Akim Demaille <akim@epita.fr>
21291
21292 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21293
c8ea038e
AD
212942001-12-05 Akim Demaille <akim@epita.fr>
21295
21296 * src/conflicts.c (print_reductions): Improve variable locality.
21297
aa2aab3c
AD
212982001-12-05 Akim Demaille <akim@epita.fr>
21299
21300 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
21301 * src/lalr.c: Use them.
21302
b178c8cc
AD
213032001-12-05 Akim Demaille <akim@epita.fr>
21304
21305 * src/LR0.c (augment_automaton): Formatting changes.
21306 Better variable locality.
21307
f67d13aa
AD
213082001-12-05 Akim Demaille <akim@epita.fr>
21309
21310 * src/lalr.c (matrix_print): New.
21311 (transpose): Use it.
21312 Use arrays instead of pointers.
21313
c2713865
AD
213142001-12-05 Akim Demaille <akim@epita.fr>
21315
21316 * src/lalr.c (maxrhs): Move to...
21317 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
21318 * src/lalr.c (build_relations): Adjust.
21319
9887c18a
AD
213202001-12-05 Akim Demaille <akim@epita.fr>
21321
21322 * src/lalr.c (transpose): Free the memory allocated to the
21323 argument, as it is replaced by the results by the unique caller.
21324 (build_relations): Merely invoke transpose: it handles the memory
21325 deallocation.
21326 Improve variable locality.
21327 Avoid variables used as mere abbreviations.
21328 (compute_lookaheads): Use arrays instead of pointers.
21329
4d4f699c
AD
213302001-12-05 Akim Demaille <akim@epita.fr>
21331
21332 * src/lalr.c (initialize_F): Improve variable locality.
21333 Avoid variables used as mere abbreviations.
21334
80a69750
AD
213352001-12-05 Akim Demaille <akim@epita.fr>
21336
21337 * src/derives.c (print_derives): Display the ruleno.
21338 * src/lalr.c (initialize_F, transpose): Better variable locality
21339 to improve readability.
21340 Avoid variables used as mere abbreviations.
21341
fe961097
AD
213422001-12-05 Akim Demaille <akim@epita.fr>
21343
21344 * src/lalr.c (traverse): Use arrays instead of pointers.
21345
e3e4e814
AD
213462001-12-05 Akim Demaille <akim@epita.fr>
21347
21348 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
21349 the handling of squeue.
21350 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21351
630e182b
AD
213522001-12-05 Akim Demaille <akim@epita.fr>
21353
21354 Because useless nonterminals are now kept alive (instead of being
21355 `destroyed'), we now sometimes examine them, and store information
21356 related to them. Hence we need to know their number, and adjust
21357 memory allocations.
21358
21359 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
21360 static.
21361 * src/LR0.c (allocate_itemsets): The memory allocated to
21362 `symbol_count' was used for two different purpose: once to count
21363 the number of occurrences of each symbol, and later reassigned to
21364 `shift_symbol', containing the symbol that can be shifted from a
21365 given state.
21366 Deobfuscate, i.e., allocate, use and free `symbol_count' here
21367 only, and...
21368 (new_itemsets): Allocate `shift_symbol' here.
21369 (allocate_itemsets): symbol_count includes useless nonterminals.
21370 Make room for them.
21371 (free_storage): Use `free', not `XFREE', for pointers that cannot
21372 be null.
21373
81b51460
AD
213742001-12-05 Akim Demaille <akim@epita.fr>
21375
21376 * src/nullable.c (set_nullable): Deobfuscate the handling of
21377 ritem.
21378 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21379
3067fbef
AD
213802001-12-05 Akim Demaille <akim@epita.fr>
21381
21382 * src/gram.c, src/gram.h (ritem_print): New.
21383 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
21384 (This useless function was defined only to work around VMS linkers
21385 that can't handle compilation units with variables only).
21386 * src/reduce.c (dump_grammar): Use it to trace the construction of
21387 ritem.
21388
c2bea5f9
PE
213892001-12-04 Paul Eggert <eggert@twinsun.com>
21390
7d27c823
PE
21391 * src/bison.simple (union yyalloc): Change member names
21392 to be the same as the stack names.
21393 (yyparse): yyptr is now union yyalloc *, not char *.
21394 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
21395 and may generate better code on some machines.
c2bea5f9
PE
21396 (yystpcpy): Use prototype if __STDC__ is defined, not just
21397 if __cplusplus is defined.
35687a9d 21398
2c8a9dfa
AD
213992001-11-30 Akim Demaille <akim@epita.fr>
21400
21401 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
21402 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
21403 Gettext doesn't compile cleanly, and dies with -Werror.
21404 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
21405 Include WARNING_CFLAGS here.
21406 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
21407 before being defined.
21408
f4e421e6
AD
214092001-11-27 Paul Eggert <eggert@twinsun.com>
21410
21411 * lib/quotearg.h (quotearg_n, quotearg_n_style):
21412 First arg is int, not unsigned.
21413 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
21414 (SIZE_MAX, UINT_MAX): New macros.
21415 (quotearg_n_options): Abort if N is negative.
21416 Avoid overflow check on hosts where size_t is 64 bits and int
21417 is 32 bits, as overflow is impossible there.
21418 Fix off-by-one typo that caused unnecessary reallocation.
21419
7093d0f5
AD
214202001-11-29 Paul Eggert <eggert@twinsun.com>
21421
21422 Name space cleanup in generated parser.
21423
21424 * doc/bison.texinfo (Bison Parser): Discuss system headers
21425 and their effect on the user name space.
21426
21427 * src/bison.simple:
21428 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
21429 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
21430 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
21431
21432 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
21433 on user names when possible.
21434
21435 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
21436 Simplify test for whather <alloca.h> exists.
21437
21438 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
21439
21440 (<stdio.h>): Include if YYDEBUG.
21441
21442 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
21443 ! defined (yyoverflow) && ! defined (yymemcpy).
21444
21445 (yymemcpy, yyparse): Rename local variables as needed so that
21446 they all begin with 'yy'.
21447
21448 (yystrlen, yystpcpy): New functions.
21449
21450 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
21451 All uses changed.
21452
21453 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
21454 instead of relying on string.h functions. Use YYSTACK_ALLOC
21455 and YYSTACK_FREE instead of malloc and free.
21456
fd51e5ff
AD
214572001-11-30 Akim Demaille <akim@epita.fr>
21458
21459 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
21460 before their first uses.
21461 (YYBISON, YYPURE): Move to the top of the output.
21462
7d13ff5f
AD
214632001-11-30 Akim Demaille <akim@epita.fr>
21464
21465 * tests/reduce.at (Useless Nonterminals): Fix.
21466
892a3995
AD
214672001-11-30 Akim Demaille <akim@epita.fr>
21468
21469 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
21470 if body instead of `;' to pacify GCC's warnings.
21471
68f1e3ed
AD
214722001-11-30 Akim Demaille <akim@epita.fr>
21473
21474 Instead of mapping the LHS of unused rules to -1, keep the LHS
21475 valid, but flag the rules as invalid.
21476
21477 * src/gram.h (rule_t): `useful' is a new member.
21478 * src/print.c (print_grammar): Adjust.
21479 * src/derives.c (set_derives): Likewise.
21480 * src/reader.c (packgram, reduce_output): Likewise.
21481 * src/reduce.c (reduce_grammar_tables): Likewise.
21482 * tests/reduce.at (Underivable Rules, Useless Rules): New.
21483
d2d1b42b
AD
214842001-11-30 Akim Demaille <akim@epita.fr>
21485
21486 * src/reduce.c (reduce_output): Formatting changes.
21487 * src/print.c (print_results, print_grammar): Likewise.
21488 * tests/regression.at (Rule Line Numbers)
21489 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
21490
760b53a8
AD
214912001-11-30 Akim Demaille <akim@epita.fr>
21492
21493 * src/reduce.c (nonterminals_reduce): Instead of throwing away
21494 useless nonterminals, move them at the end of the symbol arrays.
21495 (reduce_output): Adjust.
21496 * tests/reduce.at (Useless Nonterminals): Adjust.
21497
00238958
AD
214982001-11-30 Akim Demaille <akim@epita.fr>
21499
21500 * src/reduce.c: Various comment/formatting changes.
21501 (nonterminals_reduce): New, extracted from...
21502 (reduce_grammar_tables): here.
21503 (reduce_grammar): Call nonterminals_reduce.
21504
396452de
PE
215052001-11-29 Paul Eggert <eggert@twinsun.com>
21506
21507 * src/bison.simple (YYSTACK_REALLOC): Remove.
21508 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
21509 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
21510 New macros.
21511 (union yyalloc): New type.
21512 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
21513 an arbitrary restriction on hosts where size_t is wider than int.
21514
21515 (yyparse): Don't dump core if alloca or malloc fails; instead, report
21516 a parser stack overflow. Allocate just one block of memory for all
21517 three stacks, instead of allocating three blocks; this typically is
21518 faster and reduces fragmentation.
21519
21520 Do not limit the number of items in the stack to a value that fits
21521 in 'int', as this is an arbitrary limit on hosts with 64-bit
21522 size_t and 32-bit int.
21523
147e184c
MA
215242001-11-29 Marc Autret <autret_m@epita.fr>
21525
21526 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
21527 of defining YYERROR_VERBOSE.
21528 [AT_DATA]: $4 is now out of C declarations in the prologue.
21529
426cf563
MA
215302001-11-28 Marc Autret <autret_m@epita.fr>
21531
21532 * src/reader.c (parse_dquoted_param): New.
21533 (parse_skel_decl): Use it.
21534 * src/lex.h: Add its prototype.
21535 * src/lex.c (literalchar): Become not static.
21536
c7925b99
MA
215372001-11-28 Marc Autret <autret_m@epita.fr>
21538
21539 * src/output.h: And put its extern declaration here.
21540 * src/output.c (error_verbose): Define here.
21541 (prepare): Echo name modification.
21542 * src/getargs.h: Clean its extern declaration.
21543 * src/getargs.c (error_verbose_flag): Remove.
21544 (getargs): Remove case 'e'.
21545 * src/options.c (option_table): 'error-verbose' is now seen as simple
21546 percent option.
21547 Include output.h.
21548
21549 * src/reader.c (read_declarations): Remove case tok_include.
21550 (parse_include_decl): Remove.
21551 * src/lex.h (token_t): Remove tok_include.
21552 * src/options.c (option_table): 'include' is now a simple command line
21553 option.
21554
5b5d1929
MA
215552001-11-28 Marc Autret <autret_m@epita.fr>
21556
21557 * src/bison.simple: Adjust muscle names.
21558 * src/muscle_tab.c (muscle_init): Also rename the muscles.
21559 * src/output.c (prepare): s/_/-/ for the muscles names.
21560 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
21561
8850be4b
MA
215622001-11-28 Marc Autret <autret_m@epita.fr>
21563
21564 * src/bison.simple: Fix debug.
21565 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
21566
4a38e613
AD
215672001-11-28 Akim Demaille <akim@epita.fr>
21568
21569 * src/LR0.c (shifts_new): New.
21570 (save_shifts, insert_start_shift, augment_automaton): Use it.
21571
4b35e1c1
AD
215722001-11-28 Akim Demaille <akim@epita.fr>
21573
21574 * src/closure.c (closure): `b' and `ruleno' denote the same value:
21575 keep ruleno only.
21576
d2b04478
AD
215772001-11-28 Akim Demaille <akim@epita.fr>
21578
21579 * src/closure.c (closure): Instead of looping over word in array
21580 then bits in words, loop over bits in array.
21581
2c4c30aa
AD
215822001-11-28 Akim Demaille <akim@epita.fr>
21583
21584 * src/closure.c (closure): No longer optimize the special case
21585 where all the bits of `ruleset[r]' are set to 0, to make the code
21586 clearer.
21587
576890b7
AD
215882001-11-28 Akim Demaille <akim@epita.fr>
21589
21590 * src/closure.c (closure): `r' and `c' are new variables, used to
21591 de-obfuscate accesses to RULESET and CORE.
21592
cb487d7d
AD
215932001-11-28 Akim Demaille <akim@epita.fr>
21594
21595 * src/reduce.c (reduce_print): Use ngettext.
21596 (dump_grammar): Improve the trace accuracy.
21597
6013d43f
AD
215982001-11-28 Akim Demaille <akim@epita.fr>
21599
21600 * src/reduce.c (dump_grammar): Don't translate trace messages.
21601
cb4956ee
AD
216022001-11-28 Akim Demaille <akim@epita.fr>
21603
21604 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
21605 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
21606 as all tags are free'ed afterwards.
21607 From Enrico Scholz.
21608
648185ab
PE
216092001-11-27 Paul Eggert <eggert@twinsun.com>
21610
21611 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
21612 use alloca when we didn't want to, and vice versa.
21613
68254a03
MA
216142001-11-27 Marc Autret <autret_m@epita.fr>
21615
9113b58f
AD
21616 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
21617 initialization.
68254a03
MA
21618 * src/output.c (prepare): Remove its update.
21619
04d843a2
MA
216202001-11-27 Marc Autret <autret_m@epita.fr>
21621
21622 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
21623 Use %error-verbose.
21624
d2079671 216252001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
21626
21627 * src/bison.simple: Remove YYERROR_VERBOSE using.
21628 Use %%error_verbose.
21629 (yyparse): Likewise.
21630 * src/output.c (prepare): Give its final value.
21631 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
21632 * src/getargs.h: Add its extern declaration.
21633 * src/getargs.c (error_verbose_flag): New int.
21634 (getargs): Update to catch new case.
21635 * src/options.c (option_table): 'error-verbose' is a new option.
21636 (shortopts): Update.
21637
e0327bc8
AD
216382001-11-27 Akim Demaille <akim@epita.fr>
21639
21640 * src/system.h: Use intl/libgettext.h.
21641 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
21642
000f1a3c
AD
216432001-11-27 Akim Demaille <akim@epita.fr>
21644
21645 * tests/torture.at (Exploding the Stack Size with Malloc):
21646 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
21647
26cfe0be
AD
216482001-11-27 Akim Demaille <akim@epita.fr>
21649
21650 * src/files.c: Include error.h.
21651 Reported by Hans Aberg.
21652
f6bd5427
MA
216532001-11-26 Marc Autret <autret_m@epita.fr>
21654
d2079671 21655 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
21656 (read_declarations): Add case tok_include.
21657 * src/getargs.h (include): Add its extern definition.
21658 * src/getargs.c (include): New const char *.
21659 (getargs): Add case '-I'.
21660 * src/options.c (option_table): Add include as command line and
21661 percent option.
21662 * src/lex.h (token_t): Add tok_include.
21663
2ca209c1
AD
216642001-11-26 Akim Demaille <akim@epita.fr>
21665
21666 * src/reader.c (readgram): Make sure rules for mid-rule actions
21667 have a lineno equal to that of their host rule.
21668 Reported by Hans Aberg.
21669 * tests/regression.at (Rule Line Numbers): New.
21670
0e41b407
AD
216712001-11-26 Akim Demaille <akim@epita.fr>
21672
21673 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
21674 size_ts.
21675
216762001-11-26 Akim Demaille <akim@epita.fr>
21677
21678 * src/complain.c, src/complain.h (error): Remove, provided by
21679 lib/error.[ch].
21680
e0c40012
AD
216812001-11-26 Akim Demaille <akim@epita.fr>
21682
21683 * src/reader.c (read_declarations): Don't abort on tok_illegal,
21684 issue an error message.
21685 * tests/regression.at (Invalid %directive): New.
21686 Reported by Hans Aberg.
21687
5e147124
AD
216882001-11-26 Akim Demaille <akim@epita.fr>
21689
21690 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
21691 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
21692
a034c8b8
AD
216932001-11-26 Akim Demaille <akim@epita.fr>
21694
21695 * src/conflicts.c (conflicts_print): Don't complain at all when
21696 there are no reduce/reduce conflicts, and as many shift/reduce
21697 conflicts as expected.
21698 * tests/regression.at (%expect right): Adjust.
21699
c64a20f3
AD
217002001-11-23 Akim Demaille <akim@epita.fr>
21701
21702 * lib/alloca.c: Update, from fileutils.
21703
5b0d29bb
AD
217042001-11-23 Akim Demaille <akim@epita.fr>
21705
21706 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
21707
722c4bfe
AD
217082001-11-23 Akim Demaille <akim@epita.fr>
21709
21710 * src/system.h: Include alloca.h.
21711 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
21712
6255b435
AD
217132001-11-23 Akim Demaille <akim@epita.fr>
21714
21715 * src/print_graph.c (print_actions): Remove `rule', unused.
21716 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
21717 pacify GCC's signed < unsigned warnings.
21718 * src/closure.c (itemsetsize): Likewise.
21719 * src/reader.c (symbol_list_new): Static.
21720
b29b2ed5
AD
217212001-11-23 Akim Demaille <akim@epita.fr>
21722
21723 Attaching lineno to buckets is stupid, since only one copy of each
21724 symbol is kept, only the line of the first occurrence is kept too.
21725
21726 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
21727 * src/reader.c (rline_allocated): Remove, unused.
21728 (symbol_list): Have a `line' member.
21729 (symbol_list_new): New.
21730 (readgram): Use it.
21731 * src/print.c (print_grammar): Output the rule line numbers.
21732 * tests/regression.at (Solved SR Conflicts)
21733 (Unresolved SR Conflicts): Adjust.
21734 Reported by Hans Aberg.
21735
a81b1d4a
MA
217362001-11-22 Marc Autret <autret_m@epita.fr>
21737
21738 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
21739
c1ecb3c1
MA
217402001-11-22 Marc Autret <autret_m@epita.fr>
21741
21742 * src/muscle_tab.c (muscle_init): Remove initialization of
21743 skeleton muscle.
21744 * src/output.c (output_master_parser): Do it here.
21745
fbe01355
AD
217462001-11-20 Akim Demaille <akim@epita.fr>
21747
21748 * po/sv.po: New.
21749 * configure.in (ALL_LINGUAS): Adjust.
21750 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
21751 longer contains strings to translate.
21752
81e895c0
AD
217532001-11-19 Akim Demaille <akim@epita.fr>
21754
21755 * src/conflicts.c (conflicts_print): Add a missing \n.
21756
6bb1878b
AD
217572001-11-19 Akim Demaille <akim@epita.fr>
21758
21759 * src/nullable.c (nullable_print): New.
21760 (set_nullable): Call it when tracing.
21761 Better locality of variables.
21762
d9ec2d07
AD
217632001-11-19 Akim Demaille <akim@epita.fr>
21764
21765 * src/print.c (print_actions): Better locality of variables.
21766
720e5c1b
AD
217672001-11-19 Akim Demaille <akim@epita.fr>
21768
21769 * src/derives.c (print_derives): Fix and enrich.
21770 * src/closure.c (print_fderives): Likewise.
21771
fb908786
AD
217722001-11-19 Akim Demaille <akim@epita.fr>
21773
21774 * src/closure.c (itemsetend): Remove, replaced with...
21775 (itemsetsize): new.
21776
125ecb56
AD
217772001-11-19 Akim Demaille <akim@epita.fr>
21778
21779 * src/LR0.c (kernel_end): Remove, replaced with...
21780 (kernel_size): new.
21781
d8cf039f
AD
217822001-11-19 Akim Demaille <akim@epita.fr>
21783
21784 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
21785 to clarify.
21786
7bec0760
AD
217872001-11-19 Akim Demaille <akim@epita.fr>
21788
21789 * src/closure.c (closure): Use arrays instead of pointers to clarify.
21790
c87d4863
AD
217912001-11-19 Akim Demaille <akim@epita.fr>
21792
21793 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
21794 trace messages.
21795 * src/LR0.c: Likewise.
21796 (allocate_itemsets): Use arrays instead of pointers to clarify.
21797
9bfe901c
AD
217982001-11-19 Akim Demaille <akim@epita.fr>
21799
21800 * src/getargs.c (statistics_flag): Replace with...
21801 (trace_flag): New.
21802 (longopts): Accept --trace instead of --statistics.
21803 * src/getargs.h, src/options.c: Adjust.
21804 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
21805 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
21806
97db7bd4
AD
218072001-11-19 Akim Demaille <akim@epita.fr>
21808
cc72668c 21809 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
21810 pointers to clarify the code.
21811 (save_reductions, save_shifts): Factor common parts of alternatives.
21812
2c5f66ed
AD
218132001-11-19 Akim Demaille <akim@epita.fr>
21814
21815 * src/LR0.c (new_state, get_state): Complete TRACE code.
21816 * src/closure.c: Include `reader.h' to get `tags', needed by the
21817 trace code.
21818 Rename the conditional DEBUG as TRACE.
21819 Output consistently TRACEs to stderr, not stdout.
21820 * src/derives.c: Likewise.
21821 * src/reduce.c: (inaccessable_symbols): Using if is better style
21822 than goto.
21823 Use `#if TRACE' instead of `#if 0' for tracing code.
21824
300f275f
AD
218252001-11-19 Akim Demaille <akim@epita.fr>
21826
21827 * src/system.h (LIST_FREE, shortcpy): New.
21828 * src/LR0.c: Use them.
21829 * src/output.c (free_itemsets, free_reductions, free_shifts):
21830 Remove, replaced by LIST_FREE.
21831
f59c437a
AD
218322001-11-19 Akim Demaille <akim@epita.fr>
21833
21834 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
21835 (REDUCTIONS_ALLOC): New.
21836 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
21837 allocation.
21838
6986fd9e
AD
218392001-11-19 Akim Demaille <akim@epita.fr>
21840
21841 * src/LR0.c (new_state): Complete trace code.
21842 * src/nullable.c (set_nullable): Don't translate traces.
21843
4bc30f78
AD
218442001-11-19 Akim Demaille <akim@epita.fr>
21845
21846 * src/print_graph.c (print_core): Better locality of variables.
21847 * src/print.c (print_core): Likewise.
21848
08a946e0
AD
218492001-11-19 Akim Demaille <akim@epita.fr>
21850
21851 * src/vcg.c: You do the output, so you are responsible of the
21852 handling of VCG syntax, in particular: use quotearg.
21853 * src/print_graph.c: Don't.
21854 (print_actions): Don't output the actions as part of the nodes,
21855 since that's the job of the edges.
21856 (print_state): Don't output by hand: fill the node description,
9bfe901c 21857 and ask for its output.
08a946e0 21858
f0473484
AD
218592001-11-19 Akim Demaille <akim@epita.fr>
21860
cc72668c
AD
21861 * src/bison.simple (yyparse): When verbosely reporting an error,
21862 no longer put additional quotes around token names.
f0473484
AD
21863 * tests/calc.at: Adjust.
21864
e41dc700
AD
218652001-11-19 Akim Demaille <akim@epita.fr>
21866
21867 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
21868 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
21869 * src/output.c: Adjust.
21870
652a871c
AD
218712001-11-19 Akim Demaille <akim@epita.fr>
21872
21873 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
21874 (rule_t): this.
21875 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
21876
b2ed6e58
AD
218772001-11-19 Akim Demaille <akim@epita.fr>
21878
21879 * src/gram.h (rule_t): New.
21880 (rule_table): New.
21881 (rrhs, rlhs): Remove, part of state_t.
21882 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
21883 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
21884 * src/reader.c, src/reduce.c: Adjust.
21885
edad7067
AD
218862001-11-19 Akim Demaille <akim@epita.fr>
21887
21888 * src/reader.c (symbols_output): New, extracted from...
21889 (packsymbols): Here.
21890 (reader): Call it.
21891
3feec034
AD
218922001-11-19 Akim Demaille <akim@epita.fr>
21893
21894 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
21895 (maxrhs): this new function.
21896
ddcd5fdf
AD
218972001-11-19 Akim Demaille <akim@epita.fr>
21898
cc72668c 21899 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
21900 Adjust.
21901
bb527fc2
AD
219022001-11-19 Akim Demaille <akim@epita.fr>
21903
cc72668c 21904 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
21905 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21906 * src/lalr.c: Adjust.
21907
a845a697
AD
219082001-11-19 Akim Demaille <akim@epita.fr>
21909
21910 * src/lalr.c (initialize_LA): Only initialize LA. Let...
21911 (set_state_table): handle the `lookaheads' members.
21912
f004bf6a
AD
219132001-11-19 Akim Demaille <akim@epita.fr>
21914
cc72668c
AD
21915 * src/lalr.h (lookaheads): Removed array, whose contents is now
21916 a member of...
f004bf6a
AD
21917 (state_t): this structure.
21918 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21919 Adjust.
21920
de326cc0
AD
219212001-11-19 Akim Demaille <akim@epita.fr>
21922
cc72668c
AD
21923 * src/lalr.h (consistent): Removed array, whose contents is now
21924 a member of...
de326cc0
AD
21925 (state_t): this structure.
21926 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21927 Adjust.
21928
90b4416b
AD
219292001-11-19 Akim Demaille <akim@epita.fr>
21930
cc72668c
AD
21931 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
21932 contents are now members of...
90b4416b
AD
21933 (state_t): this structure.
21934 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21935 Adjust.
21936
9703cc49
AD
219372001-11-19 Akim Demaille <akim@epita.fr>
21938
21939 * src/lalr.h (state_t): New.
21940 (state_table): Be a state_t * instead of a core **.
21941 (accessing_symbol): Remove, part of state_t.
21942 * src/lalr.c: Adjust.
21943 (set_accessing_symbol): Merge into...
21944 (set_state_table): this.
21945 * src/print_graph.c, src/conflicts.c: Adjust.
21946
d803322e
AD
219472001-11-14 Akim Demaille <akim@epita.fr>
21948
21949 * tests/calc.at, tests/output.at, tests/regression.at,
21950 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
21951 now the tests are run in private dirs, therefore AC_CLEANUP and
21952 family can be simplified to 0-ary.
21953 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
21954 use abs. path to find config.h.
21955 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
21956 stderr, there can be way too much random noise.
21957 Instead pass -Werror to GCC and rely on the exit status.
21958 Reported by Wolfram Wagner.
21959
3d76b07d
AD
219602001-11-14 Akim Demaille <akim@epita.fr>
21961
21962 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
21963 defined only if yyoverflow is defined, to avoid `warning: unused
21964 variable `yyvs1''.
21965 Reported by The Test Suite.
21966
09b503c8
AD
219672001-11-14 Akim Demaille <akim@epita.fr>
21968
21969 * src/print.c: Include reduce.h.
21970 Reported by Hans Aberg.
21971
219722001-11-14 Akim Demaille <akim@epita.fr>
21973
21974 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
21975 Revert a previous patch: these are really const.
21976 * src/conflicts.c (conflict_report): Additional useless pair of
21977 braces to pacify GCC's warnings for `if () if () {} else {}'.
21978 * src/lex.c (parse_percent_token): Replace equal_offset with
21979 arg_offset.
21980 arg is const.
21981 Be sure to strdup `arg' when used, since there is no reason for
21982 token_buffer not to change.
21983
0f37a994
AD
219842001-11-14 Akim Demaille <akim@epita.fr>
21985
21986 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
21987 definition.
21988 * src/main.c (main): Use them.
21989 Suggested by Hans Aberg.
21990
d39d93b8
AD
219912001-11-12 Akim Demaille <akim@epita.fr>
21992
21993 * src/system.h (ngettext): Now that we use ngettext, be sure to
21994 provide a default definition when NLS are not used.
21995
9edcd895
AD
219962001-11-12 Akim Demaille <akim@epita.fr>
21997
21998 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
21999 Use @kbd to denote user input.
22000 (Language and Grammar): ANSIfy the example.
22001 Adjust its layout for info/notinfo.
22002 (Location Tracking Calc): Output error messages to stderr.
22003 Output locations in a more GNUtically correct way.
22004 Fix a couple of Englishos.
22005 Adjust @group/@end group pairs.
22006
7da99ede
AD
220072001-11-12 Akim Demaille <akim@epita.fr>
22008
e3aa65c5 22009 %expect was not functioning at all.
7da99ede
AD
22010
22011 * src/conflicts.c (expected_conflicts): Set to -1.
22012 (conflict_report): Use ngettext.
22013 (conflicts_print): Check %expect and make its violation an error.
22014 * doc/bison.texinfo (Expect Decl): Adjust.
22015 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
22016 * tests/regression.at (%expect not enough, %expect right)
22017 (%expect too much): New.
22018
ba9dda1a
AD
220192001-11-12 Akim Demaille <akim@epita.fr>
22020
22021 * tests/regression.at (Conflicts): Rename as...
22022 (Unresolved SR Conflicts): this.
22023 (Solved SR Conflicts): New.
22024
337c5bd1
AD
220252001-11-12 Akim Demaille <akim@epita.fr>
22026
22027 * src/reduce.c (print_results): Rename as...
22028 (reduce_output): This.
22029 Output to OUT, passed as argument, instead of output_obstack.
22030 (dump_grammar): Likewise.
22031 (reduce_free): New.
22032 Also free V1.
22033 (reduce_grammar): No longer call reduce_output, since...
22034 * src/print.c (print_results): do it.
22035 * src/main.c (main): Call reduce_free;
22036
c73a41af
AD
220372001-11-12 Akim Demaille <akim@epita.fr>
22038
22039 * src/conflicts.c (print_reductions): Accept OUT as argument.
22040 Output to it, not to output_obstack.
22041 * src/print.c (print_actions): Adjust.
22042
0df87bb6
AD
220432001-11-12 Akim Demaille <akim@epita.fr>
22044
22045 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
22046 the result instead of using...
22047 (src_total, rrc_total, src_count, rrc_count): Remove.
22048 (any_conflicts): Remove.
22049 (print_conflicts): Split into...
22050 (conflicts_print, conflicts_output): New.
22051 * src/conflicts.h: Adjust.
22052 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 22053 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
22054 * tests/regression.at (Conflicts): New.
22055 Reported by Tom Lane.
22056
e4d3d4de
AD
220572001-11-12 Akim Demaille <akim@epita.fr>
22058
22059 * tests/regression.at (Invalid input): Remove, duplicate with
22060 ``Invalid input: 1''.
22061
6d7d248e
AD
220622001-11-12 Akim Demaille <akim@epita.fr>
22063
22064 * tests/torture.at (AT_DATA_STACK_TORTURE)
22065 (Exploding the Stack Size with Alloca)
22066 (Exploding the Stack Size with Malloc): New.
22067
e9e4c321
AD
220682001-11-12 Akim Demaille <akim@epita.fr>
22069
22070 * src/bison.simple (YYSTACK_REALLOC): New.
22071 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 22072 Reported by Per Allansson.
e9e4c321 22073
5f7e0832
AD
220742001-11-12 Pascal Bart <pascal.bart@epita.fr>
22075
22076 * src/bison.simple: Define type yystype instead of YYSTYPE, and
22077 define CPP macro, which substitute YYSTYPE by yystype.
22078 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
22079 with yyltype/YYLTYPE. This allows inclusion of the generated
22080 header within the parser if the compiler, such as GGC, accepts
22081 multiple equivalent #defines.
22082 From Akim.
22083
e3f1699f
AD
220842001-11-05 Akim Demaille <akim@epita.fr>
22085
22086 * src/reader.c (symbols_output): New, extracted from...
22087 (packsymbols): here.
22088 (reader): Adjust.
22089
65be0866
AD
220902001-11-05 Akim Demaille <akim@epita.fr>
22091
22092 * src/lex.c (parse_percent_token): s/quotearg/quote/.
22093
e4d910bf
AD
220942001-11-05 Akim Demaille <akim@epita.fr>
22095
22096 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
22097 pattern.
22098
951366c1
AD
220992001-11-05 Akim Demaille <akim@epita.fr>
22100
22101 * src/options.h (struct option_table_struct): set_flags is void*.
22102 * src/options.c (longopts): Support `--output' and `%output'.
22103 (usage): Adjust.
22104 * src/lex.h (tok_setopt): Remove, replaced with...
22105 (tok_intopt, tok_stropt): these new guys.
22106 * src/lex.c (getopt.h): Not needed.
22107 (token_buffer, unlexed_token_buffer): Not const.
22108 (percent_table): Promote `-' over `_' in directive names.
22109 Active `%name-prefix', `file-prefix', and `output'.
22110 (parse_percent_token): Accept possible arguments to directives.
22111 Promote `-' over `_' in directive names.
22112
d8988b2f
AD
221132001-11-04 Akim Demaille <akim@epita.fr>
22114
22115 * doc/bison.texinfo (Decl Summary): Split the list into
22116 `directives for grammars' and `directives for bison'.
22117 Sort'em.
22118 Add description of `%name-prefix', `file-prefix', and `output'.
22119 Promote `-' over `_' in directive names.
22120 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
22121 Simplify the description of `--name-prefix'.
22122 Promote `-' over `_' in directive names.
22123 Promote `--output' over `--output-file'.
22124 Fix the description of `--defines'.
22125 * tests/output.at: Exercise %file-prefix and %output.
22126
6468d18e
AD
221272001-11-02 Akim Demaille <akim@epita.fr>
22128
22129 * doc/refcard.tex: Update.
22130
6b7e85b9
AD
221312001-11-02 Akim Demaille <akim@epita.fr>
22132
22133 * src/symtab.h (SUNDEF): New.
22134 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
22135 stand for `uninitialized', instead of 0.
22136 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
22137 * src/lex.c (lex): Adjust.
22138
22139 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
22140 Number it 0.
22141 Let yylex return it instead of a plain 0.
22142 Reported by Dick Streefland.
22143
cd5aafcf
AD
221442001-11-02 Akim Demaille <akim@epita.fr>
22145
22146 * tests/regression.at (Mixing %token styles): New test.
22147
037ca2f1
AD
221482001-11-02 Akim Demaille <akim@epita.fr>
22149
22150 * src/reader.c (parse_thong_decl): Formatting changes.
22151 (token_translations_init): New, extracted from...
22152 (packsymbols): Here.
22153 Adjust.
22154
270a173c
AD
221552001-11-01 Akim Demaille <akim@epita.fr>
22156
22157 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
22158 Check that `9foo.y' produces correct cpp guards.
22159 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
22160 guards.
22161 Reported by Wwp.
22162
561f9a30
AD
221632001-11-01 Akim Demaille <akim@epita.fr>
22164
22165 * tests/regression.at (Invalid input: 2): New.
22166 * src/lex.c (unlexed_token_buffer): New.
22167 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
22168 too.
22169 Reported by Wwp.
22170
f987e9d2
AD
221712001-11-01 Akim Demaille <akim@epita.fr>
22172
22173 * tests/calc.at: Catch up with 1.30.
22174 * configure.in: Bump to 1.49a.
22175 Adjust to newer Autotest.
22176
0846f581
PB
221772001-10-19 Pascal Bart <pascal.bart@epita.fr>
22178
22179 * src/conflicts.c: Move global variables rrc_total and src_total ...
22180 (print_conflicts): here.
22181 * src/output.c (output): Free global variable user_toknums.
22182 * src/lex.c (token_obstack): Become static.
22183
3c1a79b3
AD
221842001-10-18 Akim Demaille <akim@epita.fr>
22185
22186 * tests/atlocal.in (GCC): Add.
22187 * tests/calc.at: s/m4_match/m4_bmatch/.
22188 s/m4_patsubst/m4_bpatsubst/.
22189 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
22190 * configure.in: AC_SUBST(GCC).
22191
5d52e7d0
MA
221922001-10-14 Marc Autret <autret_m@epita.fr>
22193
22194 * src/options.c (create_long_option_table): Fix.
22195
631aa1d3
AD
221962001-10-10 Akim Demaille <akim@epita.fr>
22197
22198 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
22199
f6ec6d13
AD
222002001-10-04 Akim Demaille <akim@epita.fr>
22201
22202 * src/reader.c (parse_union_decl): Push the caracters in
22203 union_obstack, not attrs_obstack.
22204
342b8b6e
AD
222052001-10-04 Akim Demaille <akim@epita.fr>
22206
22207 Merge in the branch 1.29.
22208
22209 * src/reader.c (packsymbols): Use a temporary obstack for
22210 `%%tokendef', since output_stack is already used elsewhere.
22211
22212 2001-10-02 Akim Demaille <akim@epita.fr>
22213
22214 Bump 1.29d.
22215
22216 2001-10-02 Akim Demaille <akim@epita.fr>
22217
22218 Version 1.29c.
22219
22220 2001-10-02 Akim Demaille <akim@epita.fr>
22221
22222 * tests/regression.at (Invalid CPP headers): New.
22223 From Alexander Belopolsky.
22224 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
22225
22226 2001-10-02 Akim Demaille <akim@epita.fr>
22227
22228 * tests/regression.at (Invalid input): New.
22229 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
22230 Reported by Shura.
22231
22232 2001-10-02 Akim Demaille <akim@epita.fr>
22233
22234 * tests/calc.at: Now that --debug works, the tests must be adjusted.
22235
22236 2001-10-02 Akim Demaille <akim@epita.fr>
22237
22238 * src/output.c (output_parser): Assert `skeleton'.
22239 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
22240 systems.
22241 From Shura.
22242
22243 2001-10-01 Marc Autret <autret_m@epita.fr>
22244
22245 * src/lex.h: Echo modifications.
22246 * src/lex.c (unlex): Parameter is now token_t.
22247 From Hans Aberg.
22248
22249 2001-10-01 Marc Autret <autret_m@epita.fr>
22250
22251 * src/main.c: Include lex.h.
22252 From Hans Aberg.
22253
22254 2001-09-29 Akim Demaille <akim@epita.fr>
22255
22256 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
22257
22258 2001-09-28 Akim Demaille <akim@epita.fr>
22259
22260 * tests/testsuite.at: Update to newer Autotest.
22261 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
22262
22263 2001-09-27 Akim Demaille <akim@epita.fr>
22264
22265 Position independent wrapper.
22266
22267 * tests/bison: Remove.
22268 * tests/bison.in: New.
22269 * configure.in: Adjust.
22270
22271 2001-09-27 Paul Eggert <eggert@twinsun.com>
22272
22273 Port quotearg fixes from tar 1.13.24.
22274
22275 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
22276 tm to be declared.
22277 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
22278 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
22279
22280 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
22281 * m4/mbrtowc.m4: New file.
22282 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
22283 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
22284
22285 2001-09-27 Akim Demaille <akim@epita.fr>
22286
22287 Bump to 1.29c.
22288
22289 2001-09-27 Akim Demaille <akim@epita.fr>
22290
22291 Version 1.29b.
22292
22293 2001-09-25 Akim Demaille <akim@epita.fr>
22294
22295 * src/system.h: Include `xalloc.h'.
22296 Remove it from the C files.
22297 * src/files.c (output_files): Free the obstacks.
22298 * src/lex.c (init_lex): Rename as...
22299 (lex_init): this.
22300 (lex_free): New.
22301 * src/main.c (main): Use it.
22302
22303 2001-09-24 Marc Autret <autret_m@epita.fr>
22304
22305 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
22306 to output informations in fout (FILE*).
22307 (open_graph, close_graph): Likewise.
22308 (output_graph, output_edge, output_node): Likewise.
22309 * src/vcg.h: Update function prototypes.
22310 * src/print_graph.c (print_graph): Open output graph file.
22311 (print_actions): Adjust.
22312 * src/files.h: Remove extern declaration.
22313 * src/files.c: Remove graph_obstack declaration.
22314 (open_files): Remove graph_obstack initialization.
22315 (output_files): Remove graph_obstack saving.
22316
22317 2001-09-24 Marc Autret <autret_m@epita.fr>
22318
22319 * src/files.c (compute_output_file_names): Fix.
22320
22321 2001-09-24 Marc Autret <autret_m@epita.fr>,
22322 Akim Demaille <akim@epita.fr>
22323
22324 * src/reader.c (reader): Remove call to free_symtab ().
22325 * src/main.c (main): Call it here.
22326 Include symtab.h.
22327 * src/conflicts.c (initialize_conflicts): Rename as...
22328 (solve_conflicts): this.
22329 * src/print.c (print_core, print_actions, print_state)
22330 (print_grammar): Dump to a file instead a `output_obstack'.
22331 (print_results): Dump `output_obstack', and then proceed with the
22332 FILE *.
22333 * src/files.c (compute_output_file_names, close_files): New.
22334 (output_files): Adjust.
22335 * src/main.c (main): Adjust.
22336
22337 2001-09-23 Marc Autret <autret_m@epita.fr>
22338
22339 * src/files.c (compute_header_macro): Computes header macro name
22340 from spec_defines_file when given.
22341
22342 2001-09-23 Marc Autret <autret_m@epita.fr>
22343
22344 * src/files.c (output_files): Add default extensions.
22345
22346 2001-09-22 Akim Demaille <akim@epita.fr>
22347
22348 * src/conflicts.c (finalize_conflicts): Rename as...
22349 (free_conflicts): this.
22350
22351 2001-09-22 Akim Demaille <akim@epita.fr>
22352
22353 * src/gram.c (gram_free): Rename back as...
22354 (dummy): this.
22355 (output_token_translations): Free `token_translations'.
22356 * src/symtab.c (free_symtab): Free the tag field.
22357
22358 2001-09-22 Akim Demaille <akim@epita.fr>
22359
22360 Remove `translations' as it is always set to true.
22361
22362 * src/gram.h: Adjust.
22363 * src/reader.c (packsymbols, parse_token_decl): Adjust
22364 * src/print.c (print_grammar): Adjust.
22365 * src/output.c (output_token_translations): Adjust.
22366 * src/lex.c (lex): Adjust.
22367 * src/gram.c: Be sure the set pointers to NULL.
22368 (dummy): Rename as...
22369 (gram_free): this.
22370
22371 2001-09-22 Akim Demaille <akim@epita.fr>
22372
22373 * configure.in: Invoke AM_LIB_DMALLOC.
22374 * src/system.h: Use dmalloc.
22375 * src/LR0.c: Be sure to have pointers initialized to NULL.
22376 (allocate_itemsets): Allocate kernel_items only if needed.
22377
22378 2001-09-22 Akim Demaille <akim@epita.fr>
22379
22380 * configure.in: Bump to 1.29b.
22381 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
22382 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
22383 need xmalloc.c in calc.y.
22384 From Pascal Bart.
22385
22386 2001-09-21 Akim Demaille <akim@epita.fr>
22387
22388 Version 1.29a.
22389 * Makefile.maint, config/config.guess, config/config.sub,
22390 * config/missing: Update from masters.
22391 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
22392 upon package.m4.
22393 * configure.in (ALL_LINGUAS): Add `tr'.
22394
22395 2001-09-21 Akim Demaille <akim@epita.fr>
22396
22397 * tests/Makefile.am (package.m4): Move to...
22398 ($(srcdir)/$(TESTSUITE)): here.
22399
22400 2001-09-20 Akim Demaille <akim@epita.fr>
22401
22402 * src/complain.c: No longer try to be standalone: use system.h.
22403 Don't assume __STDC__ is defined to 1. Just test if it is defined.
22404 * src/complain.h: Likewise.
22405 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
22406 Remove the unused variable `n'.
22407 From Albert Chin-A-Young.
22408
22409 2001-09-18 Marc Autret <autret_m@epita.fr>
22410
22411 * doc/bison.1: Update.
22412 * doc/bison.texinfo (Bison Options): Update --defines and --graph
22413 descriptions.
22414 (Option Cross Key): Update.
22415 Add --graph.
22416
22417 2001-09-18 Marc Autret <autret_m@epita.fr>
22418
22419 * tests/regression.at: New test (comment in %union).
22420
22421 2001-09-18 Marc Autret <autret_m@epita.fr>
22422
22423 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
22424 do that.
22425 Reported by Keith Browne.
22426
22427 2001-09-18 Marc Autret <autret_m@epita.fr>
22428
22429 * tests/output.at: Add tests for --defines and --graph.
22430
22431 2001-09-18 Marc Autret <autret_m@epita.fr>
22432
22433 * tests/output.at: Removes tests of %{header,src}_extension features.
22434
22435 2001-09-18 Akim Demaille <akim@epita.fr>
22436
22437 * tests/Makefile.am (package.m4): New.
22438 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
22439 (_AT_CHECK_CALC_ERROR): Likewise.
22440 Factor the `, ' part of verbose error messages.
22441
22442 2001-09-18 Marc Autret <autret_m@epita.fr>
22443
22444 * src/getargs.c (longopts): Declare --defines and --graph as options
22445 with optional arguments.
22446 * src/files.h: Add extern declarations.
22447 * src/files.c (spec_graph_file, spec_defines_file): New.
22448 (output_files): Update.
22449 Remove CPP-outed code.
22450
22451 2001-09-18 Marc Autret <autret_m@epita.fr>
22452
22453 Turn off %{source,header}_extension feature.
22454
22455 * src/files.c (compute_exts_from_gf): Update.
22456 (compute_exts_from_src): Update.
22457 (output_files): CPP-out useless code.
22458 * src/files.h: Remove {header,source}_extension extern declarations.
22459 * src/reader.c (parse_dquoted_param): CPP-out.
22460 (parse_header_extension_decl): Remove.
22461 (parse_source_extension_decl): Remove.
22462 (read_declarations): Remove cases tok_{hdrext,srcext}.
22463 * src/lex.c (percent_table): Remove {header,source}_extension entries.
22464 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
22465
22466 2001-09-10 Akim Demaille <akim@epita.fr>
22467
22468 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
22469 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
22470 (AT_CHECK_OUTPUT): this.
22471 Merely check ls' exit status, its output is useless.
22472
22473 2001-09-10 Akim Demaille <akim@epita.fr>
22474
22475 * tests/calc.at: Use m4_match.
22476 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
22477
22478 2001-09-10 Marc Autret <autret_m@epita.fr>,
22479 Akim Demaille <akim@epita.fr>
22480
22481 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
22482 enum color_e.
22483 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
22484 to `normal'.
22485 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
22486 * src/lex.h: Adjust prototype.
22487 (token_t): Add `tok_undef'.
22488 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
22489 (parse_percent_token): Now returns token_t.
22490 Add default statement in switch.
22491 (lex): Separate `c' as an input variable, from the token_t result
22492 part.
22493 (unlexed): Is a token_t.
22494
22495 2001-09-10 Akim Demaille <akim@epita.fr>
22496
22497 * configure.in: Bump to 1.29a.
22498
22499 2001-09-07 Akim Demaille <akim@epita.fr>
22500
22501 Version 1.29.
22502
22503 2001-08-30 Akim Demaille <akim@epita.fr>
22504
22505 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
22506 * m4/atconfig.m4: Remove.
22507 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
22508 * tests/bison: New.
22509 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
22510 m4_if, m4_patsubst, and m4_regexp.
22511 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
22512 `input' file instead of echo.
22513
22514 2001-08-29 Akim Demaille <akim@epita.fr>
22515
22516 Bump to 1.28e.
22517
22518 2001-08-29 Akim Demaille <akim@epita.fr>
22519
22520 Version 1.28d.
22521
22522 2001-08-29 Paul Eggert <eggert@twinsun.com>
22523
22524 * src/bison.simple (yyparse): Don't take the address of an
22525 item before the start of an array, as that doesn't conform to
22526 the C Standard.
22527
22528 2001-08-29 Robert Anisko <anisko_r@epita.fr>
22529
22530 * doc/bison.texinfo (Location Tracking Calc): New node.
22531
22532 2001-08-29 Paul Eggert <eggert@twinsun.com>
22533
22534 * src/output.c (output): Do not define const, as this now
22535 causes more problems than it cures.
22536
22537 2001-08-29 Akim Demaille <akim@epita.fr>
22538
22539 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
22540 the nodes.
22541 Be sure to tag the `detailmenu'.
22542
22543 2001-08-29 Akim Demaille <akim@epita.fr>
22544
22545 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
22546 download in a tmp dir.
22547
22548 2001-08-28 Marc Autret <autret_m@epita.fr>
22549
22550 * config/depcomp: New file.
22551
22552 2001-08-28 Marc Autret <autret_m@epita.fr>
22553
22554 * doc/bison.1 (mandoc): Adjust.
22555 From Juan Manuel Guerrero.
22556
22557 2001-08-28 Marc Autret <autret_m@epita.fr>
22558
22559 * src/print_graph.c (print_state): Fix.
22560
22561 2001-08-27 Marc Autret <autret_m@epita.fr>
22562
22563 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
22564 char * members.
22565 Echo modifications to the functions prototypes.
22566 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
22567
22568 2001-08-27 Marc Autret <autret_m@epita.fr>
22569
22570 * src/vcg.c: Include `xalloc.h'.
22571 (add_colorentry): New.
22572 (add_classname): New.
22573 (add_infoname): New.
22574 * src/vcg.h: Add new prototypes.
22575
22576 2001-08-27 Akim Demaille <akim@epita.fr>
22577
22578 * Makefile.maint: Sync. again with CVS Autoconf.
22579
22580 2001-08-27 Akim Demaille <akim@epita.fr>
22581
22582 * Makefile.maint: Formatting changes.
22583 (po-update, cvs-update, update): New targets.
22584 (AMTAR): Remove.
22585
22586 2001-08-27 Akim Demaille <akim@epita.fr>
22587
22588 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22589 * Makefile.maint: Sync. with CVS Autoconf.
22590
22591 2001-08-27 Marc Autret <autret_m@epita.fr>
22592
22593 * src/vcg.h (struct infoname_s): New.
22594 (struct colorentry_s): New.
22595 (graph_s): New fields {vertical,horizontal}_order in structure.
22596 Add `infoname' field.
22597 Add `colorentry' field;
22598 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
22599 (G_HORIZONTAL_ORDER): New.
22600 (G_INFONAME): New.
22601 (G_COLORENTRY): New.
22602 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
22603 Add output of `infoname'.
22604 Add output of `colorentry'.
22605
22606 2001-08-27 Marc Autret <autret_m@epita.fr>
22607
22608 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
22609 This one shadowed a global parameter.
22610
22611 2001-08-24 Marc Autret <autret_m@epita.fr>
22612
22613 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
22614 instead of `unsigned'.
22615 (print_state): Do not call obstack_object_size () in obstack_grow ()
22616 to avoid macro variables shadowing.
22617
22618 2001-08-23 Marc Autret <autret_m@epita.fr>
22619
22620 * src/lex.c (percent_table): Typo: s/naem/name/.
22621 Add graph option.
22622 Normalize new options declarations.
22623
22624 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
22625
22626 * tests/suite.at: Exercise %header_extension and %source_extension.
22627
22628 2001-08-16 Marc Autret <autret_m@epita.fr>
22629
22630 * src/reader.c (parse_dquoted_param): New.
22631 (parse_header_extension_decl): Use it.
22632 (parse_source_extension_decl): Likewise.
22633
22634 2001-08-16 Marc Autret <autret_m@epita.fr>
22635
22636 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
22637 (get_xxxx_str): Use assert () instead of complain ().
22638 Remove return invokations in default cases.
22639 (get_decision_str): Modify default behaviour. Remove second argument.
22640 Echo modifications on calls.
22641 (output_graph): Fix.
22642
22643 2001-08-16 Marc Autret <autret_m@epita.fr>
22644
22645 * src/getargs.c (usage): Update with ``-g, --graph''.
22646
22647 2001-08-16 Marc Autret <autret_m@epita.fr>
22648
22649 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
22650 (Option Cross Key): Likewise.
22651 * doc/bison.1: Update.
22652
1c8c2190
PB
226532001-09-25 Pascal Bart <pascal.bart@epita.fr>
22654
22655 * src/output.c (output_master_parser): Don't finish action_obstack.
22656 (output_parser): Don't care about the muscle action, here.
22657 (prepare): Copy the action_obstack in the action muscle.
22658 (output): Free action_obstack.
22659
180d45ba
PB
226602001-09-23 Pascal Bart <pascal.bart@epita.fr>
22661
22662 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
22663 will contain `%union' declaration.
22664 (parse_union_decl): Delete #line directive output.
22665 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
22666 informations about %union.
22667 (parse_union_decl): Copy the union_obstack in the muscle stype.
22668 * src/bison.simple: Add new #line directive.
22669 Add typdef %%stype YYSTYPE.
22670
c51d1a19
PB
226712001-09-23 Pascal Bart <pascal.bart@epita.fr>
22672
22673 * src/bison.simple: Add new `#line' directive.
22674
6f9344da
PB
226752001-09-22 Pascal Bart <pascal.bart@epita.fr>
22676
22677 * src/bison.simple: New `#line' directive.
22678 * src/output.c (output_parser): Support new dynamic muscle input_line.
22679
652def80
MA
226802001-09-22 Marc Autret <autret_m@epita.fr>
22681
22682 * src/output.c (output_master_parser): New.
22683 (output_parser): Be more re-entrant.
22684
25b222fa
MA
226852001-09-21 Marc Autret <autret_m@epita.fr>
22686
22687 * src/reader.c (copy_definition, parse_union_decl): Update and use
22688 `linef' muscle.
22689 (copy_action): Likewise.
22690 Use obstack_1grow ().
22691 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
22692
6bc35ae5
MA
226932001-09-21 Marc Autret <autret_m@epita.fr>
22694
22695 * src/options.c (option_table): Adjust.
22696 * src/lex.c (parse_percent_token): Fix.
22697
c0629aa1
PB
226982001-09-20 Pascal Bart <pascal.bart@epita.fr>
22699
22700 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 22701
82b6d266
PB
227022001-09-20 Pascal Bart <pascal.bart@epita.fr>
22703
22704 * src/lex.c (parse_percent_token): Change type of variable `tx', which
22705 is now an option_table_struct*.
22706 (option_strcmp): New function option_strcmp.
22707 (parse_percent_token): Call option_strcmp.
22708 * src/getargs.c (xalloc.h, options.h): Include it.
22709 (getargs): Call create_long_option_table.
22710 (getargs): Free longopts at the end of the function.
22711 (shortopts): Move in options.c.
22712 * src/options.c (create_long_option_table): New function. Convert
22713 information from option_table to option structure.
22714 * src/reader.c (options.h): Include it.
22715
22716 * src/Makefile.am: Adjust.
22717 * src/options.c (option_table): Create from longopts and percent_table.
22718 * src/getargs.c (longopts): Delete.
22719 * src/lex.c (struct percent_table_struct): Delete.
22720 (percent_table): Delete.
22721 (options.h): Include it.
22722 * src/options.c: Create.
22723 * src/options.h: Create.
22724 Declare enum opt_access_e.
22725 Define struct option_table_struct.
22726
75f5aaea
MA
227272001-09-20 Marc Autret <autret_m@epita.fr>
22728
22729 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
22730 sections of Bison.
22731
f508cb0a
PB
227322001-09-19 Pascal Bart <pascal.bart@epita.fr>
22733
22734 * src/bison.simple: s/%%filename/%%skeleton.
22735 * src/muscle_tab.c (getargs.h): Include it.
22736 (muscle_init): Insert new muscle skeleton.
22737
13105fc1
PB
227382001-09-18 Pascal Bart <pascal.bart@epita.fr>
22739
22740 * src/output.c (output_parser): Delete unused variable actions_dumped.
22741
b0c4483e
PB
227422001-09-07 Pascal Bart <pascal.bart@epita.fr>
22743
22744 * src/output.c (output): Delete call to reader_output_yylsp.
22745 * src/reader.c (reader): Likewise.
ba0fe3c7 22746 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 22747
11d82f03
MA
227482001-09-02 Marc Autret <autret_m@epita.fr>
22749
22750 * src/reader.c: Include muscle_tab.h.
22751 (parse_union_decl): Update.
22752 (parse_macro_decl): Rename parse_muscle_decl.
22753 Update to use renamed functions and variable.
22754 (read_declarations, copy_action, read_additionnal_code, : Updated
22755 with correct variables and functions names.
22756 (packsymbols, reader): Likewise.
342b8b6e 22757
11d82f03 22758 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 22759
11d82f03
MA
22760 * src/output.c: Include muscle_tab.h
22761 In all functions using macro_insert, change by using muscle_insert ().
22762 (macro_obstack): Rename muscle_obstack.
22763 Echo modifications in the whole file.
22764 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
22765 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
22766 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
22767
22768 * src/muscle_tab.h: Update double inclusion macros.
22769 (macro_entry_s): Rename muscle_entry_s.
22770 Update prototypes.
342b8b6e 22771
11d82f03
MA
22772 * src/muscle_tab.c: Include muscle_tab.h.
22773 Rename macro_tabble to muscle_table.
22774 (mhash1, mhash2, mcmp): Use muscle_entry.
22775 (macro_init): Rename muscle_init. Update.
22776 (macro_insert): Rename muscle_insert. Update.
22777 (macro_find): Rename muscle_find. Update.
22778
22779 * src/main.c: Include muscle_tab.h.
22780 (main): Call muscle_init ().
22781 * src/Makefile.am (bison_SOURCES): Echo modifications.
22782
93a37297
MA
227832001-09-02 Marc Autret <autret_m@epita.fr>
22784
f753cd62 22785 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 22786
f753cd62
MA
22787 * src/muscle_tab.c, src/muscle_tab.h: Add files.
22788
227892001-09-02 Marc Autret <autret_m@epita.fr>
22790
22791 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 22792
682d48cd
PB
227932001-09-01 Pascal Bart <pascal.bart@epita.fr>
22794
342b8b6e 22795 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
22796 filename.
22797
087c8fda
MA
227982001-09-01 Marc Autret <autret_m@epita.fr>
22799
22800 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
22801 to an explicit value to activate the feature. We do it here.
22802
dda680cb
PB
228032001-08-31 Pascal Bart <pascal.bart@epita.fr>
22804
22805 * src/output.c (prepare): Delete the `filename' muscule insertion.
22806 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
22807 (parse_union_decl): Likewise.
22808 * src/macrotab.c (macro_init): Initialize filename by infile.
22809
9e644e64
MA
228102001-08-31 Marc Autret <autret_m@epita.fr>
22811
22812 * src/bison.simple (YYLSP_NEEDED): New definition.
22813 * src/output.c (prepare): Add macro insertion of `locations_flag'
22814
17da6427
PB
228152001-08-31 Pascal Bart <pascal.bart@epita.fr>
22816
22817 * src/output.c (prepare): Delete insertion of previous muscles,
22818 and insert the `prefix' muscles.
22819 * src/macrotab.c (macro_init): Likewise.
22820 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 22821 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
22822 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
22823 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 22824 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
22825 name_prefix.
22826
e8cb70b9
PB
228272001-08-31 Pascal Bart <pascal.bart@epita.fr>
22828
22829 * src/main.c (main): Standardize.
22830 * src/output.c (output_table_data, output_parser): Likewise.
22831 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
22832
63c2d5de
MA
228332001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
22834
342b8b6e 22835 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
22836 %%epilogue.
22837 * src/output.c (output): Rename %%declarations to %%prologue.
22838 * src/bison.simple: Echo modifications.
342b8b6e 22839
d8cb5183
MA
228402001-08-31 Marc Autret <autret_m@epita.fr>
22841
22842 * src/reader.c (readgram): CleanUp.
22843 (output_token_defines): Likewise.
22844 (packsymbols): Likewise.
22845 (reader): Likewise.
22846 * src/output.c (output): CPP-out useless code.
22847
6c686258
PB
228482001-08-31 Pascal Bart <pascal.bart@epita.fr>
22849
342b8b6e 22850 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
22851 output_trailers and output_headers.
22852 * src/output.h: Remove obsolete functions prototypes of output_headers
22853 and output_trailers.
22854
8f451ef7
PB
228552001-08-30 Pascal Bart <pascal.bart@epita.fr>
22856
22857 * src/main.c: Include macrotab.h.
342b8b6e 22858 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
22859 Adjust functions prototypes.
22860 * src/macrotab.c (macro_insert): Constify key and value.
22861 (macro_find): Constify key.
22862 (macro_insert): Include 'xalloc.h'
22863 (macro_insert): Use XMALLOC.
22864 (macro_find): Constify return value.
22865 * src/output.c (output_table_data): Rename table to table_data.
22866 (output_parser): Constify macro_key, macro_value.
22867
997b6fd0 228682001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
22869
22870 * src/reader.c (parse_skel_decl): New.
342b8b6e 22871 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
22872 * src/lex.h (token_t): New token `tok_skel'.
22873 * src/lex.c (percent_table): Add skeleton option entry.
22874 Standardize.
22875
ff48177d
MA
228762001-08-29 Marc Autret <autret_m@epita.fr>
22877
22878 * src/bison.simple: Add %%user_code directive at the end.
22879 * src/reader.c (read_additionnal_code): New.
22880 (reader): Use it.
22881 * src/output.c (output_program): Remove.
22882 (output): Update.
22883
b33160bf
MA
228842001-08-28 Marc Autret <autret_m@epita.fr>
22885
22886 * src/output.c (output_actions): Clean up.
4e5caae2 22887 (output_gram): CPP-out useless code.
b33160bf
MA
22888 * src/reader.c (reader): Clean up, CPP-out useless code.
22889
d1a2daf7
PB
228902001-08-28 Pascal Bart <pascal.bart@epita.fr>
22891
342b8b6e 22892 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 22893 directive.
d1a2daf7
PB
22894 * src/bison.simple: Add `%%definitions'.
22895
2b763dfe
MA
228962001-08-28 Marc Autret <autret_m@epita.fr>
22897
22898 * config/depcomp: New file.
22899
f1a87ef6
PE
229002001-08-27 Paul Eggert <eggert@twinsun.com>
22901
22902 * src/bison.simple (yyparse): Don't take the address of an
22903 item before the start of an array, as that doesn't conform to
22904 the C Standard.
22905
82e236e2
RA
229062001-08-27 Robert Anisko <robert.anisko@epita.fr>
22907
f1a87ef6 22908 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
22909 obstack. It was done too late here.
22910
22911 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
22912 completely wrong.
22913 (reader): Initialize the macro obstack here, since we need it to grow
22914 '%define' directives.
22915
22916 * src/reader.h: Declare the macro obstack as extern.
22917
b0cfa28a
RA
229182001-08-27 Robert Anisko <robert.anisko@epita.fr>
22919
22920 * src/output.c (output_parser): Fix. Store single '%' characters in
22921 the output obstack instead of throwing them away.
22922
6fc74234
AD
229232001-08-27 Akim Demaille <akim@epita.fr>
22924
22925 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22926
9c76d118
RA
229272001-08-25 Robert Anisko <robert.anisko@epita.fr>
22928
22929 * lib/Makefile.am: Adjust.
22930
a8289c62
RA
229312001-08-25 Robert Anisko <robert.anisko@epita.fr>
22932
22933 * src/bison.simple: Update and add '%%' directives.
22934
b6610515
RA
229352001-08-25 Robert Anisko <robert.anisko@epita.fr>
22936
22937 * src/reader.c (reader): Remove calls to 'output_headers' and
22938 'output_trailers'. Remove some C output.
22939 (readgram): Disable a piece of code that was writing a default
22940 definition for 'YYSTYPE'.
22941 (reader_output_yylsp): Remove.
22942 (packsymbols): Output token defintions to a macro.
22943 (copy_definition): Disable C output.
6fc74234 22944
b6610515
RA
22945 * src/reader.c (parse_macro_decl): New function used to parse macro
22946 declarations.
22947 (copy_string2): Put the body of copy_string into this new function.
22948 Add a parameter to let the caller choose whether he wants to copy the
22949 string delimiters or not.
22950 (copy_string): Be a simple call to copy_string2 with the last argument
22951 bound to true.
22952 (read_declarations): Add case for macro definition.
22953 (copy_identifier): New.
6fc74234 22954 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
22955 rather than lex.
22956
26f609ff
RA
229572001-08-25 Robert Anisko <robert.anisko@epita.fr>
22958
22959 * src/output.c (prepare): Add prefixed names.
22960 (output_parser): Output semantic actions.
22961 (output_parser): Fix bug on '%%line' directives.
6fc74234 22962
26f609ff
RA
22963 * src/output.c (output_headers): Remove. The C code printed by this
22964 function should now be in the skeletons.
22965 (output_trailers): Remove.
22966 (output): Disable call to 'reader_output_yylsp'.
22967 (output_rule_data): Do not output tables to the table obstack.
22968
22969 * src/output.c: Remove some C dedicated output.
22970 Improve the use of macro and output obstacks.
22971 (output_defines): Remove.
6fc74234 22972
26f609ff
RA
22973 * src/output.c (output_token_translations): Associate 'translate'
22974 table with a macro. No output to the table obstack.
22975 (output_gram): Same for 'rhs' and 'prhs'.
22976 (output_stos): Same for 'stos'.
22977 (output_rule_data): Same for 'r1' and 'r2'.
22978 (token_actions): Same for 'defact'.
22979 (goto_actions): Same for 'defgoto'.
22980 (output_base): Same for 'pact' and 'pgoto'.
22981 (output_table): Same for 'table'.
22982 (output_check): Same for 'check'.
6fc74234 22983
26f609ff
RA
22984 * src/output.c (output_table_data): New function.
22985 (output_short_table): Remove.
22986 (output_short_or_char_table): Remove.
6fc74234 22987
26f609ff
RA
22988 * src/output.c (output_parser): Replace most of the skeleton copy code
22989 with something new. Skeletons are now processed character by character
22990 rather than line by line, and Bison looks for '%%' macros. This is the
22991 first step in making Bison's output process (a lot) more flexible.
22992 (output_parser): Use the macro table.
22993
6f43b113
RA
229942001-08-25 Robert Anisko <robert.anisko@epita.fr>
22995
22996 * src/main.c (main): Initialize the macro table.
22997
dd3127cf
RA
229982001-08-25 Robert Anisko <robert.anisko@epita.fr>
22999
23000 * src/lex.c (percent_table): Add tok_define.
23001 * src/lex.h: Add tok_define.
23002
aa321494
RA
230032001-08-25 Robert Anisko <robert.anisko@epita.fr>
23004
23005 * src/macrotab.c: New file.
23006 * src/macrotab.h: New file.
23007 * src/Makefile.am: Update.
23008
68bd3b6b
RA
230092001-08-25 Robert Anisko <robert.anisko@epita.fr>
23010
23011 * lib/hash.c: New file.
23012 * lib/hash.h: New file.
23013 * lib/Makefile.am: Update.
23014
45f8dd1e
AD
230152001-08-15 Akim Demaille <akim@epita.fr>
23016
23017 Version 1.28c.
23018
40a64a7a 230192001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
23020
23021 * src/reader.c (readgram): Indent output macro YYSTYPE.
23022 (packsymbols): Likewise.
23023 (output_token_defines): Likewise.
23024 * src/files.c: Standardize.
23025 (compute_header_macro): New.
23026 (defines_obstack_save): New. Use compute_header_macro.
23027 (output_files): Update. Use defines_obstack_save.
23028
f9a8293a
AD
230292001-08-15 Akim Demaille <akim@epita.fr>
23030
23031 * doc/bison.texinfo (Table of Symbols): Document
23032 YYSTACK_USE_ALLOCA.
23033
150ca7a7
AD
230342001-08-15 Akim Demaille <akim@epita.fr>
23035
23036 * missing: Update from CVS Automake.
23037 * config/config.guess, config/config.sub, config/texinfo.tex:
23038 Update from gnu.org.
23039
69b5cec4
AD
230402001-08-15 Akim Demaille <akim@epita.fr>
23041
23042 * Makefile.maint: Sync with CVS Autoconf.
23043
f2b5126e
PB
230442001-08-14 Pascal Bart <pascal.bart@epita.fr>
23045
69b5cec4 23046 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
23047 `fdl.texi'.
23048 * doc/fdl.texi: Add to package.
23049
4ecbf796
MA
230502001-08-14 Marc Autret <autret_m@epita.fr>
23051
23052 Turn on %{source,header}_extension features.
23053
69b5cec4 23054 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
23055 source_extension.
23056 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 23057 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
23058 between options.
23059
95fb5662
MA
230602001-08-14 Marc Autret <autret_m@epita.fr>
23061
23062 * src/files.c (compute_base_names): Add extensions computing when
23063 `--file-prefix' used.
23064 Standardize function calls.
23065
78d09da9
MA
230662001-08-13 Marc Autret <autret_m@epita.fr>
23067
69b5cec4 23068 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
23069 defining it (defined but null disables alloca).
23070
5a009f2c
MA
230712001-08-13 Marc Autret <autret_m@epita.fr>
23072
23073 * src/bison.simple (_yy_memcpy): CPP reformat.
23074
1e41465a
PB
230752001-08-13 Pascal Bart <pascal.bart@epita.fr>
23076
23077 * tests/atconfig.in (CPPFLAGS): Fix.
23078
c67a198d
PB
230792001-08-10 Pascal Bart <pascal.bart@epita.fr>
23080
79282c6c 23081 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
23082 `gpl.texi'.
23083 * doc/gpl.texi: Add to package.
23084
09a6de7e
MA
230852001-08-10 Marc Autret <autret_m@epita.fr>
23086
23087 * src/print_graph.h: Fix.
23088 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
23089
b77b9ee0
AD
230902001-08-10 Akim Demaille <akim@epita.fr>
23091
23092 * src/system.h: Provide default declarations for stpcpy, strndup,
23093 and strnlen.
23094
3e259915
MA
230952001-08-10 Robert Anisko <anisko_r@epita.fr>
23096
23097 * doc/bison.texinfo (Locations): Update @$ stuff.
23098
ca96bc2d
MA
230992001-08-09 Robert Anisko <anisko_r@epita.fr>
23100
23101 * src/bison.simple (YYLLOC_DEFAULT): Update.
23102 (yyparse): Adjust.
23103
fdc6758b
MA
231042001-08-08 Marc Autret <autret_m@epita.fr>
23105
b77b9ee0 23106 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
23107 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
23108 Reported by Fabrice Bauzac.
957d4dbf 23109
600cad3b
MA
231102001-08-08 Marc Autret <autret_m@epita.fr>
23111
23112 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
23113 * src/vcg.c (output_node): Fix.
23114 * src/vcg.h: Cleanup.
23115 * src/print_graph.c: Add comments.
b77b9ee0 23116 (node_output_size): New global variable. Simplify the formatting of
600cad3b 23117 the VCG graph output.
b77b9ee0 23118 (print_actions): Unused code is now used. It notifies the final state
600cad3b 23119 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 23120 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
23121 blue.
23122 Get the current node name and node_obstack by argument.
23123 (node_obstack): New variable.
23124 (print_state): Manage node_obstack.
23125 (print_core): Use node_obstack given by argument.
23126 A node is not only computed here but in print_actions also.
23127 (print_graph): CPP out useless code instead of commenting it.
23128
976e528f
AD
231292001-08-07 Pascal Bart <pascal.bart@epita.fr>
23130
23131 * tests/atconfig.in (CPPFLAGS): Fix.
23132
20e8e5ca
AD
231332001-08-07 Akim Demaille <akim@epita.fr>
23134
23135 * src/print_graph.c (quote): New.
23136 (print_core): Use it.
23137
957d4dbf 231382001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 23139
3e3da797
AD
23140 * src/vcg.c (complain.h): Include it.
23141 Unepitaize `return' invocations.
c4b66126 23142 [NDEBUG] (main): Remove.
79282c6c 23143 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
23144 * src/files.c (open_files): Initialize graph_obstack.
23145 * src/print_graph.c (print_actions): CPP out useless code.
23146 (print_core): Don't output the last `\n' in labels.
23147 Use `quote'.
23148 * src/files.c (output_files): Output the VCG file.
23149 * src/main.c (main): Invoke print_graph ();
3e3da797 23150
957d4dbf 231512001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
23152
23153 Automaton VCG graph output.
23154 Using option ``-g'' or long option ``--graph'', you can generate
23155 a gram_filename.vcg file containing a VCG description of the LALR (1)
23156 automaton of your grammar.
23157
23158 * src/main.c: Call to print_graph() function.
23159 * src/getargs.h: Update.
23160 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
23161 (graph_flag): New flag.
23162 (longopts): Update.
23163 (getargs): Add case `g'.
23164 * src/files.c (graph_obstack): New obstack struct.
23165 (open_files): Initialize new obstack.
23166 (output_files): Saves graph_obstack if required.
23167 * src/files.h (graph_obstack): New extern declaration.
23168 * src/Makefile.am: Add new source files.
23169
927c1557 231702001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
23171
23172 * src/print_graph.c, src/print_graph.h (graph): New.
23173 * src/vcg.h: New file.
23174 * src/vcg.c: New file, VCG graph handling.
23175
7333d403
AD
231762001-08-06 Marc Autret <autret_m@epita.fr>
23177
23178 Add of %source_extension and %header_extension which specify
23179 the source or/and the header output file extension.
23180
23181 * src/files.c (compute_base_names): Remove initialisation of
23182 src_extension and header_extension.
23183 (compute_exts_from_gf): Update.
23184 (compute_exts_from_src): Update.
23185 (output_files): Update.
23186 * src/reader.c (parse_header_extension_decl): New.
23187 (parse_source_extension_decl): New.
23188 (read_declarations): New case statements for the new tokens.
23189 * src/lex.c (percent_table): Add entries for %source_extension
23190 and %header_extension.
23191 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
23192
84163231
AD
231932001-08-06 Marc Autret <autret_m@epita.fr>
23194
23195 * configure.in: Bump to 1.28c.
23196 * doc/bison.texinfo: Texinfo thingies.
23197
8303fc42
AD
231982001-08-04 Pascal Bart <pascal.bart@epita.fr>
23199
23200 * tests/atconfig.in (CPPFLAGS): Add.
23201 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
23202
70a84437
AD
232032001-08-03 Akim Demaille <akim@epita.fr>
23204
23205 Version 1.28b.
23206
2ce10144
AD
232072001-08-03 Akim Demaille <akim@epita.fr>
23208
23209 * tests/Makefile.am (check-local): Ship testsuite.
23210 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
23211 Include `string.h'.
23212
1e3e4bc1
AD
232132001-08-03 Akim Demaille <akim@epita.fr>
23214
23215 * configure.in: Try using -Wformat when compiling.
23216
42b45b7f
AD
232172001-08-03 Akim Demaille <akim@epita.fr>
23218
23219 * configure.in: Bump to 1.28b.
23220
8f13fe33
AD
232212001-08-03 Akim Demaille <akim@epita.fr>
23222
23223 * src/complain.c: Adjust strerror_r portability issues.
23224
b37ba92c
AD
232252001-08-03 Akim Demaille <akim@epita.fr>
23226
23227 Version 1.28a.
23228
b0ce6046
AD
232292001-08-03 Akim Demaille <akim@epita.fr>
23230
23231 * src/getargs.c, src/getarg.h (skeleton)): Constify.
23232 * src/lex.c (literalchar): Avoid name clashes on `buf'.
23233 * src/getargs.c: Include complain.h.
23234 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
23235 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
23236
d01c415b
AD
232372001-08-03 Akim Demaille <akim@epita.fr>
23238
23239 * src/reader.c (readgram): Display hidden chars in error messages.
23240
459dd1a6
AD
232412001-08-03 Akim Demaille <akim@epita.fr>
23242
23243 Update to gettext 0.10.39.
23244
53b74c0c
AD
232452001-08-03 Akim Demaille <akim@epita.fr>
23246
23247 * lib/strspn.c: New.
23248
234a3be3
AD
232492001-08-01 Marc Autret <autret_m@epita.fr>
23250
23251 * doc/bison.texinfo: Update.
23252 * doc/bison.1 (mandoc): Update.
23253 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
23254 * src/files.c: Support output files extensions computing.
23255 (src_extension): New static variable.
23256 (header_extension): New static variable.
23257 (tr): New function.
23258 (get_extension_index): New function, gets the index of an extension
23259 filename in a string.
23260 (compute_exts_from_gf): New function, computes extensions from the
23261 grammar file extension.
23262 (compute_exts_from_src): New functions, computes extensions from the
23263 C source file extension, file given by ``-o'' option.
23264 (compute_base_names): Update.
23265 (output_files): Update.
23266
847bf1f5
AD
232672001-08-01 Robert Anisko <anisko_r@epita.fr>
23268
d995fee7 23269 * doc/bison.texi: Document @$.
847bf1f5
AD
23270 (Locations): New section.
23271
d074a105
AD
232722001-07-18 Akim Demaille <akim@epita.fr>
23273
23274 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
23275 * config/prev-version.txt, config/move-if-change: New.
23276 * Makefile.am: Adjust.
23277
3419715d
AD
232782001-07-08 Pascal Bart <pascal.bart@epita.fr>
23279
23280 * src/bison.simple (yyparse): Suppress warning `comparaison
23281 between signed and unsigned'.
23282
62ab6972
AD
232832001-07-05 Pascal Bart <pascal.bart@epita.fr>
23284
23285 * src/getargs.h (raw_flag): Remove.
23286 * src/getargs.c: Die on `-r'/`--raw'.
23287 * src/lex.c (parse_percent_token): Die on `%raw'.
23288 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
23289 * tests/calc.at: Suppress test with option `--raw'.
23290
1e24cc5b
AD
232912001-07-14 Akim Demaille <akim@epita.fr>
23292
23293 * config/: New.
23294 * configure.in: Require Autoconf 2.50.
23295 Update to gettext 0.10.38.
23296
32dfccf8
AD
232972001-03-16 Akim Demaille <akim@epita.fr>
23298
23299 * doc/bison.texinfo: ANSIfy the examples.
23300
cd5bd6ac
AD
233012001-03-16 Akim Demaille <akim@epita.fr>
23302
23303 * getargs.c (skeleton): New variable.
23304 (longopts): --skeleton is a new option.
23305 (shortopts, getargs): -S is a new option.
23306 * getargs.h: Declare skeleton.
23307 * output.c (output_parser): Use it.
23308
5141b016
AD
233092001-03-16 Akim Demaille <akim@epita.fr>
23310
23311 * m4/strerror_r.m4: New.
23312 * m4/error.m4: Run AC_FUNC_STRERROR_R.
23313 * lib/error.h, lib/error.c: Update.
23314
447992b9
AD
233152001-03-16 Akim Demaille <akim@epita.fr>
23316
23317 * src/getargs.c (longopts): Clean up.
23318
274d42ce
AD
233192001-02-21 Akim Demaille <akim@epita.fr>
23320
23321 * src/reader.c (gensym): `gensym_count' is your own.
23322 Use a static buf to create the symbol name, as token_buffer is no
23323 longer a buffer.
23324
22c821f3
AD
233252001-02-08 Akim Demaille <akim@epita.fr>
23326
23327 * src/conflicts.c (conflict_report): Be sure not to append to res
23328 between two calls, which could happen if both first sprintf were
23329 skipped, but not the first cp += strlen.
23330
18569462
AD
233312001-02-08 Akim Demaille <akim@epita.fr>
23332
23333 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
23334 New, from fileutils 4.0.37.
23335 * configure.in: Require Autoconf 2.49c. I took some time before
23336 making this decision. This is the only way out for portability
23337 issues in Bison, it would mean way too much duplicate effort to
23338 import in Bison features implemented in 2.49c since 2.13.
23339 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
23340
0d8f3c8a
AD
233412001-02-02 Akim Demaille <akim@epita.fr>
23342
23343 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 23344 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 23345
f17bcd1f
AD
233462001-01-19 Akim Demaille <akim@epita.fr>
23347
23348 Get rid of the ad hoc handling of token_buffer in the scanner: use
23349 the obstacks.
23350
23351 * src/lex.c (token_obstack): New.
23352 (init_lex): Initialize it. No longer call...
23353 (grow_token_buffer): this. Remove it.
23354 Adjust all the places which used it to use the obstack.
23355
511e79b3
AD
233562001-01-19 Akim Demaille <akim@epita.fr>
23357
23358 * src/lex.h: Rename all the tokens:
23359 s/\bENDFILE\b/tok_eof/g;
23360 s/\bIDENTIFIER\b/tok_identifier/g;
23361 etc.
23362 Let them be enums, not #define, to ease debugging.
23363 Adjust all the code.
23364
0d6508ef
AD
233652001-01-18 Akim Demaille <akim@epita.fr>
23366
23367 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
23368 * src/lex.c (maxtoken, grow_token_buffer): Static.
23369
6deb4447
AD
233702001-01-18 Akim Demaille <akim@epita.fr>
23371
23372 Since we now use obstacks, more % directives can be enabled.
23373
23374 * src/lex.c (percent_table): Also accept `%yacc',
23375 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
23376 `%debug'.
23377 Handle the actions for `%semantic_parser' and `%pure_parser' here,
23378 instead of returning a token.
23379 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
23380 * src/reader.c (read_declarations): Adjust.
23381 * src/files.c (open_files): Don't call `compute_base_names', don't
23382 compute `attrsfile' since they depend upon data which might be
23383 *in* the input file now.
23384 (output_files): Do it here.
23385 * src/output.c (output_headers): Document the fact that this patch
23386 introduces a guaranteed SEGV for semantic parsers.
23387 * doc/bison.texinfo: Document them.
23388 * tests/suite.at: Exercise these %options.
23389
ff4423cc
AD
233902000-12-20 Akim Demaille <akim@epita.fr>
23391
23392 Also handle the output file (--verbose) with obstacks.
23393
23394 * files.c (foutput): Remove.
23395 (output_obstack): New.
23396 Adjust all dependencies.
23397 * src/conflicts.c: Return a string.
23398 * src/system.h (obstack_grow_string): Rename as...
23399 (obstack_sgrow): this. Be ready to work with non literals.
23400 (obstack_fgrow4): New.
23401
956dba3a
AD
234022000-12-20 Akim Demaille <akim@epita.fr>
23403
23404 * src/files.c (open_files): Fix the computation of short_base_name
23405 in the case of `-o foo.tab.c'.
23406
337bab46
AD
234072000-12-20 Akim Demaille <akim@epita.fr>
23408
23409 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
23410 (copy_dollar): Now that everything uses obstacks, get rid of the
23411 FILE * parameters.
23412
5d3214b8
AD
234132000-12-20 Akim Demaille <akim@epita.fr>
23414
23415 * src/files.c (open_files): Actually the `.output' file is based
23416 on the short_base_name, not base_name.
23417 * tests/suite.at (Checking output file names): Adjust.
23418
29092a57
AD
234192000-12-20 Akim Demaille <akim@epita.fr>
23420
23421 * src/bison.s1: Remove, we now use directly...
23422 * src/bison.simple: this.
23423 * src/Makefile.am: Use pkgdata instead of data.
23424
ea5607fd
AD
234252000-12-20 Akim Demaille <akim@epita.fr>
23426
23427 * src/files.c (guard_obstack): New.
23428 (open_files): Initialize it.
23429 (output_files): Dump it...
23430 * src/files.h: Export it.
23431 * src/reader.c (copy_guard): Use it.
23432
27110317
AD
234332000-12-19 Akim Demaille <akim@epita.fr>
23434
23435 * src/files.c (outfile, defsfile, actfile): Removed as global
23436 vars.
23437 (open_files): Don't compute them.
23438 (output_files): Adjust.
23439 (base_name, short_base_name): Be global.
23440 Adjust dependencies.
23441
19c50364
AD
234422000-12-19 Akim Demaille <akim@epita.fr>
23443
23444 * src/files.c (strsuffix): New.
23445 (stringappend): Be just like strcat but allocate.
23446 (base_names): Eve out from open_files.
23447 Try to simplify the rather hairy computation of base_name and
23448 short_base_name.
23449 (open_files): Use it.
23450 * tests/suite.at (Checking output file names): New test.
23451
573c1d9f
AD
234522000-12-19 Akim Demaille <akim@epita.fr>
23453
23454 * src/system.h (obstack_grow_literal_string): Rename as...
23455 (obstack_grow_string): this.
23456 * src/output.c (output_parser): Recognize `%% actions' instead of
23457 `$'.
23458 * src/bison.s1: s/$/%% actions/.
23459 * src/bison.hairy: Likewise.
23460
ef7ddedd
AD
234612000-12-19 Akim Demaille <akim@epita.fr>
23462
23463 * src/output.c (output_parser): Compute the `#line' lines when
23464 there are.
23465 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
23466 Suggested by Hans Aberg.
23467
ff61dabd
AD
234682000-12-19 Akim Demaille <akim@epita.fr>
23469
23470 Let the handling of the skeleton files be local to the procedures
23471 that use it.
23472
23473 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
23474 longer static.
23475 (fparser, open_extra_files): Remove.
23476 (open_files, output_files): Don't take care of fparser.
23477 * src/files.h: Adjust.
23478 * src/output.c (output_parser): Open and close the file to the
23479 skeleton.
23480 * src/reader.c (read_declarations): When %semantic_parser, open
23481 fguard.
23482
55b96341
AD
234832000-12-19 Akim Demaille <akim@epita.fr>
23484
23485 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
23486 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
23487
358c15b7
AD
234882000-12-19 Akim Demaille <akim@epita.fr>
23489
23490 * src/files.c (open_files): Yipee! We no longer need all the code
23491 looking for `/tmp' since we have no tmp file.
23492
7de3329e
AD
234932000-12-19 Akim Demaille <akim@epita.fr>
23494
23495 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
23496 New macros.
23497 * src/files.c (open_files): Less dependency on MSDOS etc.
23498
3abcd459
AD
234992000-12-14 Akim Demaille <akim@epita.fr>
23500
23501 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
23502 Provide a default definition.
23503 Use it when executing the default @ action.
23504 * src/reader.c (reader_output_yylsp): No longer include
23505 `timestamp' and `text' in the default YYLTYPE.
23506
2a91a95e
AD
235072000-12-12 Akim Demaille <akim@epita.fr>
23508
23509 * src/reader.c (copy_definition, parse_union_decl, copy_action)
23510 (copy_guard): Quote the file names.
23511 Reported by Laurent Mascherpa.
23512
14d3eb9b
AD
235132000-12-12 Akim Demaille <akim@epita.fr>
23514
23515 * src/output.c (output_headers, output_program, output): Be sure
23516 to escape special characters when outputting filenames.
23517 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
23518 (output_headers): Don't depend on them, Use ACTSTR.
23519
d7045ec6
AD
235202000-11-17 Akim Demaille <akim@epita.fr>
23521
23522 * lib/obstack.h: Formatting changes.
23523 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
23524 prevents type checking.
23525 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
23526 cast the value to (void *): assigning a `foo *' to a `void *'
23527 variable is valid.
23528 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
23529 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
23530 append characters.
23531
6fd54b73
AD
235322000-11-17 Akim Demaille <akim@epita.fr>
23533
23534 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
23535 as...
23536 (suite.m4, regression.m4, calc.m4): these.
23537 * tests/atgeneral.m4: Update from CVS Autoconf.
23538
4c50eae6
AD
235392000-11-17 Akim Demaille <akim@epita.fr>
23540
23541 * tests/regression.m4 (%union and --defines): New test,
23542 demonstrating a current bug in the obstack implementation.
23543
a35f64ea
AD
235442000-11-17 Akim Demaille <akim@epita.fr>
23545
23546 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
23547 macros.
23548 Use them to declare the variables which are global or local to
23549 `yyparse'.
23550
7de23534
AD
235512000-11-17 Akim Demaille <akim@epita.fr>
23552
23553 * acconfig.h: Remove, no longer used.
23554
aa7815f5
AD
235552000-11-07 Akim Demaille <akim@epita.fr>
23556
23557 * src: s/Copyright (C)/Copyright/g.
23558
5af1f549
AD
235592000-11-07 Akim Demaille <akim@epita.fr>
23560
23561 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
23562 defining.
23563 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
23564
553e2b22
AD
235652000-11-07 Akim Demaille <akim@epita.fr>
23566
23567 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
23568 Merge in a single CPP if/else.
23569
8a4f41d6
AD
235702000-11-07 Akim Demaille <akim@epita.fr>
23571
23572 * src/output.c (output): Remove useless variables.
23573 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
23574 argument `data' for consistency with the prototypes.
23575 Qualify it `const'.
23576 (obstack_copy, obstack_copy0): Rename the second argument as
23577 `address' for consistency. Qualify it `const'.
23578 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
23579 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
23580 `const' their input argument (`data' or `address').
23581 Adjust the corresponding macros to include `const' in casts.
23582
095a3fb5
AD
235832000-11-03 Akim Demaille <akim@epita.fr>
23584
23585 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
23586 s/PFILE1/BISON_HAIRY/.
23587 Adjust dependencies.
23588
d1cdce7c
AD
235892000-11-03 Akim Demaille <akim@epita.fr>
23590
090c5ebf 23591 For some reason, this was not applied.
d1cdce7c
AD
23592
23593 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23594 `unlink': it's no longer used.
23595
9311529b
AD
235962000-11-03 Akim Demaille <akim@epita.fr>
23597
23598 * src/files.c (skeleton_find): New function, eved out of...
23599 (open_files, open_extra_files): here.
23600
d8880f69
AD
236012000-11-03 Akim Demaille <akim@epita.fr>
23602
23603 Don't use `atexit'.
23604
23605 * src/files.c (obstack_save): New function.
23606 (done): Rename as...
23607 (output_files): this.
23608 Use `obstack_save'.
23609 * src/main.c (main): Don't use `atexit' to register `done', since
23610 it no longer has to remove tmp files, just call `output_files'
23611 when there are no errors.
23612
0dbb648e
AD
236132000-11-02 Akim Demaille <akim@epita.fr>
23614
23615 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23616 `unlink': it's no longer used.
23617 * src/files.h: Formatting changes.
23618
896fe5c1
AD
236192000-11-02 Akim Demaille <akim@epita.fr>
23620
23621 Remove the last uses of mktemp and unlink/delete.
23622
23623 * src/files.c (fdefines, ftable): Removed.
23624 (defines_ostack, table_obstack): New.
23625 Adjust dependencies of the former into uses of the latter.
23626 * src/output.c (output_short_or_char_table, output_short_table):
23627 Convert to using obstacks.
23628 * src/reader.c (copy_comment2): Accept one FILE * and two
23629 obstacks.
23630 (output_token_defines, reader_output_yylsp): Use obstacks.
23631 * src/system.h (obstack_fgrow3): New.
1f65350a 23632 * po/POTFILES.in: Adjust.
896fe5c1 23633
dd60faec
AD
236342000-11-01 Akim Demaille <akim@epita.fr>
23635
23636 Change each use of `fattrs' into a use of `attrs_obstack'.
23637
23638 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
23639 * src/files.c (fattrs): Remove.
23640 (attrs_obstack): New.
23641 Adjust all dependencies.
23642 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
23643
8c7ebe49
AD
236442000-11-01 Akim Demaille <akim@epita.fr>
23645
23646 Introduce obstacks.
23647 Change each use of `faction' into a use of `action_obstack'.
23648
23649 * lib/obstack.h, lib/obstack.c: New files.
23650 * src/files.c (faction): Remove.
23651 (action_obstack): New.
23652 Adjust all dependencies.
23653
77aee789
AD
236542000-10-20 Akim Demaille <akim@epita.fr>
23655
23656 * lib/quote.h (PARAMS): New macro. Use it.
23657
43591cec
AD
236582000-10-16 Akim Demaille <akim@epita.fr>
23659
23660 * src/output.c (output_short_or_char_table): New function.
23661 (output_short_table, output_token_translations): Use it.
23662 (goto_actions): Use output_short_table.
23663
1e9798d5
AD
236642000-10-16 Akim Demaille <akim@epita.fr>
23665
23666 * src/symtab.c (bucket_new): New function.
23667 (getsym): Use it.
23668
23669 * src/output.c (output_short_table): New argument to display the
23670 comment associated with the table.
23671 Adjust dependencies.
23672 (output_gram): Use it.
23673 (output_rule_data): Nicer output layout for YYTNAME.
23674
f282676b
AD
236752000-10-16 Akim Demaille <akim@epita.fr>
23676
23677 * src/lex.c (read_typename): New function.
23678 (lex): Use it.
23679 * src/reader.c (copy_dollar): Likewise.
23680
550a72a3
AD
236812000-10-16 Akim Demaille <akim@epita.fr>
23682
23683 * src/reader.c (copy_comment2): Expect the input stream to be on
23684 the `/' which is suspected to open a comment, instead of being
23685 called after `//' or `/*' was read.
23686 (copy_comment, copy_definition, parse_union_decl, copy_action)
23687 (copy_guard): Adjust.
23688
131e2fef
AD
236892000-10-16 Akim Demaille <akim@epita.fr>
23690
23691 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
23692 `read_signed_integer'.
23693
79282c5a
AD
236942000-10-16 Akim Demaille <akim@epita.fr>
23695
23696 * src/reader.c (copy_dollar): New function.
23697 (copy_guard, copy_action): Use it.
23698
ff4a34be
AD
236992000-10-16 Akim Demaille <akim@epita.fr>
23700
23701 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
23702 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
23703 New files, from Fileutils 4.0.27.
23704 * src/main.c (printable_version): Remove.
23705 * src/lex.c, src/reader.c: Use `quote'.
23706
237072000-10-04 Akim Demaille <akim@epita.fr>
23708
23709 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
23710
14ded682
AD
237112000-10-04 Akim Demaille <akim@epita.fr>
23712
23713 * doc/bison.texinfo: Various typos spotted by Neil Booth.
23714
8e03724b
AD
237152000-10-04 Akim Demaille <akim@epita.fr>
23716
23717 When a literal string is used to define two different tokens,
23718 `bison -v' segfaults.
23719 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
23720
23721 * tests/regression.m4: New file.
23722 Include the core of the sample provided by Piotr Gackiewicz.
23723 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
23724 properly.
23725
a9e64249
AD
237262000-10-04 Akim Demaille <akim@epita.fr>
23727
23728 * src/reader.c (parse_expect_decl): Keep `count' within the size
23729 of `buffer'.
23730 From Neil Booth.
23731
da9abf43
AD
237322000-10-02 Paul Eggert <eggert@twinsun.com>
23733
23734 * bison.s1 (yyparse): Assign the default value
23735 unconditionally, to avoid a GCC warning and make the parser a
23736 tad smaller.
23737
c33638bb
AD
237382000-10-02 Akim Demaille <akim@epita.fr>
23739
23740 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
23741 options.
23742
444c570a
AD
237432000-10-02 Akim Demaille <akim@epita.fr>
23744
23745 * src/derives.c, src/print.c, src/reduce.c: To ease the
23746 translation, move some `\n' out of the translated strings.
23747
89cab50d
AD
237482000-10-02 Akim Demaille <akim@epita.fr>
23749
23750 The location tracking mechanism is precious for parse error
23751 messages. Nevertheless, it is enabled only when `@n' is used in
23752 the grammar, which is a different issue (you can use it in error
23753 message, but not in the grammar per se). Therefore, there should
23754 be another means to enable it.
23755
23756 * src/getargs.c (getargs): Support `--locations'.
23757 (usage): Report it.
23758 * src/getargs.h (locationsflag): Export it.
23759 * src/lex.c (percent_table): Support `%locations'.
23760 * src/reader.c (yylsp_needed): Remove this variable, now replaced
23761 with `locationsflag'.
23762 * doc/bison.texinfo: Document `--locations' and `%locations'.
23763 Sort the options.
23764 * tests/calc.m4: Test it.
23765
23766 For regularity of the names, replace each
23767 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
23768 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
23769 In addition replace each `flag' with `_flag'.
23770
d6c2cba0
AD
237712000-10-02 Akim Demaille <akim@epita.fr>
23772
23773 Also test parse error messages, including with YYERROR_VERBOSE.
23774
23775 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
23776 associative).
23777 Use it to check the computations.
23778 Use it to check `nonassoc' is honored.
23779 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
23780 `--yyerror-verbose'.
23781 (_AT_CHECK_CALC): Adjust to this option.
23782 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
23783
5a35a6cb
AD
237842000-10-02 Akim Demaille <akim@epita.fr>
23785
23786 Test also `--verbose', `--defines' and `--name-prefix'. Testing
23787 the latter demonstrates a flaw in the handling of non debugging
23788 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
23789 was used in order to simplify:
23790
23791 #if YYDEBUG
23792 if (yydebug)
23793 {
23794 ...
23795 }
23796 #endif
23797
23798 into
23799
23800 if (yydebug)
23801 {
23802 ...
23803 }
23804
23805 unfortunately this leads to a CPP conflict when
23806 `--name-prefix=foo' is used since it produces `#define yydebug
23807 foodebug'.
23808
23809 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
23810 (YYDPRINTF): New macro.
23811 Spread its use.
23812 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
23813 the bison options.
23814 Also test `--verbose', `--defines' and `--name-prefix'.
23815
71da9eea
AD
238162000-10-02 Akim Demaille <akim@epita.fr>
23817
23818 Improve the readability of the produced parsers.
23819
23820 * src/bison.s1: Formatting changes.
23821 Improve the comment related to the `$' mark.
23822 (yydefault): Don't fall through to `yyresume': `goto' there.
23823 * src/output.c (output_parser): When the `$' is met, skip the end
23824 of its line.
23825 New variable, `number_of_dollar_signs', to check there's exactly
23826 one `$' in the parser skeleton.
23827
95e36146
AD
238282000-10-02 Akim Demaille <akim@epita.fr>
23829
23830 * lib/xstrdup.c: New file, from the fileutils.
23831 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
23832 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
23833 instead of strlen + xmalloc + strcpy.
23834 * src/symtab.c (copys): Remove, use xstrdup instead.
23835
d7020c20
AD
238362000-10-02 Akim Demaille <akim@epita.fr>
23837
23838 * src/gram.h (associativity): New enum type which replaces the
23839 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
23840 `right_assoc', `left_assoc' and `non_assoc'.
23841 Adjust all dependencies.
23842 * src/reader.c: Formatting changes.
23843 (LTYPESTR): Don't define it, use it as a literal in
23844 `reader_output_yylsp'.
23845 * src/symtab.h (symbol_class): New enum type which replaces the
23846 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
23847 `sunknown', `stoken and `snterm'.
23848
1916f98e
AD
238492000-10-02 Akim Demaille <akim@epita.fr>
23850
23851 * src/getargs.c (fixed_outfiles): Rename as...
23852 (yaccflag): for consistency and accuracy.
23853 Adjust dependencies.
23854
d7913476
AD
238552000-10-02 Akim Demaille <akim@epita.fr>
23856
23857 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
23858 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
23859 difficult and introduced a lot of core dump. It turns out that
23860 Bison used an implementation of `xmalloc' based on `calloc', and
23861 at various places it does depend upon the initialization to 0. I
23862 have not tried to isolate the pertinent places, and all the former
23863 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
23864 someone should address this issue.
23865
23866 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
23867 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
23868 files.
23869 Adjust dependencies.
23870 * src/warshall.h: New file.
23871 Propagate.
23872
340ef489
AD
238732000-10-02 Akim Demaille <akim@epita.fr>
23874
23875 Various anti-`extern in *.c' changes.
23876
23877 * src/system.h: Include `assert.h'.
23878
b2ca4022
AD
238792000-10-02 Akim Demaille <akim@epita.fr>
23880
23881 * src/state.h (nstates, final_state, first_state, first_shift)
23882 (first_reduction): Move their exportation from here...
23883 * src/LR0.h: to here.
23884 Adjust dependencies.
23885 * src/getargs.c (statisticsflag): New variable.
23886 Add support for `--statistics'.
23887 Adjust dependencies.
23888
23889 Remove a lot of now useless `extern' statements in most files.
23890
403b315b
AD
238912000-10-02 Akim Demaille <akim@epita.fr>
23892
23893 * src/LR0.h: New file.
23894 Propagate its use.
23895
07a58c13
AD
238962000-10-02 Akim Demaille <akim@epita.fr>
23897
23898 * src/print.h: New file.
23899 Propagate its use.
23900 * src/print.c: Formatting and ordering changes.
23901 (verbose, terse): Replace with...
23902 (print_results): this new function.
23903 Adjust dependencies.
23904
0619caf0
AD
239052000-10-02 Akim Demaille <akim@epita.fr>
23906
23907 * src/conflicts.c (conflict_report): New function.
23908 (conflict_log, verbose_conflict_log): Replace with...
23909 (print_conflicts): this function.
23910 Adjust dependencies.
23911 * src/conflicts.h: New file.
23912 Propagate its inclusion.
23913
3519ec76
AD
239142000-10-02 Akim Demaille <akim@epita.fr>
23915
23916 * src/nullable.h: New file.
23917 Propagate its inclusion.
23918 * src/nullable.c: Formatting changes.
23919
015acc48
AD
239202000-10-02 Akim Demaille <akim@epita.fr>
23921
23922 * src/reduce.h: New file.
23923 Propagate its inclusion.
23924 * src/reduce.c: Topological sort and other formatting changes.
23925 (bool, TRUE, FALSE): Move their definition to...
23926 * src/system.h: here.
23927
8963a27b
AD
239282000-10-02 Akim Demaille <akim@epita.fr>
23929
23930 * src/files.c: Formatting changes.
23931 (tryopen, tryclose, openfiles): Rename as...
23932 (xfopen, xfclose, open_files): this.
23933 (stringappend): static.
23934 * src/files.h: Complete the list of exported symbols.
23935 Propagate its use.
23936
a70083a3
AD
239372000-10-02 Akim Demaille <akim@epita.fr>
23938
23939 * src/reader.h: New file.
23940 Propagate its use instead of tedious list of `extern' and
23941 prototypes.
23942 * src/reader.c: Formatting changes, topological sort,
23943 s/register//.
23944
abadc117
AD
239452000-10-02 Akim Demaille <akim@epita.fr>
23946
23947 * src/lex.h: Prototype `lex.c' exported functions.
23948 * src/reader.c: Adjust.
23949 * src/lex.c: Formatting changes.
23950 (safegetc): Rename as...
23951 (xgetc): this.
23952
720d742f
AD
239532000-10-02 Akim Demaille <akim@epita.fr>
23954
23955 * src/lalr.h: New file.
23956 Propagate its inclusion instead of prototypes and `extern'.
23957 * src/lalr.c: Formatting changes, topological sorting etc.
23958
f2acea59
AD
239592000-10-02 Akim Demaille <akim@epita.fr>
23960
23961 * src/output.c (token_actions): Introduce a temporary array,
23962 YYDEFACT, that makes it possible for this function to use
23963 output_short_table.
23964
d019d655
AD
239652000-10-02 Akim Demaille <akim@epita.fr>
23966
23967 `user_toknums' is output as a `short[]' in `output.c', while it is
23968 defined as a `int[]' in `reader.c'. For consistency with the
23969 other output tables, `user_toknums' is now defined as a table of
23970 shorts.
23971
23972 * src/reader.c (user_toknums): Be a short table instead of an int
23973 table.
23974 Adjust dependencies.
23975
23976 Factor the short table outputs.
23977
23978 * src/output.c (output_short_table): New function.
23979 * src/output.c (output_gram, output_stos, output_rule_data)
23980 (output_base, output_table, output_check): Use it.
23981
6c89f1c1
AD
239822000-10-02 Akim Demaille <akim@epita.fr>
23983
23984 * src/output.c (output): Topological sort of the functions, in
23985 order to get rid of the `static' prototypes.
23986 No longer use `register'.
23987 * src/output.h: New file.
23988 Propagate its inclusion in files explicitly prototyping functions
23989 from output.c.
23990
d9efd181
AD
239912000-09-21 Akim Demaille <akim@epita.fr>
23992
23993 * src/atgeneral.m4: Update from Autoconf.
23994
c29240e7 239952000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
23996
23997 * src/closure.h: New file.
23998 * src/closure.c: Formatting changes, topological sort over the
23999 functions, use of closure.h.
24000 (initialize_closure, finalize_closure): Rename as...
24001 (new_closure, free_closure): these. Adjust dependencies.
24002 * src/LR0.c: Formatting changes, topological sort, use of
24003 cloture.h.
24004 (initialize_states): Rename as...
24005 (new_states): this.
24006 * src/Makefile.am (noinst_HEADERS): Adjust.
24007
499daa50
AD
240082000-09-20 Akim Demaille <akim@epita.fr>
24009
24010 * src/acconfig.h: Don't protect config.h against multiple
24011 inclusion.
24012 Don't define PARAMS.
24013 * src/system.h: Define PARAMS.
24014 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
24015 purpose of config.h. system.h must not try to fix wrong
24016 definitions in config.h.
24017
cc84fd5d
AD
240182000-09-20 Akim Demaille <akim@epita.fr>
24019
24020 * src/derives.h: New file.
24021 * src/main.c, src/derives.h: Use it.
24022 Formatting changes.
24023 * src/Makefile.am (noinst_HEADERS): Adjust.
24024
db5b3a89
AD
240252000-09-20 Akim Demaille <akim@epita.fr>
24026
24027 * tests/atgeneral.m4: Update from Autoconf.
24028 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
24029 (AT_CHECK_CALC): New macros.
24030 Use these macros to test bison with options `', `--raw',
24031 `--debug', `--yacc', `--yacc --debug'.
24032
ceed8467
AD
240332000-09-19 Akim Demaille <akim@epita.fr>
24034
24035 * src/output.c: Formatting changes.
24036 * src/machine.h: Remove, leaving its contents in...
24037 * src/system.h: here.
24038 Include stdio.h.
24039 Adjust all dependencies on stdio.h and machine.h.
24040 * src/getargs.h: New file.
24041 Let all `extern' declarations about getargs.c be replaced with
24042 inclusion of `getargs.h'.
24043 * src/Makefile.am (noinst_HEADERS): Adjust.
24044
24045 * tests/calc.m4 (yyin): Be initialized in main, not on the global
24046 scope.
24047 (yyerror): Returns void, not int.
24048 * doc/bison.texinfo: Formatting changes.
24049
05a1d24b
AD
240502000-09-19 Akim Demaille <akim@epita.fr>
24051
24052 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
24053 portable.
24054
cbd25751
AD
240552000-09-18 Akim Demaille <akim@epita.fr>
24056
24057 * configure.in: Append WARNING_CFLAGS to CFLAGS.
24058 * src/Makefile.am (INCLUDES): Don't.
24059 Be ready to fetch headers in lib/.
24060
13863333
AD
240612000-09-18 Akim Demaille <akim@epita.fr>
24062
24063 * doc/bison.texinfo: Update the copyright.
24064 ANSIfy and GNUify the examples.
24065 Remove the old menu.
24066
0d533154
AD
240672000-09-18 Akim Demaille <akim@epita.fr>
24068
24069 First set of tests: use the `calc' example from the documentation.
24070
24071 * src/bison.s1 (yyparse): Condition the code using `yytname' which
24072 is defined only when YYDEBUG is.
24073 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
24074 * src/files.c (tryopen, tryclose): Formatting changes.
24075 Move to the top and be static.
24076 * src/reader.c (read_signed_integer): Likewise.
24077 * tests/calc.m4: New file.
24078 * Makefile.am, suite.m4: Adjust.
24079 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
24080
e79137ac
AD
240812000-09-18 Akim Demaille <akim@epita.fr>
24082
24083 Add support for an Autotest test suite for Bison.
24084
24085 * m4/m4.m4, m4/atconfig.m4: New files.
24086 * m4/Makefile.am (EXTRA_DIST): Adjust.
24087 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
24088 files.
24089 * src/getargs.c: Display a more standard --version message.
24090 * src/reader.c (reader): Formatting changes.
24091 No longer depend upon VERSION_STRING.
24092 * configure.in: No longer use `dnl'.
24093 Set up the test suite and the new directory `tests/.
24094 (VERSION_STRING): Remove.
24095
27821bff
AD
240962000-04-14 Akim Demaille <akim@epita.fr>
24097
24098 * src/reader.c (copy_comment2): New function, same as former
24099 `copy_comment', but outputs into two FILE *.
24100 (copy_comment): Use it.
24101 (parse_union_decl): Use it.
24102 (get_type, parse_start_decl): Use the same `invalid' message.
24103 (parse_start_decl, parse_union_decl): Use the same `multiple'
24104 message.
24105 (parse_union_decl, copy_guard, copy_action): Use the same
24106 `unmatched' message.
24107 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
24108
cfe5fbc0
AD
241092000-03-31 Akim Demaille <akim@epita.fr>
24110
24111 * src/files.c (tryopen, tryclose): Move to the top.
24112 Be static.
24113
cb7db13e
AD
241142000-03-31 Akim Demaille <akim@epita.fr>
24115
24116 * src/main.c (main): Don't call `done', exit does it.
24117
a0f6b076
AD
241182000-03-31 Akim Demaille <akim@epita.fr>
24119
36281465
AD
24120 * allocate.c: s/return (foo)/return foo/.
24121 * lalr.c: Likewise.
24122 * LR0.c: Likewise.
24123 * output.c: Likewise.
24124 * reader.c: Likewise.
24125 * symtab.c: Likewise.
24126 * vmsgetargs.c: Likewise.
24127
241282000-03-31 Akim Demaille <akim@epita.fr>
24129
24130 Clean up the error reporting functions.
a0f6b076
AD
24131
24132 * src/report.c: New file.
24133 * src/report.h: Likewise.
24134 * src/Makefile.am: Adjust.
24135 * m4/error.m4: New file.
24136 * m4/Makefile.am: Adjust.
24137 * configure.in (jm_PREREQ_ERROR): Call it.
24138 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
24139 Remove.
24140 (fatal, fatals): Remove. All callers use complain.c::fatal.
24141 (warn, warni, warns, warnss, warnss): Remove. All callers use
24142 complain.c::complain.
24143 (toomany): Remove, use fatal instead.
24144 * src/files.c (done): No argument, use complain_message_count.
24145 * src/main.c (main): Register `done' to `atexit'.
24146
24147 * src/getargs.c (usage): More `fputs', less `fprintf'.
24148
18539825
AD
241492000-03-28 Akim Demaille <akim@epita.fr>
24150
24151 * lib/: New directory.
24152 * Makefile.am (SUBDIRS): Adjust.
24153 * configure.in: Adjust.
24154 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
24155 useless.
24156 * src/alloca.c: Moved to lib/.
24157 * src/getopt.c: Likewise.
24158 * src/getopt1.c: Likewise.
24159 * src/getopt.h: Likewise.
24160 * src/ansi2knr.c: Likewise.
24161 * src/ansi2knr.1: Likewise.
24162 * src/Makefile.am: Adjust.
24163 * lib/Makefile.am: New file.
24164
9f306f2a
AD
241652000-03-28 Akim Demaille <akim@epita.fr>
24166
24167 * src/getargs.c (usage): Refresh the help message.
24168
0ba347b6
AD
241692000-03-17 Akim Demaille <akim@epita.fr>
24170
24171 * src/getopt1.c: Updated from textutils 2.0e
24172 * src/getopt.c: Likewise.
24173 * src/getopt.h: Likewise.
24174
dbe7f271
AD
241752000-03-17 Akim Demaille <akim@epita.fr>
24176
24177 * src/Makefile.am (bison.simple): Fix the awk program: quote only
24178 the file name, not the whole `#line LINE FILE'.
24179
75bbe78d
AD
241802000-03-17 Akim Demaille <akim@epita.fr>
24181
24182 On syntax errors, report the token on which we choked.
24183
aa5fd0ee
AD
24184 * src/bison.s1 (yyparse): In the label yyerrlab, when
24185 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 24186
7b306f52
AD
241872000-03-17 Akim Demaille <akim@epita.fr>
24188
aa5fd0ee 24189 * src/reader.c (copy_at): New function.
7b306f52
AD
24190 (copy_guard): Use it.
24191 (copy_action): Use it.
24192
e87b5700
AD
241932000-03-17 Akim Demaille <akim@epita.fr>
24194
24195 Be kind to translators, save some useless translations.
24196
aa5fd0ee 24197 * src/main.c (banner): New function.
e87b5700
AD
24198 (fatal_banner): Use it.
24199 (warn_banner): Use it.
24200
ae3c3164
AD
242012000-03-17 Akim Demaille <akim@epita.fr>
24202
aa5fd0ee
AD
24203 * src/reader.c (copy_definition): Use copy_string and
24204 copy_comment. Removed now unused `match', `ended',
24205 `cplus_comment'.
ae3c3164
AD
24206 (copy_comment, copy_string): Moved, to be visible from
24207 copy_definition.
24208
4dc58e7c
AD
242092000-03-17 Akim Demaille <akim@epita.fr>
24210
aa5fd0ee
AD
24211 * src/reader.c (copy_string): Declare `static inline'. No
24212 problems with inline, since it is checked by configure.
4dc58e7c
AD
24213 (copy_comment): Likewise.
24214
0a6384c4
AD
242152000-03-17 Akim Demaille <akim@epita.fr>
24216
aa5fd0ee 24217 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 24218
3cef001a
AD
242192000-03-17 Akim Demaille <akim@epita.fr>
24220
aa5fd0ee 24221 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
24222 (copy_action): Use it. Removed now unused `match', `ended',
24223 `cplus_comment'.
24224 (copy_guard): Likewise.
24225
ca36d2ef
AD
242262000-03-17 Akim Demaille <akim@epita.fr>
24227
aa5fd0ee 24228 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
24229 (copy_action): Use it.
24230 (copy_guard): Likewise.
24231
6666f98f
AD
242322000-03-17 Akim Demaille <akim@epita.fr>
24233
24234 Change the handling of @s so that they behave exactly like $s.
24235 There is now a pseudo variable @$ (readble and writable), location
24236 of the lhs of the rule (by default ranging from the location of
24237 the first symbol of the rhs, to the location of the last symbol,
24238 or, if the rhs is empty, YYLLOC).
24239
24240 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
24241 yyval.
24242 (yyparse): When providing a default semantic action, provide a
24243 default location action.
24244 (after the $): No longer change `*YYLSP', just stack YYLOC the
24245 same way you stack YYVAL.
24246 * src/reader.c (read_declarations): Use warns.
24247 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
24248 (copy_action, case '@'): Likewise.
24249 Use a standard error message, to save useless work from
24250 translators.
24251
41aca2e0
AD
242522000-03-17 Akim Demaille <akim@epita.fr>
24253
aa5fd0ee
AD
24254 * src/bison.s1: Formatting and cosmetics changes.
24255 * src/reader.c: Likewise.
41aca2e0
AD
24256 Update the Copyright notice.
24257
dc08c1d5
AD
242582000-03-17 Akim Demaille <akim@epita.fr>
24259
aa5fd0ee
AD
24260 * src/bison.s1 (#line): All set to `#line' only, since the
24261 Makefile now handles them.
dc08c1d5 24262
9ee3c97b
AD
242632000-03-16 Akim Demaille <akim@epita.fr>
24264
24265 * src/output.c (output_rule_data): Output the documentation of
24266 some of the tables.
24267 (Copyright notice): Update.
24268 Formatting changes.
24269
0de741ca
AD
242702000-03-16 Akim Demaille <akim@epita.fr>
24271
24272 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
24273 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
24274 One `#if YYDEBUG' remains, since it uses variables which are
24275 defined only if `YYDEBUG != 0'.
24276
bb10be54
AD
242772000-03-16 Akim Demaille <akim@epita.fr>
24278
24279 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
24280 and related variables so that the similarities are highlighted.
24281
b07b484a
AD
242822000-03-16 Akim Demaille <akim@epita.fr>
24283
24284 * src/bison.s1: Properly indent CPP directives.
24285
361f60b3
AD
242862000-03-16 Akim Demaille <akim@epita.fr>
24287
24288 * src/bison.s1: Properly indent the `alloca' CPP section.
24289
8c44d3ec
AD
242902000-03-16 Akim Demaille <akim@epita.fr>
24291
24292 Do not hard code values of directories in `configure.in'.
24293 Update the `configure' tool chain.
24294
24295 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
24296 src/makefile.am.
24297 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
24298 (AC_OUTPUT): Add m4/Makefile.
24299 Bump to bison 1.28a, 1.29 has never been released.
24300 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
24301 handled via src/Makefile.am.
24302 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
24303 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
24304 autoheader.
24305 * Makefile.am (SUBDIRS): Add m4.
24306 (ACLOCAL_AM_FLAGS): New variable.
24307 (AUTOMAKE_OPTIONS): Add check-news.
24308 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
24309 the proper line number and file name.
24310 (DEFS): Propagate the location of bison library files and of the
24311 locale files.
24312 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
24313 builddir.
24314 * acinclude.m4: Remove, replaced by the directory m4.
24315 * m4/Makefile.am (EXTRA_DIST): New variable.
24316 * m4/gettext.m4: New file, from the fileutils.
24317 * m4/lcmessage.m4: Likewise
24318 * m4/progtest.m4: Likewise.
24319 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
24320
f95997e7
AD
243212000-03-10 Akim Demaille <akim@epita.fr>
24322
24323 * src/closure.c:
24324 Formatting changes of various comments.
24325 Respect the GNU coding standards at various places.
24326 Don't use `_()' when no translation is needed.
24327
243281999-12-13 Jesse Thilo <jthilo@gnu.org>
24329
24330 * src/files.c:
24331 OS/2 honors TMPDIR environment variable.
24332
243331999-12-13 Jesse Thilo <jthilo@gnu.org>
24334
24335 * doc/bison.texinfo: Tweaked spelling and grammar.
24336 Updated ISBN.
24337 Removed reference to price of printed copy.
24338 Mention BISON_SIMPLE and BISON_HAIRY.
24339
243401999-12-13 Jesse Thilo <jthilo@gnu.org>
24341
24342 * configure.in, NEWS:
24343 Bison 1.29 released.
24344
243451999-10-27 Jesse Thilo <jthilo@gnu.org>
24346
24347 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
24348 Added reference card.
24349
243501999-07-26 Jesse Thilo <jthilo@gnu.org>
24351
24352 * po/ru.po: Added Russian translation.
24353
243541999-07-26 Jesse Thilo <jthilo@gnu.org>
24355
24356 * configure.in: Added Russian translation.
24357
243581999-07-06 Jesse Thilo <jthilo@gnu.org>
24359
24360 * configure.in, NEWS, README:
24361 Released version 1.28.
24362
243631999-06-14 Jesse Thilo <jthilo@gnu.org>
24364
24365 * src/system.h:
24366 Squashed redefinition warning on some systems.
24367
24368 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
24369 Have configure build version string instead of relying on ANSI string
24370 concatentation.
24371
243721999-06-14 Jesse Thilo <jthilo@gnu.org>
24373
24374 * po/POTFILES.in: Got rid of version.c.
24375
243761999-06-14 Jesse Thilo <jthilo@gnu.org>
24377
24378 * acconfig.h, configure.in:
24379 Have configure build version string instead of relying on ANSI string
24380 concatentation.
24381
243821999-06-08 Jesse Thilo <jthilo@gnu.org>
24383
24384 * doc/bison.1:
24385 Dropped mention of `+' for long-named options.
24386
243871999-05-30 Jesse Thilo <jthilo@gnu.org>
24388
24389 * src/files.c: Added <unistd.h> for unlink().
24390
24391 * src/Makefile.am, src/system.h:
24392 I18n fixes.
24393
243941999-05-30 Jesse Thilo <jthilo@gnu.org>
24395
24396 * README: Added a FAQ list.
24397
24398 * configure.in, acconfig.h:
24399 I18n fixes.
24400
244011999-05-30 Jesse Thilo <jthilo@gnu.org>
24402
24403 * doc/FAQ, doc/Makefile.am:
24404 Added a FAQ list.
24405
244061999-05-19 Jesse Thilo <jthilo@gnu.org>
24407
24408 * src/alloc.h, src/symtab.h, src/version.c:
24409 Protected inclusion of "config.h" with HAVE_CONFIG_H.
24410
244111999-04-18 Jesse Thilo <jthilo@gnu.org>
24412
24413 * src/.cvsignore, src/Makefile.am:
24414 Reorganized: sources in `src', documentation in `doc'.
24415
24416 * src/lex.c (literalchar):
24417 fixed the code for escaping double quotes (thanks
24418 Jonathan Czisny.)
24419
244201999-04-18 Jesse Thilo <jthilo@gnu.org>
24421
24422 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
24423 Adjusted paths to reflect directory reorganization.
24424
244251999-04-18 Jesse Thilo <jthilo@gnu.org>
24426
24427 * doc/.cvsignore, doc/Makefile.am:
24428 Reorganized: sources in `src', documentation in `doc'.
24429
244301999-04-18 Jesse Thilo <jthilo@gnu.org>
24431
24432 * configure.in:
24433 Updated AC_INIT file to reflect directory reorganization.
24434
24435 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
24436 Reorganized: sources in `src', documentation in `doc'.
24437
244381999-04-13 Jesse Thilo <jthilo@gnu.org>
24439
24440 * src/allocate.c:
24441 Don't declare calloc() and realloc() if not necessary.
24442
244431999-04-13 Jesse Thilo <jthilo@gnu.org>
24444
24445 * configure.in, acconfig.h, acinclude.m4:
24446 Don't declare calloc() and realloc() if not necessary.
24447
244481999-03-23 Jesse Thilo <jthilo@gnu.org>
24449
24450 * po/.cvsignore: Added i18n support.
24451
244521999-03-23 Jesse Thilo <jthilo@gnu.org>
24453
24454 * acconfig.h, configure.in, Makefile.am:
24455 Added i18n support.
24456
244571999-03-22 Jesse Thilo <jthilo@gnu.org>
24458
24459 * src/bison.s1: Fixed #line numbers.
24460
244611999-03-15 Jesse Thilo <jthilo@gnu.org>
24462
24463 * po/es.po, po/fr.po, po/nl.po, po/de.po:
24464 Added PO files from Translation Project.
24465
244661999-03-03 Jesse Thilo <jthilo@gnu.org>
24467
24468 * Makefile.am:
24469 Added support for non-ANSI compilers (ansi2knr).
24470
244711999-02-16 Jesse Thilo <jthilo@gnu.org>
24472
24473 * configure.in: Bumped version number to 1.27.
24474
24475 * Makefile.am:
24476 Added `bison.simple' to list of files removed by `make distclean'.
24477
244781999-02-12 Jesse Thilo <jthilo@gnu.org>
24479
24480 * src/files.c, src/files.h:
24481 Defined locations of parser files in config.h instead of Makefile.
24482
244831999-02-12 Jesse Thilo <jthilo@gnu.org>
24484
24485 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
24486 Defined locations of parser files in config.h instead of Makefile.
24487
244881999-02-09 Jesse Thilo <jthilo@gnu.org>
24489
24490 * Makefile.am:
24491 Removed inappropriate use of $< macro.
24492
244931999-02-05 Jesse Thilo <jthilo@gnu.org>
24494
24495 * po/Makefile.in.in, po/POTFILES.in:
24496 Add `po' directory skeleton.
24497
244981999-01-27 Jesse Thilo <jthilo@gnu.org>
24499
24500 * README: Document help-bison list.
24501
24502 * configure.in: Add check for mkstemp().
24503
245041999-01-20 Jesse Thilo <jthilo@gnu.org>
24505
24506 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
24507 Hush a few compiler warnings.
24508
24509 * src/files.c:
24510 Add tryclose(), which verifies that fclose was successful.
24511 Hush a couple of compiler warnings.
24512
245131999-01-20 Jesse Thilo <jthilo@gnu.org>
24514
24515 * Makefile.am, OChangeLog:
24516 ChangeLog is now automatically generated. Include the old version as
24517 OChangeLog.
24518
245191999-01-14 Jesse Thilo <jthilo@gnu.org>
24520
24521 * 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:
24522 Update FSF address.
24523
245241999-01-14 Jesse Thilo <jthilo@gnu.org>
24525
24526 * doc/bison.texinfo: Fix formatting glitch.
24527
24528 * doc/bison.texinfo: Update FSF address.
24529
245301999-01-14 Jesse Thilo <jthilo@gnu.org>
24531
24532 * acconfig.h: Update FSF address.
24533
245341999-01-08 Jesse Thilo <jthilo@gnu.org>
24535
24536 * src/system.h:
24537 Don't define PACKAGE here, since config.h defines it.
24538
245391998-12-30 Jesse Thilo <jthilo@gnu.org>
24540
24541 * src/reader.c: Update copyright date.
24542
24543 * src/main.c:
24544 Ditch sprintf to statically-sized buffers in fatal/warn functions in
24545 favor of output directly to stderr (avoids buffer overruns).
24546
24547 * src/reader.c: Some checks for premature EOF.
24548
24549 * 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:
24550 Use prototypes if the compiler understands them.
24551
24552 * src/files.c: Honor TMPDIR on Unix hosts.
24553 Use prototypes if the compiler understands them.
24554
24555 * src/reader.c:
24556 Fix a couple of buffer overrun bugs.
24557 Use prototypes if the compiler understands them.
24558
24559 * src/system.h: Include unistd.h and ctype.h.
24560 Use #ifdef instead of #if for NLS symbols.
24561
245621998-12-30 Jesse Thilo <jthilo@gnu.org>
24563
24564 * doc/bison.texinfo:
24565 Delete comment "consider using @set for edition number, etc..." since
24566 we now are doing so.
24567
245681998-12-30 Jesse Thilo <jthilo@gnu.org>
24569
24570 * configure.in:
24571 Use prototypes if the compiler understands them.
24572
24573 * NEWS: Document 1.26 highlights.
24574
24575 * Makefile.am: Require Automake 1.3 or later.
24576
24577 * acconfig.h:
24578 Use prototypes if the compiler understands them.
24579
245801998-12-29 Jesse Thilo <jthilo@gnu.org>
24581
24582 * src/version.c:
24583 Use VERSION symbol from automake for version number.
24584
245851998-12-29 Jesse Thilo <jthilo@gnu.org>
24586
24587 * acconfig.h, configure.in, version.cin:
24588 Use VERSION symbol from automake for version number.
24589
245901998-11-28 Jesse Thilo <jthilo@gnu.org>
24591
24592 * Makefile.am:
24593 Distribute original version of simple parser (bison.s1), not built
24594 version (bison.simple).
24595
245961998-11-28 Jesse Thilo <jthilo@gnu.org>
24597
24598 * doc/bison.texinfo: Add info dir entry.
24599
24600 * doc/bison.texinfo:
24601 Let automake put version number into documentation.
24602
246031998-11-26 Jesse Thilo <jthilo@gnu.org>
24604
24605 * src/bison.cld, src/build.com, src/vmshlp.mar:
24606 Add non-RCS files from /gd/gnu/bison.
24607
246081998-11-26 Jesse Thilo <jthilo@gnu.org>
24609
24610 * doc/bison.1:
24611 Document the BISON_HAIRY and BISON_SIMPLE variables.
24612
246131998-11-25 Jesse Thilo <jthilo@gnu.org>
24614
24615 * src/version.c: Build version.c automatically.
24616
24617 * src/reader.c:
24618 Fix token numbering (used to start at 258, not 257).
24619
24620 * src/system.h: Include config.h.
24621
24622 * src/getargs.c: Update bug report address.
24623
24624 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
24625 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
24626
246271998-11-25 Jesse Thilo <jthilo@gnu.org>
24628
24629 * Makefile.am:
24630 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24631
24632 * configure.in, version.cin:
24633 Build version.c automatically.
24634
24635 * AUTHORS: Add AUTHORS file.
24636
24637 * README: Update bug report address.
24638
24639 * bison.simple:
24640 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24641
24642 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
24643 Add automake stuff.
24644
246451998-11-25 Jesse Thilo <jthilo@gnu.org>
24646
24647 * doc/bison.texinfo: Clean up some formatting.
24648
246491998-05-05 Richard Stallman <rms@gnu.org>
24650
24651 * doc/bison.texinfo:
24652 Explain better why to make a pure parser.
24653
246541998-01-05 Richard Stallman <rms@gnu.org>
24655
24656 * src/files.c (openfiles):
24657 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
24658 find a temporary directory, if possible. Do not unlink files while
24659 they are open.
24660
246611997-08-25 Richard Stallman <rms@gnu.org>
24662
24663 * src/reader.c (stack_offset;):
24664 Change some warni to warns.
24665
24666 * src/lex.c (literalchar): Use warns, not warni.
24667
246681997-06-28 Richard Stallman <rms@gnu.org>
24669
24670 * src/bison.s1: Add a Bison version comment.
24671
24672 * src/main.c (fatal, warn, berror):
24673 Use program_name.
24674
246751997-06-28 Richard Stallman <rms@gnu.org>
24676
24677 * Makefile.in (bison_version): New variable.
24678 (dist): Use that variable.
24679 (bison.s1): Substitute the Bison version into bison.simple.
24680
24681 * bison.simple: Add a Bison version comment.
24682
246831997-06-18 Richard Stallman <rms@gnu.org>
24684
24685 * src/main.c (fatal, warn, berror):
24686 Make error messages standard.
24687 (toomany): Improve error message text.
24688
24689 * 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:
24690 new.h renamed to alloc.h.
24691
246921997-06-18 Richard Stallman <rms@gnu.org>
24693
24694 * Makefile.in: new.h renamed to alloc.h.
24695
246961997-05-24 Richard Stallman <rms@gnu.org>
24697
24698 * src/lex.c (literalchar):
24699 Fix the code for escaping \, " and '.
24700
24701 (lex): Avoid trouble when there are many chars
24702 to discard in a char literal with just several chars in it.
24703
247041997-05-17 Richard Stallman <rms@gnu.org>
24705
24706 * src/bison.s1:
24707 Use malloc, if using alloca is troublesome.
24708 (YYSTACK_USE_ALLOCA): New flag macro.
24709 Define it for some systems and compilers.
24710 (YYSTACK_ALLOC): New macro.
24711 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24712 If it was malloc'd, free it.
24713
247141997-05-17 Richard Stallman <rms@gnu.org>
24715
24716 * bison.simple:
24717 Use malloc, if using alloca is troublesome.
24718 (YYSTACK_USE_ALLOCA): New flag macro.
24719 Define it for some systems and compilers.
24720 (YYSTACK_ALLOC): New macro.
24721 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24722 If it was malloc'd, free it.
24723
247241997-04-23 Richard Stallman <rms@gnu.org>
24725
24726 * src/bison.s1:
24727 (alloca) [__hpux]: Always define as __builtin_alloca.
24728
247291997-04-23 Richard Stallman <rms@gnu.org>
24730
24731 * bison.simple:
24732 (alloca) [__hpux]: Always define as __builtin_alloca.
24733
247341997-04-22 Richard Stallman <rms@gnu.org>
24735
24736 * src/bison.s1:
24737 [__hpux]: Include alloca.h (right for HPUX 10)
24738 instead of declaring alloca (right for HPUX 9).
24739
24740 * src/bison.s1 (__yy_memcpy):
24741 Declare arg `count' as unsigned int.
24742 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24743
247441997-04-22 Richard Stallman <rms@gnu.org>
24745
24746 * bison.simple:
24747 [__hpux]: Include alloca.h (right for HPUX 10)
24748 instead of declaring alloca (right for HPUX 9).
24749
24750 * bison.simple (__yy_memcpy):
24751 Declare arg `count' as unsigned int.
24752 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24753
247541997-01-03 Richard Stallman <rms@gnu.org>
24755
24756 * src/allocate.c: [__STDC__ or _MSC_VER]:
24757 Declare calloc and realloc to return void *.
24758
247591997-01-02 Richard Stallman <rms@gnu.org>
24760
24761 * src/system.h:
24762 [_MSC_VER]: Include stdlib.h and process.h.
24763 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
24764
24765 * src/main.c (main): Return FAILURE as a value.
24766 (printable_version): Declare arg as int, not char.
24767
247681997-01-02 Richard Stallman <rms@gnu.org>
24769
24770 * Makefile.in (dist):
24771 Explicitly check for symlinks, and copy them.
24772
247731996-12-19 Richard Stallman <rms@gnu.org>
24774
24775 * src/files.c:
24776 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
24777
247781996-12-18 Paul Eggert <eggert@gnu.org>
24779
24780 * src/bison.s1 (yyparse):
24781 If __GNUC__ and YYPARSE_PARAM are both defined,
24782 declare yyparse to have a void * argument.
24783
247841996-12-18 Paul Eggert <eggert@gnu.org>
24785
24786 * bison.simple (yyparse):
24787 If __GNUC__ and YYPARSE_PARAM are both defined,
24788 declare yyparse to have a void * argument.
24789
247901996-12-17 Richard Stallman <rms@gnu.org>
24791
24792 * src/reduce.c (nbits): Add some casts.
24793
247941996-08-12 Richard Stallman <rms@gnu.org>
24795
24796 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
24797
247981996-08-12 Richard Stallman <rms@gnu.org>
24799
24800 * bison.simple: Test _MSDOS as well as _MSDOS_.
24801
248021996-07-31 Richard Stallman <rms@gnu.org>
24803
24804 * src/bison.s1:
24805 [__sun && __i386]: Include alloca.h.
24806
248071996-07-31 Richard Stallman <rms@gnu.org>
24808
24809 * bison.simple:
24810 [__sun && __i386]: Include alloca.h.
24811
248121996-07-30 Richard Stallman <rms@gnu.org>
24813
24814 * src/bison.s1: Comment change.
24815
24816 * src/bison.s1: Test _MSDOS_, not MSDOS.
24817
248181996-07-30 Richard Stallman <rms@gnu.org>
24819
24820 * bison.simple: Comment change.
24821
24822 * bison.simple: Test _MSDOS_, not MSDOS.
24823
248241996-06-01 Richard Stallman <rms@gnu.org>
24825
24826 * 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:
24827 Insert `_' macro around many string constants.
24828
24829 * src/main.c:
24830 Insert `_' macro around many string constants.
24831
24832 (main): Call setlocale, bindtextdomain and textdomain.
24833
24834 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
24835 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
24836 [ENABLE_NLS]: Include libintl.h.
24837 [ENABLE_NLS] (gettext): Define.
24838 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
24839 (N_, PACKAGE, LOCALEDIR): New macros.
24840
248411996-06-01 Richard Stallman <rms@gnu.org>
24842
24843 * POTFILES.in: New file.
24844
24845 * Makefile.in (allocate.o):
24846 Define target explicitly.
24847
24848 * Makefile.in (CFLAGS): Set to @CFLAGS@.
24849 (LDFLAGS): Set to @LDFLAGS@.
24850 (configure): Run autoconf only if preceding `cd' succeeds.
24851 (bison.s1): Redirect output to temporary file then move the
24852 temporary to the target, rather than redirecting directly to bison.s1.
24853 (clean): Remove config.status and config.log.
24854 (distclean): Don't remove config.status here.
24855
248561996-05-12 Richard Stallman <rms@gnu.org>
24857
24858 * src/bison.s1:
24859 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24860
248611996-05-12 Richard Stallman <rms@gnu.org>
24862
24863 * bison.simple:
24864 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24865
248661996-05-11 Richard Stallman <rms@gnu.org>
24867
24868 * src/bison.s1 (__yy_memcpy):
24869 Really reorder the args, as was supposedly done on Feb 14 1995.
24870 (yyparse): Calls changed accordingly.
24871
248721996-05-11 Richard Stallman <rms@gnu.org>
24873
24874 * Makefile.in (dist): Don't use $(srcdir).
24875
24876 * bison.simple (__yy_memcpy):
24877 Really reorder the args, as was supposedly done on Feb 14 1995.
24878 (yyparse): Calls changed accordingly.
24879
248801996-01-27 Richard Stallman <rms@gnu.org>
24881
24882 * src/output.c (output_rule_data):
24883 Test YYERROR_VERBOSE in the conditional
24884 around the definition of ttyname.
24885
248861995-12-29 Richard Stallman <rms@gnu.org>
24887
24888 * src/bison.s1:
24889 Fix line numbers in #line commands.
24890
248911995-12-29 Richard Stallman <rms@gnu.org>
24892
24893 * bison.simple:
24894 Fix line numbers in #line commands.
24895
248961995-12-27 Richard Stallman <rms@gnu.org>
24897
24898 * src/bison.s1 (YYPARSE_PARAM_DECL):
24899 In C++, make it always null.
24900 (YYPARSE_PARAM_ARG): New macro.
24901 (yyparse): Use YYPARSE_PARAM_ARG.
24902
249031995-12-27 Richard Stallman <rms@gnu.org>
24904
24905 * bison.simple (YYPARSE_PARAM_DECL):
24906 In C++, make it always null.
24907 (YYPARSE_PARAM_ARG): New macro.
24908 (yyparse): Use YYPARSE_PARAM_ARG.
24909
249101995-11-29 Richard Stallman <rms@gnu.org>
24911
24912 * doc/bison.texinfo:
24913 Describe literal string tokens, %raw, %no_lines, %token_table.
24914
249151995-11-29 Daniel Hagerty <hag@gnu.org>
24916
24917 * doc/bison.texinfo: Fixed update date
24918
249191995-10-16 Richard Stallman <rms@gnu.org>
24920
24921 * src/version.c: Version 1.25.
24922
249231995-10-16 Richard Stallman <rms@gnu.org>
24924
24925 * NEWS: *** empty log message ***
24926
249271995-10-16 Richard Stallman <rms@gnu.org>
24928
24929 * doc/bison.1, doc/bison.rnh:
24930 Add new options.
24931
249321995-10-15 Richard Stallman <rms@gnu.org>
24933
24934 * src/vmsgetargs.c, src/getargs.c:
24935 Added -n, -k, and -raw switches.
24936 (noparserflag, toknumflag, rawtoknumflag): New variables.
24937
24938 * src/symtab.h (SALIAS):
24939 New #define for adding aliases to %token.
24940 (struct bucket): Added `alias' field.
24941
24942 * src/reduce.c (reduce_grammar):
24943 Revise error message.
24944 (print_notices): Remove final `.' from error message.
24945
24946 * src/reader.c (reader_output_yylsp):
24947 New function.
24948 (readgram): Use `#if 0' around code that accepted %command
24949 inside grammar rules: The documentation doesn't allow it,
24950 and it will fail since the %command processors scan for the next %.
24951 (parse_token_decl): Extended the %token
24952 declaration to allow a multi-character symbol as an alias.
24953 (parse_thong_decl): New function.
24954 (read_declarations): Added %thong declarations.
24955 (read_declarations): Handle NOOP to deal with allowing
24956 % declarations as another means to specify the flags.
24957 (readgram): Allow %prec prior to semantics embedded in a rule.
24958 (skip_to_char, read_declarations, copy_definition)
24959 (parse_token_decl, parse_start_decl, parse_type_decl)
24960 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
24961 (get_type_name, copy_guard, copy_action, readgram)
24962 (get_type, packsymbols): Revised most error messages.
24963 Changed `fatal' to `warnxxx' to avoid aborting for error.
24964 Revised and use multiple warnxxx functions to avoid using VARARGS1.
24965 (read_declarations): Improve the error message for
24966 an invalid character. Do not abort.
24967 (read_declarations, copy_guard, copy_action): Use
24968 printable_version to avoid unprintable characters in printed output.
24969 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
24970 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
24971 Allow the type of a non-terminal can be given
24972 more than once, as long as all specifications give the same type.
24973
24974 * src/output.c:
24975 (output_headers, output_trailers, output, output_gram)
24976 (output_rule_data): Implement noparserflag variable.
24977 Implement toknumflag variable.
24978 (output): Call reader_output_yylsp to output LTYPESTR.
24979
24980 * src/main.c (main):
24981 If reader sees an error, don't process the grammar.
24982 (fatals): Updated to not use VARARGS1.
24983 (printable_version, int_to_string, warn, warni, warns, warnss)
24984 (warnsss): New error reporting functions. Avoid abort for error.
24985
24986 * src/lex.h:
24987 Added THONG and NOOP for alias processing.
24988 Added SETOPT for the new code that allows setting options with %flags.
24989
24990 * src/lex.c:
24991 Include getopt.h. Add some extern decls.
24992 (safegetc): New function to deal with EOF gracefully.
24993 (literalchar); new function to deal with reading \ escapes.
24994 (lex): Use literalchar.
24995 (lex): Implemented "..." tokens.
24996 (literalchar, lex, parse_percent_token): Made tokenbuffer
24997 always contain the token. This includes growing the token
24998 buffer while reading an integer.
24999 (parse_percent_token): Replaced if-else statement with percent_table.
25000 (parse_percent_token): Added % declarations as another
25001 way to specify the flags -n, -l, and -r. Also added hooks for
25002 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
25003 major changes to files.c.
25004 (lex) Retain in the incoming stream a character following
25005 an incorrect '/'.
25006 (skip_white_space, lex): Revised most error messages
25007 and changed fatal to warn to avoid aborting.
25008 (percent_table): Added %thong declarations.
25009
25010 * src/gram.h: Comment changes.
25011
25012 * src/files.c (openfiles, open_extra_files, done):
25013 Add faction flag
25014 and actfile file. Handle noparserflag. Both for -n switch.
25015
25016 * src/conflicts.c (resolve_sr_conflict):
25017 Remove use of alloca.
25018
250191995-06-01 Jim Meyering <meyering@gnu.org>
25020
25021 * doc/bison.texinfo: *** empty log message ***
25022
250231995-05-06 Richard Stallman <rms@gnu.org>
25024
25025 * src/bison.s1: Comment change.
25026
250271995-05-06 Richard Stallman <rms@gnu.org>
25028
25029 * bison.simple: Comment change.
25030
250311995-05-03 Richard Stallman <rms@gnu.org>
25032
25033 * src/version.c: Version now 1.24.
25034
25035 * src/bison.s1: Change distribution terms.
25036
25037 * src/version.c: Version now 1.23.
25038
250391995-05-03 Richard Stallman <rms@gnu.org>
25040
25041 * doc/bison.texinfo:
25042 Rewrite "Conditions for Using Bison".
25043 Update version to 1.24.
25044
250451995-05-03 Richard Stallman <rms@gnu.org>
25046
25047 * bison.simple: Change distribution terms.
25048
250491995-02-23 Richard Stallman <rms@gnu.org>
25050
25051 * src/files.c: Test __VMS_POSIX as well as VMS.
25052
250531995-02-14 Jim Meyering <meyering@gnu.org>
25054
25055 * src/bison.s1 (__yy_memcpy):
25056 Renamed from __yy_bcopy to avoid
25057 confusion. Reverse FROM and TO arguments to be consistent with
25058 those of memcpy.
25059
250601995-02-14 Jim Meyering <meyering@gnu.org>
25061
25062 * bison.simple (__yy_memcpy):
25063 Renamed from __yy_bcopy to avoid
25064 confusion. Reverse FROM and TO arguments to be consistent with
25065 those of memcpy.
25066
250671994-11-10 David J. MacKenzie <djm@gnu.org>
25068
25069 * NEWS: reformat
25070
25071 * NEWS: New file.
25072
25073 * Makefile.in (DISTFILES): Include NEWS.
25074
25075 * Makefile.in (DISTFILES):
25076 Include install-sh, not install.sh.
25077
25078 * configure.in: Update to Autoconf v2 macro names.
25079
250801994-10-05 David J. MacKenzie <djm@gnu.org>
25081
25082 * Makefile.in: fix typo
25083
25084 * Makefile.in (prefix, exec_prefix):
25085 Let configure set them.
25086
250871994-09-28 David J. MacKenzie <djm@gnu.org>
25088
25089 * Makefile.in: Set datadir to $(prefix)/share.
25090
250911994-09-15 Richard Stallman <rms@gnu.org>
25092
25093 * src/bison.s1:
25094 Update copyright notice and GPL version.
25095
250961994-09-15 Richard Stallman <rms@gnu.org>
25097
25098 * bison.simple:
25099 Update copyright notice and GPL version.
25100
251011994-07-12 Richard Stallman <rms@gnu.org>
25102
25103 * src/reduce.c, src/reader.c:
25104 entered into RCS
25105
251061994-05-05 David J. MacKenzie <djm@gnu.org>
25107
25108 * Makefile.in: entered into RCS
25109
251101994-03-26 Richard Stallman <rms@gnu.org>
25111
25112 * src/bison.s1: entered into RCS
25113
251141994-03-26 Richard Stallman <rms@gnu.org>
25115
25116 * bison.simple: entered into RCS
25117
251181994-03-25 Richard Stallman <rms@gnu.org>
25119
25120 * src/main.c: entered into RCS
25121
251221994-03-24 Richard Stallman <rms@gnu.org>
25123
25124 * src/conflicts.c: entered into RCS
25125
251261994-01-02 Richard Stallman <rms@gnu.org>
25127
25128 * Makefile.in: *** empty log message ***
25129
251301993-11-21 Richard Stallman <rms@gnu.org>
25131
25132 * src/bison.s1: *** empty log message ***
25133
251341993-11-21 Richard Stallman <rms@gnu.org>
25135
25136 * doc/bison.texinfo: entered into RCS
25137
25138 * doc/bison.texinfo: *** empty log message ***
25139
251401993-11-21 Richard Stallman <rms@gnu.org>
25141
25142 * bison.simple: *** empty log message ***
25143
251441993-10-25 David J. MacKenzie <djm@gnu.org>
25145
25146 * doc/bison.texinfo: *** empty log message ***
25147
251481993-10-19 Richard Stallman <rms@gnu.org>
25149
25150 * src/bison.s1: *** empty log message ***
25151
251521993-10-19 Richard Stallman <rms@gnu.org>
25153
25154 * bison.simple: *** empty log message ***
25155
251561993-10-14 Richard Stallman <rms@gnu.org>
25157
25158 * src/bison.s1: *** empty log message ***
25159
251601993-10-14 Richard Stallman <rms@gnu.org>
25161
25162 * bison.simple: *** empty log message ***
25163
251641993-09-14 David J. MacKenzie <djm@gnu.org>
25165
25166 * doc/bison.texinfo: *** empty log message ***
25167
251681993-09-13 Noah Friedman <friedman@gnu.org>
25169
25170 * Makefile.in: *** empty log message ***
25171
251721993-09-10 Richard Stallman <rms@gnu.org>
25173
25174 * src/conflicts.c: *** empty log message ***
25175
25176 * src/system.h: entered into RCS
25177
251781993-09-10 Richard Stallman <rms@gnu.org>
25179
25180 * doc/bison.1: entered into RCS
25181
251821993-09-06 Noah Friedman <friedman@gnu.org>
25183
25184 * src/version.c: entered into RCS
25185
251861993-09-06 Noah Friedman <friedman@gnu.org>
25187
25188 * Makefile.in: *** empty log message ***
25189
251901993-07-30 David J. MacKenzie <djm@gnu.org>
25191
25192 * Makefile.in: *** empty log message ***
25193
251941993-07-24 Richard Stallman <rms@gnu.org>
25195
25196 * src/bison.s1: *** empty log message ***
25197
251981993-07-24 Richard Stallman <rms@gnu.org>
25199
25200 * bison.simple: *** empty log message ***
25201
252021993-07-08 David J. MacKenzie <djm@gnu.org>
25203
25204 * Makefile.in: *** empty log message ***
25205
252061993-07-04 Richard Stallman <rms@gnu.org>
25207
25208 * src/bison.s1: *** empty log message ***
25209
252101993-07-04 Richard Stallman <rms@gnu.org>
25211
25212 * bison.simple: *** empty log message ***
25213
252141993-06-26 David J. MacKenzie <djm@gnu.org>
25215
25216 * src/getargs.c: entered into RCS
25217
252181993-06-26 David J. MacKenzie <djm@gnu.org>
25219
25220 * doc/bison.texinfo: *** empty log message ***
25221
25222 * doc/bison.1: New file.
25223
252241993-06-25 Richard Stallman <rms@gnu.org>
25225
25226 * src/getargs.c: New file.
25227
252281993-06-16 Richard Stallman <rms@gnu.org>
25229
25230 * src/bison.s1: *** empty log message ***
25231
252321993-06-16 Richard Stallman <rms@gnu.org>
25233
25234 * bison.simple: *** empty log message ***
25235
252361993-06-03 Richard Stallman <rms@gnu.org>
25237
25238 * src/bison.s1: New file.
25239
252401993-06-03 Richard Stallman <rms@gnu.org>
25241
25242 * doc/bison.texinfo: *** empty log message ***
25243
252441993-06-03 Richard Stallman <rms@gnu.org>
25245
25246 * bison.simple: New file.
25247
252481993-05-19 Richard Stallman <rms@gnu.org>
25249
25250 * doc/bison.texinfo: New file.
25251
252521993-05-07 Noah Friedman <friedman@gnu.org>
25253
25254 * Makefile.in: *** empty log message ***
25255
252561993-04-28 Noah Friedman <friedman@gnu.org>
25257
25258 * src/reader.c: *** empty log message ***
25259
252601993-04-23 Noah Friedman <friedman@gnu.org>
25261
25262 * src/alloc.h: entered into RCS
25263
252641993-04-20 David J. MacKenzie <djm@gnu.org>
25265
25266 * src/version.c: *** empty log message ***
25267
25268 * src/files.c, src/allocate.c:
25269 entered into RCS
25270
25271 * src/reader.c: *** empty log message ***
25272
25273 * src/lex.c: entered into RCS
25274
25275 * src/conflicts.c: New file.
25276
25277 * src/symtab.c: entered into RCS
25278
25279 * src/alloc.h: New file.
25280
25281 * src/LR0.c: entered into RCS
25282
252831993-04-18 Noah Friedman <friedman@gnu.org>
25284
25285 * src/reader.c: New file.
25286
25287 * src/version.c: *** empty log message ***
25288
252891993-04-18 Noah Friedman <friedman@gnu.org>
25290
25291 * Makefile.in: *** empty log message ***
25292
252931993-04-17 Noah Friedman <friedman@gnu.org>
25294
25295 * Makefile.in: *** empty log message ***
25296
252971993-04-15 Richard Stallman <rms@gnu.org>
25298
25299 * src/main.c, src/files.c:
25300 New file.
25301
253021993-04-15 Noah Friedman <friedman@gnu.org>
25303
25304 * configure.in: entered into RCS
25305
25306 * configure.in: *** empty log message ***
25307
25308 * configure.in: New file.
25309
253101993-04-14 Richard Stallman <rms@gnu.org>
25311
25312 * Makefile.in: New file.
25313
253141993-04-13 Richard Stallman <rms@gnu.org>
25315
25316 * src/version.c: New file.
25317
253181993-03-25 Richard Stallman <rms@gnu.org>
25319
25320 * src/output.c: entered into RCS
25321
253221992-09-25 Richard Stallman <rms@gnu.org>
25323
25324 * configure.bat: entered into RCS
25325
253261992-06-22 Richard Stallman <rms@gnu.org>
25327
25328 * src/vmsgetargs.c: entered into RCS
25329
253301992-06-22 Richard Stallman <rms@gnu.org>
25331
25332 * doc/bison.rnh: entered into RCS
25333
253341992-04-20 David J. MacKenzie <djm@gnu.org>
25335
25336 * README: entered into RCS
25337
253381992-01-22 Richard Stallman <rms@gnu.org>
25339
25340 * src/machine.h: entered into RCS
25341
253421991-12-21 Richard Stallman <rms@gnu.org>
25343
25344 * src/lalr.c, src/closure.c:
25345 entered into RCS
25346
253471991-12-20 Richard Stallman <rms@gnu.org>
25348
25349 * src/state.h: entered into RCS
25350
253511991-12-18 Richard Stallman <rms@gnu.org>
25352
25353 * src/print.c, src/nullable.c, src/derives.c:
25354 entered into RCS
25355
253561991-11-03 David J. MacKenzie <djm@gnu.org>
25357
25358 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
25359 entered into RCS
25360
253611988-09-09 Richard Stallman <rms@gnu.org>
25362
25363 * src/bison.hairy: entered into RCS
25364
253651987-12-16 Richard Stallman <rms@gnu.org>
25366
25367 * REFERENCES: entered into RCS
dc546b0f 25368
f294a2c2 25369
04098407 25370 -----
f294a2c2 25371
e141f4d4
JD
25372 Copyright (C) 1987-1988, 1991-2010 Free Software Foundation,
25373 Inc.
f294a2c2 25374
04098407
PE
25375 Copying and distribution of this file, with or without
25376 modification, are permitted provided the copyright notice and this
25377 notice are preserved.