]> git.saurik.com Git - bison.git/blame - ChangeLog
Complain about unused %define variables and %code qualifiers.
[bison.git] / ChangeLog
CommitLineData
628be6c9
JD
12009-09-03 Joel E. Denny <jdenny@clemson.edu>
2
3 Complain about unused %define variables and %code qualifiers.
4 * NEWS (2.5): Document.
5 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
6 * doc/bison.texinfo (Decl Summary): Document complaint, and
7 improve %define documentation a little otherwise.
8 * tests/input.at (Reject unused %code qualifiers): Update.
9 (%define errors): Update.
10 (%define, --define, --force-define): Update.
11 (%define backward compatibility): Update.
12 (Unused %define api.pure): Update.
13 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
14
c842365a
JD
152009-09-03 Joel E. Denny <jdenny@clemson.edu>
16
17 Use aver not assert.
18 * src/output.c: Don't include assert.h.
19 (output_skeleton): Use aver not assert.
20 * src/system.h (aver): In documentation of why, add links to
21 Paul Eggert's explanations in the mailing lists.
22
14e568d7
AR
232009-09-05 Alex Rozenman <rozenman@gmail.com>
24
25 Use "Unresolved reference" error message when no symbols were found
26 in a symbolic reference resolution. Remove .expr and -expr from
27 the shown reference when the reference is unresolved.
28 * src/scan-code.l: Change the error message, adjust location columns,
29 rename variable "exact_mode" to "explicit_bracketing".
30 * tests/named-ref.at: Adjust existing tests and add a new one.
31
dac8cc0d
AD
322009-09-03 Akim Demaille <demaille@gostai.com>
33
34 * NEWS (2.4.2): Add "Internationalization" item.
35
3710dd02
AD
362009-09-03 Akim Demaille <demaille@gostai.com>
37
38 bootstrap: fix/improve find_tool.
39 * bootstrap (find_tool): Improve error messages.
40 Fix typo about find_tool_names.
41
9852b61c
JD
422009-08-29 Joel E. Denny <jdenny@clemson.edu>
43
44 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
45 See
46 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
47 * src/scan-code.h (code_props_rule_action_init): Rename
48 named_ref arg to name so it doesn't shadow named_ref type. This
49 makes it consistent with the function definition in scan-code.l
50 anyway.
51
f37495f6
JD
522009-08-28 Joel E. Denny <jdenny@clemson.edu>
53
54 %define: accept unquoted values.
55 * NEWS (2.5): Group all %define changes together, and document
56 this one. Remove quotes in IELR and canonical LR entry.
57 * doc/bison.texinfo: Remove quotes in most examples throughout.
58 (Decl Summary): Update %define documentation.
59 (Table of Symbols): Likewise.
60 * src/ielr.c (LrType): Update documentation.
61 * src/parse-gram.y (content.opt): Add production for ID.
5bf2bf7a 62 * tests/calc.at: Remove quotes in most tests.
f37495f6
JD
63 * tests/existing.at: Likewise.
64 * tests/input.at: Likewise.
65 * tests/local.at: Likewise.
66 * tests/push.at: Likewise.
67 * tests/reduce.at: Likewise.
68 * tests/torture.at: Likewise.
69
3a414bbf
JD
702009-08-28 Joel E. Denny <jdenny@clemson.edu>
71
72 %define lr.type: make values lowercase IDs.
73 That is, "LALR" => "lalr", "IELR" => "ielr", and
74 "canonical LR" => "canonical-lr".
75 * NEWS (2.5): Update documentation.
76 * doc/bison.texinfo (Decl Summary): Likewise.
77 * src/ielr.c (ielr): Use new values.
78 * src/ielr.h (ielr): Update documentation.
79 * src/reader.c (prepare_percent_define_front_end_variables): Use
80 and validate new values.
81 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
82 grammars.
83 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
84
4bb975e1
EB
852009-08-27 Eric Blake <ebb9@byu.net>
86
87 scan-gram: avoid portability trap with ctype usage.
88 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
89 Avoid compiler warning.
90
74baf5c9
JD
912009-08-27 Joel E. Denny <jdenny@clemson.edu>
92
93 tests: use perl for printing special sequences to files.
94 And skip tests if perl is not available. This is better than
95 playing tricks with shell portability. Suggested by Akim
96 Demaille.
97 * tests/input.at (Bad character literals): Use it here for
98 omitting final newlines.
99 (Bad escapes in literals): Use it here for special characters.
100
d63e1279
JD
1012009-08-26 Joel E. Denny <jdenny@clemson.edu>
102
103 tests: show a use of %define lr.default-reductions "consistent"
104 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
105 prevents the omission of expected tokens for %error-verbose.
106
833d1720
AD
1072009-08-26 Akim Demaille <demaille@gostai.com>
108
109 tests: portability fix.
110 * tests/input.at (Bad escapes in literals): Don't expect "echo
111 '\0'" to output \ then 0.
112
e4bcae3c
JD
1132009-08-26 Joel E. Denny <jdenny@clemson.edu>
114
115 Actually handle the yytable zero value correctly this time.
116 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Don't
117 mention zero values in the YYTABLE comments.
118 * data/glr.c (yytable_value_is_error): Don't check for zero
119 value.
120 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
121 * data/yacc.c (yytable_value_is_error): Likewise.
122 * data/lalr1.java (yy_table_value_is_error_): Likewise.
123 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
124 * src/tables.h: In header comments, explain why it's useless to
125 check for a zero value in yytable.
126
d5eb0826
JD
1272009-08-25 Joel E. Denny <jdenny@clemson.edu>
128
129 More fixes related to last two patches.
130 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
131 defined.
132 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Fix
133 yytable comments: zero indicates syntax error not default
134 action.
135 * data/glr.c (yyis_pact_ninf): Rename to...
136 (yypact_value_is_default): ... this.
137 (yyisDefaultedState): Update for rename.
138 (yyis_table_ninf): Rename to...
139 (yytable_value_is_error): ... this, and check for value zero
140 besides just YYTABLE_NINF.
141 (yygetLRActions): Check for default value from yypact. It
142 appears that this check is always performed before this function
143 is invoked, and so adding the check here is probably redundant.
144 However, the code may evolve after this subtlety is forgotten.
145 Also, update for rename to yytable_value_is_error. Because that
146 macro now checks for zero, a different but equivalent branch of
147 the if-then-else here is evaluated.
148 (yyreportSyntaxError): Update for rename to
149 yytable_value_is_error. The zero condition was mishandled
150 before.
151 (yyrecoverSyntaxError): Update for renames. No behavioral
152 changes.
153 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
154 New function.
155 (yy_table_value_is_error_): New function.
156 (parse): Use new functions where possible. No behavioral
157 changes.
158 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
159 The zero condition was mishandled before.
160 * data/yacc.c (yyis_pact_ninf): Rename to...
161 (yypact_value_is_default): ... this.
162 (yyis_table_ninf): Rename to...
163 (yytable_value_is_error): ... this, and check for value zero
164 besides just YYTABLE_NINF.
165 (yysyntax_error): Update for rename to yytable_value_is_error.
166 The zero condition was mishandled before.
167 (yyparse): Update for renames. No behavioral changes.
168 * src/tables.h: Improve comments about yypact, yytable, etc.
169 more. Most importantly, say yytable value of zero means syntax
170 error not default action.
171
1fa30307
JD
1722009-08-25 Joel E. Denny <jdenny@clemson.edu>
173
174 Fix %error-verbose for conflicts resolved by %nonassoc.
175 * NEWS (2.5): Document.
176 * data/glr.c (yyreportSyntaxError): Fix this by checking
177 yyis_table_ninf.
178 * data/yacc.c (yysyntax_error): Likewise.
179 * data/lalr1.cc (yysyntax_error_): Fix this by checking
180 yytable_ninf_.
181 * data/lalr1.java (yysyntax_error): Likewise.
182 * tests/conflicts.at (%nonassoc and eof): Update expected output
183 and remove FIXME.
184
77373efa
JD
1852009-08-25 Joel E. Denny <jdenny@clemson.edu>
186
187 Some code and documentation improvements.
188 * data/c.m4 (b4_table_value_equals): New macro to capture
189 some repeated code.
190 * data/glr.c (yyis_pact_ninf): Use it here.
191 (yyis_table_ninf): Likewise.
192 (yyreportSyntaxError): Improve internal comments.
193 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
194 Use it everywhere possible.
195 (yyis_table_ninf): Likewise.
196 (yysyntax_error): Improve internal comments.
197 * data/lalr1.cc (yysyntax_error_): Likewise.
198 * data/lalr1.java (yysyntax_error): Likewise.
199 * src/tables.h: Improve comments about yypact, yytable, etc.
200
890ab17c
JD
2012009-08-21 Joel E. Denny <jdenny@clemson.edu>
202
203 Use locale when quoting.
204 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
205 quote rather than implementing quoting here.
206
c5196098
EB
2072009-08-20 Eric Blake <ebb9@byu.net>
208
aa50ba7b
EB
209 Make previous patch more robust.
210 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
211 argmatch.h.
212 (output_skeleton): Use it.
213 Suggested by Akim Demaille.
214
c5196098
EB
215 Import latest m4/m4.m4.
216 * submodules/autoconf: Update to autoconf 2.64.
217 * configure.ac (M4_GNU_OPTION): New define.
218 * src/output.c (output_skeleton): Use it to resolve FIXME.
219 * NEWS: Mention this.
220
39fb7e62
JD
2212009-08-19 Joel E. Denny <jdenny@clemson.edu>
222
223 Fix complaints about escape sequences.
224 Discussed starting at
225 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
226 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
227 For a \0 and similar escape sequences meaning the null
228 character, report an invalid escape sequence instead of an
229 invalid null character because the latter does not actually
230 appear in the user's input.
231 In all escape sequence complaints, don't escape the initial
232 backslash, and don't quote when the sequence appears at the end
233 of the complaint line unless there's whitespace that quotearg
234 won't escape.
235 Consistently say "invalid" not "unrecognized".
236 Consistently prefer "empty character literal" over "extra
237 characters in character literal" warning for invalid escape
238 sequences; that is, consistently discard those sequences.
239 * tests/input.at (Bad escapes in literals): New.
240
c33bc800
AD
2412009-08-19 Akim Demaille <demaille@gostai.com>
242
243 doc: fixes.
244 * doc/bison.texinfo: Fix minor Texinfo errors.
245
8fbbeba2
AD
2462009-08-19 Akim Demaille <demaille@gostai.com>
247
248 doc: %initial-action to initialize yylloc.
249 Reported by Bill Allombert.
250 * doc/bison.texinfo: Set fill-column to 76.
251 (Location Type): Document the use of %initial-action to initialize
252 yylloc.
253
1874a474
JD
2542009-08-18 Joel E. Denny <jdenny@clemson.edu>
255
256 maint: update for gnulib's recent update-copyright changes
257 * gnulib: Update.
258 * .x-update-copyright (COPYING): Add as it's no longer implied
259 when .x-update-copyright is present.
260 * cfg.mk (update-copyright-local): Remove, now ignored.
261 (update-copyright): Declare update-b4-copyright as a dependency.
262
f4bfd5a9
AD
2632009-08-17 Akim Demaille <demaille@gostai.com>
264
265 build: require gettext 0.17.
266
267 Suggested by Bruno Haible.
268 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
269 * configure.ac: require gettext 0.17 to ensure compatibility with
270 gnulib.
271
2509eba6
AD
2722009-08-17 Akim Demaille <demaille@gostai.com>
273
274 build: lower gettext requirements.
275
276 Bison was uselessly requiring the formatstring macros from
277 gettext, which resulted in mo files not being installed on systems
278 that perfectly supported Bison mo files. Lower the requirement.
279 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
280
aa50ba7b
EB
281 * configure.ac: Require need-ngettext instead of
282 need-formatstring-macros.
283 Reported by Martin Jabocs.
284 Suggested by Bruno Haible.
285 * INSTALL: Restructure.
286 (Internationalization): New.
2509eba6 287
314542f9
JD
2882009-08-14 Joel E. Denny <jdenny@clemson.edu>
289
290 maint: fix use of copyright year intervals.
291 * gnulib: Update.
292 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
293 as now recommended in gnulib/NEWS.
294 * build-aux/update-b4-copyright: Fix.
295 * cfg.mk (update-copyright-env): Configure update-copyright.
296
24985964
JD
2972009-08-13 Joel E. Denny <jdenny@clemson.edu>
298
299 Make it easier to write deterministic tests.
300 Continues Akim's work from his 2009-06-10 commits.
301 * src/reader.c (check_and_convert_grammar): Don't add any
302 symbols after the first symbols_do invocation.
303 * src/symtab.c (symbols_sorted): New static global.
304 (user_token_number_redeclaration): Update comments.
305 (symbol_from_uniqstr): If a new symbol is being created, assert
306 that symbols_sorted hasn't been allocated yet.
307 (symbols_free): Free symbols_sorted.
308 (symbols_cmp, symbols_cmp_qsort): New functions.
309 (symbols_do): Sort symbol_table into symbols_sorted on first
310 invocation.
311 * tests/input.at (Numbered tokens): Recombine tests now that the
312 output should be deterministic across multiple numbers.
313
47076da5
AD
3142009-08-12 Akim Demaille <demaille@gostai.com>
315
316 distcheck: fix.
317
aa50ba7b 318 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
47076da5 319
36dfe466
JD
3202009-08-10 Joel E. Denny <jdenny@clemson.edu>
321
322 * tests/Makefile.am (TESTSUITE_AT): Add named-refs.at.
323
07c0db18
JD
3242009-08-10 Joel E. Denny <jdenny@clemson.edu>
325
326 Miscellaneous code readability improvements.
327
328 * src/reader.c (reader): Move %define front-end variable
329 defaults and checking into...
330 (prepare_percent_define_front_end_variables): ... this new
331 function.
332
333 * src/scan-gram.l (INITIAL): For consistency with string
334 literals, don't store open quote on character literal. It's
335 discarded before returning anyway.
336 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
337 Make length test more readable, and make the character stored
338 for an empty literal more obvious while consistent with the
339 previous behavior.
340
341 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
342 USER_NUMBER_HAS_STRING_ALIAS throughout.
343 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
344 that is repeated in symtab.h. Improve argument names to make it
345 clear which side of the symbol-string alias pair is which.
346 (symbol_check_alias_consistency): Improve local variable names
347 for the same purpose.
348 * src/symtab.h (struct symbol): Make comments about aliases
349 clearer.
350 (symbol_make_alias): Improve comments and argument name.
351 * src/output.c (token_definitions_output): Update for rename to
352 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
353
1a323c2f
AR
3542009-08-08 Alex Rozenman <rozenman@gmail.com>
355
356 Convert "misleading reference" messages to warnings.
357 * src/scan-code.l: New function 'show_sub_messages', more
358 factoring.
359 * tests/named-ref.at: Adjust tests.
360
38609c34
JD
3612009-08-06 Joel E. Denny <jdenny@clemson.edu>
362
363 maint: run "make update-copyright"
364
642f240e
JD
3652009-08-06 Joel E. Denny <jdenny@clemson.edu>
366
367 maint: make update-b4-copyright easier to use
368 * build-aux/update-b4-copyright: In warnings, report line
369 numbers rather than character positions.
370 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
371 that update-copyright runs it.
372 * gnulib: Update.
373
d0caad01
JD
3742009-08-05 Joel E. Denny <jdenny@clemson.edu>
375
376 maint: clean up update-b4-copyright code
377 * build-aux/update-b4-copyright: Do not accept 2-digit
378 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
379 Don't accept a `[' in a b4_copyright argument.
380 Format code more consistently.
381 Don't assume b4*copyright never occurs.
382
ac2def56
JD
3832009-08-04 Joel E. Denny <jdenny@clemson.edu>
384
385 maint: automate b4_copyright updates.
386 * Makefile.am (update-b4-copyright): New target rule.
387 * build-aux/Makefile.am (EXTRA_DIST): Add update-b4-copyright.
388 * build-aux/update-b4-copyright: New.
389 * data/yacc.c: Remove stray characters around b4_copyright
390 invocations.
391
dbbb64f0
JD
3922009-08-04 Joel E. Denny <jdenny@clemson.edu>
393
394 maint: automate annual package-wide copyright-year update.
395 * .x-update-copyright: New.
396 * Makefile.am (EXTRA_DIST): Remove maint.mk.
397 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
398 update-copyright. Remove gnumakefile, which is implied by
399 maintainer-makefile.
400 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
401 * gnulib: Update.
402 * maint.mk: Remove, now copied from gnulib.
403 * examples/extexi: Add missing "(C)" in copyright statement so
404 update-copyright can recognize it.
405 * src/LR0.h: Likewise.
406 * src/print.h: Likewise.
407 * src/print_graph.h: Likewise.
408 * src/gram.c: Add missing comma in copyright statement.
409 * src/gram.h: Likewise.
410
bfa018d4
JD
4112009-08-04 Joel E. Denny <jdenny@clemson.edu>
412
413 Fix "make distcheck".
414 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
415 of just calc.stamp.
416
4521fcdf
JD
4172009-08-01 Joel E. Denny <jdenny@clemson.edu>
418
419 Pacify "gcc -Wunused" for the input function from Flex.
420 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
421 and later.
422 * src/scan-code.l: Add "%option noinput", which I cannot find in
423 the Flex manual, but which Flex has supported since at least as
424 far back as 2.5.4. However, if any of our developers still use
425 Flex 2.5.4, they'll need to stop configuring with
426 --enable-gcc-warnings because "%option noinput" didn't work
427 correctly until Flex 2.5.6.
428 * src/scan-gram.l: Likewise.
429 * src/scan-skel.l: Likewise.
430
992e874a
AR
4312009-07-31 Alex Rozenman <rozenman@gmail.com>
432
433 Fix --enable-gcc-warnings problems.
434 * src/reader.c: Adjust variable names.
435 * src/scan-code.l: Fix prototypes and adjust names.
436 * src/named-ref.c: Remove redundant "if".
437
a1ed2b71
JD
4382009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
439
440 Fix a --enable-gcc-warnings problem.
441 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
442 variable.
443
cbc6a70e 4442009-07-24 Alex Rozenman <rozenman@gmail.com>
1e20ad11
AR
445
446 Fix some memory leaks.
447 * src/named-ref.c: Add a pointer check (named_ref_free).
448 * src/scan-code.l: New function (variant_table_free). Called in
449 code_scanner_free.
450 * src/symlist.c: Call to named_ref_free (symbol_list_free).
451
ac9b0e95
JD
4522009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
453
454 Warn about character literals not of length one.
455 * NEWS (2.5): Document.
456 * src/scan-gram.l (INITIAL): Remove comment that we don't check
457 the length.
458 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
459 * tests/input.at (Bad character literals): New test group.
460
2de160e1
JD
4612009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
462
463 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
464
cba97506
JD
4652009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
466
467 Some M4 cleanup in the testsuite.
468 Suggested by Eric Blake at
469 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
470 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
471 complicate the code by distinguishing between a missing value
472 and an empty string value for an optional argument. This fix is
473 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
474 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
475 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
476 arguments are not needed because of the following changes.
477 Fix stale comments.
478 Bison developers should use GNU M4 and should not use
479 POSIXLY_CORRECT when building the test suite, so do not
480 complicate the code by avoiding $10 and above.
481 Do not quote an empty string value for an optional argument, and
482 do not distinguish between a missing value and an empty string
483 value.
484
62eb2d1b
JD
4852009-07-21 Joel E. Denny <jdenny@ces.clemson.edu>
486
487 * m4/m4.m4: Make it a sym link to submodules/autoconf/m4/m4.m4.
488
620b2e36
JD
4892009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
490
491 Revert unnecessary column realignment in --help output.
492 Reported by Akim Demaille at
493 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
494 * src/getargs.c (usage): Here.
495
cbc6a70e 4962009-07-04 Alex Rozenman <rozenman@gmail.com>
dad6544d
AR
497
498 Alphabetical order in src/Makefile.am.
499 * src/Makefile.am: Adjust.
500
cbc6a70e 5012009-07-04 Alex Rozenman <rozenman@gmail.com>
d5e8574b
AR
502
503 Style changes and factoring.
504 * src/named-ref.h: Add comments.
505 * src/parse-gram.y: Readability and style changes.
506 * src/reader.c: Factoring: assign_named_ref function.
507 * src/scan-code.l: Factoring and style changes. Rename
508 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
509 Use "unsigned" type for variant index. Improve readablity.
510 * src/scan-gram.l: Change error messages and add comments.
511 * src/symlist.h: symbol_list_null: New function decl.
512 * src/symlist.c: symbol_list_null: Implement here.
513 * tests/named-refs.at: Adjust for new error messages.
514
ae09ec85
EB
5152009-06-29 Eric Blake <ebb9@byu.net>
516
517 scan-code: avoid compiler warnings
518 * src/scan-code.l (parse_named_ref): Use correct specifiers.
519
80d653fd
AD
5202009-06-29 Akim Demaille <demaille@gostai.com>
521
522 build: avoid concurrent extraction of calc++.
523 * examples/calc++/Makefile.am (calc.stamp): New.
524 Depend on it to create the sources of calc++ so that concurrent
525 builds don't launch several "extexi" in parallel.
526 Not only this is inefficient, this also builds incorrect sources
527 with several extractions mixed together.
528
7685e2f7
AR
5292009-06-27 Alex Rozenman <rozenman@gmail.com>
530
531 Implement support for named symbol references.
532 * src/parse-gram.y: Add new syntax (named_ref.opt).
533 * src/reader.c: Store named refs in symbol lists.
534 * src/reader.h: New argument for symbol_append and
535 action_append functions.
536 * src/scan-code.h: Add new field (named_ref) into
537 code_props data structure. Keeps named ref of midrule
538 actions.
539 * src/scan-code.l: Support for named refs in semantic
540 action code. New function 'parse_named_ref'.
541 * src/scan-gram.l: Support bracketed id.
542 * src/symlist.c: Store named refs in symbol lists.
543 * src/symlist.h: New field in symbol list: named_ref.
544 * src/named-ref.h: New file, a struct for named_ref.
545 * src/named-ref.cp: New file, named_ref_new function.
546 * src/local.mk: Add two new files.
547 * tests/testsuite.at: Include new test group:
548 * tests/named-refs.at: this new file.
549
67f8cf51
AD
5502009-06-25 Akim Demaille <demaille@gostai.com>
551
552 hash: check insertion for memory exhaustion.
553 * src/uniqstr.c (uniqstr_new): New.
554
83b66ddd
AD
5552009-06-11 Akim Demaille <demaille@gostai.com>
556
557 style changes.
558 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
559 * src/print-xml.c: Style changes.
560 * tests/conflicts.at: Comment changes.
561
517cb0ad
AD
5622009-06-11 Akim Demaille <demaille@gostai.com>
563
564 xml: beware of user strings used to give a %prec to rules.
565 * tests/conflicts.at (%prec with user strings): New.
566 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
567 XML output.
568
75c7a52a
AD
5692009-06-11 Akim Demaille <demaille@gostai.com>
570
571 hash: check insertion for memory exhaustion.
572 * src/muscle-tab.c (muscle_insert, muscle_grow)
573 * src/state.c (state_hash_insert): Check the return value of
574 hash_insert.
575
66ed9753
AD
5762009-06-10 Akim Demaille <demaille@gostai.com>
577
578 deterministic test suite.
579 Some consistency checks on symbols are performed after all the
580 symbols were read, by an iteration over the symbol table. This
581 traversal is nondeterministic, which can be a problem for test
582 cases.
583 Avoid this.
584 Addresses another form of nondeterminism reported by Joel E. Denny.
585 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
586
587 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
588 test in two.
589 Use different file names for the three tests to make the
590 maintenance easier.
591
ed15d907
AD
5922009-06-10 Akim Demaille <demaille@gostai.com>
593
95d176ff
AD
594 deterministic user-token-number redeclaration errors.
595 Address nondeterminism reported by Joel E. Denny.
596 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
597
598 * src/uniqstr.h: Comment changes.
599 * src/location.h (boundary_cmp, location_cmp): New.
600 * src/symtab.c (user_token_number_redeclaration): New.
601 (symbol_translation): Use it.
602 * tests/input.at (Numbered tokens): Adjust the expected output.
603
6042009-05-25 Akim Demaille <demaille@gostai.com>
605
ed15d907 606 gnulib: update.
aa50ba7b
EB
607 * gnulib: Update to latest.
608 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
609 * m4/.gitignore: Regen.
610 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
611 Call xalloc_die on hash_insert failures.
612 Requested by the new __warn_unused_result__ attribute of
613 hash_insert.
ed15d907 614
e3a33f7c
JD
6152009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
616
617 Convert multiple variable definition warnings to complaints.
618 * NEWS (2.5): Add a new entry for that change.
619 * doc/bison.texinfo (Decl Summary): Update %define entry.
620 (Bison Options): Update -D/--define/-F/--force-define entry.
621 * src/muscle_tab.c (muscle_percent_define_insert): Implement.
622 * src/muscle_tab.h (muscle_percent_define_insert): Update
623 comments.
624 * tests/input.at (`%define errors'): Update.
625 (`%define, --define, --force-define'): Update.
626
34d41938
JD
6272009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
628
629 -F/--force-define and relative %define/-D/--define priorities.
630 * NEWS (2.5): Add documentation to -D/--define entry.
631 * build-aux/cross-options.pl: Hard-code association of
632 --force-define with %define.
633 * doc/bison.texinfo (Decl Summary): In %define entry,
634 cross-reference command-line options.
635 (Bison Options): Add documentation to -D/--define entry.
636 (Option Cross Key): Widen column for --force-define row.
637 * src/getargs.c (usage): Document -F/--force-define. Realign
638 options in output.
639 (short_options, long_options, getargs): Parse -F/--force-define,
640 and update muscle_percent_define_insert invocation.
641 * src/muscle_tab.h (muscle_percent_define_how): New enum type.
642 (muscle_percent_define_insert): Add argument with that type.
643 * src/muscle_tab.c (muscle_percent_define_insert): Implement
644 -F/--force-define behavior and priorities.
645 * src/parse-gram.y (prologue_declaration): Update
646 muscle_percent_define_insert invocations.
647 * tests/input.at (`%define, --define'): Rename to...
648 (`%define, --define, --force-define'): ... this and extend.
649
246c4efa
JD
6502009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
651
652 Update some comments to make sense for -D.
653 * data/bison.m4 (b4_check_user_names): In header comments, say
654 "user occurrence" instead of "grammar occurrence".
655 * src/muscle_tab.h (muscle_percent_define_insert): Likewise.
656 (muscle_percent_code_grow): Likewise just for consistency.
657
531683e7
JD
6582009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
659
660 * data/c++.m4: Update copyright year.
661
e7bfa8b7
JD
6622009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
663
664 * data/c++.m4 (b4_namespace_close): Simplify slightly.
665
8c221795
JD
6662009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
667
668 Handle a trailing `:' in a user-supplied C++ namespace better.
669 * data/c++.m4 (b4_namespace_close): Don't let it be printed
670 among the closing braces here. This fix might make the
671 generated code easier to debug, but otherwise it should be
672 insignificant because a trailing `:' is a C++ error already.
673
c8bf65f0
AD
6742009-05-19 Akim Demaille <demaille@gostai.com>
675
676 remove useless variable.
677 * src/getargs.c (skeleton_arg): Remove now useless variable.
678 Should help the compiler see that this printf-like call is sane.
679
7ac45a46
AD
6802009-05-11 Akim Demaille <demaille@gostai.com>
681
682 doc: use C++ headers.
683 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
684 headers.
685
601bdfab
AD
6862009-05-05 Akim Demaille <demaille@gostai.com>
687
688 fix hexadecimal token number support.
689 * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers.
690
d19123e6
AD
6912009-05-05 Akim Demaille <demaille@gostai.com>
692
693 tests: check token numbers.
694 * tests/input.at (Numbered tokens): New.
695
ecdfea9a
AD
6962009-05-04 Akim Demaille <demaille@gostai.com>
697
698 bison: catch bad symbol names.
699 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
700 * tests/input.at: Adjust.
701
43e6aea5
AD
7022009-05-04 Akim Demaille <demaille@gostai.com>
703
704 space changes.
705 * src/scan-gram.l: Untabify to be robust to zealous editors.
706
c046698e
AD
7072009-05-04 Akim Demaille <demaille@gostai.com>
708
709 identifiers: dashes are letters.
710 Dashes can now start identifiers (symbols and directives).
b10dd689 711
c046698e
AD
712 * src/scan-gram.l ({letter}): Add dash.
713 ({id}): Remove it.
714 * tests/input.at (Symbols): Adjust.
715 Remove stray comment.
716 * tests/regression.at (Invalid inputs): Adjust error message.
717 * doc/bison.texinfo (Symbols): Update.
718
966aba65
JD
7192009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
720
721 Declare %code to be a permanent feature.
722 * NEWS (2.4.2): Here.
723 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
724 experimental.
725 (Decl Summary): Likewise.
726
812775a0
JD
7272009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
728
729 Convert underscores to dashes in some %define variable names.
730 For now, just api.push-pull and lr.keep-unreachable-states.
731 Maintain old names for backward compatibility.
732 * NEWS (2.5): Document.
733 * data/c.m4 (b4_identification): Update comment.
734 * data/yacc.c: Update access.
735 * doc/bison.texinfo: Update.
736 * etc/bench.pl.in (bench_grammar): Update use.
737 * src/files.c (tr): Move to...
738 * src/getargs.c, src/getargs.h (tr): ... here because I can't
739 think of a better place to expose it. My logic is that, for all
740 uses of tr so far, command-line arguments can be involved, and
741 getargs.h is already included.
742 * src/main.c (main): Update access.
743 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
744 variable names to new variable names before assigning value.
745 * src/reader.c (reader): Update setting default.
746 * tests/calc.at: Update uses.
747 * tests/conflicts.at (Unreachable States After Conflict
748 Resolution): Update use.
749 * tests/input.at (%define enum variables): Update use.
750 (%define backward compatibility): New test group.
751 * tests/push.at: Update uses.
752 * tests/reduce.at: Update uses.
753 * tests/torture.at: Update uses.
754
1c4aa81d
JD
7552009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
756
757 Set all front-end %define defaults in one place.
758 * src/main.c (main): Move lr.keep_unreachable_states default...
759 * src/reader.c (reader): ... to here.
760
1d0f55cc
JD
7612009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
762
763 Rename lr.default_reductions to lr.default-reductions.
764 * NEWS (2.5): Here.
765 * doc/bison.texinfo: Here.
766 * src/lalr.c (initialize_LA): Here.
767 * src/print.c (print_reductions): Here.
768 * src/reader.c (reader): Here.
769 * src/tables.c (action_row): Here.
770 * tests/input.at (%define enum variables): Here.
771 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
772
0b593457
JD
7732009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
774
775 Pacify ./configure --enable-gcc-warnings.
776 * tests/input.at (Symbols): Prototype yyerror and yylex.
777
0939aa2d
AD
7782009-04-21 Akim Demaille <demaille@gostai.com>
779
780 tests: check the use of dashes and periods in symbols.
781 * tests/input.at (Symbol): New test group.
782
0b593457 7832009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
ae618dcc
JD
784
785 Document how `%define "var" "value"' is not M4-friendly.
786 * src/parse-gram.y (variable): In comments here.
787
0b593457 7882009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
6789b8bd
JD
789
790 Add copyright updates missed during previous cherry pick.
791 * src/output.c: Here.
792 * src/parse-gram.y: Here.
793 * src/scan-gram.l: Here.
794
663ce7bb
AD
7952009-04-20 Akim Demaille <demaille@gostai.com>
796
797 variables: accept dashes.
798 * src/scan-gram.l ({id}): Also accept dashes after the initial
799 letter.
800 ({directive}): Use {id}.
801 * src/parse-gram.y: Comment and formatting changes.
802 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
803 symbols.
804 * src/complain.h, src/complain.c (yacc_at): New.
805 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
806 symbol names.
807 * src/output.c (token_definitions_output): Do not #define token
808 names with dashes.
809
379261b3
JD
8102009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
811
812 Clean up recent patches a little.
813 Reported by Akim Demaille.
814 * doc/bison.texinfo (Understanding): Fix typos.
815 * src/print.c (print_reductions): Don't use negated variable.
816
25029e16
JD
8172009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
818
819 List accepted values for a %define enum variable with an invalid value.
820 Suggested by Akim Demaille at
821 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
822 * data/bison.m4 (_b4_percent_define_check_values): Implement.
823 * src/muscle_tab.c (muscle_percent_define_check_values): Implement.
824 * tests/input.at (%define lr.default_reductions invalid values): Merge
825 into...
826 (%define enum variables): ... here, and update output.
827
620b5727
JD
8282009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
829
830 Rename "default rule" to "default reduction".
831 This includes changing variable names in code, changing
832 comments, and renaming %define lr.default_rules to %define
833 lr.default_reductions.
834 * NEWS (2.5): Update IELR documentation.
835 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c:
836 Adjust YYDEFACT and yydefact_ documentation.
837 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
838 and lr.type documentation. Make some other wording
839 improvements.
840 (Glossary): Adjust cross-references and Default Reduction
841 definition.
842 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
843 Remove a confusing comment pointed out by Akim Demaille.
844 (initialize_LA): Adjust code.
845 * src/print-xml.c (print_reductions): Adjust code.
846 * src/print.c (print_reductions): Adjust code.
847 * src/reader.c (reader): Adjust code.
848 * src/tables.c (action_row): Adjust code.
849 (token_actions): Adjust code.
850 * src/tables.h: Adjust YYDEFACT documentation.
851 * tests/input.at (%define lr.default_rules invalid values):
852 Rename test group to...
853 (%define lr.default_reductions invalid values): ... this, and
854 update grammar file and expected output.
855 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
856 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
857
34a6c2d1
JD
8582009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
859
860 Document %define lr.type and lr.default_rules.
861 * NEWS (2.5): Add an entry.
862 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
863 besides just LALR(1) and GLR(1).
864 * doc/bison.texinfo (Introduction): Likewise.
865 (Language and Grammar): Bison is no longer limited to LALR(1)
866 restrictions.
867 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
868 when trying to distinguish from GLR. Talk about LR(1) grammars
869 rather than LALR(1) grammars.
870 (Decl Summary): In %define api.push_pull entry, say it applies
871 to deterministic parsers in C rather than LALR(1) parsers in C.
872 Add lr.default_rules entry.
873 Add lr.type entry.
874 (Mystery Conflicts): Bison is no longer limited to LALR(1)
875 restrictions.
876 (Generalized LR Parsing): Same changes as for the previous GLR
877 section.
878 (Memory Management): Say deterministic rather than LALR(1).
879 (Understanding): Correct some bison output.
880 Index discussion of "accepting state".
881 Say deterministic rather than LALR(1).
882 (Bison Options): In --yacc entry, say deterministic rather than
883 LALR(1).
884 In --report, --graph, and --xml entries, just don't mention
885 LALR(1).
886 (C++ Parsers): Say deterministic rather than LALR(1).
887 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
888 (Glossary): Add Accepting State, Consistent State, Default Rule,
889 and IELR(1) definitions.
890 In Generalized LR (GLR) definition, make same changes as in
891 previous GLR sections.
892 In LALR(1) definition, say Bison uses LALR(1) by default rather
893 than implying Bison is limited to LALR(1).
894 (LocalWords): Add IELR.
895
f805dfcb
JD
8962009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
897
898 Finish implementing %define lr.type.
899 Its value can be "LALR", "IELR", or "canonical LR".
900 * lib/timevar.def (TV_IELR_PHASE1): New var.
901 (TV_IELR_PHASE2): New var.
902 (TV_IELR_PHASE3): New var.
903 (TV_IELR_PHASE4): New var.
904 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
905 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
906 Sbitset.h, ielr.h, and ielr.c.
907 * src/getargs.h, src/getargs.c (enum trace, trace_args,
908 trace_types): Add trace_ielr.
909 * src/lalr.h, src/lalr.c (ngotos): Export it.
910 (F): Rename to...
911 (goto_follows): ... this, update all uses, and export it.
912 (set_goto_map): Export it.
913 (map_goto): Export it.
914 (compute_lookahead_tokens): Don't free goto_follows yet. Now
915 handled in ielr.
916 (initialize_LA): Export it. Move lookback allocation to...
917 (lalr): ... here because, for canonical LR, initialize_LA must
918 be invoked but lookback and much of the rest of LALR isn't
919 needed.
920 * main.c (main): Instead of lalr, invoke ielr, which invokes
921 lalr.
922 * src/reader.c (reader): Default lr.type to "LALR".
923 Default lr.default_rules to "accepting" if lr.type is "canonical
924 LR". Leave the default as "all" otherwise.
925 Check for a valid lr.type value.
926 * src/state.h, src/state.c (struct state_list): Add state_list
927 member.
928 (state_new): Initialize state_list member to NULL.
929 (state_new_isocore): New function, exported.
930 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
931 exercises all values of lr.type.
932 (GNU AWK Grammar): Rename test group to...
933 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
934 AT_TEST_EXISTING_GRAMMAR.
935 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
936 (GNU pic Grammar): Rename test group to...
937 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
938 AT_TEST_EXISTING_GRAMMAR.
939 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
940 all values of lr.type.
941 (Single State Split): New test groups using AT_TEST_LR_TYPE.
942 (Lane Split): Likewise.
943 (Complex Lane Split): Likewise.
944 (Split During Added Lookahead Propagation): Likewise.
945
166366b2
JD
9462009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
947
948 Add new files for IELR and canonical LR implementation.
949 * src/AnnotationList.c: New.
950 * src/AnnotationList.h: New.
951 * src/InadequacyList.c: New.
952 * src/InadequacyList.h: New.
953 * src/Sbitset.c: New.
954 * src/Sbitset.h: New.
955 * src/ielr.c: New.
956 * src/ielr.h: New.
957
03c07b03
JD
9582009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
959
960 Implement %define lr.default_rules.
961 Its value describes the states that are permitted to contain
962 default rules: "all", "consistent", or "accepting".
963 * src/reader.c (reader): Default lr.default_rules to "all".
964 Check for a valid lr.default_rules value.
965 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
966 is "accepting", then only mark the accepting state as
967 consistent.
968 (initialize_LA): Tell state_lookahead_tokens_count whether
969 lr.default_rules is "accepting".
970 * src/tables.c (action_row): If lr.default_rules is not "all",
971 then disable default rules in inconsistent states.
972 * src/print.c (print_reductions): Use this opportunity to
973 perform some assertions about whether lr.default_rules was
974 obeyed correctly.
975 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
976 helps with checking the parser tables for a grammar.
977 * tests/input.at (%define lr.default_rules invalid values): New
978 test group.
979 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
980 AT_TEST_TABLES_AND_PARSE.
981 (`no %define lr.default_rules'): New test group generated by
982 AT_TEST_LR_DEFAULT_RULES.
983 (`%define lr.default_rules "all"'): Likewise.
984 (`%define lr.default_rules "consistent"'): Likewise.
985 (`%define lr.default_rules "accepting"'): Likewise.
986
44c124a3
AD
9872009-04-20 Akim Demaille <demaille@gostai.com>
988
989 Consistently refer to Yacc, not YACC.
990 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
991
42660736
JD
9922009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
993
994 Pacify make maintainer-check-posix.
995 * tests/input.at (%define, --define): Move bison command-line
996 options before grammar file name.
997
a2d05674
JD
9982009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
999
1000 Document semicolon warnings.
1001 * NEWS (2.5): Here.
1002
c4fae1ef
AD
10032008-12-08 Akim Demaille <demaille@gostai.com>
1004
1005 Fix portability issue in the test suite.
1006 * tests/local.at (AT_MATCHES_CHECK): New.
1007 Based on Perl instead of Sed. Sed has too many portability
1008 pitfalls, not ever Sed is GNU Sed.
1009 * tests/actions.at (Fix user actions without a trailing semicolon):
1010 Use it.
1011
42f4393a
DJ
10122008-12-07 Di-an Jan <dianj@freeshell.org>
1013
1014 Implement the FIXME that ends an user action with a semicolon
1015 if it seems necessary.
1016 * src/scan-code.l (flex rules section): Flag cpp directive from
1017 any `#' to the first unescaped end-of-line. Semicolon is not
1018 needed after `;', `{', '}', or cpp directives and is needed after
1019 any other token (whitespaces and comments have no effect).
1020 * tests/actions.at (Fix user actions without a trailing semicolon):
1021 New test.
1022 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
1023 to make user actions complete statements.
1024 Adjust column numbers in error messages.
1025 * tests/regression.at (Fix user actions without a trailing semicolon):
1026 Remove. Covered by new test.
1027
bd5df716
AD
10282009-04-14 Akim Demaille <demaille@gostai.com>
1029
1030 doc: minor fixes.
1031 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
1032 (Table of Symbols): Remove duplicate entry for %debug.
1033
7ba0d59d
EB
10342009-04-10 Eric Blake <ebb9@byu.net>
1035
1036 submodules: update to latest
1037 * submodules/autoconf: Use latest upstream Autoconf.
1038
b4d71a96
EB
10392009-04-06 Eric Blake <ebb9@byu.net>
1040
1041 Work around autoconf 2.63b bug in testsuite.
1042 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
1043 autoconf bug related to # in test.
1044
4ecd3681
JD
10452009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1046
1047 * NEWS (2.5): Describe new -D/--define feature.
1048
c65e5292
AD
10492008-11-10 Akim Demaille <demaille@gostai.com>
1050
1051 --trace=muscles
1052 * src/getargs.h, src/getargs.c (trace_muscle): New.
1053 (trace_types, trace_args): Support it.
1054 * src/output.c (output_skeleton): Use it.
1055
96002de2
AD
10562008-11-10 Akim Demaille <demaille@gostai.com>
1057
1058 muscles_output.
1059 * src/output.c (muscles_output): New, extracted from...
1060 (output_skeleton): here.
1061 Adjust.
1062
fadb13b5
AD
10632008-11-21 Akim Demaille <demaille@gostai.com>
1064
1065 Display the changes in cross-options.texi.
1066 * build-aux/cross-options.pl ($sep): New, to separate items.
1067 * doc/Makefile.am ($(srcdir)/cross-options.texi): Use diff to display
1068 the changes.
1069
72183df4
DJ
10702008-11-20 Di-an Jan <dianj@freeshell.org>
1071
1072 Improves options in the manual.
1073 * doc/bison.texinfo (-g, -x): Add space before argument.
1074 (Option Cross Key): Implement FIXME: listing directives also.
1075 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
1076 (Short Option): Special case -d. Put arguments inside @option.
fadb13b5 1077 (Bison Directive): Add column, automatically extracted from
72183df4
DJ
1078 src/scan-gram.l (actual name passed as the first argument)
1079 with special case for %define.
1080 * doc/Makefile.am (doc/cross-options.texi): Pass src/scan-gram.l
1081 to build-aux/cross-options.pl.
1082 * src/getargs.c (usage): Document limitations of cross-options.pl.
1083 * src/scan-gram.l: Likewise.
1084
e80b068c
AD
10852009-02-25 Akim Demaille <demaille@gostai.com>
1086
1087 Copyright years.
1088 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
1089
e3ee30b8
AD
10902008-12-08 Akim Demaille <demaille@gostai.com>
1091
1092 Install autoconf as a submodule to get m4sugar.
1093 * .gitmodules: Add submodules/autoconf.
1094 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
1095 submodules/autoconf.
1096
c4eb1e84
JD
10972008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1098
1099 Simplify last patch slightly.
1100 * src/getargs.c (getargs): Here.
1101
10fa0146
JD
11022008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1103
1104 Fix last warning from --enable-gcc-warnings.
1105 * src/getargs.c (getargs): Don't assign const address to non-const
1106 pointer.
1107
6f5be1ab
DJ
11082008-11-17 Di-an Jan <dianj@freeshell.org>
1109
1110 Handle --enable-gcc-warnings.
1111 * src/getargs.c (command_line_location): Set parameters to void.
1112
11c4e57d
AD
11132008-11-11 Akim Demaille <demaille@gostai.com>
1114
1115 AT_FULL_COMPILE.
1116 * tests/actions.at, tests/regression.at: Use it.
1117
e186a284
AD
11182008-11-07 Akim Demaille <demaille@gostai.com>
1119
1120 Pass command line location to skeleton_arg and language_argmatch.
1121 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
1122 The location argument is now mandatory.
1123 Adjust all dependencies.
1124 (getargs): Use command_line_location.
1125
e14c6831
AD
11262008-11-07 Akim Demaille <demaille@gostai.com>
1127
1128 -D, --define.
1129 * src/getargs.c (usage): Document -D.
1130 Fix help string for --locations.
1131 (command_line_location): New.
1132 (short_options, long_options, getargs): Support -D, --define.
1133 (getargs): Move -d support at the right place.
1134 * doc/bison.texinfo (Bison Options): Update.
1135 * tests/input.at (%define, --define): New.
1136
75c21b61
AD
11372008-11-07 Akim Demaille <demaille@gostai.com>
1138
1139 Initialize the muscle table before parsing the command line.
1140 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
1141 (getargs): Define file_name.
1142 * src/main.c (main): Initialize muscle_tab before calling
1143 getargs.
1144 * src/muscle_tab.c (muscle_init): No longer define file_name, as
1145 its value is not available yet.
1146
33d2a860
AD
11472008-11-09 Akim Demaille <demaille@gostai.com>
1148
1149 Require the generation of parse-gram.output.
1150 * src/Makefile.am (YACC): Pass --report=all.
1151
006faedf
JD
11522009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1153
1154 * NEWS (2.5): New stub.
1155
ecd1b61c
JD
11562009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1157
1158 Fix options documentation.
1159 * build-aux/cross-options.pl: As in --help output, write optional
1160 arguments as [=ARG] not =[ARG].
1161 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
1162
f67c4037
AD
11632008-11-07 Akim Demaille <demaille@gostai.com>
1164
1165 Fix --help.
1166 * src/getargs.c (usage): Fix help string for -W.
1167
0213d651
AD
11682008-11-07 Akim Demaille <demaille@gostai.com>
1169
1170 Handle more general types of option arguments.
1171 * build-aux/cross-options.pl: The argument ends at the first
1172 space, not the first non-symbol character.
1173 Use @var for each word appearing the argument description.
1174
c19178bf
JD
11752009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1176
1177 Remove spurious initial empty lines.
1178 * data/location.cc: End the @output lines with an @.
1179
0d2b2ab0
AD
11802008-11-04 Akim Demaille <demaille@gostai.com>
1181
1182 Remove spurious initial empty lines.
1183 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1184 * data/yacc.c: End the @output lines with an @.
1185
8ba62e3e
JD
11862009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1187
1188 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
1189 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
1190 requirements for a correct m4 are stricter.
1191 * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
1192 * configure.ac: Update to use AC_PROG_GNU_M4.
1193 Reported by Eric Blake.
1194
5bc993d9
JD
11952009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1196
1197 Help with updating web manual.
1198 * HACKING: Incorporate instructions from gnulib/doc/README.
1199 * bootstrap.conf (gnulib_modules): Add gendocs.
1200
580c075d
JD
12012009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1202
1203 Fix strange %define locations for default values.
1204 Reported by Akim Demaille at
1205 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
1206 and discussed again starting at
1207 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
1208 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
1209 because location information is bogus.
1210 Use angle brackets to delimit fake file name because square brackets
1211 look like underexpanded m4. Choose a better fake file name.
1212 Use negative line numbers.
1213 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
1214 * src/location.c (location_print): If line for a boundary is negative,
1215 only print that boundary's file name.
1216 * src/location.h: Document that.
1217 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1218 defaults): Update output.
1219
5d3a1ecb
AD
12202008-11-07 Akim Demaille <demaille@gostai.com>
1221
1222 Locations without columns for command line arguments.
1223 * src/location.c (location_print): Don't display negative columns.
1224 * src/location.h: Document this.
1225
015e86a7
JD
12262009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
1227
1228 Add reminder about uploading public key to keys.gnupg.net.
1229 * HACKING (Release Procedure): Here.
1230
c1455bab
AD
12312009-03-31 Akim Demaille <demaille@gostai.com>
1232
1233 bootstrap: --help to stdout.
1234 * bootstrap (usage): Don't send --help to stderr.
1235 Use a here doc instead of a long string.
1236
2075a82a
AD
12372009-03-31 Akim Demaille <demaille@gostai.com>
1238
1239 bootstrap: README-hacking no longer exists
1240 * bootstrap (checkout_only_file): Set to HACKING.
1241
26fccd4d
AD
12422009-03-26 Akim Demaille <demaille@gostai.com>
1243
1244 doc: merge HACKING and README-hacking.
1245 Two files is confusing.
1246 Reported by Alexandre Duret-Lutz.
5bc993d9 1247
26fccd4d
AD
1248 * README-hacking: Merge into...
1249 * HACKING (Working from the repository): here.
1250
6469c4d7
AD
12512009-03-26 Akim Demaille <demaille@gostai.com>
1252
1253 doc: update README-hacking.
1254 * README-hacking: We now use git and git submodules.
1255 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
1256
b328890a
AD
12572009-03-26 Akim Demaille <demaille@gostai.com>
1258
1259 lalr1.cc: avoid GCC 4.3 warnings.
1260 GCC 4.3 now warns about "a || b && c" and asks for explicit
1261 parentheses.
1262 Reported by Alexandre Duret-Lutz.
1263 * data/location.cc: Update copyright years.
1264 (Position::operator==): Use parens to make precedence explicit.
1265 Compare lines and columns first, as they are more likely to be
1266 different, and they are faster to compare.
1267
f3079439
AD
12682009-03-26 Akim Demaille <demaille@gostai.com>
1269
1270 gnulib: update.
1271 * gnulib: Update to latest.
1272 * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so
1273 use +=.
1274
8defe11b
AD
12752009-01-08 Akim Demaille <demaille@gostai.com>
1276
1277 Fix grep portability issues.
1278 Grep on Solaris does not support -q.
1279 Reported by Summum Bonum.
5bc993d9 1280
8defe11b
AD
1281 * NEWS: Add a stub for 2.4.2.
1282 * THANKS: Add Summum Bonum.
1283 * tests/atlocal.in (EGREP): New.
1284 (CC, CXX, XSLTPROC): Make it possible to override them via
1285 envvars.
1286 * tests/java.at: Use $EGREP instead of egrep.
1287 Use AT_CHECK's ignore instead of grep's -q.
1288
41930e7a
JD
12892008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1290
1291 Version 2.4.1.
1292 * NEWS: Set version and date.
1293 * lib/Makefile.am: Update copyright year.
1294 * tests/atlocal.in: Update copyright year.
1295
d07932ef
JD
12962008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1297
1298 Semicolon feature removal is not about future language support.
1299 * NEWS: The semicolon feature is no longer active for newer languages,
1300 so don't claim that it causes trouble for them.
1301
0364b334
JD
13022008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1303
1304 * gnulib: Update submodule to HEAD.
1305
876fd835
AD
13062008-12-09 Akim Demaille <demaille@gostai.com>
1307
1308 Update data/README.
1309 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
1310
bee1df15
EB
13112008-12-05 Eric Blake <ebb9@byu.net>
1312
1313 Build testsuite with newer autoconf.
1314 * tests/output.at (m4_expand): Don't override in newer autoconf,
1315 where the underlying implementation changed.
1316 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
1317 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
1318 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
1319 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
1320 since some of them contain unbalanced ')'.
1321
7e6d1e22
JD
13222008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1323
1324 * NEWS: Clarify a little.
1325
a957d06c
JD
13262008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1327
1328 * NEWS: Update for recent changes.
1329
462503f8
JD
13302008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1331
1332 Fix unexpanded macros in GLR defines file.
1333 Reported by Csaba Raduly at
1334 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
1335 * THANKS (Csaba Raduly): Add.
1336 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
1337 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
1338 lexer in a separate module that includes the defines file.
1339 (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
1340 source.
1341 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
1342 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
1343 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
1344 (AT_DATA_SOURCE_PROLOGUE): New.
1345 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
1346 (AT_DATA_SOURCE): New.
1347 (AT_FULL_COMPILE): New, copied from master branch and extended to
1348 support an additional source file.
1349
bf151b75
JD
13502008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1351
1352 Don't let maintainer-*-check targets force a version update.
1353 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
1354 handled.
1355
f56274a8
DJ
13562008-11-17 Di-an Jan <dianj@freeshell.org>
1357
1358 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
1359 Align menus. Adjust word wrapping. Use node names for menu names.
1360 (Examples): Don't abbreviate node names.
1361 (LocalWords): Remove abbreviations.
1362 (Copying): Make description a sentence.
bf151b75 1363 (Java Action Features): Remove period to match the rest of menu.
f56274a8 1364
b5775a81
PB
13652008-11-11 Paolo Bonzini <bonzini@gnu.org>
1366
1367 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
1368 * configure.ac: Adjust usage.
1369 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1370 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1371 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
1372
7ed73f82
JD
13732008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1374
1375 Don't add a semicolon to actions for %skeleton or %language.
1376 It breaks Java test cases as reported by Akim Demaille.
1377 * src/scan-code.l: Implement.
1378
4b1ebc49
JD
13792008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1380
1381 Clean up %skeleton and %language priority implementation.
1382 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
1383 remove static qualifier because others will soon need to see it.
1384 (language_prio): Likewise.
1385 (getargs): Use command_line_prio rather than 0.
1386 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
1387 enum fields.
1388 (skeleton_prio): Extern it.
1389 (language_prio): Extern it.
1390 * src/parse-gram.y: Use grammar_prio rather than 1.
1391
738cde3e
AD
13922008-11-04 Akim Demaille <demaille@gostai.com>
1393
1394 * NEWS: Mention the trailing semicolon in action.
1395
d6fb461d
AD
13962008-11-04 Akim Demaille <demaille@gostai.com>
1397
1398 Reformat NEWS.
1399 * NEWS: Use more outline-mode markup.
1400 Suggested by Jim Meyering.
1401
14da0cdd
JD
14022008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
1403
1404 Fix user actions without a trailing semicolon.
1405 Reported by Sergei Steshenko at
1406 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
1407 * THANKS (Sergei Steshenko): Add.
1408 * src/scan-code.l (SC_RULE_ACTION): Fix it.
1409 * tests/regression.at (Fix user actions without a trailing semicolon):
1410 New test case.
1411
c9ba9e59
JD
14122008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1413
1414 Initiate further development.
1415 * NEWS: Create an empty section for new entries.
1416 * gnulib: Update submodule to HEAD.
1417
bfb40910
JD
14182008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1419
1420 * NEWS: Version 2.4.
1421
241fda7a
JD
14222008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1423
1424 Prepare for next release.
1425 * NEWS: Briefly mention changes since 2.3b.
1426 * README: Say GNU m4 1.4.6, which we've been requiring in release
1427 announcements already, not 1.4.3, which breaks the build.
1428
ed4d67dc
JD
14292008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1430
1431 Say %language is experimental.
1432 We're thinking of extending it's effect on output file naming. See the
1433 thread at
1434 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
1435 * NEWS: Say it's experimental.
1436 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
1437 recommend it over %skeleton for now.
1438 (Bison Options): Likewise.
1439 (C++ Bison Interface): Use %skeleton not %language.
1440 (Calc++ Parser): Use %skeleton not %language.
1441 * src/getargs.c (usage): Say it's experimental.
1442
e254a580
DJ
14432008-11-01 Di-an Jan <dianj@freeshell.org>
1444 Paolo Bonzini <bonzini@gnu.org>
1445
1446 Support all Java parser class modifiers.
1447 * data/java.m4 (b4_percent_define_get3): New.
1448 (b4_final_if, b4_strictfp_if): New.
1449 * data/lalr1.java (final, strictfp, extends, implements): Support.
1450 * doc/bison.texinfo (final, strictfp, extends, implements): Add
1451 documentation.
1452 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
1453 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
1454 (AT_CHECK_JAVA_GREP): New.
1455 (Java parser class modifiers): New test.
1456 (Java parser class extends and implements): New test.
1457
1458 Model exception propagation better with throws and lex_throws.
1459 * data/java.m4 (b4_list2): New.
1460 (throws): Change default.
1461 * data/lalr1.java (yyaction): Add throws.
1462 (parse): Add lex_throws in addition to throws.
1463 * doc/bison.texinfo (throws, lex_throws): Add documentation.
1464 * tests/java.at (Java throws specifications): New test.
1465
1466 Improve documentation for Java parsers.
1467 * doc/bison.texinfo (Java Parsers): Add subsections.
1468 Don't quote first argument of %define.
1469 (Java Bison Interface): Document output files. Move documentation
1470 of parser class and merge into Java Parser Interface. Document
1471 features that error out. Document directives with no effect.
1472 Move note about Javadoc higher.
1473 (Java Semantic Values): Explicitly mention stype.
1474 Document that generic types cannot be used.
1475 (Java Location Values): Use @deftypeivar. Document constructors.
1476 Correct return value for toString.
1477 (Java Parser Interface): List undocumented constants/fields.
1478 Move documentation of fields added by %parse-param closer to list
1479 of members. Document that token names are added as fields.
1480 Document constructors accurately. Remove error method.
1481 (Java Scanner Interface): Move note on %pure-parser to Java Bison
1482 Interface. Describe %code lexer and yylex accutately.
1483 Remove documentation that does not match the code.
1484 (Java Action Features): New.
1485 (Java Differences): Add reference. Add item on semantic values.
1486 Add note about @{ ... @}. Clarify %% epilogue placement.
1487 (Java Declarations Summary): New.
1488
1489 Fix Java skeleton.
1490 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
1491 (b4_remove_comma): Quote test argument.
1492 (b4_identification): Remove "bison" field.
1493 * tests/java.at (Java parser class and package names): New test.
1494 (Java %parse-param and %lex-param): New test.
1495 (Java stype, position_class and location_class): New test.
1496
f259e4e6
PB
14972008-10-31 Di-an Jan <dianj@freeshell.org>
1498
1499 * data/lalr1.jave: Update copyright years.
1500 (YYParser): Correct name of "generated from" file in Javadoc:
1501 use b4_file_name instead of @ofile@.
1502 (Location constructor): Correct Javadoc parameter name.
1503 (yylloc): Add missing opening m4 quote after b4_location_if.
1504 This removes a stray [ in the Javadoc of Lexer.getStartPos.
1505 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
1506 (YYParser constructor): Correct Javadoc parameter name.
1507
cae5057f
JD
15082008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
1509
1510 Always put auxiliary code files in the same dir as other output files.
1511 * src/files.c (compute_file_name_parts): When the user specifies
1512 --output but not --file-prefix, extract the directory prefix from the
1513 file prefix not from the grammar file name. This affects the location
1514 of files like location.hh generated by the C++ skeleton. The includes
1515 in the other output files require this fix.
1516 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
1517 for expected output files.
1518 (Output files): Add a test for the above.
1519
4af432ba
JD
15202008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
1521
1522 * gnulib: Update submodule to HEAD.
1523
e26d4e43
JD
15242008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1525
1526 Update copyright year.
1527 * src/files.c: Here.
1528
c0ee9e21
DJ
15292008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
1530
1531 Don't overwrite the input file.
1532 * src/files.c (output_file_name_check): Fatal error if using input file
1533 for output.
1534 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
1535 argument.
1536 (Conflicting output files): Add test.
1537
482dc52f
AD
15382008-10-28 Akim Demaille <demaille@gostai.com>
1539
1540 Space changes.
1541 * data/lalr1.cc: Formatting changes.
1542
52cbbe84
AD
15432008-10-28 Akim Demaille <demaille@gostai.com>
1544
1545 Don't define debugging functions when !YYDEBUG.
1546 * data/lalr1.cc (debug_stream, set_debug_stream)
1547 (debug_level_type, debug_level, set_debug_level): Don't
1548 declare them when YYDEBUG is not defined.
1549 The implementation are already YYDEBUG-aware.
1550
0925d5bf
AD
15512008-10-28 Akim Demaille <demaille@gostai.com>
1552
1553 Prefer "continue" for empty loop bodies.
1554 * etc/bench.pl.in: Use "continue" instead of {}.
1555
cf98343c
AD
15562008-10-28 Akim Demaille <demaille@gostai.com>
1557
1558 Space and comments changes.
1559 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
1560 * data/c.m4, data/lalr1.cc: Space changes.
1561
9f467b7d
AD
15622008-10-28 Akim Demaille <demaille@gostai.com>
1563
1564 Make gnulib a submodule.
1565 * gnulib: New.
1566 * .gitmodules (gnulib): New.
1567
0f0e1ace
JD
15682008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1569
1570 Fix yyerror_range for user-defined location type in C++. Reported by
1571 Georg Sauthoff at
1572 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
1573 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
1574 * THANKS (Georg Sauthoff): Add.
1575
548e2104
JD
15762008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1577
1578 Update several administrative files mainly to facilitate releasing.
1579 * HACKING (Administrivia): Make the git-merge-changelog notes more
1580 helpful.
1581 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
1582 (Release Procedure): Update for git and add numerous details that were
1583 previously missing.
1584 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
1585 * maint.mk (announcement): Don't list bison as a bootstrap tool so
1586 that announcements don't claim we bootstrapped with whatever bison
1587 happened to be in PATH. Add flex as a bootstrap tool.
1588 * Makefile.maint: Remove, previously replaced by maint.mk.
1589 * Makefile.cfg: Remove, and migrate settings to...
1590 * cfg.mk: ... here for the sake of `make announcement'.
1591 * bootstrap.conf (gnulib_modules): Add announce-gen.
1592 * README: Say GNU Bison instead of just Bison. Suggested by Karl
1593 Berry.
1594
ddf17a6e
PB
15952008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
1596
1597 Small but important bugfixes for the Java skeleton.
1598 * data/lalr1.java (yyerror): Change Location to b4_location_type.
1599 (yy_symbol_print): Call toString on yyvaluep.
1600
e1145ad8
AD
16012008-08-29 Akim Demaille <demaille@gostai.com>
1602
1603 Clarify UPDATED use.
bee1df15 1604 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 1605 not to the release date of Bison.
bee1df15 1606 Reported by Joel E. Denny.
e1145ad8 1607
0df72d78
AD
16082008-08-29 Akim Demaille <demaille@gostai.com>
1609
1610 * README: Update FAQ pointer.
1611 Reported by Joel E. Denny.
1612
9a90b6bb
EB
16132008-08-27 Eric Blake <ebb9@byu.net>
1614
1615 Resync m4sugar from autoconf.
1616 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
1617 (m4_init): Adjust to latest m4.git changes.
1618 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
1619 effects.
1620 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
1621 (_m4_list_cmp): Reduce side effects.
1622
65015668
AD
16232008-08-27 Akim Demaille <demaille@gostai.com>
1624
1625 Check yyerrok in calc.at.
bee1df15
EB
1626 * tests/calc.at (calc.y): Use yyerrok on "( error )".
1627 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
1628 expected.
65015668 1629
98e26a92
AD
16302008-08-27 Akim Demaille <demaille@gostai.com>
1631
1632 Support yyerrok in lalr1.cc.
1633 YYBACKUP is still to import back into lalr1.cc.
bee1df15 1634 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 1635
86c0e784
JD
16362008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1637
1638 For maintainer-check*, don't recompile for a $(VERSION) update.
1639 * cfg.mk: New file.
1640 (_is-dist-target): Override the one in GNUmakefile.
1641 * Makefile.am (EXTRA_DIST): Add cfg.mk.
1642
88511166
JD
16432008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1644
1645 Update for recent change to gnulib.
1646 * src/parse-gram.y: Don't include strverscmp.h. It comes from
1647 string.h now.
1648
6bbb2ed5
EB
16492008-08-15 Eric Blake <ebb9@byu.net>
1650
d67c52e8
EB
1651 Remaining m4sugar merge from autoconf.
1652 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
1653 * data/m4sugar/foreach.m4: New file, copied from autoconf.
1654 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
1655 * src/output.c (output_skeleton): Tell m4 how to find it.
1656
6bbb2ed5
EB
1657 Partial m4sugar merge from autoconf: m4_map.
1658 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
1659 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
1660 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
1661 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
1662 for empty list.
1663 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
1664 Likewise.
1665 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
1666 declares it.
1667
8dce3875
JD
16682008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
1669
1670 Keep .version and PACKAGE_VERSION in sync.
1671 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
1672 dependency, and add comments justifying this in more detail. Discussed
1673 starting at
1674 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
1675
882a1fbf
EB
16762008-08-06 Eric Blake <ebb9@byu.net>
1677
a3764451
EB
1678 Partial m4sugar merge from autoconf: m4_shiftn.
1679 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
1680 (m4_shift2, m4_shift3): New macros.
1681 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
1682 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
1683 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
1684 * data/java.m4 (b4_remove_comma): Likewise.
1685
882a1fbf
EB
1686 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
1687 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
1688 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
1689 (m4_init): Consolidate wrapped text into single m4_wrap.
1690 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
1691 in wrapped text.
1692
a30e920d
EB
16932008-08-05 Eric Blake <ebb9@byu.net>
1694
dfcc5959
EB
1695 Partial m4sugar merge from autoconf: builtins, version.m4.
1696 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
1697 (m4_prepend): Remove, as it is unused and inherently quadratic,
1698 whereas m4_append is linear in newer m4.
1699 (m4_mkstemp): New builtin.
1700 (m4_symbols): Make rename conditional.
1701 (m4_version_prereq): Ensure fatal error if used in bison, which
1702 intentionally lacks version.m4.
1703
a30e920d
EB
1704 Fix comments in m4sugar.
1705 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
1706
445b7470
JD
17072008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1708
1709 Update for recent .gitignore fix in Gnulib.
1710 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
1711 anchored .gitignore entries.
1712
a1e50014
JD
17132008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1714
1715 Set gnu or gnits strictness.
1716 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
1717 development and gnits strictness for releases. Based on Eric Blake's
1718 suggestion at
1719 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
1720
d43f77e7
PB
17212008-07-31 Paolo Bonzini <bonzini@gnu.org>
1722
1723 * NEWS: Clarify documentation of %language.
1724
fee2ed87
PB
17252008-07-31 Paolo Bonzini <bonzini@gnu.org>
1726
1727 Support usage of git-merge-changelog.
1728 * .gitattributes: New.
1729 * HACKING: Document usage of git-merge-changelog.
1730 * bootstrap: Install git-merge-changelog entries in .git/config
1731 if appropriate.
1732
78029cd5
JD
17332008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1734
1735 Remove remaining dependence on CVS Id keyword.
1736 * ChangeLog: For the sake of people still using CVS, don't use dollars
1737 when mentioning Id.
1738 * data/xslt/bison.xsl: Remove Id from header comments, where it was
1739 unusual anyway.
1740 * data/xslt/xml2dot.xsl: Likewise.
1741 * data/xslt/xml2text.xsl: Likewise.
1742 * data/xslt/xml2xhtml.xsl: Likewise.
1743 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
1744 * doc/Makefile.am (neutralize): Remove, no longer needed.
1745 (.x.1): Don't use neutralize.
1746 (edit): Don't substitute for ID.
1747 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
1748
c53d18b1
JD
17492008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1750
1751 Fix dependence on computed configure variables.
1752 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
1753 $(top_srcdir)/configure.ac so that changes to computed variables, such
1754 as PACKAGE_VERSION, are seen.
1755 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
1756
5523ac79
JD
17572008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
1758
1759 Update copyright dates for recent changes.
1760 * Makefile.am: Here.
1761 * src/Makefile.am: Here.
1762 * src/reduce.c: Here.
1763 * tests/reduce.at: Here.
1764
8fa36911
JD
17652008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
1766
1767 Use git-version-gen for version names between releases.
1768 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
1769 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
1770 * .prev-version: New.
1771 * .version.in: Remove.
78029cd5 1772 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
1773 revision.
1774 * GNUmakefile: Remove, now copied from Gnulib.
1775 * Makefile.am: Add code suggested by comments in
1776 build-aux/git-version-gen.
1777 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
1778 .prev-version, and .version.
1779 * NEWS (2.3b+): Rename to...
1780 (?.?): ... this because we're dropping the "+" version naming scheme,
1781 but, in general, we still can't be sure of our next release name.
1782 * bootstrap: Add a quick hack to remove from .gitignore the
1783 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
1784 entry. This should really be fixed in gnulib instead.
1785 * bootstrap.conf (gnulib_modules): Add gnumakefile.
1786 * configure.ac (AC_INIT): Set version name by invoking
1787 build-aux/git-version-gen.
1788 (AC_CONFIG_FILES): Remove .version, now generated by
1789 build-aux/git-version-gen.
1790 * maint.mk: New, copied from coreutils.
1791 * doc/.cvsignore (bison.1): Add.
1792 * doc/.gitignore (/bison.1): Add.
1793 * doc/bison.1: Remove, generated.
1794 * src/.cvsignore (revision.c): Remove.
1795 * src/.gitignore (/revision.c): Remove.
1796 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
1797 (BUILT_SOURCES): Remove revision.c.
1798 (revision.c): Remove.
1799 * src/getargs.c (version): Don't print revision after the VERSION.
1800 * src/revision.h: Remove.
1801
bcf07cb7
JD
18022008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1803
1804 Fix untranslatable composition of sentences. Reported by Goran
1805 Uddeborg at
1806 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
1807 * THANKS (Goran Uddeborg): Add.
1808 * src/reduce.c (reduce_print): Report the number of nonterminals and
1809 rules useless in the grammar in separate sentences.
1810 * tests/reduce.at (Useless Rules): Update output.
1811 (Reduced Automaton): Likewise.
1812 (Underivable Rules): Likewise.
1813 (Empty Language): Likewise.
1814
9aacab9a
JD
18152008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1816
1817 Fix some .gitignore and .cvsignore problems.
1818 * bootstrap (insert_sorted_if_absent): Replace all uses with...
1819 (insert_vc_ignore): ... this new function, which prepends `/' to all
1820 .gitignore entries before passing them to insert_sorted_if_absent.
1821 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
1822 .cvsignore files are maintained even though Bison developers run
1823 bootstrap while using Git.
1824 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
1825 unneeded by Bison.
1826 (gnulib): Add.
1827 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
1828 unneeded. Reported by Eric Blake.
1829 * lib/.gitignore (/*~): Add.
1830 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
1831 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
1832 Blake.
1833 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
1834
a9fc7990
JD
18352008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1836
1837 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
1838 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
1839 * bootstrap.conf (gnulib_modules): Add unsetenv.
1840 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
1841 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
1842 (/setenv.m4): Add.
1843 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
1844 the first argument because it may become position-dependent, and unset
1845 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
1846 Add comments explaining these issues in more detail.
1847
0f1d6f10
JD
18482008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
1849
1850 Add .gitignore everywhere based on .cvsignore.
1851 * .gitignore: New.
1852 * build-aux/.gitignore: New.
1853 * data/.gitignore: New.
1854 * doc/.gitignore: New.
1855 * etc/.gitignore: New.
1856 * examples/.gitignore: New.
1857 * examples/calc++/.gitignore: New.
1858 * lib/.gitignore: New.
1859 * m4/.gitignore: New.
1860 * po/.gitignore: New.
1861 * runtime-po/.gitignore: New.
1862 * src/.gitignore: New.
1863 * tests/.gitignore: New.
1864
7bd1665a
JD
18652008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1866
1867 * NEWS (2.3b+): New section, empty for now.
1868 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
1869
72c5b982
JD
18702008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1871
1872 * NEWS (2.3b): Update release date since there has been a delay in
1873 getting the announcements and tarballs out.
1874
bd02cd5d
JD
18752008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1876
1877 * NEWS: Version 2.3b.
1878 * configure.ac (AC_INIT): Likewise.
1879 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
1880
9126263e
JD
18812008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1882
1883 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
1884 been doing it for years.
1885 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
1886 (Release Procedure): Add FIXME about make alpha being unmaintained.
1887
fa6aa7b3
JD
18882008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
1889
1890 * data/yacc.c: Reformat m4 a little for readability.
1891 * src/lalr.c (build_relations): Correct comment.
1892
d30b312d
JMG
18932008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1894
1895 DJGPP specific issue.
1896 * djgpp/config.sed: Fixes required to run configure scripts generated
1897 by autoconf 2.62.
1898
138d4cd9
JD
18992008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1900
1901 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
1902 coordinator@translationproject.org.
1903
8f7e2e1f
JD
19042008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1905
1906 * THANKS: Add Eric Blake.
1907
f55efa38
JD
19082008-04-23 Eric Blake <ebb9@byu.net>
1909
1910 Revert prior patch, by working around autoconf regression.
1911 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
1912 ("Output file name: ("): Uncomment test.
1913 ("Output file name: )"): Likewise.
1914 Based on an idea from Noah Misch.
1915
096c9f9d
JD
19162008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1917
1918 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
1919 2.61. Reported by Juan Manuel Guerrero at
1920 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
1921 * tests/output.at ("Output file name: ("): Comment out test case for
1922 now.
1923 ("Output file name: )"): Likewise.
1924
0f664b89
JD
19252008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1926
1927 * GNUmakefile: Update git-version-gen invocation so make dist
1928 succeeds.
1929
1cfe6375
JD
19302008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1931
1932 Update to the current gnulib CVS repository, and fix trigraph handling
1933 in Bison.
1934 * bootstrap: Update gnulib CVS repository URL.
1935 (symlink_to_dir): Encapsulate the code that guarantees the destination
1936 directory exists into...
1937 (check_dst_dir): ... this new function, and...
1938 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
1939 fail when copying files into lib/uniwidth/.
1940 * src/output.c (prepare_symbols): When writing yytname muscles, where
1941 symbol names will be encoded in C-string literals, tell quotearg to
1942 escape trigraphs. This used to be the default in gnulib.
1943 * tests/regression.at (Token definitions): Because of the change in
1944 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
1945 escapes trigraphs in symbol names. Thus, yytname no longer has
1946 trigraphs unnecessarily doubly escaped. Update test case output.
1947 Extend test case to be sure Bison's own error messages will no longer
1948 have trigraphs in symbol names unnecessarily escaped once.
1949
74c52fc8
JD
19502008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1951
1952 Fix make dist infinite loop reported by Juan Manuel Guerrero at
1953 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
1954 * .cvsignore: Add .version.
1955 * .version.in: New.
1956 * bootstrap.conf (gnulib_modules): Add git-version-gen.
1957 * configure.ac (AC_CONFIG_FILES): Add .version.
1958 * build-aux/.cvsignore: Add git-version-gen.
1959
8e55b3aa
JD
19602008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
1961
1962 * NEWS (2.3a+): Mention that -g now takes an argument.
1963 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
1964 consistency. Update the -g and -x entries now that they take
1965 arguments. Use brackets to indicate optional arguments.
1966 * src/getargs.c (usage): Explain the relationship between arguments of
1967 long and short options more completely. Document --defines and -d
1968 separately since the former takes an argument but, for POSIX Yacc, the
1969 latter does not.
1970 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 1971 (getargs): Sort cases.
8e55b3aa 1972
59c5ac72
AD
19732008-02-28 Akim Demaille <demaille@gostai.com>
1974
1975 * doc/bison.texinfo: Fix a few typos.
1976
118d4978
AD
19772008-02-28 Akim Demaille <akim@epita.fr>
1978
1979 * doc/bison.texinfo (Bison Options): Document -W.
1980 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
1981
7020f1e9
AD
19822008-02-28 Akim Demaille <akim@epita.fr>
1983
1984 * src/getargs.c (short_options): Split and sort for readability.
1985 -g and -x take optional arguments, just like their long options.
1986 * build-aux/cross-options.pl: Use /x to make the regexp easier to
1987 understand.
1988 Fix the handling of $opt which resulted in all the argument to be
1989 considered as optional.
1990
59da312b
JD
19912008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1992
1993 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
1994 say its interface is experimental.
1995 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1996 Java.
1997 (Bison Options): In the -L and --language entry, mention Java.
1998 (Java Bison Interface): Say the interface is experimental.
1999 * src/getargs.c (usage): Mention -L and --language.
2000
2001 * NEWS (2.3a+): Say the push parsing interface is experimental.
2002 * doc/bison.texinfo (Push Decl): Likewise.
2003 (Decl Summary): Likewise in the "%define api.push_pull" entry.
2004 (Push Parser Function): Likewise.
2005 (Pull Parser Function): Likewise.
2006 (Parser Create Function): Likewise.
2007 (Parser Delete Function): Likewise.
2008 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
2009 yypull_parse, and yypush_parse entries.
2010
2011 * NEWS (2.3a+): Mention XML support, and say the schema is
2012 experimental.
2013 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
2014 * src/getargs.c (usage): Say the XML schema is experimental.
2015
2016 * NEWS (2.3a+): Say option instead of flag.
2017
2bb3ebec
WP
20182008-02-21 Wojciech Polak <polak@gnu.org>
2019
2020 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
2021 text.
2022
333e670c
JD
20232008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
2024
2025 Fix impure push parser compile error reported by Bob Rossi at
2026 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
2027 * data/yacc.c: Clean up whitespace in the output a little.
2028 (yypstate_allocated): Define for impure push parsers regardless of
2029 whether the pull interface is also requested.
2030 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
2031 check impure push parsers without the pull interface.
2032
2033 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
2034 yyerror takes arguments specified by %parse-param while yypstate_new
2035 does not.
2036 * doc/bison.texinfo (Parser Create Function): Document that
2037 yypstate_new returns 0 for multiple impure parser instances.
2038 * tests/push.at (Push Parsing: Multiple impure instances): Update
2039 expected stderr output.
2040
798096e1
JD
20412008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
2042
2043 * runtime-po/POTFILES.in (push.c): Remove.
2044
9ca7f077
JD
20452008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2046
2047 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
2048 * data/push.c: Rename to...
2049 * data/yacc.c: ... this, overwriting it.
2050 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
2051 `%push-pull-parser' -> `%define api.push_pull "both"'.
2052 Remove old yacc.c tests, and update push.c tests to yacc.c.
2053
42ee26bb
JD
20542008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2055
2056 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
2057 `"%code top" blocks' instead of `%code "top" blocks'.
2058 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
2059 Clean up whitespace in the output a little.
2060
b1cc23c4
JD
20612008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2062
2063 Fix documentation problems reported by Tim Josling at
2064 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
2065 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
2066 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
2067 integers. Explain the effect of literal string aliases on error
2068 messages. Copy token 0 documentation from the C++ skeleton
2069 documentation.
2070
ab7f29f8
JD
20712008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2072
2073 Accept a token number in a %left, %right, or %nonassoc for POSIX
2074 conformance. Reported by Tim Josling at
2075 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
2076 * NEWS (2.3a+): Mention.
2077 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
2078 and code numbers are treated by precedence declarations.
2079 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
2080 of symbols.1.
2081 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
2082 of symbol.
2083 (symbol.prec): New, just like symbol but allows INT.
2084 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
2085 longer holds.
2086 * tests/regression.at (Token number in precedence declaration): New
2087 test case.
2088
a924ef36
JMG
20892008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2090
2091 DJGPP specific issues.
2092 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
2093 be changed. Copyright timestamp adjusted.
2094 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
2095 be changed. Copyright timestamp adjusted.
2096 * djgpp/config.site: Copyright timestamp adjusted.
2097 * djgpp/config_h.sed: Copyright timestamp adjusted.
2098 * djgpp/djunpack.bat: Copyright timestamp adjusted.
2099 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
2100 filename translation list.
2101 * djgpp/subpipe.c (init_subpipe): Check the environment variables
2102 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
2103 files shall be created. Before trying to use the temp dir where the
2104 environment variable points to check that the dir really exists. If
2105 not default to the cwd as temp dir. Copyright timestamp adjusted.
2106 * djgpp/subpipe.h: Copyright timestamp adjusted.
2107 * djgpp/testsuite.sed: Copyright timestamp adjusted.
2108
389c8cfd
PE
21092008-01-30 Paul Eggert <eggert@cs.ucla.edu>
2110
2111 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
2112
5d1cfef4
PE
21132008-01-09 Paul Eggert <eggert@cs.ucla.edu>
2114
2115 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
2116 Problem reported by Claudio Saavedra in
2117 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
2118
e2dcf996
WP
21192008-01-05 Wojciech Polak <polak@gnu.org>
2120
2121 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
2122 document's title with the input grammar file name.
2123
da730230
JD
21242007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
2125
2126 Automate regression testing of the XML/XSLT implementation. Discussed
2127 starting at
2128 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
2129 * configure.ac (XSLTPROC): New substitution.
2130 * Makefile.am (maintainer-xml-check): New phony target invoking...
2131 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
2132 invoking make maintainer-check with BISON_TEST_XML=1.
2133 * tests/atlocal.in (XSLTPROC): New.
2134 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
2135 not to report reachable memory when Bison is expected to have a
2136 non-zero exit status and (2) to compare XML/XSLT output with --graph
2137 and --report=all output for every working grammar when
2138 BISON_TEST_XML=1.
2139 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
2140 (AT_BISON_CHECK_XML): New.
2141 (AT_QUELL_VALGRIND): New.
2142 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
2143 (AT_CHECK): ... don't redefine this since this was the old way to
2144 quell Valgrind.
2145 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
2146 AT_BISON_CHECK invocations.
2147 * tests/c++.at: Likewise.
2148 * tests/calc.at: Likewise.
2149 * tests/conflicts.at: Likewise.
2150 * tests/cxx-type.at: Likewise.
2151 * tests/existing.at: Likewise.
2152 * tests/glr-regression.at: Likewise.
2153 * tests/headers.at: Likewise.
2154 * tests/input.at: Likewise.
2155 * tests/java.at: Likewise.
2156 * tests/output.at: Likewise.
2157 * tests/push.at: Likewise.
2158 * tests/reduce.at: Likewise.
2159 * tests/regression.at: Likewise.
2160 * tests/sets.at: Likewise.
2161 * tests/skeletons.at: Likewise.
2162 * tests/synclines.at: Likewise.
2163 * tests/torture.at: Likewise.
2164 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
2165 tends to hang xsltproc.
2166 (Big horizontal): Likewise.
2167
408476bc
JD
21682007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2169
2170 In XML output, remove redundant class attribute on symbol element.
2171 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
2172 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
2173 look up a symbol to determine whether it's a nonterminal or terminal.
2174 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
2175 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
2176
2177 Add prec/assoc information to XML output.
2178 * src/gram.c (grammar_rules_print_xml): For each rule that has a
2179 %prec, add a percent_prec attribute.
2180 * src/print-xml.c (print_grammar): For each terminal that has a
2181 precedence or associativity, add a prec or assoc attribute.
2182 (xml_indent): New.
2183 (xml_puts): Use xml_indent.
2184 (xml_printf): Use xml_indent.
2185 * src/print-xml.h (xml_indent): Prototype.
2186
2187 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
2188 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
2189
d4a26c48
JD
21902007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2191
2192 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
2193 (bison:ruleByNumber): ... this for clarity.
2194 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
2195 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
2196 (xsl:template match="reduction"): Update.
2197 (xsl:template match="item"): Update.
2198 (xsl:template match="reduction"): Update.
2199
2200 In the XML output, don't print the list of rules where symbols appear.
2201 Compute it in XSLT instead. Discussed at
2202 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
2203 * data/xslt/bison.xsl (bison:ruleByLhs): New.
2204 (bison:ruleByRhs): New.
2205 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
2206 bison:ruleByRhs.
2207 (xsl:template match="terminal/rule"): Remove.
2208 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2209 bison:ruleByRhs.
2210 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2211 Remove.
2212 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
2213 bison:ruleByRhs and mode="number-link" for rule template.
2214 (xsl:template match="terminal/rule"): Remove.
2215 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2216 bison:ruleByRhs and mode="number-link" for rule template.
2217 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2218 Rewrite as...
2219 (xsl:template match="rule" mode="number-link"): ... this.
2220 * src/print-xml.c (print_grammar): Don't print the list of rules.
2221
ef1b4273
JD
22222007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2223
2224 Don't let --report affect XML output; always print all information.
2225 Discussed at
2226 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
2227 * src/conflicts.c (log_resolution): Implement.
2228 * src/print-xml.c (print_core): Implement.
2229 (print_state): Implement.
2230 (print_xml): Implement.
2231
2232 * NEWS (2.3a+): Fix quotes.
2233 * src/parse-gram.y (prologue_declaration): For consistency with -v,
2234 don't let %verbose clear the list specified by --report.
2235
0f6cd9e3
AD
22362007-11-26 Akim Demaille <akim@epita.fr>
2237
2238 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
2239
d80fb37a
JD
22402007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
2241
2242 In the XML output, list useless and unused symbols and rules with the
2243 useful ones and add a "usefulness" attribute. Discussed starting at
2244 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
2245 * src/gram.c (grammar_rules_partial_print_xml): Remove.
2246 (grammar_rules_print_xml): Print all rules instead of just those
2247 useful in the grammar, and add a "usefulness" attribute.
2248 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
2249 * src/print-xml.c (print_rules_useless_in_parser): Remove.
2250 (print_grammar): Print all nonterminals instead of just useful ones,
2251 and add a "usefulness" attribute to nonterminals and terminals.
2252 (print_xml): Don't print a separate "reductions" or
2253 "rules-useless-in-parser" element.
2254 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
2255 (reduce_xml): Remove.
2256 (reduce_token_unused_in_grammar): New.
2257 (reduce_nonterminal_useless_in_grammar): New.
2258 * src/reduce.h (reduce_xml): Remove prototype.
2259 (reduce_token_unused_in_grammar): Add prototype.
2260 (reduce_nonterminal_useless_in_grammar): Add prototype.
2261 * data/xslt/xml2text.xsl: Update for XML changes.
2262 * data/xslt/xml2xhtml.xsl: Update for XML changes.
2263 * tests/reduce.at (Useless Terminals): Update output.
2264 (Useless Rules): Update output.
2265 (Reduced Automaton): Update output.
2266
2267 Say "Terminals unused in grammar" instead of "Unused terminals".
2268 * NEWS (2.3a+): Update.
2269 * doc/bison.texinfo (Understanding): Update example output.
2270 * src/reduce.c (reduce_output): Implement.
2271 * data/xslt/xml2text.xsl: Implement.
2272 * data/xslt/xml2xhtml.xsl: Implement.
2273
1bb2bd75
JD
22742007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2275
2276 Accept --report-file=FILE to override the default `.output' filename.
2277 * NEWS (2.3a+): Mention.
2278 * doc/bison.texinfo (Bison Options): Add an entry.
2279 * src/files.c (compute_output_file_names): Don't override
2280 spec_verbose_file if already set.
2281 * src/getargs.c (usage): Document --report-file.
2282 (REPORT_FILE_OPTION): New anonymous enum member.
2283 (long_options): Add entry for it.
2284 (getargs): Add case for it setting spec_verbose_file.
2285
2286 * build-aux/cross-options.pl: Don't record a short option just because
2287 there's an arg.
2288 * doc/.cvsignore: Add yacc.1.
2289
a005a9c4
AD
22902007-11-14 Akim Demaille <akim@epita.fr>
2291
2292 * doc/yacc.1.in: New.
2293 * configure.ac, doc/Makefile.am: Adjust.
2294 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
2295 config.h symbol.
2296 Use AC_SUBST for assignments too.
2297 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
2298
cff03fb2
JD
22992007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2300
2301 * src/gram.c: Remove comments that duplicate comments in gram.h.
2302
2303 When reporting useless rules and nonterminals, say "useless in grammar"
2304 instead of "useless", and say "useless in parser" instead of "never
2305 reduced". Discussed starting at
2306 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
2307 * NEWS (2.3a+): Mention this change.
2308 * data/xslt/xml2text.xsl: Update output text and expected input XML
2309 element names to match changes below.
2310 * data/xslt/xml2xhtml.xsl: Likewise.
2311 (xsl:template match="bison-xml-report"): Add missing entry in Table of
2312 Contents: "Rules useless in parser due to conflicts".
2313 * doc/bison.texinfo (Decl Summary): Reword a little.
2314 (Understanding): Update example output for changes below.
2315 * src/gram.c: (rule_useful_p): Rename to...
2316 (rule_useful_in_grammar_p): ... this.
2317 (rule_useless_p): Rename to...
2318 (rule_useless_in_grammar_p): ... this.
2319 (rule_never_reduced_p): Rename to...
2320 (rule_useless_in_parser_p): ... this.
2321 (grammar_rules_print): Update for renames.
2322 (grammar_rules_print_xml): Update for renames.
2323 (grammar_rules_never_reduced_report): Rename to...
2324 (grammar_rules_useless_report): ... this since it is used for either
2325 kind of useless rule.
2326 * src/gram.h: Reword comments and update function names in prototypes.
2327 * src/main.c (main): Say "rule useless in parser due to conflicts".
2328 * src/print-xml.c (print_rules_never_reduced): Rename to...
2329 (print_rules_useless_in_parser): ... this, and rename output XML
2330 element "rules-never-reduced" to "rules-useless-in-parser".
2331 (print_xml): Update for rename.
2332 * src/print.c (print_results): Say "Rules useless in parser due to
2333 conflicts".
2334 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
2335 (nonterminals_reduce): Say "nonterminal useless in grammar".
2336 (reduce_output): Say "Nonterminals useless in grammar".
2337 Say "Rules useless in grammar".
2338 (reduce_xml): Rename output XML element "useless" to
2339 "useless-in-grammar".
2340 (reduce_print): Don't report the count of grammatically useless rules
2341 as "rules never reduced" just because %yacc is specified.
2342 In the correct report of this count, say nonterminal(s) and rule(s)
2343 "useless in grammar".
2344 * tests/conflicts.at (S/R in initial): Update expected output.
2345 (Defaulted Conflicted Reduction): Likewise.
2346 (Unreachable States After Conflict Resolution): Likewise.
2347 * tests/existing.at (GNU pic Grammar): Likewise.
2348 * tests/reduce.at (Useless Nonterminals): Likewise.
2349 (Useless Rules): Likewise.
2350 (Reduced Automaton): Likewise.
2351 (Underivable Rules): Likewise.
2352 (Empty Language): Likewise.
2353
66f0441d
JD
23542007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2355
2356 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
2357 here document and before the EOF so that BSD's implementation of Bourne
2358 shell doesn't parse the delimiter as part of the here document.
2359 * doc/.cvsignore: Add cross-options.texi.
2360 * src/getargs.c (usage): Add a blank line after the warning categories.
2361
d0ee4105
PB
23622007-11-08 Paolo Bonzini <bonzini@gnu.org>
2363
2364 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
2365
e8b1fb9b
AD
23662007-11-05 Akim Demaille <akim@epita.fr>
2367
2368 Remove Id: from bison.1.
2369 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
2370 (perl -0777 -pi -e 's/\.PP\nId): New.
2371 (.x.1): Use it to ignore the version control revision.
2372
2f7a96b5
AD
23732007-11-05 Akim Demaille <demaille@gostai.com>
2374
2375 * build-aux/Makefile.am: Ship cross-options.pl.
2376 * doc/Makefile.am: Always refer to cross-options.texi with
2377 $(srcdir).
2378 (MAINTAINERCLEANFILES): Add it.
2379
f4101aa6
AD
23802007-11-04 Akim Demaille <demaille@gostai.com>
2381
2382 Generate the long/short option cross-table.
2383 * build-aux/cross-options.pl: New.
2384 * doc/Makefile.am (cross-options.texi): New.
2385 * doc/bison.texinfo: Use it.
2386
727a1401
AD
23872007-11-04 Akim Demaille <demaille@gostai.com>
2388
2389 Generate bison.1 using help2man.
2390 * doc/common.x, doc/bison.x: New.
2391 * doc/Makefile.am (bison.1, .x.1): New.
2392 The code is taken from autoconf-2.61/man/Makefile.am.
2393 * configure.ac: Look for help2man.
2394
6aeb9c57
AD
23952007-11-04 Akim Demaille <demaille@gostai.com>
2396
2397 Complete --help.
2398 * src/getargs.c (usage): Document -W, make it clear that -d,
2399 -g and -x have optional arguments.
2400
d7be4085
AD
24012007-11-04 Akim Demaille <demaille@gostai.com>
2402
2403 Find sha1sum when named gsha1sum.
2404 * bootstrap (find_tool): New.
2405 ($SHA1SUM): New.
2406
d9df47b6
JD
24072007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2408
2409 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
2410 at
2411 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
2412 * NEWS (2.3a+): Mention.
2413 * data/bison.m4 (b4_pure_if): Don't define it here.
2414 * data/c.m4 (b4_identification): Depend on individual skeletons to
2415 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
2416 values of the %define variables api.pure or api.push_pull. Define
2417 YYPURE, YYPUSH, and YYPULL accordingly.
2418 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
2419 glr.cc has already defined b4_pure_flag.
2420 * data/push.c: Define b4_pure_if based on `%define api.pure'.
2421 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 2422 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
2423 * doc/bison.texinfo (Pure Decl): Update.
2424 (Push Decl): Update.
2425 (Decl Summary): Add api.pure to %define entry.
2426 In %pure-parser entry, say it's deprecated and reference %define.
2427 (Pure Calling): Update.
2428 (Error Reporting): Update.
2429 (C++ Scanner Interface): Update.
2430 (How Can I Reset the Parser): Update.
2431 (Table of Symbols): In %pure-parser entry, say it's deprecated and
2432 reference %define.
2433 * src/getargs.c (pure_parser): Remove global variable.
2434 * src/getargs.h (pure_parser): Remove extern.
2435 * src/output.c (prepare): Don't define pure_flag muscle.
2436 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
2437 wrapper around `%define api.pure'.
2438 * tests/calc.at (Simple LALR Calculator): Update.
2439 (Simple GLR Calculator): Update.
2440 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
2441 Update.
2442 (GLR: Resolve ambiguity, pure, locations): Update.
2443 (GLR: Merge conflicting parses, pure, no locations): Update.
2444 (GLR: Merge conflicting parses, pure, locations): Update.
2445 * tests/glr-regression.at (Uninitialized location when reporting
2446 ambiguity): Update
2447 * tests/input.at (Unused %define api.pure): New test case.
2448 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
2449 AT_PURE_IF and AT_PURE_AND_LOC_IF.
2450 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2451
c373bf8b
JD
24522007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2453
2454 %define push_pull -> %define api.push_pull. Discussed starting at
2455 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
2456 * data/push.c: Expect the new name.
2457 * data/yacc.c: Likewise.
2458 * doc/bison.texinfo (Push Decl): Update.
2459 (Decl Summary): Update %define entry.
2460 (Push Parser Function): Update.
2461 (Pull Parser Function): Update.
2462 (Parser Create Function): Update.
2463 (Parser Delete Function): Update.
2464 * tests/calc.at (Simple LALR Calculator): Update.
2465 * tests/input.at (%define enum variables): Update.
2466 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2467 (Push Parsing: Multiple impure instances): Update.
2468 (Push Parsing: Unsupported Skeletons): Update.
2469 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
2470 (Exploding the Stack Size with Malloc): Update.
2471
2472 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
2473 other entries some.
2474
32f19b6b
JD
24752007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
2476
2477 For the XML output's terminal element, rename @number to @token-number,
2478 and add @symbol-number. In the nonterminal element, rename @number to
2479 @symbol-number. Discussed starting at
2480 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
2481 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
2482 renames.
2483 (xsl:template match="nonterminal"): Likewise.
2484 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
2485 (xsl:template match="nonterminal"): Likewise.
2486 * src/print-xml.c (print_grammar): Implement.
2487
255a6b90
JD
24882007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2489
2490 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
2491 2007-10-11 change, the child elements here are items not rules.
408476bc 2492 (xsl:template match="item"): New.
255a6b90
JD
2493 (xsl:template match="rule"): Update for new reduced itemset.
2494 (xsl:template match="point"): Remove.
2495 (xsl:template match="empty"): For consistency with --graph, don't
2496 output "/* empty */".
2497 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
2498 line-wrap, don't pass a negative value as first-line-length since this
2499 won't work with the following changes.
2500 (xsl:template name="line-wrap"): Simplify slightly.
2501 (xsl:template name="ws-search"): Eliminate recursion.
2502 * src/print_graph.c (print_core): Don't print a reduction's lookahead
2503 set next to an item whose dot is not at the end of the RHS even if it
2504 happens to be associated with the same rule.
2505
88c78747
JD
25062007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2507
31984206
JD
2508 Add %define lr.keep_unreachable_states.
2509 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
2510 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
2511 * src/main.c (main): Implement it.
2512 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2513 Extend to test it, and fix a typo.
2514
25152007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2516
2517 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
2518 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
2519 the example .output text.
2520 * tests/regression.at (Extra lookahead sets in report): Improve wording
2521 of comments.
2522
b7a70162
WP
25232007-10-17 Wojciech Polak <polak@gnu.org>
2524
2525 * src/print-xml.c (print_grammar): Renamed
2526 <terminal> and <nonterminal> attributes:
2527 "type" to "number" and "symbol" to "name".
2528 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
2529 Use new attribute names.
2530 (xsl:template match="nonterminal"): Likewise.
2531 * data/xslt/xml2xhtml.xsl: Likewise.
2532
a0de5091
JD
25332007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
2534
2535 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
2536 (Option Cross Key): Likewise.
2537
2538 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
2539 next to an item whose dot is not at the end of the RHS even if it
2540 happens to be associated with the same rule.
2541 * src/print.c (print_core): Likewise.
2542 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
2543 (Resolved SR Conflicts): Update output.
2544 * tests/regression.at (Extra lookahead sets in report): New test case.
2545
4c20d18d
WP
25462007-10-11 Wojciech Polak <polak@gnu.org>
2547
2548 * src/print-xml.c (print_core): Remove item set
2549 redundancy.
2550 * data/xslt/bison.xsl (bison:ruleNumber): New key.
2551 Improve processing time. Suggested by Joel E. Denny.
2552 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
2553 Write xsl:param "required" attribute as comment.
2554 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
2555 (xsl:template match="rule"): Support new reduced itemset.
2556 (xsl:template match="point"): Remove.
2557 * data/xslt/xml2xhtml.xsl: Likewise.
2558
f506ad1c
JD
25592007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2560
2561 * src/getargs.c (version): Update copyright year.
2562
21f1b063
JD
25632007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2564
2565 Make xml2dot.xsl and --graph produce the same output.
2566 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
2567 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
2568 escaped later.
2569 (xsl:template name="output-node"): Use the new escape template instead
2570 of the string-replace template directly.
2571 (xsl:template name="output-edge"): Likewise.
2572 (xsl:template name="escape"): New, escapes backslashes and newlines in
2573 addition to quotation marks.
2574 * src/graphviz.c (start_graph, output_node, output_edge): Add
2575 whitespace to output for legibility.
2576
2577 Make xml2text.xsl and --report produce the same output, and remove the
2578 XML "conflicts" element since a conflict summary is easily extracted
2579 from the automaton.
2580 * data/xslt/bison.xsl: New.
2581 (xsl:template match="state" mode="bison:count-conflicts): New.
2582 * data/xslt/xml2text.xsl: Import bison.xsl.
2583 (xsl:template match="bison-xml-report"): Instead of styling the
2584 "conflicts" element, style the "automaton" element with mode
2585 "conflicts". Unlike the former, the latter lists S/R and R/R
2586 conflicts for a state on the same line.
2587 (xsl:template match="conflicts"): Remove.
2588 (xsl:template match="conflict"): Remove.
2589 (xsl:template match="terminal"): Line-wrap the list of rules in which
2590 the terminal is used.
2591 (xsl:template match="nonterminal"): Likewise for nonterminals.
2592 (xsl:template match="automaton" mode="conflicts"): New.
2593 (xsl:template match="state" mode="conflicts"): New.
2594 (xsl:template name="line-wrap"): New.
2595 (xsl:template name="ws-search"): New.
2596 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
2597 (xsl:template match="bison-xml-report"): Instead of styling the
2598 "conflicts" element, style the "automaton" element with mode
2599 "conflicts."
2600 (xsl:template match="conflicts"): Remove.
2601 (xsl:template match="conflict"): Remove.
2602 (xsl:template match="automaton" mode="conflicts"): New.
2603 (xsl:template match="state" mode="conflicts): New.
2604 * src/conflicts.c (conflicts_output_xml): Remove.
2605 * src/conflicts.h (conflicts_output_xml): Remove prototype.
2606 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
2607 * src/print.c (print_grammar): Consistently wrap at the 66th column so
2608 the corresponding XSLT is easier. Also, never wrap between a word and
2609 the comma that follows it.
2610
793fbca5
JD
26112007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2612
2613 Improve C++ namespace support. Discussed starting at
2614 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
2615 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
2616 b4_namespace_close): New macros that interpret the %define variable
2617 "namespace" so its value can contain "::" to indicate nested
2618 namespaces.
2619 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
2620 the above macros.
2621 * data/lalr1.cc (b4_namespace): Likewise.
2622 * data/location.cc (b4_namespace): Likewise.
2623 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
2624 inside a new table in the general %define entry. Document `%define
2625 namespace' there as well. Point the %name-prefix entry to it since it
2626 explains it more completely in the case of C++.
2627 (C++ Bison Interface): Mention `%define namespace' instead of
2628 %name-prefix.
2629 (Table of Symbols): Remove the `%define push_pull' entry. The %define
2630 entry suffices.
2631 * tests/c++.at (Relative namespace references): New test case.
2632 (Absolute namespace references): New test case.
2633 (Syntactically invalid namespace references): New test case.
2634 * tests/input.at (C++ namespace reference errors): New test case.
2635
35b8730d
JD
26362007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2637
2638 Add syncline support and location accessor to internal %define
2639 interfaces.
2640 * data/bison.m4 (b4_percent_define_get_loc): New.
2641 (b4_percent_define_get_syncline): New.
2642 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
2643 (b4_percent_define_default): Record defining location as line 1 rather
2644 than 0 for the sake of synchronizing #line's, and define
2645 b4_percent_define_syncline(VARIABLE).
2646 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
2647 * src/muscle_tab.c (muscle_syncline_grow): New.
2648 (muscle_code_grow): Use muscle_syncline_grow.
2649 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
2650 define b4_percent_define_syncline(VARIABLE).
2651 (muscle_percent_define_get_loc): New.
2652 (muscle_percent_define_get_syncline): New.
2653 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
2654 remove some unused variables.
2655 (muscle_percent_define_default): Record defining location as line 1
2656 rather than 0 for the sake of synchronizing #line's, and define
2657 b4_percent_define_syncline(VARIABLE).
2658 (muscle_percent_define_check_values): Use
2659 muscle_percent_define_get_loc.
2660 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
2661 (muscle_percent_define_get_syncline): Prototype.
2662 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2663 defaults): Update output for location change.
2664 (Complaining during macro argument expansion): Extend to test
2665 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
2666
7dc4a694
JD
26672007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
2668
2669 Fix some error-reporting macro bugs.
2670 * data/bison.m4 (b4_cat): New.
2671 (b4_error, b4_error_at): Use b4_cat to send error directives directly
2672 to stdout so they don't become arguments to other macros. Update
2673 comments and add examples.
2674 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
2675 add examples.
2676 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
2677 after printing the error directive so that M4 doesn't report subsequent
2678 problems that are induced by this problem.
2679 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
2680 instead of just in them. Recognize @\n in both places. Both expand to
2681 the empty string. Needed by b4_cat.
2682 * tests/skeletons.at (Complaining during macro argument expansion):
2683 New test case.
2684 (Fatal errors make M4 exit immediately): New test case.
2685
d4bd2295
JD
26862007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
2687
2688 Implement --print-datadir.
2689 * src/getargs.c (usage): Mention.
2690 (PRINT_DATADIR_OPTION): New anonymous enum member.
2691 (long_options): Add entry for it.
2692 (getargs): Add case for it calling compute_pkgdatadir.
2693 * src/output.c (output_skeleton): Encapsulate data directory
2694 computation from here...
2695 (prepare): ... and from here...
2696 (compute_pkgdatadir): ... into this new function.
2697 * src/output.h (compute_pkgdatadir): Prototype.
2698
34cdeddf
JD
26992007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
2700
2701 * src/print-xml.c (escape_bufs): New static global variable
2702 replacing...
2703 (xml_escape_n): ... the static local variable buf here.
2704 (print_xml): Free memory for escape_bufs.
2705 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
2706
d782395d
JD
27072007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
2708
2709 Replace `%push-parser' and `%push-pull-parser' with
2710 `%define push_pull "push"' and `%define push_pull "both"'.
2711 `%define push_pull "pull"' is the default.
2712 * doc/bison.texinfo (Push Decl, Push Parser Function,
2713 Pull Parser Function, Parser Create Function, Parser Delete Function):
2714 Update declarations.
2715 (Decl Summary, Table of Symbols): Replace %push-parser and
2716 %push-pull-parser entries with a %define push_pull entry.
2717 * data/bison.m4 (b4_percent_define_check_values): New macro.
2718 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
2719 definitions...
2720 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
2721 definitions...
2722 * data/push.c: ... to here and compute them from the value of the
2723 %define variable push_pull.
2724 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
2725 parsing requests here...
2726 * data/yacc.c: ... hack this to switch to push.c any time
2727 b4_use_push_pull_flag or the %define variable push_pull is set. This
2728 will go away when we mv push.c yacc.c.
2729 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
2730 push parsing is not supported since unused %define variables are
2731 reported anyway.
2732 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
2733 * src/muscle_tab.h (muscle_percent_define_check_values): Update
2734 comments for consistency with b4_percent_define_check_values.
2735 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
2736 muscles.
2737 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
2738 Remove.
2739 (prologue_declaration): Remove %push-parser and %push-pull-parser
2740 rules.
2741 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
2742 * tests/calc.at: Update declarations.
2743 * tests/input.at (%define enum variables): New test case.
2744 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
2745 declaration.
2746 (Push Parsing: Multiple impure instances): Update declaration.
2747 (Push Parsing: Unsupported Skeletons): New test case.
2748 * tests/torture.at (Exploding the Stack Size with Alloca): Update
2749 declaration.
2750 (Exploding the Stack Size with Malloc): Update declaration.
2751
3f999f78
WP
27522007-09-24 Wojciech Polak <polak@gnu.org>
2753
2754 Add XSLT transformations.
2755
2756 * data/xslt/xml2dot.xsl: Transform XML into DOT.
2757 * data/xslt/xml2text.xsl: Transform XML into plain text.
2758 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
2759 * data/Makefile.am (xsltdir): New variable.
2760 (dist_xslt_DATA): Add xslt/*.xsl files.
2761
a4f75309
PE
27622007-09-23 Paul Eggert <eggert@cs.ucla.edu>
2763
2764 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
2765 Problem reported by Wojciech Polak.
2766 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
2767 (xml_printf): Undo change I made on 21 September; that is,
2768 indent 2 spaces, not 1.
2769
ad5feac4
JD
27702007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
2771
2772 Pacify ./configure --enable-gcc-warnings.
2773 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
2774 `char const *' instead of `char *'.
2775 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
2776 local variable `sep'.
2777
41d7a5f2
PE
27782007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2779
2780 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
2781 elsewhere.
2782 * src/print-xml.c: Prefer "const" after types; that's more consistent.
2783 (xml_printf): Indent just 1 space for level.
2784 (e_char, xlate_char): Remove.
2785 (xml_escape_string): Rewrite to avoid undefined behavior (used
2786 storage that was freed from the stack).
2787 (xml_escape_n): Don't bother checking for subscript error.
2788
3f999f78
WP
27892007-09-21 Wojciech Polak <polak@gnu.org>
2790
2791 Add Bison XML Automaton Report.
41d7a5f2
PE
2792
2793 Add support for an -x option to generate an XML report.
2794 It is not documented yet.
2795 * src/print-xml.c: New file.
2796 * src/print-xml.h: Likewise.
2797 * lib/timevar.def (TV_XML): New var.
2798 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
2799 * src/conflicts.c: Include print-xml.h.
2800 (solved_conflicts_xml_obstack): New var.
2801 (log_resolution, conflicts_solve, conflicts_free):
2802 Add support for XML report.
2803 (conflicts_output_val): New function.
2804 * src/conflicts.h (conflicts_output_val): New decl.
2805 * src/files.c (spec_xml_file): New var.
2806 (compute_output_file_names, output_file_names_free): Add XML support.
2807 * src/files.h (spec_xml_file): New decl.
2808 * src/getargs.c (xml_flag): New var.
2809 (usage, short_options, long_options, getargs): Add XML support.
2810 * src/getargs.h (xml_flag): New decl.
2811 * src/gram.c: Include print-xml.h.
2812 (rule_lhs_print_xml, rule_rhs_print_xml):
2813 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
2814 New functions.
2815 * src/gram.h: Declare external ones.
2816 * src/main.c: Include print-xml.h.
2817 (main): Add XML support.
2818 * src/reduce.c: Include print-xml.h.
2819 (reduce_xml): New function.
2820 * src/reduce.h: Declare it.
2821 * src/state.c: Include print-xml.h.
2822 (state_new): Add XML support.
2823 (state_rule_lookahead_tokens_print_xml): New function.
2824 * src/state.h: Declare it.
2825 (struct state): New member solved_conflicts_xml.
2826 * src/symtab.c (symbol_class_get_string): New function.
2827 * src/symtab.h: Declare it.
2828
6d8e724d
PE
28292007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2830
2831 * GNUmakefile: Switch to coreutils's version.
2832 * bootstrap: Likewise.
2833 * Makefile.cfg: Adjust to new GNUmakefile.
2834 * README-hacking: Likewise.
2835
2836 Import from gnulib:
2837
2838 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
2839 Bruno Haible <bruno@clisp.org>
2840
2841 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
2842 and is a script that invokes bison. Tighten the code. Add comments.
2843
922bdd7f
JD
28442007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
2845
2846 Spell "boolean" as "Boolean". Reported by Akim Demaille.
2847 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
2848 * doc/bison.texinfo (Decl Summary): Fix.
2849 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
2850 * tests/input.at (Boolean %define variables): Update output.
2851 * tests/skeletons.at (%define boolean variables: invalid skeleton
2852 defaults): Rename to...
2853 (%define Boolean variables: invalid skeleton defaults): ... this and
2854 update output.
2855
1b17b01d
JD
28562007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
2857
2858 In impure push mode, don't allow more than one yypstate to be allocated
2859 since multiple impure parsers would corrupt yynerrs.
2860 * data/push.c (yypstate_allocated): New static global variable
2861 initialized to 0.
2862 (yypull_parse): If yypstate_new returns 0, don't report it as memory
2863 exhaustion if yypstate_allocated is 1, but still return 2.
2864 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
2865 already 1. Otherwise, set it to 1.
2866 (yypstate_delete): Set it to 0.
2867 * tests/push.at (Push Parsing: Multiple impure instances): New test
2868 case.
2869
9987d1b3
JD
28702007-08-17 Bob Rossi <bob@brasko.net>
2871
2872 * doc/bison.texinfo (Push Decl): Document the push parser.
2873 (Table of Symbols): Ditto.
2874 (Pure Decl): Ditto.
2875 (Decl Summary): Ditto.
2876 (Multiple Parsers, Push Parser Function, Pull Parser Function,
2877 Parser Create Function, Parser Delete Function):
2878 Add new push parser symbols.
2879 (Table of Symbols): Document push-parser, push-pull-parser,
2880 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
2881
f16b0819
PE
28822007-08-15 Paul Eggert <eggert@cs.ucla.edu>
2883
2884 Update to GPLv3.
2885 * doc/gpl-3.0.texi: New file.
2886 * doc/gpl.texi: Remove.
2887 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
2888 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
2889 * README-hacking, TODO, bootstrap, bootstrap.conf:
2890 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
2891 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
2892 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
2893 * data/lalr1.cc, data/lalr1.java, data/location.cc:
2894 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
2895 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
2896 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
2897 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
2898 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
2899 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
2900 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
2901 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
2902 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
2903 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
2904 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
2905 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
2906 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
2907 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
2908 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
2909 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
2910 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
2911 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
2912 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
2913 * src/complain.c, src/complain.h, src/conflicts.c:
2914 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
2915 * src/files.h, src/flex-scanner.h, src/getargs.c:
2916 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
2917 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
2918 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
2919 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
2920 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
2921 * src/print.c, src/print.h, src/print_graph.c:
2922 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
2923 * src/reduce.h, src/relation.c, src/relation.h:
2924 * src/revision.h, src/scan-code.h, src/scan-code.l:
2925 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
2926 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
2927 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
2928 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
2929 * tests/Makefile.am, tests/actions.at, tests/c++.at:
2930 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
2931 * tests/existing.at, tests/glr-regression.at:
2932 * tests/headers.at, tests/input.at, tests/java.at:
2933 * tests/local.at, tests/output.at, tests/push.at:
2934 * tests/reduce.at, tests/regression.at, tests/sets.at:
2935 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
2936 * tests/torture.at:
2937 Update to GPLv3.
2938
728c4be2
JD
29392007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2940
2941 Get rid of broken %no-parser, -n, and --no-parser implementation and
2942 documentation.
2943 * TODO: Don't mention them.
2944 * doc/bison.1: Likewise.
2945 * doc/bison.texinfo (Decl Summary): Likewise.
2946 (Bison Options): Likewise.
2947 (Option Cross Key): Likewise.
2948 * src/getargs.c (no_parser_flag): Remove global variable.
2949 (usage): Don't print description of -n and --no-parser.
2950 (long_options): Remove --no-parser entry here.
2951 (getargs): Remove -n case in the switch here.
2952 * src/getargs.h (no_parser_flag): Remove extern.
2953 * tests/regression.at (Web2c Actions): Remove comment that mentions
2954 --no-parser.
2955
5d31a216
JD
29562007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2957
2958 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
2959 name user variables starting with `yy'. Just pass NULL instead of a
2960 dummy local &yylval to yypush_parse.
2961 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
2962 starting with `yy'.
2963
a2ea208d
JD
29642007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
2965
2966 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
2967 true since it's then always used regardless of whether yyoverflow is
2968 defined. Reported by Christian Burger at
2969 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
2970 * THANKS: Add Christian Burger.
2971
91661ebb
JD
2972 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
2973 node names: say "Decl Summary" not "Bison Declaration Summary".
2974
cbd50549
JD
29752007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
2976
2977 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
2978 determine whether this function has already complained about an invalid
2979 value for a %define boolean variable, don't check whether Bison has
2980 ever examined the value. As written, the check was a tautology.
2981 Instead, record and check for this complaint using a separate muscle.
2982
eb1b0740
JD
29832007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2984
2985 Fix push parsing memory leak reported by Brandon Lucia at
2986 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
2987 * THANKS: Add Brandon Lucia.
2988 * data/push.c (yypstate_delete): Free the stack if it was reallocated
2989 but the parse never completed and thus freed it.
2990 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
2991 * tests/testsuite.at: Include push.at.
2992 * test/push.at: New.
2993 (Push Parsing: Memory Leak for Early Deletion): New test case.
2994
9d774aff
JD
29952007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
2996
2997 Improve handling of multiple S/R conflicts in the same state and of S/R
2998 conflicts involving multiple reductions.
2999 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
3000 set for a state here or Bison will abort if it is reassigned on a
3001 later conflicted reduction in the same state.
3002 Similarly, don't finalize and assign the solved conflicts report here
3003 or it will be lost if it is reassigned on a later conflicted reduction
3004 in the same state.
3005 (set_conflicts): Instead, assign them both here after all S/R conflicts
3006 in the state have been fully examined.
3007 * src/print.c (shift_set): Rename to...
3008 (no_reduce_set): ... this.
3009 (print_reductions): Update for rename, and add %nonassoc error action
3010 tokens to no_reduce_set so that, when printing the first remaining
3011 reduction on an error action token, the reduction is enclosed in
3012 brackets.
3013 (print_results): Update for rename.
3014 * tests/conflicts.at (Solved conflicts report for multiple reductions
3015 in a state): New test case.
3016 (%nonassoc error actions for multiple reductions in a state): New test
3017 case.
3018
3019 * src/main.c (main): Don't depend on C99 features.
3020
10159d2a
JD
30212007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3022
3023 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
3024 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
3025 uniwidth.
10159d2a 3026
953b3935
JD
30272007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
3028
3029 * bootstrap (slurp): Create target directories that don't exist.
3030 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
3031
6ce2d93a
JD
30322007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3033
3034 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
3035 than item number.
3036 * closure.c (closure): Likewise.
3037 * state.h (reductions): Comment sorting of rules.
3038 (state): Comment sorting of items.
3039
ce3448d5
JD
30402007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
3041
3042 Fix C++ test cases after recent Gnulib changes. Discussed starting at
3043 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
3044 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
3045 definition in order to avoid Gnulib headers since we don't use config.h
3046 here.
3047 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
3048 rather than AT_DATA so that config.h is included.
3049
8a86eef0
JD
30502007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
3051
3052 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
3053 instead of fprintf. Guard these functions with #if YYDEBUG instead of
3054 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
3055 and so that YYFPRINTF is guaranteed to be defined here.
3056
b1a81613
JD
30572007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3058
3059 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
3060 with...
3061 (muscle_percent_define_check_values): ... this more helpful function.
3062 Again, it's not used yet, but it will be.
3063 * src/muscle_tab.h: Likewise.
3064
71b61d4d
JD
3065 Improve some comments in parser table construction.
3066 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
3067 (generate_states): Don't mention ruleset, which is internal to closure.
3068 * src/closure.c (closure): Explain sorting of core and itemset, which
3069 is required for this function to behave correctly.
3070 * src/closure.h (closure): Mention sorting.
3071
2a6b783d
JD
30722007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
3073
3074 * src/lalr.c (state_lookahead_tokens_count): For code readability,
3075 move the check for disabled transitions to an aver since conflict
3076 resolution hasn't happened yet.
3077
3078 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
3079 labels a state as inconsistent just because it has error transitions.
3080 The original form of this check appeared in revision 1.1 of lalr.c,
3081 which was committed on 1991-12-21. Now (at least), changing the
3082 consistency label on such a state appears to have no useful effect in
3083 any of the places it is examined, which I enumerate below. The key
3084 point to understanding each item in this enumeration is that a state
3085 with an error transition is labelled consistent in the first place only
3086 if it has no rules, so the check cannot matter for states that have
3087 rules. (1) Labelling a state as inconsistent will cause set_conflicts
3088 to try to identify its conflicts, and a state must have *rules* to have
3089 conflicts. (2) Labelling a state as inconsistent will affect how
3090 action_row sets the default *rule* for the state. (3) Labelling a
3091 state as inconsistent will cause build_relations to add lookback edges
3092 to *rules* in that state.
3093 * src/state.h (struct state): Word the comment for member consistent
3094 more carefully.
3095
14462c2b
JD
30962007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3097
3098 Don't depend on C99 features.
3099 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
3100 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
3101 * src/reader.c (check_and_convert_grammar): Fix for-loop.
3102 * src/state.c (state_mark_reachable_states): Fix for-loop.
3103 (state_remove_unreachable_states): Fix for-loop.
3104
3105 Don't widen struct state with member reachable just to temporarily
3106 record reachability. Instead, use a local bitset.
3107 * src/state.h (struct state): Remove member.
3108 * src/state.c (state_new): Don't initialize it.
3109 (state_mark_reachable_states): Rename to...
3110 (state_record_reachable_states): ... this, and use bitset.
3111 (state_remove_unreachable_states): Use bitset.
3112
5a43d418
JD
31132007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
3114
3115 * src/Makefile.am (yacc): Quote target action commands properly so
3116 that the yacc script isn't corrupt. Reported by Hans Aberg at
3117 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
3118
0c650a20
JD
3119 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
3120 the case of pure parsers. Reported by Frans Englich at
3121 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
3122 * THANKS: Add Frans Englich.
3123
61fee93e
JD
3124 * NEWS (2.3a+): In the %code entry, reference section `Bison
3125 Declaration Summary' from the manual now since the %code summary has
3126 moved there.
3127 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
3128 in the rules section must be terminated by semicolons.
3129
f124d423
JD
31302007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
3131
3132 Extend the front-end API for %define variables to more completely
3133 mirror the back-end. This will be useful in the future.
3134 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
3135 Update comments to mention the new front-end counterparts of these
3136 macros.
3137 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
3138 for muscle_string_decode and muscle_location_decode.
3139 (muscle_string_decode): New static function.
3140 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
3141 (muscle_percent_define_get, muscle_percent_define_ifdef): New
3142 functions.
3143 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
3144 muscle_percent_define_get to mimic the b4_percent_define_flag_if
3145 implementation more closely.
3146 (muscle_percent_define_invalid_value): New function.
3147 * src/muscle_tab.h (muscle_percent_define_get,
3148 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
3149 Prototype.
3150
75ad86ee
JD
31512007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3152
3153 * NEWS (2.3a+): Mention yesterday's state-removal change.
3154 (2.3a): Remove the %language entry, which was added after 2.3a.
3155 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
3156 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
3157 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
3158 tests/existing.at: Update copyright date.
3159
5967f0cf
JD
31602007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3161
3162 If conflict resolution makes states unreachable, remove those states,
3163 report rules that are then unused, and don't report conflicts in those
3164 states.
3165 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
3166 New global function.
3167 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
3168 function.
3169 * src/main.c (main): After conflict resolution, remove the unreachable
3170 states and update all data structures that reference states by number.
3171 * src/state.c (state_new): Initialize each state's reachable member to
3172 false.
3173 (state_mark_reachable_states): New static function.
3174 (state_remove_unreachable_states): New global function.
3175 * src/state.h (struct state): Add member bool reachable.
3176 (state_remove_unreachable_states): Prototype.
3177 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3178 New test case.
3179 * tests/existing.at (GNU pic Grammar): Update test case output now that
3180 an unused rule is discovered.
3181
b09f4f48
JD
31822007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3183
3184 Minor code cleanup in parser table construction.
3185 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
3186 (new_itemsets, save_reductions): Update for rename to nitemset.
3187 * src/closure.c (nritemset): Rename to...
3188 (nitemset): ... this since the "r" appears to meaningless and isn't
3189 used in the comments.
3190 (closure): Update for rename.
3191 * src/closure.h (nritemset): Update extern to...
3192 (nitemset): ... this.
3193 * src/lalr.c (LA): Fix a typo in comments.
3194 * src/print.c (print_core): Update for rename to nitemset.
3195 * src/print_graph.c (print_graph): Likewise.
3196 * src/state.h: Fix some typos in header comments.
3197
bbb44d83
PE
31982007-04-04 Paul Eggert <eggert@cs.ucla.edu>
3199
9b33de72
PE
3200 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
3201 still sticks to ASCII. Sorry!
3202
bbb44d83
PE
3203 * README-hacking: New file, taken mostly from coreutils, with changes
3204 for Bison. Contains much of the contents of:
3205 * README-cvs: Remove.
3206 * bootstrap: Sync from gnulib.
3207 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
3208 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
3209
29553547
JD
32102007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
3211
3212 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
3213 Setzer.
3214 (Java Differences): Fix some typos.
3215 * THANKS: Add Sebastian Setzer.
3216
01b477c6
PB
32172007-03-07 Paolo Bonzini <bonzini@gnu.org>
3218
730739e4
AD
3219 * data/java.m4 (b4_single_class_if): Remove.
3220 (b4_abstract_if): Look at "%define abstract".
3221 (b4_lexer_if): New.
3222 (b4_union_name): Rename...
3223 (b4_yystype): ... to this. Map to "%define stype".
3224 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
3225 b4_maybe_throws): Fix quoting.
3226 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
3227 * data/lalr1.java (Lexer interface): Always define.
3228 (Lexer interface within parser class): Remove.
3229 (YYLexer class): New, used when "%code lexer" is present.
3230 (constructor): When "%code lexer" is used, pass %lex-param
3231 to the lexer constructor.
3232 (yylex, yyparse): Remove %lex-param from method invocations
3233 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
3234
3235 * doc/bison.texinfo (Java Bison Interface): Mention "%define
3236 abstract". Rename "%define union_name" to "%define stype".
3237 Rename method names according to previous patch.
3238 (Java Scanner Interface): Describe "%code lexer" instead of
3239 "%pure-parser" and "%define single_class".
3240 (Java Differences): Mention "%code lexer".
3241
3242 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
3243 Include scanner here, using macros from tests/local.at.
3244 (AT_DATA_CALC_Y): Remove final argument.
3245 (_AT_CHECK_JAVA_CALC): Likewise.
3246 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
3247 of %locations and %error-verbose.
3248 (main): Test with and without %lex-param.
3249 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
3250 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 3251
122bea3a
JMG
32522007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3253
3254 DJGPP spefic issue. Inhibit the use of disallowed characters for
3255 file name genertion on Win98, WinXP, etc. These are |<>":?*\
3256 and concern testsuite case 46.
3257 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
3258 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
3259 * djgpp/config.bat: Inhibit the use of disallowed characters.
3260
9611cfa2
JD
32612007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3262
3263 Miscellaneous %define and %code cleanup.
3264 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
3265 values are interpreted.
3266 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
3267 documentation a little more.
3268 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
3269 muscle_percent_define_insert, muscle_percent_code_grow): New
3270 functions/macros.
3271 * src/muscle_tab.h (muscle_percent_define_insert,
3272 muscle_percent_code_grow): Prototype.
3273 * src/parse-gram.y (prologue_declaration): Use
3274 muscle_percent_define_insert and muscle_percent_code_grow when parsing
3275 %define and %code directives.
3276
3277 Make it easy to share %define boolean variables between the front-end
3278 and back-end. Though not used yet, this will be useful in the future.
3279 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
3280 Bison uses of names rather than just skeleton uses of names.
3281 (b4_percent_define_get, b4_percent_define_ifdef): Rename
3282 b4_percent_define_skeleton_variables(VARIABLE) to
3283 b4_percent_define_bison_variables(VARIABLE).
3284 (b4_percent_code_get, b4_percent_code_ifdef): Rename
3285 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
3286 b4_percent_code_bison_qualifiers(QUALIFIER).
3287 (b4_check_user_names_wrap): Update for renames.
3288 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
3289 muscle_percent_define_default): New functions mimicking
3290 b4_percent_define_flag_if and b4_percent_define_default.
3291
3292 For %define variables, report locations for invalid values and
bbb44d83 3293 redefinitions.
9611cfa2
JD
3294 * data/bison.m4 (b4_percent_define_flag_if): Read
3295 b4_percent_define_loc(VARIABLE) to report the location of an invalid
3296 value for VARIABLE.
3297 (b4_percent_define_default): Save a special location in
3298 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
3299 must later be reported as invalid.
3300 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
3301 functions.
3302 (muscle_percent_define_insert): Record the location of VARIABLE in
3303 muscle percent_define_loc(VARIABLE), and use it to report the previous
3304 location for a redefinition.
3305 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
3306 (muscle_percent_define_default): Update like b4_percent_define_default.
3307 (muscle_grow_user_name_list): Rename to...
3308 (muscle_user_name_list_grow): ... this for consistency and use
3309 muscle_location_grow.
3310 * src/muscle_tab.h (muscle_location_grow): Prototype.
3311 * tests/input.at (%define errors): Update expected output.
3312 * tests/skeletons.at (%define boolean variables: invalid skeleton
3313 defaults): New test case.
3314
0bf92491
JD
33152007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
3316
3317 * src/print.c (lookahead_set, state_default_rule): Remove.
3318 (print_reductions): Replace state_default_rule invocation with
3319 equivalent use of yydefact, which was computed in token_actions in
3320 tables.c.
3321 (print_results): Don't allocate lookahead_set.
3322
d3b12988
PB
33232007-02-27 Paolo Bonzini <bonzini@gnu.org>
3324
3325 * data/lalr1.java: Prefix all private members with yy.
3326
f57a7536
JD
33272007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
3328
3329 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 3330 Sebastien Fricker at
f57a7536 3331 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 3332 * THANKS: Add Sebastien Fricker.
f57a7536
JD
3333 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
3334 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
3335 accept a variable number of arguments.
3336
6404a5bf
JD
33372007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3338
3339 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
3340
e4e09639
JMG
33412007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3342
3343 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
3344 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
3345 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
3346
d7e0a1a7
PE
33472007-02-11 Paul Eggert <eggert@cs.ucla.edu>
3348
3349 Undo my 2007-02-07 change, switching back to the c-strcase module
3350 introduced in the 2007-02-03 change. Bruno Haible reported that
3351 the 2007-02-07 change would be dangerous in Turkish if we add a
3352 language whose name contains "i", since "i" is not lowercase "I"
3353 in Turkish.
3354 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
3355 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
3356 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
3357 * m4/.cvsignore: Remove strcase.m4.
3358 * src/getargs.c: Revert 2007-02-07 change, as follows.
3359 Include c-strcase.h.
3360 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
3361
deee93a1
JD
33622007-02-11 Bruno Haible <bruno@clisp.org>
3363
3364 Enable the Java related testsuite tests when the only Java compiler
3365 found is a gcj < 4.3. Discussed at
3366 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
3367 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
3368
574add85
JD
33692007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
3370
3371 * data/Makefile.am: Update copyright date.
3372 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
3373 yypstate_new returns NULL.
3374 (yypstate_new): Return NULL if malloc does.
3375 * src/reader.c (packgram): Move translation of rule actions from the
3376 beginning of packgram to...
3377 (check_and_convert_grammar): ... here right before packgram is invoked
3378 so it's easier to write more complete comments, and remove redundant
3379 code.
3380
e785ccf7
JD
33812007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
3382
3383 As in semantic actions, make @$ in %initial-action, %destructor, and
3384 %printer imply %locations.
3385 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
3386 scanning @$.
3387 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
3388 (@$ in %initial-action implies %locations,
3389 @$ in %destructor implies %locations,
3390 @$ in %printer implies %locations): ... these new test cases.
3391
1cfe1ed7
PE
33922007-02-07 Paul Eggert <eggert@cs.ucla.edu>
3393
3394 Undo most of the 2007-02-03 change, switching to the strcase module
3395 now that gnulib strcase has been fixed.
3396 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
3397 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
3398 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
3399 * m4/.cvsignore: Add strcase.m4.
3400 * src/getargs.c: Revert 2007-02-03 change, as follows.
3401 Don't include c-strcase.h.
3402 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
3403 strcasecmp has "unspecified behavior" outside the POSIX locale,
3404 but it works fine in practice if at least one argument is ASCII,
3405 as is the case in Bison.
3406
0049ec86
PB
34072007-02-07 Paolo Bonzini <bonzini@gnu.org>
3408
3409 * tests/java.at: Skip tests if only one of javac/java is present.
3410 Reported by Joel E. Denny.
3411 * tests/atlocal.in: Adjust copyright years.
3412
34132007-02-05 Paolo Bonzini <bonzini@gnu.org>
3414
3415 * data/lalr1.java (Stack): Work around old verifiers that disallow
3416 access to the private fields of an inner class, from the outer class.
3417 We can make Stack's fields public because user code doesn't have access
3418 to the instance of Stack used by parse(). Reported by Paul Eggert.
3419
2c2b7220
PE
34202007-02-03 Paul Eggert <eggert@cs.ucla.edu>
3421
3422 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
3423 the right spot for these files?
3424 * bootstrap.conf (gnulib_modules): Add c-strcase.
3425 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
3426 c-strncasecmp.c.
3427 * src/getargs.c: Include c-strcase.h.
3428 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
3429 to avoid unspecified behavior.
3430
b2b81dae
JD
34312007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
3432
3433 * doc/bison.texinfo (Decl Summary): Correct typo.
3434
c1d19e10
PB
34352007-01-30 Paolo Bonzini <bonzini@gnu.org>
3436
3437 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
3438 Complain if the value does not match empty, "true" or "false".
3439 * data/c++.m4: Adjust default definitions of %define variables.
3440 * data/java.m4: Adjust default definitions of %define variables.
3441 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
3442 to above behavior.
3443 * tests/input.at (Boolean %define variables): Test new behavior.
3444
8405b70c
PB
34452007-01-29 Paolo Bonzini <bonzini@gnu.org>
3446
3447 * NEWS: Mention java.
3448 * TODO: Remove things that are done.
3449 * bootstrap.conf: Add javacomp-script and javaexec-script.
3450 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
3451
3452 * data/Makefile.am: Add new files.
3453 * data/java-skel.m4: New.
3454 * data/java.m4: New.
3455 * data/lalr1.java: New.
3456
3457 * doc/bison.texinfo: Put "A Complete C++ Example" under
3458 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
3459 under Other Languages.
3460
3461 * src/getargs.c (valid_languages): Add Java.
3462 * src/getargs.h (struct bison_language): Update size of string fields.
3463
3464 * tests/Makefile.am: Add java.at.
3465 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
3466 * tests/java.at: New.
3467 * tests/testsuite.at: Include it.
3468
3eb82471
JD
34692007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
3470
3471 Clean up.
3472 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
3473 at_directive_argv arguments so these no longer have to be global
3474 variables. Also, update the implementation for the following changes.
3475 (fail_for_at_directive_too_many_args,
3476 fail_for_at_directive_too_few_args): Add at_directive_name argument.
3477 (at_directive_name): Remove as at_directive_argv[0] will be used for
3478 this now.
3479 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
3480 for the directive name.
3481 (at_directive_argc, at_directive_argv): Make these local within
3482 skel_lex instead of global.
3483 (INITIAL): Update directive start action for above changes.
3484 (SC_AT_DIRECTIVE_ARG): Rename to...
3485 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
3486 (SC_AT_DIRECTIVE_SKIP_WS): Update.
3487 (scan_skel): Move yylex_destroy to...
3488 (skel_scanner_free): ... here.
3489 * tests/skeletons.at (installed skeleton file name): Rename to...
3490 (installed skeleton file names): ... this.
3491
148d66d8
JD
34922007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
3493
3494 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3495 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
3496 Summary" not "Directives".
3497 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
3498 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
3499 since the former is now the more complete one.
3500 (Prologue Alternatives): Likewise and do the same for %defines.
3501 (Table of Symbols): Add summary of %code, add summary of %define, and
3502 move full %code documentation to...
3503 (Decl Summary): ... here for consistency with other entries in these
3504 sections.
3505 Move %define entry in order to keep this list alphabetized.
3506 Reword %define entry a little to put less emphasis on the skeleton
3507 concept, which most users shouldn't have to think about.
3508
665f0c24
PE
35092007-01-26 Paul Eggert <eggert@cs.ucla.edu>
3510
3511 Adjust to recent gnulib changes.
3512 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
3513 Add string.h, string_.h, unistd_.h, wchar_.h.
3514 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
3515 * src/system.h: Don't include <stpcpy.h>; this is now done by
3516 <string.h>.
3517
592d0b1e
PB
35182007-01-23 Paolo Bonzini <bonzini@gnu.org>
3519
3520 Simplify implementation of unqualified %code, implement macros for
3521 uniform treatment of boolean %define flags. Document %define.
3522 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
3523 b4_percent_code_ifdef): New.
3524 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
3525 * data/c++.m4: Define default value for global_tokens_and_yystype.
3526 * data/glr.cc: Likewise.
3527 * data/location.cc: Use b4_percent_define_flag_if.
3528
148d66d8 3529 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
3530
3531 * src/parse-gram.y (Unqualified %code): Change muscle name to
3532 b4_percent_code().
3533 (content.opt): Default to empty.
3534
a7867f53
JD
35352007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3536
3537 Implement support for relative and absolute skeleton file names.
3538 Discussed starting at
3539 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
3540 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
3541 (Bison Options): Document in --skeleton entry.
3542 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
3543 full_skeleton can't necessarily hold all of pkgdatadir.
3544 If the specified skeleton file name contains a `/', don't prepend
3545 pkgdatadir.
3546 * src/parse-gram.y (prologue_declaration): If the specified skeleton
3547 file name contains a `/', prepend the grammar file directory.
3548 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
3549 * skeletons.at: New file.
3550 (relative skeleton file names): New test case.
3551 (installed skeleton file names): New test case.
3552 * tests/testsuite.at: Include skeletons.at.
3553
3554 * bootstrap: Update copyright to 2007.
3555
830c9b18
PB
35562007-01-17 Paolo Bonzini <bonzini@gnu.org>
3557
3558 * bootstrap: Remove occurrences of .#bootmp from the files.
3559
a8c2e813
AD
35602007-01-17 Akim Demaille <akim@epita.fr>
3561
3562 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
3563 nonterminals.
3564 Use per-type %printer.
3565
279cabb6
JD
35662007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3567
3568 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
3569 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3570 djgpp/config.site, src/files.c, src/files.h, src/main.c,
3571 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
3572 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
3573 tests/glr-regression.at, tests/input.at, tests/local.at,
3574 tests/output.at, tests/torture.at: Update copyright to 2007.
3575
bb32f4f2
AD
35762007-01-16 Akim Demaille <akim@epita.fr>
3577
3578 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
3579 error code.
3580 (Calc++ Scanner): Exit with failure if we can't open the input
3581 file.
3582 Accept "-" standing for stdin.
3583 (Calc++ Top Level): Print the result only if the parsing was
3584 successful.
3585
7cff04b5
AD
35862007-01-16 Akim Demaille <akim@epita.fr>
3587
3588 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
3589
a4e25e1d
JD
35902007-01-15 Paolo Bonzini <bonzini@gnu.org>
3591 and Joel E. Denny <jdenny@ces.clemson.edu>
3592
3593 Clean up %define and %code implementation in M4 some. Most
3594 importantly, rename all related macros to be in the b4_percent_define
3595 and b4_percent_code namespaces. Also, complete support for `.' in
3596 %define variable names and %code qualifiers.
3597 * data/bison.m4 (b4_check_user_names): Check for special
3598 "SKELETON-NAMESPACE(name)" macros instead of using two nested
3599 m4_foreach loops.
3600 (b4_get_percent_define, b4_get_percent_code): Rename to...
3601 (b4_percent_define_get, b4_percent_code_get): ... these.
3602 Extend documentation with examples.
3603 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
3604 b4_percent_define_skeleton_variables and
3605 b4_percent_code_skeleton_qualifiers.
3606 Expect any value for the %define variable `foo' to be stored in the
3607 macro named `b4_percent_define(foo)'; expect any %code blocks for the
3608 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
3609 expect any unqualified %code blocks to be stored in a macro named
3610 `b4_percent_code_unqualified'.
3611 Use m4_indir so that %define variable names and %code qualifiers can
3612 contain `.', which is allowed by the grammar parser.
3613 (b4_percent_define_default): New macro to set a default value for a
3614 %define variable.
3615 (m4_wrap): Update wrapped code, and fix some underquoting.
3616 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
3617 Expect grammar uses of %define variables and %code qualifiers to be
3618 defined in b4_percent_define_user_variables and
3619 b4_percent_code_user_qualifiers.
3620 * data/c++.m4: Use b4_percent_define_default rather than
3621 m4_define_default. Fix some underquoting. Skeleton usage of %define
3622 variable define_location_comparison now implies skeleton usage of
3623 %define variable filename_type.
3624 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3625 data/push.c, data/yacc.c: Update macro names.
3626 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
3627 muscle names.
3628
e37c665c
JMG
36292007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3630
3631 DJGPP specific issues.
3632
3633 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
3634 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
3635
7d2d521f
JD
36362007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3637
3638 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
3639 run parsers in all tests so that Valgrind is invoked during
3640 maintainer-check-valgrind.
3641 (Duplicate representation of merged trees): Free all semantic values.
3642 (Duplicated user destructor for lookahead): Likewise.
3643
e0ac9b4b
JD
36442007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3645
3646 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
3647 command-line prefix.
3648 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
3649 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
3650 miss Valgrind messages.
3651 (Exploding the Stack Size with Malloc): Likewise.
3652
78143faa
JD
36532007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3654
3655 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
3656 locals. Reported by Juan Manuel Guerrero at
3657 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
3658 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
3659 Fix some indentation also.
3660 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
3661 explaining this issue.
3662
7ecec4dd
JD
36632007-01-09 Paolo Bonzini <bonzini@gnu.org>
3664 and Joel E. Denny <jdenny@ces.clemson.edu>
3665
3666 Simplify union and prologue handling, and escape union and lex/parse
3667 params with digraphs.
3668 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
3669 values to the empty string since these are no longer guaranteed
3670 initialized by the front-end.
3671 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
3672 braces around b4_user_stype since this is no longer done by the
3673 front-end.
3674 * src/files.c, src/files.h (pre_prologue_obstack,
3675 post_prologue_obstack): Remove.
3676 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
3677 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
3678 with digraphs. This fixes lex params and parse params.
3679 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
3680 * src/output.c (prepare): Remove muscle insertion of the prologues.
3681 (output): Remove freeing of pre_prologue_obstack and
3682 post_prologue_obstack.
3683 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
3684 than prologue_augment for prologue parsing so you don't need prologue
3685 obstacks.
5c80250c
JD
3686 (grammar_declaration): For %union RHS, use `braceless' instead of
3687 "{...}" so that braces are already stripped and code is escaped with
3688 digraphs.
7ecec4dd
JD
3689 * src/reader.c (prologue_augment): Remove.
3690 (reader): Remove initialization of pre_prologue_obstack and
3691 post_prologue_obstack.
3692 * src/reader.h (prologue_augment): Remove.
3693
3694 * data/c.m4: Remove stray parenthesis.
3695
16dc6a9e
JD
36962007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3697
3698 Remove quotes from variables names in %define directives and from
3699 qualifiers in %code directives, and restrict the characters that are
3700 allowed in them to M4-friendly ones. For %define, continue to support
3701 the quoted form as a deprecated feature. Discussed starting at
3702 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
3703 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
3704 %code.
3705 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
3706 (Decl Summary): In %defines entry, update mention of `%code requires'
3707 and `%code provides'.
16dc6a9e
JD
3708 (C++ Location Values): Update %define uses.
3709 (Calc++ Parser Interface): Likewise.
3710 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 3711 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
3712 * src/parse-gram.y (prologue_declaration): For %define variables, use
3713 `variable' instead of `STRING'.
3714 (grammar_declaration): For %code qualifiers, use `ID' instead of
3715 `STRING'.
3716 (variable): New nonterminal that takes an `ID' or a `STRING'.
3717 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
3718 and %define uses.
3719 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
3720 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
3721 (%define errors): Update %define uses.
3722
e9813cd4
JD
37232007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3724
3725 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
3726 instead of muscle_insert for %define values so that M4-special
3727 characters are replaced with digraphs.
3728 * tests/input.at (%define errors): Extend to check weird values.
3729
6afc30cc
JD
37302007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3731
3732 Instead of having skeletons declare all valid %define variables and
3733 %code qualifiers, provide macros that retrieve the associated values
3734 and build these lists automatically. Thus Bison will now warn when a
3735 variable or qualifier is not used by the skeleton in the current
3736 invocation regardless of whether it might sometimes be used by that
3737 skeleton in other invocations. Also, move all %define value macros to
3738 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
3739 form, which is replaced by %code.
3740 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
3741 (b4_check_user_names): ... this, and change the series of valid name
3742 arguments to a single list argument for names used in the skeleton
3743 similar to the existing list argument for names used in the grammar.
3744 Warn instead of complaining.
3745 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
3746 values and %code code, to format %code code properly, and to build
3747 lists of all %define variables and %code qualifiers used in the
3748 skeleton: b4_skeleton_percent_define_variables and
3749 b4_skeleton_percent_code_qualifiers.
3750 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
3751 Remove, and...
3752 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
3753 the skeleton names lists can finish building first. In place of
3754 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
3755 expect the lists b4_user_percent_define_variables and
3756 b4_user_percent_code_qualifiers.
3757 * data/c++.m4: Where setting default values for b4_parser_class_name,
3758 b4_location_type, b4_filename_type, b4_namespace, and
3759 b4_define_location_comparison, update their names to the
3760 b4_percent_define_ namespace.
3761 * data/glr.c: Don't use b4_check_percent_define_variables and
3762 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3763 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
3764 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 3765 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
3766 * data/location.cc: Use b4_get_percent_define.
3767 * data/push.c: Don't use b4_check_percent_define_variables and
3768 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3769 * data/yacc.c: Likewise, and don't call m4_exit in
3770 b4_use_push_for_pull_if or m4_wrap code will never execute.
3771 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
3772 Rename to...
3773 (muscle_grow_user_name_list): ... this for consistency with the
3774 terminology used in bison.m4.
3775 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
3776 %define variable names, and rename muscle used_percent_define_variables
3777 to user_percent_define_variables.
3778 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
3779 user_percent_code_qualifiers.
3780 (content): Remove.
3781 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
3782 {CODE} form is no longer accepted.
3783 * tests/input.at (Reject bad %code qualifiers): Rename to...
3784 (Reject unused %code qualifiers): ... this, and update test output.
3785 (%define error): Update test output.
3786
7eb8a0bc
JD
37872007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
3788
3789 Check for unrecognized %define variables similar to checking for
3790 unrecognized %code qualifiers. Check for redefined %define variables.
3791 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
3792 generalizes...
3793 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
3794 (b4_check_percent_define_variables): New, also wraps it.
3795 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
3796 variables using b4_check_percent_define_variables.
3797 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
3798 all those exercised in the test suite and all those listed in the
3799 `Default values' section of c++.m4. Are there others?
3800 * data/push.c, data/yacc.c: Declare no valid %define variables.
3801 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
3802 similar to muscle_find, but it works even when the muscle stores a
3803 const value.
3804 (muscle_grow_used_name_list): New function for constructing the used
3805 name list muscles that b4_check_for_unrecognized_names requires.
3806 * src/parse-gram.y (prologue_declaration): Warn if a variable is
3807 %define'd more than once. Define the b4_used_percent_define_variables
3808 muscle with muscle_grow_used_name_list.
3809 (grammar_declaration): Abbreviate %code code with
3810 muscle_grow_used_name_list.
3811 * tests/input.at (%define errors): New.
3812
3fc65ead
JD
38132007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3814
3815 Provide warn_at, complain_at, and fatal_at function callbacks to the
3816 skeletons, and use this for %code qualifier complaints.
3817 * data/bison.m4 (b4_error_at): New, invoked by...
3818 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
3819 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
3820 @fatal_at(...@) directives.
3821 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
3822 qualifiers in b4_used_percent_code_qualifiers and to use
3823 b4_complain_at.
3824 * src/location.c, src/location.h (boundary_set_from_string): New global
3825 function.
3826 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
3827 function.
3828 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
3829 to b4_used_percent_code_qualifiers.
3830 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
3831 function.
3832 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
3833 (lineno): Rename to...
3834 (out_lineno): ... this so I don't misunderstand it again.
3835 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
3836 here; these newlines are in the input but not the output file.
3837 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
3838 (at_directive_perform): ... this new static function, and add handling
3839 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
3840 directives.
3841 * tests/input.at (Reject bad %code qualifiers): Update test output with
3842 locations and extend.
3843
3844 * tests/output.at (Output file name: [, Output file name: ]): Remove
3845 bogus comment about these tests failing.
3846
1c7b7e1d
JD
38472007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3848
3849 Clean up b4_check_percent_code_qualifiers a little.
3850 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
3851 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
3852 documentation and add examples.
3853 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
3854 qualifiers here.
3855
08af01c2
JD
38562007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3857
3858 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
3859 unreliable -- especially when they're hidden inside another macro.
3860 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
3861 data/c.m4: Remove m4_divert(-1).
3862 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3863 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
3864 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 3865 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
3866 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
3867 pushed and popped by m4sugar, should be first on the stack.
3868
3869 Provide warn, complain, and fatal function callbacks to the skeletons.
3870 This provides more flexibility than m4_fatal, improves the error
3871 message format, and captures messages for translation. Discussed
3872 starting at
3873 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
3874 * data/bison.m4 (b4_error): New, invoked by...
3875 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
3876 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
3877 directives. Because these M4 macros might be called when the current
3878 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
3879 the previous removal of uses of m4_divert, which caused trouble.
3880 (b4_check_percent_code_qualifiers): Use b4_complain instead of
3881 m4_fatal to report unrecognized %code qualifiers.
3882 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
3883 push parser requests.
3884 * data/glr.c: Use b4_complain instead of m4_fatal to report
3885 non-deterministic push parser requests.
3886 Update @output usage to @output(...@) form.
3887 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
3888 report missing %defines. Update @output usage to @output(...@) form.
3889 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
3890 @output(...@) form.
3891 * src/main.c (main): Invoke skel_scanner_free.
3892 * src/scan-skel.h (skel_scanner_free): Prototype new function.
3893 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
3894 obstack_for_string from flex-scanner.h.
3895 (YY_DECL): Use to declare skel_lex static.
3896 (decode_at_digraphs): Remove; now handled in the new
3897 SC_AT_DIRECTIVE_ARG start condition.
3898 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
3899 functions.
3900 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
3901 at_directive_argv): New static globals.
3902 (INITIAL): Use fail_for_invalid_at.
3903 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
3904 recognize the start of a generalized `@directive(...@)' form and
3905 start...
3906 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
3907 directive args (using the new obstack_for_string), to decode the
3908 contained @ diagraphs, and to perform the directive. It recognizes
3909 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
3910 @output(...@).
3911 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
3912 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
3913 `@,'.
3914 (scan_skel): Initialize obstack_for_string on the first call.
3915 (skel_scanner_free): New function to free obstack_for_string.
3916 * tests/input.at (Reject bad %code qualifiers): Update test output.
3917
8e0a5e9e
JD
39182007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
3919
3920 Consolidate the 4 prologue alternative directives (%code, %requires,
3921 %provides, and %code-top) into a single %code directive with an
3922 optional qualifier field. Discussed at
3923 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
3924 * NEWS (2.3a+): Rewrite the existing entry for the prologue
3925 alternatives.
3926 * doc/bison.texinfo (Prologue Alternatives): Update.
3927 (Decl Summary): Update to %code "requires" and %code "provides".
3928 (Calc++ Parser): Update to %code "requires".
148d66d8 3929 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
3930 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
3931 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
3932 are replaced by b4_percent_code_provides and b4_percent_code_requires,
3933 which are skeleton-specific.
3934 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
3935 declare what %code qualifiers it supports and to complain if any other
3936 qualifiers were used in the grammar.
3937 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
3938 and b4_user_code([b4_percent_code_provides]) in place of
3939 b4_user_requires and b4_user_provides.
3940 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
3941 Add b4_user_code([b4_percent_code_top]) and
3942 b4_user_code([b4_percent_code]).
3943 Invoke b4_check_percent_code_qualifiers.
3944 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3945 PERCENT_REQUIRES): Remove.
3946 (grammar_declaration): Remove RHS's for %code-top, %provides, and
3947 %requires. Rewrite the %code RHS as the unqualified form defining the
3948 muscle b4_percent_code. Add another RHS for the qualified %code form,
3949 which defines muscles of the form b4_percent_code_QUALIFIER and the
3950 b4_used_percent_code_qualifiers muscle.
3951 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3952 PERCENT_REQUIRES): Remove.
3953 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
3954 %code "requires" and %code "provides".
3955 * tests/input.at (Reject bad %code qualifiers): New.
3956
95021767
JD
39572007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3958
3959 Use the new code_props interface for destructors and printers.
3960 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
3961 printer_location members, and change the type of the destructor and
3962 printer members to code_props.
3963 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
3964 symbol_printer_get, semantic_type_destructor_set,
3965 semantic_type_printer_set, default_tagged_destructor_set,
3966 default_tagless_destructor_set, default_tagged_printer_set,
3967 default_tagless_printer_set): Use code_props in arguments and return
3968 types in place of char const * and location.
3969 (symbol_destructor_location_get, symbol_printer_location_get): Remove
3970 since the locations are now contained in the return of
3971 symbol_destructor_get and symbol_printer_get.
3972 * src/output.c (symbol_destructors_output, symbol_printers_output):
3973 Replace with...
3974 (symbol_code_props_output): ... this to eliminate duplicate code.
3975 (output_skeleton): Update to use symbol_code_props_output.
3976 * src/reader.c (symbol_should_be_used): Update use of
3977 symbol_destructor_get.
3978 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3979 Update uses of the various _destructor_set and _printer_set functions.
3980 * src/symtab.c: (default_tagged_destructor_location,
3981 default_tagless_destructor_location, default_tagged_printer_location,
3982 default_tagless_printer_location): Remove since we...
3983 (default_tagged_destructor, default_tagless_destructor,
3984 default_tagged_printer, default_tagless_printer): ... change the type
3985 of these to code_props.
3986 (symbol_new, semantic_type_new, symbol_destructor_set,
3987 semantic_type_destructor_set, symbol_destructor_get,
3988 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
3989 symbol_check_alias_consistency, default_tagged_destructor_set,
3990 default_tagless_destructor_set, default_tagged_printer_set,
3991 default_tagless_printer_set): Update.
3992 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
3993 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
3994 code_props members.
3995 (symbol_print): Use SYMBOL_CODE_PRINT.
3996
f6857bbf
JD
39972007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3998
3999 Use the new code_props interface for rule actions.
4000 * src/symlist.h (symbol_list): Replace action, action_location, and
4001 used members with a code_props action_props member.
4002 * src/reader.c (symbol_should_be_used, grammar_rule_check,
4003 grammar_midrule_action, grammar_current_rule_merge_set,
4004 grammar_current_rule_symbol_append, packgram): Update.
4005 * src/scan-code.h (translate_rule_action): Remove, no longer used.
4006 * src/scan-code.l (handle_action_dollar): Update.
4007 (translate_rule_action): Remove, no longer used.
4008 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
4009
7c0c6181
JD
40102007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4011
4012 Use the new code_props interface in parse-gram.y.
4013 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
4014 Update all uses of translate_* functions to use the new code_props
4015 interface and to use gram_scanner_last_string_free and
4016 code_scanner_last_string_free where possible.
4017 (grammar_declaration): symbol_list_destructor_set and
4018 symbol_list_printer_set now perform the translation, so don't do it
4019 here. Use gram_scanner_last_string_free where possible.
4020 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
4021 translate_code): Remove, no longer used.
4022 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
4023 symbol_list_printer_set): Perform code translation here rather than
4024 depending on the caller to do so.
4025
4026 * src/symlist.h (struct symbol_list): Correct some documentation typos.
4027 * src/scan-gram.h (gram_last_string): Remove declaration.
4028 * src/scan-gram.l (last_string): Declare it static.
4029
28e52c0d
JD
40302007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4031
4032 Encapsulate code properties and related functionality for the various
4033 destructors, printers, and actions into a code_props structure and
4034 interface. This patch merely implements code_props in scan-code.h and
4035 scan-code.l. Future patches will rewrite other modules to use it.
4036 Discussed starting at
4037 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
4038 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
4039 consistently initialize const structs that have an empty location
4040 field.
4041 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
4042 to ensure consistency.
4043 * src/scan-code.h (code_props): New structure.
4044 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
4045 function, macro, and const global variable for initializing a
4046 code_props with no code.
4047 (code_props_plain_init, code_props_symbol_action_init,
4048 code_props_rule_action_init, code_props_translate_code): The rest of
4049 the new code_props functional interface. Among other things, the init
4050 functions set the code_props kind field so that
4051 code_props_translate_code will know whether to behave like
4052 translate_symbol_action, translate_rule_action, or translate_code.
4053 These old translate functions must remain until all other modules are
4054 updated to use the new code_props interface.
4055 (code_scanner_last_string_free): New function similar to
4056 gram_scanner_last_string_free.
4057 (code_scanner_free): Add documentation.
4058 * src/scan-code.l: Implement the new interface.
4059 (code_lex): Make it static, add a code_props* argument, and remove the
4060 rule argument.
4061 (last_string): New static global similar to the one in scan-gram.l.
4062 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
4063 instead of rule.
4064 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
4065 code_props since Bison may one day use this information for destructors
4066 and printers.
4067 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
4068 (handle_action_dollar): Use symbol_list_n_get and set used flag
4069 directly since symbol_list_n_used_set is removed.
4070 (translate_action): Add a code_props* argument and remove the rule,
4071 action, and location arguments. Pass the code_props* on to code_lex.
4072 (translate_rule_action, translate_symbol_action, translate_code):
4073 Rewrite as wrappers around the new code_props interface.
4074 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
4075 it would eventually need to break the encapsulation of code_props.
4076
96034983
JD
40772007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4078
4079 * etc/.cvsignore: New.
4080
945e396c
JD
40812007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4082
4083 Add maintainer-push-check to run maintainer-check using push parsing in
4084 place of pull parsing where available.
4085 * Makefile.am (maintainer-push-check): New.
4086 * data/bison.m4 (b4_use_push_for_pull_if): New.
4087 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
4088 appropriately based on their existing values.
4089 (yypush_parse): Don't print push-parser-specific diagnostics if push
4090 parsing is being used in place of pull parsing.
4091 * data/yacc.c: If push parsing should replace pull parsing, redirect to
4092 push.c.
4093 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
4094 variable, and insert b4_use_push_for_pull_flag into muscles.
4095 * tests/Makefile.am (maintainer-push-check): New.
4096
7d596384
JD
40972006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4098
4099 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
4100 (whether successful or failed) so that yypush_parse can be invoked
4101 again to start a new parse using the same yypstate.
4102 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
4103 check multiple yypull_parse invocations on the same yypstate. For pull
4104 mode, extend to check multiple yyparse invocations.
4105 (Exploding the Stack Size with Alloca): Extend to try with
4106 %push-pull-parser.
4107 (Exploding the Stack Size with Malloc): Likewise.
4108
4109 * tests/calc.at (Simple LALR Calculator): Don't specify
4110 %skeleton "push.c" since %push-pull-parser implies that now.
4111 * tests/headers.at (export YYLTYPE): Don't check for the push
4112 declarations. Otherwise, this test case can't be used to see if push
4113 mode can truly emulate pull mode.
4114 * tests/input.at (Torturing the Scanner): Likewise.
4115 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
4116 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
4117 AT_YACC_IF, which now includes the case of push mode since %skeleton
4118 need not be used for push mode. This will be more intuitive once
4119 push.c is renamed to yacc.c.
4120
7172e23e
JD
41212006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4122
4123 For push mode, convert yyparse from a macro to a function, invoke yylex
4124 instead of passing a yylexp argument to yypull_parse, and don't
4125 generate yypull_parse or yyparse unless %push-pull-parser is declared.
4126 Discussed starting at
4127 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
4128 * data/bison.m4 (b4_pull_if): New.
4129 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
4130 * data/push.c: Improve M4 quoting a little.
4131 (b4_generate_macro_args, b4_parenthesize): Remove.
4132 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
4133 any time a pull parser is requested.
4134 Don't #define this as a wrapper around yypull_parse. Instead, when
4135 both push and pull are requested, make it a function that does that
4136 same thing.
4137 (yypull_parse): If there's a b4_prefix, #define this to
4138 b4_prefix[pull_parse] when both push and pull are requested.
4139 Don't define this as a function unless both push and pull are
4140 requested.
4141 Remove the yylexp argument and hard-code yylex invocation instead.
4142 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
4143 %push-parser.
4144 * src/getargs.c (pull_parser): New global initialized to true.
4145 * getargs.h (pull_parser): extern it.
4146 * src/output.c (prepare): Insert pull_flag muscle.
4147 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
4148 (prologue_declaration): Set both push_parser and pull_parser = true for
4149 %push-pull-parser. Set push_parser = true and pull_parser = false for
4150 %push-parser.
4151 * src/scan-gram.l: Don't accept %push_parser as an alternative to
4152 %push-parser since there's no backward-compatibility concern here.
4153 Scan %push-pull-parser.
4154 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
4155 instead of %push-parser.
4156 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
4157 prototype it in the module that calls yyparse.
4158 * tests/input.at (Torturing the Scanner): Likewise.
4159 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
4160
2e7944cb
JD
41612006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
4162
4163 Update etc/bench.pl. Optimize push mode a little (the yyn change
4164 deserves most of the credit).
4165 * Makefile.am (SUBDIRS): Add etc subdirectory.
4166 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
4167 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
4168 yytoken, yyval, and yyloc declarations to...
4169 (yyparse or yypush_parse): ... here to improve performance. For
4170 yypush_parse invocations after the first, be sure to assign yyn its old
4171 value again.
4172 (yypstate_new): Don't bother initializing the yyresult field since the
4173 initial value isn't used.
4174 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
4175 remove the #define that, in push mode, set it to yyps->NAME.
4176 * etc/Makefile.am: New.
4177 * etc/bench.pl: Remove and build it instead from...
4178 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
4179 "tests/bison" from the build directory by default rather than just
4180 invoking "bison" from $PATH.
4181 (calc_grammar): Update push parser code: don't declare yylval globally,
4182 don't define yyparse_wrapper, and don't #define yyparse.
4183 (bench_grammar): Update to check all working combinations of yacc.c,
4184 push.c, impure, pure, pull, and push.
4185
c3d50342
JD
41862006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4187
4188 For push mode, add pull wrappers around yypush_parse.
4189 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
4190 (yypull_parse): New function wrapping yypush_parse.
4191 (yyparse): New #define wrapping yypull_parse.
4192 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
4193 is declared.
4194 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
4195 prototype yylex in the module that calls yyparse, and don't prototype
4196 yyparse there. Otherwise, the yyparse expansion won't compile.
4197 * tests/input.at (Torturing the Scanner): Likewise.
4198
94ebeba5
JD
41992006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4200
4201 Enable push parsers to operate in impure mode. Thus, %push-parser no
4202 longer implies %pure-parser. The point of this change is to move
4203 towards being able to test the push parser code by running the entire
4204 test suite as if %push-parser had been declared.
4205 * data/push.c (yypush_parse): For impure mode, remove the
4206 yypushed_char, yypushed_val, and yypushed_loc arguments.
4207 Instead, declare these as local variables initialized to the global
4208 yychar, yylval, and yylloc.
4209 For the first yypush_parse invocation only, restore the initial values
4210 of these global variables when it's time to read a token since they
4211 have been overwritten.
4212 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
4213 %push-parser.
4214 * tests/calc.at (Simple LALR(1) Calculator): Always declare
4215 %pure-parser along with %push-parser since this test case was designed
4216 for pure push parsers.
4217 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
4218 (AT_YACC_OR_PUSH_IF): New.
4219 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
4220 add a note that it's still wrong for some cases (as it has been for a
4221 while).
4222 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
4223 %push-parser no longer implies %pure-parser.
4224
a0633178
JD
42252006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4226
4227 Remove some unnecessary differences between the pull parser code and
4228 the push parser code. This patch enables yynerrs in push mode.
4229 * data/push.c: Reformat M4 a little.
4230 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
4231 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
4232 because push mode is on. Instead, if pure mode is on, move yynerrs
4233 to...
4234 (b4_declare_parser_state_variables): ... here.
4235 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
4236 to yyps->NAME so it can be used in yypush_parse.
4237 (yypush_parse): Don't omit uses of yynerrs in push mode.
4238
8646b6a3
JD
42392006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4240
4241 Fix bug such that the first pushed token's value and location are
4242 sometimes overwritten (sometimes by %initial-action) before being used.
4243 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
4244 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
4245 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
4246 more closely mimic the pull parser logic.
4247 Don't copy the pushed token to yychar, yylval, and yylloc until it's
4248 time to read a token, which is after any initialization of yylval and
4249 yylloc.
4250 (gottoken): Rename label to...
4251 (yyread_pushed_token): ... for clarity and to avoid infringing on the
4252 user namespace.
4253
9baf4d74
JD
42542006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4255
4256 Rearrange initialization of the parser state variables so that the
4257 skeleton doesn't have to have a copy for pull mode and another for push
4258 mode. This patch also fixes at least a bug such that yylloc was not
4259 initialized (with b4_location_initial_line and
4260 b4_location_initial_column) upon calling yypush_parse. However, that
4261 initialization now overwrites the first token's location;
4262 %initial-action assigning @$ already did the same thing, and both bugs
4263 will be fixed in a later patch.
4264 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
4265 (b4_declare_parser_state_variables): Remove initialization of yytoken,
4266 yyss, yyvs, yyls, and yystacksize.
4267 (yypstate_new): Remove initialization of some yypstate fields: yystate,
4268 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
4269 yylsp.
4270 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
4271 yyps->NAME so it can be used in yypush_parse.
4272 (yyparse or yypush_parse): For yypush_parse, don't print the
4273 "Starting parse" diagnostic for invocations after the first.
4274 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
4275 yypush_parse, only do it for the first invocation.
4276 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
4277 initialization to occur in yypush_parse but only on the first
4278 invocation.
4279
23522164
JD
42802006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4281
4282 * data/push.c: Add CPP guards around push parser declarations in both
4283 the header and the code file.
4284 In the code file, move the push parser declarations to the same place
4285 they appear in the header file.
4286 Clean up the M4 some, especially the inconsistent underquoting in
4287 some b4_c_function_def and b4_c_function_decl uses.
4288
bb010fe5
JD
42892006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4290
4291 Encapsulate the push parser state variables into an M4 macro so the
4292 push skeleton doesn't have to list them again for pull mode's yyparse.
4293 For push mode, remove yypush_parse's local equivalents of these
4294 variables to eliminate unnecessary copying between the two sets at
4295 run-time. This patch also fixes at least a bug related to multiple
4296 %initial-action invocations in push mode.
4297 * data/push.c (b4_declare_parser_variables): Rename to...
4298 (b4_declare_scanner_communication_variables): ... this for clarity and
4299 update both uses.
4300 (b4_declare_yyparse_variables): Remove and move its contents to the one
4301 spot where it was invoked.
4302 (b4_declare_parser_state_variables): New macro containing the parser
4303 state variables required by push mode.
4304 (struct yypstate): Replace all fields but yynew with
4305 b4_declare_parser_state_variables.
4306 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
4307 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
4308 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
4309 (yyparse or yypush_parse): For yyparse in pull mode, replace local
4310 parser state variable declarations with
4311 b4_declare_parser_state_variables.
4312 Don't initialize parser state variables when calling yypush_parse since
4313 yypstate_new already does that.
4314 Invoke the user's initial action only upon the first yypush_parse
4315 invocation.
4316 Remove all code that copies between the local parser state variables
4317 and the yypstate.
4318
2d212f8c
JD
43192006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4320
4321 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
4322 prevent a name collision in a future patch where these names will
4323 sometimes be #define'd.
4324 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
4325 since it no longer has the same name as the existing argument.
4326 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
4327
e6e704dc
JD
43282006-12-19 Paolo Bonzini <bonzini@gnu.org>
4329 and Joel E. Denny <jdenny@ces.clemson.edu>
4330
4331 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4332 that the argument is case-insensitive, and there's no `=' here.
4333 For the %skeleton entry, mention that %language is better.
4334 (Bison Options): Likewise for --language and --skeleton. Move the
4335 --skeleton entry so that the `Tuning the parser' section is sorted
4336 alphabetically on long options.
4337 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
4338 %language directive in detail here; cross-reference the %language
4339 documentation instead.
4340 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
4341 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 4342 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
4343 * examples/extexi (normalize): Instead of replacing every %require
4344 argument with the current Bison version, just substitute for
4345 `@value{VERSION}'. This guarantees that we're testing what actually
4346 appears in the documentation.
4347 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
4348 rather than `@VERSION@'.
4349
0e021770
PE
43502006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4351
fd575f05
PE
4352 * NEWS: Reword the %language news a bit, and put it earlier.
4353
0e021770
PE
4354 * src/getargs.c (skeleton_arg): Last arg is now location const *.
4355 Rewrite to simplify the logic.
4356 (language_argmatch): Likewise.
fd575f05
PE
4357 (program_name): We now own this var.
4358 * src/getargs.h (struct bison_language): Use char[] rather than
4359 const char *.
0e021770
PE
4360
4361 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
4362 Java is supported.
4363 * src/complain.c (program_name): Remove decl; no longer needed.
4364 * src/main.c (program_name): Remove; now belongs to getargs.
4365
43662006-12-18 Paolo Bonzini <bonzini@gnu.org>
4367
4368 * NEWS: Document %language.
4369
4370 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
4371
4372 * data/c-skel.m4, data/c++-skel.m4: New files.
4373 * data/glr.c: Complain on push parsers.
4374
4375 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
4376 over %skeleton.
148d66d8 4377 (Decl Summary): Document %language and %skeleton.
0e021770
PE
4378 (Command line): Document -L.
4379
4380 * examples/extexi: Rewrite %require directive.
4381 * examples/calc++/Makefile.am: Pass VERSION to extexi.
4382
4383 * src/files.c (compute_exts_from_gc): Look in language structure
4384 for .y extension.
4385 (compute_file_name_parts): Check whether .tab should be added.
4386 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
4387 (language, skeleton_arg, language_argmatch): New.
4388 (long_options): Add --language.
4389 (getargs): Use skeleton_arg, add -L/--language.
4390 * src/getargs.h: Include location.h.
4391 (struct bison_language, language, skeleton_arg, language_argmatch): New.
4392 * src/output.c (prepare): Pick default skeleton from struct language.
4393 Don't dispatch C skeletons here.
4394 * src/parse-gram.y (PERCENT_LANGUAGE): New.
4395 (prologue_declaration): Add "%language" rule, use skeleton_arg.
4396 * src/scan-gram.l ("%language"): New rule.
4397
4398 * tests/calc.at: Test %skeleton and %language.
4399 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
4400 (AT_GLR_IF): Look for %skeleton "glr.cc".
4401 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
4402 (AT_YACC_IF): Reject %language.
4403
5691bf57
PE
44042006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4405
db06f0ce
PE
4406 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
4407 since it wasn't used; only the typedef name 'semantic_type' is needed.
4408 Also, omit trailing white space.
4409
5691bf57
PE
4410 * bootstrap: Sync from coreutils.
4411 (gnulib_extra_files): Add build-aux/announce.gen.
4412 (slurp): Adjust .gitignore files like .cvsignore files.
4413 * build-aux/announce-gen: Remove from CVS, since bootstrap
4414 now creates this.
4415
791934e4
JD
44162006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
4417
4418 Make %push-parser imply %pure-parser. This fixes several bugs; see
4419 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
4420 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
4421 pure_parser = true.
4422 * data/push.c: Don't bother testing b4_push_if when deciding whether
4423 to expand b4_declare_parser_variables globally.
4424 (yypush_parse): Likewise in here.
4425
4426 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
4427 (yy_reduce_print): Reformat M4 for readability.
4428
ee5abb37
JD
44292006-12-15 Bob Rossi <bob@brasko.net>
4430 and Joel Denny <jdenny@ces.clemson.edu>
4431
4432 * data/push.c (yypstate): Add typedef, and update all uses of
4433 struct yypstate to just yypstate.
4434 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
4435
16ca01f9
JD
44362006-12-14 Bob Rossi <bob@brasko.net>
4437
4438 * data/push.c (yypush_parse): Declare prototype regardless of
4439 %locations option.
4440
ab8e7e1a
JD
44412006-12-14 Bob Rossi <bob@brasko.net>
4442
4443 * data/push.c (yyparse): Remove the prototype and the #define when in
4444 push-parser mode.
4445
9bf32be3
JD
44462006-12-13 Bob Rossi <bob@brasko.net>
4447
4448 * data/push.c (yypstate_init): Rename to...
4449 (yypstate_new): ... this and use b4_c_function_def.
4450 (yypstate_delete): New.
4451 (yypush_parse): Change parameters yynval and yynlloc to be const.
4452 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
4453 yypstate_delete functions.
4454
f02e2948
JD
44552006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
4456
4457 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
4458 strange test case titles. Reported by Bob Rossi.
4459
38eb7751
PE
44602006-12-13 Paul Eggert <eggert@cs.ucla.edu>
4461
4462 * TODO: Add pointer to Sylvain Schmitz's work on static detection
4463 of potential ambiguities in GLR grammers.
4464
bd9d212b
JD
44652006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
4466
4467 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
4468 `bison ', use m4_index instead of m4_substr since chopping up a string
4469 containing M4-special characters causes problems here.
4470
4471 Fix a couple of bugs related to special characters in user-specified
4472 file names, and make it easier for skeletons to compute output file
4473 names with the same file name prefix as Bison-computed output file
4474 names.
4475 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
4476 b4_parser_file_name and b4_spec_defines_file instead of
4477 @output_parser_name@ and @output_header_name@, which are now redundant.
4478 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
4479 b4_parser_file_name, b4_spec_defines_file, and the new
4480 @basename(FILENAME@) instead of @output_parser_name@ and
4481 @output_header_name@, which inappropriately escaped the file names as
4482 C string literals.
4483 * src/files.c (all_but_ext): Remove static qualifier.
4484 (compute_output_file_names): Move `free (all_but_ext)' to...
4485 (output_file_names_free): ... here since all_but_ext is needed later.
4486 * src/files.h (all_but_ext): Extern.
4487 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
4488 exactly what MUSCLE_INSERT_STRING used to do.
4489 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
4490 characters are escaped properly.
4491 * src/output.c (prepare): Define muscle file_name_all_but_ext as
4492 all_but_ext.
4493 For pkgdatadir muscle, maintain previous functionality by using
4494 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
4495 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
4496 digraphs would never be expanded. Hopefully no one has M4-special
4497 characters in his Bison installation path.
4498 * src/scan-skel.l: Don't parse @output_header_name@ and
4499 @output_parser_name@ anymore since they're now redundant.
4500 In @output, use decode_at_digraphs.
4501 Parse a new @basename command that invokes last_component.
4502 (decode_at_digraphs): New.
4503 (BASE_QPUTS): Remove unused.
4504 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
4505 (Output file name): New tests.
4506
3f7ca628
JD
45072006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
4508
4509 Warn about output files that are generated by the skeletons and that
4510 conflict with other output files.
4511 * data/glr.c: Don't generate the header file here when glr.cc does.
4512 * src/files.c (file_names, file_names_count): New static globals.
4513 (compute_output_file_names): Invoke output_file_name_check for files
4514 not generated by the skeletons and remove existing checks.
4515 (output_file_name_check): New function that warns about conflicting
4516 output file names.
4517 (output_file_names_free): Free file_names.
4518 * src/files.h (output_file_name_check): Declare.
4519 * src/scan-skel.l: Invoke output_file_name_check for files generated by
4520 the skeletons.
4521 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
4522 (Conflicting output files): New tests.
4523
178e123e
PE
45242006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4525
4526 * doc/bison.texinfo: Fix a couple of typos.
4527
45282006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
4529
4530 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
4531 Rename to...
4532 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
4533 update all uses.
4534 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
4535 (yypush_parse): Rename yypvars argument to yyps and remove redundant
4536 local pv.
4537 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
4538 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
4539
ea17f233
JD
45402006-12-07 Bob Rossi <bob@brasko.net>
4541 and Joel Denny <jdenny@ces.clemson.edu>
4542
4543 * data/push.c (yypvarsinit): Change return type from void* to struct
4544 yypvars*. No longer cast to void* on return.
4545 (struct yypvars): Remove yylen since it need not be remembered between
4546 yypushparse invocations.
4547 (yypushparse): Don't copy between yylen and pv->yylen.
4548
55a30bda
JD
45492006-12-05 Bob Rossi <bob@brasko.net>
4550
4551 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
4552 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
4553 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
4554 (struct yypvars): Remove b4_declare_parser_variables.
4555 (yypvarsinit): Remove init code for removed variables.
4556 (global scope): Do not declare b4_declare_parser_variables if
4557 push or pure mode.
4558 (yypushparse): Add b4_declare_parser_variables.
4559 Init new local variables, and remove init code for removed
4560 yypvars variables.
4561 (yyparse): Delete.
4562 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
4563 and yyparse for other modes.
4564 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
4565 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
4566 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
4567 (AT_PURE_LEX_IF): True if pure or push parser.
4568
85894313
JD
45692006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
4570
4571 Document Yacc prologue alternatives and default %destructor's and
4572 %printer's as experimental. Don't mention Java yet. Discussed at
4573 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
4574 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
4575 (2.3a): Annotate this entry to say the old forms of these features were
4576 also experimental.
4577 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 4578 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
4579 of Java (we'll want this back eventually).
4580
02975b9a
JD
45812006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4582
4583 Support a file name argument to %defines. Deprecate `=' in
4584 %file-prefix, %name-prefix, and %output. Discussed at
4585 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
4586 * NEWS (2.3a+): Mention.
148d66d8 4587 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
4588 form of %defines, and remove `=' from entries for %file-prefix,
4589 %name-prefix, and %output.
4590 * src/parse-gram.y (prologue_declaration): Implement.
4591 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
4592 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
4593 all but one occurrence of %name-prefix.
4594 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
4595 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
4596 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
4597 occurrence of each of %file-prefix and %output. Add check for %defines
4598 with argument.
4599 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
4600 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
4601 Remove the `=' from %output.
4602
287b314e
JD
46032006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
4604
4605 Don't escape $ in test case titles since Autoconf 2.61 now does that
4606 correctly.
4607 * tests/actions.at (Default %printer and %destructor are not for error
4608 or $undefined): Here.
4609 (Default %printer and %destructor are not for $accept): Here.
4610 * tests/input.at (Invalid $n and @n): Here.
4611
3ebecc24
JD
46122006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
4613
4614 Rename <!> to <>. Discussed starting at
4615 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
4616 * NEWS (2.3a+): Update.
148d66d8 4617 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
4618 Update.
4619 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
4620 * src/scan-gram.l (INITIAL): Implement.
4621 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
4622 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
4623 comment.
4624 * tests/actions.at (Default tagless %printer and %destructor,
4625 Default tagged and per-type %printer and %destructor,
4626 Default %printer and %destructor are not for error or $undefined,
4627 Default %printer and %destructor are not for $accept,
4628 Default %printer and %destructor for mid-rule values): Update.
4629 * tests/input.at (Default %printer and %destructor redeclared,
4630 Unused values with default %destructor): Update.
4631
26b8a438
JD
46322006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
4633
4634 Don't let %prec take a nonterminal.
4635 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
4636 token.
4637 * tests/input.at (%prec takes a token): New test checking that %prec
4638 won't take a nonterminal.
4639
07c39ae9
JD
46402006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4641
405d53b7
JD
4642 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
4643 it was double-quoted.
07c39ae9
JD
4644 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
4645 grammar is maintained with Bison's highest standards.
4646 * src/getargs.c: Fix some typos in Doxygen comments.
4647
580b8926
JD
46482006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4649
4650 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
4651 later. Reported by Paul Eggert in
4652 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
4653 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
4654 * src/scan-code.l (translate_action): Don't bother invoking
4655 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
4656 (code_scanner_free): Instead of invoking
4657 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
4658 which frees more.
4659 * src/scan-gram.l (gram_scanner_free): Likewise.
4660 * src/scan-skel.l (scan_skel): Likewise.
4661
4502eadc
JD
46622006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4663
4664 * src/files.c (tr): Change return type to void.
4665 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
4666 has been called previously for the same key.
4667 (muscle_find): Return storage instead of value so that
4668 --enable-gcc-warnings doesn't produce warnings that the return discards
4669 const. aver that the value and storage are the same since storage
4670 could potentially be NULL when value is not.
4671 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
4672 same as 0.
4673
7746c8f6
PE
46742006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4675
4676 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
4677 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
4678 us a slightly cleaner distribution, and also works.
4679 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
4680 gnulib changes.
4681
eb095650
PE
46822006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
4683 and Paul Eggert <eggert@cs.ucla.edu>
4684
4685 Don't let Bison leak memory except when it complains.
4686 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
4687 (spec_defines_file, dir_prefix): Now char *, not const char *,
4688 since they are freed.
4689 * src/files.c: Likewise.
4690 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
4691 Likewise.
4692 (tr): Now operates in-place. All uses changed.
4693 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
4694 values.
4695 (compute_file_name_parts, compute_output_file_names): Don't store
4696 read-only data in variables that will be freed.
4697 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
4698 src_extension, and header_extension.
4699 (output_file_names_free): New public function to free
4700 spec_verbose_file, spec_graph_file, spec_defines_file,
4701 parser_file_name, and dir_prefix.
4702 * src/getargs.c (getargs): Don't store read-only data in variables that
4703 will be freed.
4704 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
4705 (which previously existed but was unused), and quotearg_free.
4706 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
4707 * src/muscle_tab.c: Likewise.
4708 (muscle_entry): Make the value char const *,
4709 and add a new storage member that is char * and can be freed.
4710 (muscle_entry_free): New private function.
4711 (muscle_init): Use it instead of free.
4712 (muscle_insert, muscle_grow): Update and use new storage member.
4713 (muscle_code_grow): Free the string passed to muscle_grow
4714 since it's not needed anymore.
4715 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
4716 add a new `char *code' member.
4717 ("{...}"): Declare semantic type as code.
4718 * src/scan-code.h (translate_rule_action):
4719 (translate_symbol_action, translate_code, translate_action): Return
4720 `char const *' rather than `char *' since external code should not free
4721 these strings.
4722 * src/scan-code.l: Likewise.
4723 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
4724 which is "{...}" in the parser.
4725 * tests/Makefile.am (maintainer-check-valgrind): Set
4726 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
4727 Valgrind.
4728 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
4729 complain.
4730 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
4731 expecting a non-zero exit status sets --leak-check=summary and
4732 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
4733 this case, and we don't want to hear about it.
4734
ac564be4
PE
47352006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4736
4737 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
4738 instead of from the template, to simplify configuration a bit.
4739 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
4740 and m4/wint_t.m4, as they are needed with the latest gnulib.
4741
17bd8a73
JD
47422006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4743
4744 Disable unset/unused mid-rule value warnings by default, and recognize
4745 --warnings=midrule-values to enable them. Discussed starting at
4746 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
4747 * NEWS (2.3a+): Mention.
4748 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
4749 warnings): Add entry for midrule-values subargument.
4750 * src/reader.c (symbol_should_be_used): Don't return true just because
4751 the value is a set/used mid-rule value unless
4752 --warnings=midrule-values was specified.
4753 * tests/input.at (Unused values, Unused values before symbol
4754 declarations): Run tests with and without --warnings=midrule-values.
4755
4756 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
4757 than LIST_FREE directly.
4758
89eb3c76
JD
47592006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4760
4761 Finish implementing --warnings=error, which should not be implied by
4762 --warnings=all (or by its synonyms -W and --warnings without
4763 subarguments).
4764 * src/complain.c (set_warning_issued): New function to report that
4765 warnings are being treated as errors and to record an error if so.
4766 Invoke...
4767 (warn_at, warn): ... here.
4768 * src/getargs.c (warnings_args, warnings_types): Reorder so that
4769 "error - warnings are errors" does not appear above "all - all of the
4770 above".
4771 (getargs): For -W and --warnings without subarguments, don't let
4772 FLAGS_ARGMATCH set warnings_error in warnings_flag.
4773 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
4774
ba7560e2
JD
47752006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4776
4777 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
4778 empty subargument list. For example: `bison --warnings= parser.y'.
4779
31283fc3
JD
47802006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4781
4782 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
4783 the parser header file so that gcc doesn't warn.
4784
12e35840
JD
47852006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4786
4787 Split the default %destructor/%printer into two kinds: <*> and <!>.
4788 Discussed starting at
4789 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
4790 * NEWS (2.3a+): Mention.
4791 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
4792 previous change today related to mid-rules.
148d66d8 4793 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 4794 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
4795 (TYPE_TAG_ANY): Add as <*>.
4796 (TYPE_TAG_NONE): Add as <!>.
4797 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
4798 for <*> and <!>.
4799 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
4800 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
4801 * src/symlist.c (symbol_list_default_new): Split into tagged and
4802 tagless versions.
4803 (symbol_list_destructor_set, symbol_list_printer_set): Split
4804 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
4805 SYMLIST_DEFAULT_TAGLESS.
4806 * src/symlist.h: Update symbol_list_default*_new prototypes.
4807 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
4808 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
4809 * src/symtab.c (default_destructor, default_destructor_location,
4810 default_printer, default_printer_location): Split each into tagged and
4811 tagless versions.
4812 (symbol_destructor_get, symbol_destructor_location_get,
4813 symbol_printer_get, symbol_printer_location_get): Implement tagged
4814 default and tagless default cases.
4815 (default_destructor_set, default_printer_set): Split each into tagged
4816 and tagless versions.
4817 * src/symtab.h: Update prototypes.
4818 * tests/actions.at (Default %printer and %destructor): Rename to...
4819 (Default tagless %printer and %destructor): ... this, and extend.
4820 (Per-type %printer and %destructor): Rename to...
4821 (Default tagged and per-type %printer and %destructor): ... this, and
4822 extend.
4823 (Default %printer and %destructor for user-defined end token): Extend.
4824 (Default %printer and %destructor are not for error or $undefined):
4825 Update.
4826 (Default %printer and %destructor are not for $accept): Update.
4827 (Default %printer and %destructor for mid-rule values): Extend.
4828 * tests/input.at (Default %printer and %destructor redeclared): Extend.
4829 (Unused values with default %destructor): Extend.
4830
f91b1629
JD
48312006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4832
4833 Don't apply the default %destructor/%printer to an unreferenced midrule
4834 value. Mentioned at
4835 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
4836 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
4837 like $@n instead of just @n so that the default %destructor/%printer
4838 logic doesn't see them as user-defined symbols.
4839 (symbol_is_dummy): Check for both forms of the name.
4840 * src/reader.c (packgram): Remove the `$' from each midrule symbol
4841 name for which the midrule value is referenced in any action.
4842 * tests/actions.at (Default %printer and %destructor for mid-rule
4843 values): New test.
4844 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
4845 for change to dummy symbol names.
4846
519d0004
JD
48472006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4848
4849 Warn about unset midrule $$ if the corresponding $n is used.
4850 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
4851 $n usage.
4852 (packgram): Before invoking grammar_rule_check on any rule, make sure
4853 all actions have already been scanned in order to set `used' flags.
4854 Otherwise, checking that a midrule's $$ is set will not always work
4855 properly because the midrule check must forward-reference the midrule's
4856 parent rule.
4857 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
4858 warning.
4859
a501eca9
JD
48602006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4861
4862 More improvements to the documentation of the prologue alternatives:
4863 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
4864 Bison manual.
4865 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
4866 some text to clarify the relative importance of the new directives and
4867 to show how these directives may be viewed as code labels.
4868
2cbe6b7f
JD
48692006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
4870
4871 Similar to the recently removed %before-header, add %code-top as the
4872 alternative to the pre-prologue. Mentioned at
4873 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
4874 Also, let the prologue alternatives appear in the grammar section.
4875 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
4876 (prologue_declaration): Move the existing prologue alternatives to...
4877 (grammar_declaration): ... here and add %code-top.
4878 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
4879
4880 Clean up and extend documentation for the prologue alternatives.
4881 * NEWS (2.3a+): Describe prologue alternatives.
4882 * doc/bison.texinfo (Prologue): Move discussion of prologue
4883 alternatives to...
4884 (Prologue Alternatives): ... this new section, and extend it to discuss
4885 all 4 directives in detail.
148d66d8
JD
4886 (Table of Symbols): Clean up discussion of prologue alternatives and
4887 add %code-top.
2cbe6b7f 4888
e557d3ea
JMG
48892006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4890
4891 DJGPP specific issues.
4892
4893 * djgpp/config.bat: config.hin has been moved to lib. Adjust
4894 config.bat accordingly.
4895 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
4896 * djgpp/config.site: Likewise.
4897
136a0f76
PB
48982006-10-16 Paolo Bonzini <bonzini@gnu.org>
4899
27bd5d67
PB
4900 Replace %*-header with %provides, %requires, %code. See discussion at
4901 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
4902
136a0f76
PB
4903 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
4904 (b4_user_start_header): Remove.
4905 * data/glr.c: Use new macros instead of b4_*start_header
4906 and b4_*end_header.
4907 * data/glr.cc: Likewise.
4908 * data/lalr1.cc: Likewise.
4909 * data/push.c: Likewise.
4910 * data/yacc.c: Likewise.
4911
4912 * doc/bison.texinfo: Remove %before-header, rename
4913 %{start,end,after}-header to %requires, %provides, %code.
4914
4915 * src/parse-gram.y: Likewise (also rename token names accordingly).
4916 * src/scan-gram.l: Likewise.
4917 * tests/actions.at: Likewise.
4918
10f429ef
PE
49192006-10-14 Paul Eggert <eggert@cs.ucla.edu>
4920
4921 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
4922 Problem reported by Joel E. Denny.
4923
49242006-10-14 Jim Meyering <jim@meyering.net>
4925
4926 (Sync from coreutils.)
4927 Work also when the working directory (with e.g. coreutils sources)
4928 is version controlled with git, rather than CVS.
4929 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
4930 rather than CVS.
4931 In messages and comments, say e.g., "checked-out sources",
4932 rather than "CVS sources".
4933 (version_controlled_file): New function. Work for git as well as
4934 for CVS. Don't use grep's -q option.
4935 (slurp): Call it here, in place of CVS-specific code.
4936
c4bd5bf7
JD
49372006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
4938
4939 Fix testsuite for ./configure --enable-gcc-warnings:
4940 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
4941 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
4942 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
4943 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
4944 * test/regression.at (Diagnostic that expects two alternatives):
4945 Likewise.
4946
46356ea4
PE
49472006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4948
231ed89a
PE
4949 * bootstrap.conf (gnulib_modules): Add config-h.
4950 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
4951 worry about HAVE_CONFIG_H.
4952 * lib/abitset.c: Likewise.
4953 * lib/bitset.c: Likewise.
4954 * lib/bitset_stats.c: Likewise.
4955 * lib/bitsetv-print.c: Likewise.
4956 * lib/bitsetv.c: Likewise.
4957 * lib/ebitset.c: Likewise.
4958 * lib/get-errno.c: Likewise.
4959 * lib/lbitset.c: Likewise.
4960 * lib/subpipe.c: Likewise.
4961 * lib/timevar.c: Likewise.
4962 * lib/vbitset.c: Likewise.
4963 * lib/bitset.c: Include "bitset.h" first, to test interface.
4964 * lib/bitset_stats.c: Include "bitset_stats.h" first.
4965 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
4966 * lib/bitsetv.c: Include "bitsetv.h" first.
4967 * lib/get-errno.c: Include "get-errno.h" first.
4968 * m4/.cvsignore: Add config-h.m4.
4969 * tests/actions.at (Default %printer and %destructor for ...):
4970 Adjust expected line numbers in output to reflect removal of #if
4971 HAVE_CONFIG_H lines.
4972 * tests/glr-regression.at (Missed %merge type warnings when ...):
4973 Likewise.
4974 * tests/regression.at (Braced code in declaration in rules section):
4975 Likewise.
4976 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
4977 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
4978 Include <config.h> unconditionally.
4979
46356ea4
PE
4980 * bootstrap: Sync from coreutils, as follows:
4981
4982 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4983
4984 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
4985 variable was sometimes used without being initialized. This
4986 messed up the installation of the INSTALL file in some cases.
4987
4988 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4989
4990 * bootstrap (usage, main program, symlink_to_gnulib): Add option
4991 --copy. Inspired by a suggestion from Bruno Haible.
4992
4993 2006-10-03 Jim Meyering <jim@meyering.net>
4994
4995 * bootstrap: Undo last change to this file, since now gnulib-tool
4996 sticks with the automake default in generating dependencies.
4997
dd4bf078
PE
49982006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4999
cf2a5f7c
PE
5000 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
5001 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
5002
5003 * doc/bison.1: Add copyright notice.
5004
5005 * data/glr.c: Don't include <stdarg.h>; not used.
5006
35fe0834
PE
5007 * NEWS: The -g and --graph options now output graphs in Graphviz
5008 DOT format, not VCG format.
5009 * doc/bison.1: Likewise.
5010 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
5011 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
5012 of this change in
5013 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
5014 * TODO: Remove Graphviz entry.
5015 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
5016 remove vcg.c, vcg.h, vcg_defaults.h.
5017 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
5018 * src/graphviz.c, src/graphviz.h: New files.
5019 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
5020 * src/files.h: Make comment more generic.
5021 * src/main.c (main): Likewise.
5022 * src/print_graph.h: Likewise.
5023 * src/getargs.c (usage): Make usage description more generic.
5024 * src/print_graph.c: Include graphviz.h rather than vcg.h.
5025 (static_graph, fgraph): Remove. All uses changed to pass
5026 arguments instead of sharing a static var.
5027 (print_core, print_actions, print_state, print_graph):
5028 Output graphviz format rather than VCG format.
5029 * tests/.cvsignore: Remove *.vcg; add *.dot.
5030 * tests/output.at: Expect *.dot files, not *.vcg files.
5031
dd4bf078
PE
5032 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
5033 accommodates the 2006-10-08 change.
5034
efdd7421
PE
50352006-10-11 Bob Rossi <bob@brasko.net>
5036
5037 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
5038 (b4_yyssa, b4_yyerror_range): New macros.
5039 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
5040 (yypvarsinit): Remove init of removed fields.
5041 (yypushparse): Remove use of removed fields; use new macros instead.
5042
96a1981a
PE
50432006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5044
5045 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
5046 in a push parser. Reindent slightly to match yacc.c better.
5047
50482006-10-11 Bob Rossi <bob@brasko.net>
5049
46356ea4
PE
5050 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
5051 yymsg_alloc fields.
5052 (yypvarsinit, yypushparse): Remove init of removed fields.
5053 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 5054
c1630a8b
PE
50552006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5056
5057 * THANKS: Add Paolo Bonzini and Bob Rossi.
5058
90b9908d
PB
50592006-10-08 Paolo Bonzini <bonzini@gnu.org>
5060
5061 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
5062 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
5063 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
5064 b4_define_user_cde and uses): Remove.
5065 (b4_comment, b4_prefix, b4_sync_start): New.
5066 * data/bison.m4: New file, with most of the content removed from c.m4.
5067 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
5068 * src/output.c (output_skeleton): Pass bison.m4.
5069 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
5070 only if specified.
5071
cf806753
PE
50722006-10-05 Paul Eggert <eggert@cs.ucla.edu>
5073
5074 Fix test failure reported by Tom Lane in
5075 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
5076 and try to make such failures easier to catch in the future.
5077 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
5078 that's now the caller's responsibility.
5079 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
5080 Set yychar = YYEOF if it's negative.
5081 * tests/actions.at (yylex): Abort if asked to read past EOF.
5082 * tests/conflicts.at (yylex): Likewise.
5083 * tests/cxx-type.at (yylex): Likewise.
5084 * tests/glr-regression.at (yylex): Likewise.
5085 * tests/input.at (yylex): Likewise.
5086 * tests/regression.at (yylex): Likewise.
5087 * tests/torture.at (yylex): Likewise.
5088
0e2f006a
PE
50892006-10-01 Paul Eggert <eggert@cs.ucla.edu>
5090
5091 Fix problems with translating English-language diagnostics.
5092 * bootstrap: Fix bug introduced in recent bootstrap changes, with
5093 respect to bison-runtime pot generation. The YY_ stuff
5094 wasn't being captured.
5095 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
5096 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
5097 * runtime-po/POTFILES.in: Add data/push.c.
5098
e3ddc1e3
PE
50992006-09-29 Paul Eggert <eggert@cs.ucla.edu>
5100
5101 Merge bootstrap changes from coreutils.
5102
5103 2006-09-28 Jim Meyering <jim@meyering.net>
5104
5105 Automatically generated dependencies are important even
5106 when all of the sources in a directory come from gnulib.
5107 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
5108 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
5109
5110 2006-09-23 Jim Meyering <jim@meyering.net>
5111
5112 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
5113
5114 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5115
5116 * bootstrap: Add support for --force.
5117 (usage): New function. Describe usage less tersely.
5118 (CVS_only_file): New var.
5119
01e972b3
PE
51202006-09-21 Paul Eggert <eggert@cs.ucla.edu>
5121
5122 * data/push.c (YYPUSH_MORE): Make it an enum instead.
5123 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
5124 Adjust white space and comments to match GNU style better.
5125
c63d3e90
PE
51262006-09-20 Bob Rossi <bob@brasko.net>
5127
5128 * data/push.c (yyresult_get): Remove function.
5129 (YYPUSH_MORE): Add #define.
5130 (yypushparse): Modify return value.
5131
e70f46d1
PE
51322006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5133
5134 * stamp-h.in: Remove; no longer needed.
5135 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
5136 Remove config.h, config.hin, intl (no longer created).
5137 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
5138 stamp-h1.
5139
5140 Sync bootstrap from coreutils, as follows:
5141
5142 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
5143
5144 * bootstrap (symlink_to_gnulib): New function.
5145 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
5146 to copies-of-gnulib.
5147 (cp_mark_as_generated, slurp, gnulib_files):
5148 Avoid making a copy if it's the same as the old version.
5149 (gnulib_files): Add support for this variable (used by Bison).
5150
a92be413
PE
51512006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5152
5153 * src/getargs.c (usage): Rework to use conventions similar to
5154 coreutils, to make translation a bit easier and the code a bit
5155 smaller. Problem reported by Tim Van Holder.
5156
4f82b42a
PE
51572006-09-15 Paul Eggert <eggert@cs.ucla.edu>
5158
3b2942e6
PE
5159 Use some of gnulib's new modules, taken from coreutils.
5160
5161 * bootstrap: Sync from coreutils, except add support for gnulib_files.
5162 * bootstrap.conf: New file.
5163 (gnulib_modules): Add configmake, inttypes, unistd.
5164 (XGETTEXT_OPTIONS): Add complain, complain_at,
5165 fatal, fatal_at, warn, warn_at, unexpected_end.
5166 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
5167 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
5168 (gl_EARLY): Add.
5169 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
5170 (gl_INIT): Add
5171 (GNULIB_AUTOCONF_SNIPPET): Remove.
5172 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
5173 the pickiest.
5174 * lib/.cvsignore: Add inttypes_.h.
5175 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
5176 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
5177 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
5178 no-longer-necessary initializations.
5179 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
5180 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
5181 use the unistd module.
5182 * src/system.h: Likewise.
5183 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
5184 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
5185 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
5186 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
5187 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
5188 * src/system.h: Include inttypes.h unconditionally, now that we
5189 use the inttypes module. Don't bother to include stdint.h, since
5190 inttypes.h now does that for us.
5191 (LOCALEDIR): Remove, now that we use the configmake module.
5192 * src/getargs.c: Include configmake.h.
5193 * src/main.c: Likewise.
5194 * src/output.c: Likewise.
5195 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
5196 not from $abs_top_builddir, since config.h moved.
5197
5198
4f82b42a
PE
5199 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
5200 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
5201
5202 * src/parse-gram.y (symbol_declaration): Don't put statements
5203 before declarations; it's not portable to C89.
5204 * src/scan-code.l (handle_action_at): Likewise.
5205
5206 * src/scan-code.l: Always initialize braces_level; the old code
5207 left it uninitialized and therefore had undefined behavior.
5208
5209 Don't attempt to redefine 'assert', since it runs afoul of
5210 systems where standard headers (mistakenly) include <assert.h>.
5211 Instead, define and use our own alternative, called 'aver'.
5212 * src/reader.c: Don't include assert.h, since we no longer
5213 use assert.
5214 * src/scan-code.l: Likewise.
5215 * src/system.h (assert): Remove, replacing with....
5216 (aver): New function, taking a bool arg. All uses changed.
5217 * src/tables.c (pack_vector): Ensure that aver arg is bool,
5218 not merely an integer.
5219
31c10e38
PE
52202006-09-15 Bob Rossi <bob@brasko.net>
5221
5222 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
5223 * data/c.m4 (YYPUSH): New.
5224 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
5225 * src/getargs.c (push_parser): New var.
5226 * src/getargs.h (push_parser): New declaration.
5227 * src/output.c (prepare): Add macro insertion of `push_flag'.
5228 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
5229 (prologue_declaration): Parse %push-parser.
5230 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
5231 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
5232 list of removed lines from the traces observed.
5233 (AT_CHECK_CALC_LALR): Added push parser tests.
5234
fa7b79c0
PE
52352006-09-13 Paul Eggert <eggert@cs.ucla.edu>
5236
21fe08ca
PE
5237 * NEWS: Version 2.3a.
5238 * configure.ac (AC_INIT): Likewise.
5239
e8ec4d9b
PE
5240 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
5241 "#define YYSTYPE int" that caused "make maintainer-check" to fail
5242 due to header ordering dependencies. I don't know why the #define
5243 was there.
5244
fa7b79c0
PE
5245 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
5246 runtime cost when YYDEBUG is not defined, and so that some tests
5247 that used to fail now work. Problem and initial suggestion by
5248 Paolo Bonzini.
5249 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
5250 * data/glr.cc (b4_parser_class_name):
5251 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
5252 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
5253 (yydebug_) [YYDEBUG]: New member.
5254 (yycdebug_): Now defined only if YYDEBUG.
5255 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
5256 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
5257 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
5258 if YYYDEBUG.
5259 (debug_stream, set_debug_stream, debug_level, set_debug_level):
5260 Define only if YYDEBUG.
5261 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
5262 set_debug_level.
5263 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
5264 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
5265 AT_CHECK_CALC_GLR_CC that are working now.
5266
4ec13d60
PE
52672006-09-12 Paul Eggert <eggert@cs.ucla.edu>
5268
5269 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
5270 We don't need them in glr.cc, and glr.c defines them.
5271 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
5272 assumes that defining it to anything is the same as defining
5273 it to 1. Problem reported by Paolo Bonzini.
5274
8e1687ae
PE
52752006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
5276
5277 * data/c.m4 (b4_null, b4_case): Define.
5278 * src/output.c (prepare_symbols): Use b4_null.
5279 (user_actions_output): Use b4_case.
5280
3dc5e96b
PE
52812006-09-11 Paul Eggert <eggert@cs.ucla.edu>
5282
aef3da86
PE
5283 * data/glr.c (b4_shared_declarations): Put start-header first,
5284 before any #includes that we generate, so that feature-test
5285 macros work. Problem reported by Michael Deutschmann in
5286 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
5287 * data/lalr1.cc: Likewise.
5288 * doc/bison.texinfo (Prologue): Document that feature-test macros
5289 should be defined before any Bison declarations.
5290 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
5291 that depend on location.hh after, not before, Bison decls, since
5292 we now include location.hh after the first user prologue.
5293
3dc5e96b
PE
5294 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
5295 Sander Brandenburg in
5296 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
5297 Also, fix minor white space and comment issues.
aef3da86
PE
5298 (Prologue): Mention that it's better to define feature-test macros
5299 before Bison declarations. Problem reported by Michael Deutschmann.
5300
5301 * README-cvs: Fix typo: "&" should be "&&". Problem reported
5302 by Jim Meyering.
5303 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
5304 This adjusts to recent gnulib changes.
3dc5e96b 5305
b2a0b7ca
JD
53062006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5307
5308 Finish implementation of per-type %destructor/%printer. Discussed
5309 starting at
5310 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
5311 and
5312 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
5313 * NEWS (2.3+): Add a description of this feature to the default
5314 %destructor/%printer description.
5315 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
5316 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5317 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
5318 list node contains a semantic type.
5319 * src/symtab.c, src/symtab.h: Extend with a table that associates
5320 semantic types with their %destructor's and %printer's.
5321 (semantic_type_from_uniqstr, semantic_type_get,
5322 semantic_type_destructor_set, semantic_type_printer_set): New functions
5323 composing the public interface of that table.
5324 (symbol_destructor_get, symbol_destructor_location_get,
5325 symbol_printer_get, symbol_printer_location_get): If there's no
5326 per-symbol %destructor/%printer, look up the per-type before trying
5327 the default.
5328 * tests/actions.at (Per-type %printer and %destructor): New test case.
5329 * tests/input.at (Default %printer and %destructor redeclared):
5330 Extend to check that multiple occurrences of %symbol-default in a
5331 single %destructor/%printer declaration is an error.
5332 (Per-type %printer and %destructor redeclared, Unused values with
5333 per-type %destructor): New test cases.
5334
3be03b13
JD
53352006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5336
5337 Require default %destructor/%printer to be declared using
5338 %symbol-default instead of an empty symbol list, and start working on
5339 new per-type %destructor/%printer. Discussed at
5340 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
5341 * NEWS (2.3+): Add %symbol-default to example.
5342 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 5343 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
5344 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
5345 (generic_symlist, generic_symlist_item): New nonterminals for creating
5346 a list in which each item is a symbol, semantic type, or
5347 %symbol-default.
5348 (grammar_declaration): Use generic_symlist in %destructor and %printer
5349 declarations instead of symbols.1 or an empty list.
5350 (symbol_declaration, precedence_declaration, symbols.1): Update actions
5351 for changes to symbol_list.
5352 * src/reader.c: Update for changes to symbol_list.
5353 * src/scan-code.l: Likewise.
5354 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
5355 * src/symlist.c, src/symlist.h: Extend such that a list node may
5356 represent a semantic type or a %symbol-default in addition to just an
5357 ordinary symbol. Add switched functions for setting %destructor's and
5358 %printer's.
5359 * tests/actions.at, tests/input.at: Add %symbol-default to all default
5360 %destructor/%printer declarations.
5361
3508ce36
JD
53622006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
5363
5364 Whether the default %destructor/%printer applies to a particular symbol
5365 isn't a question of whether the user *declares* that symbol (in %token,
5366 for example). It's a question of whether the user by any means
5367 *defines* the symbol at all (by simply using a char token, for
5368 example). $end is defined by Bison whereas any other token with token
5369 number 0 is defined by the user. The error token is always defined by
5370 Bison regardless of whether the user declares it with %token, but we
5371 may one day let the user define error as a nonterminal instead.
5372 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
5373 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
5374 the meaning of "user-defined".
5375 * tests/actions.at (Default %printer and %destructor for user-declared
5376 end token): Rename to...
5377 (Default %printer and %destructor for user-defined end token): ...
5378 this.
5379
5380 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
5381 computation of whether to apply the default, don't maintain a list of
5382 every Bison-defined symbol. Instead, just check for a first character
5383 of '$', which a user symbol cannot have, and check for the error token.
5384
9350499c
JD
53852006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
5386
5387 Don't apply the default %destructor or %printer to the error token,
5388 $undefined, or $accept. This change fits the general rule that the
5389 default %destructor and %printer are only for user-declared symbols,
5390 and it solves several difficulties that are described in the new test
5391 cases listed below.
5392 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
5393 * tests/actions.at (Default %printer and %destructor are not for error
5394 or $undefined, Default %printer and %destructor are not for $accept):
5395 New test cases.
5396
4d7370cb
JD
53972006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
5398
5399 Allow %start after the first rule.
5400 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
5401 when parsing the first rule.
5402 (check_and_convert_grammar): Search for it here after all grammar
5403 declarations have been parsed. Skip midrules, which have dummy LHS
5404 nonterminals.
5405 * src/symtab.c (symbol_is_dummy): New function.
5406 * src/symtab.h (symbol_is_dummy): Declare it.
5407 * tests/input.at (%start after first rule): New test.
5408
6d0ef4ec
JD
54092006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5410
5411 Redo some of the previous commit: add back the ability to use
5412 non-aliased/undeclared string literals since it might be useful to
5413 those declaring %token-table.
5414 * src/reader.c (check_and_convert_grammar): Undo changes in previous
5415 commit: don't worry about complaints from symbols_pack.
5416 * src/symtab.c (symbol_new, symbol_class_set,
5417 symbol_check_alias_consistency): Undo changes in previous commit: count
5418 each string literal as a new symbol and token, assign it a symbol
5419 number, and don't complain about non-aliased string literals.
5420 (symbols_pack): Since symbol_make_alias still does not decrement symbol
5421 and token counts but does still set aliased tokens to the same number,
5422 symbol_pack_processor now leaves empty slots in the symbols array.
5423 Remove those slots.
5424 * tests/regression.at (Undeclared string literal): Remove test case
5425 added in previous commit since non-aliased string literals are allowed
5426 again.
5427 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
5428 remove unnecessary string literal declarations.
5429 * tests/sets.at (Firsts): Likewise.
5430
965537bc
JD
54312006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5432
5433 Don't allow an undeclared string literal, but allow a string literal to
5434 be used before its declaration.
5435 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
5436 symbols_pack complained.
5437 * src/symtab.c (symbol_new): Don't count a string literal as a new
5438 symbol.
5439 (symbol_class_set): Don't count a string literal as a new token, and
5440 don't assign it a symbol number since symbol_make_alias does that.
5441 (symbol_make_alias): It's not necessary to decrement the symbol and
5442 token counts anymore. Don't assume that an alias declaration occurs
5443 before any uses of the identifier or string, and thus don't assert that
5444 one of them has the highest symbol number so far.
5445 (symbol_check_alias_consistency): Complain if there's a string literal
5446 that wasn't declared as an alias.
5447 (symbols_pack): Bail if symbol_check_alias_consistency failed since
5448 symbol_pack asserts that every token has been assigned a symbol number
5449 although undeclared string literals have not.
5450 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 5451 string literal): New test cases.
965537bc
JD
5452 (Characters Escapes, Web2c Actions): Declare string literals as
5453 aliases.
5454 * tests/sets.at (Firsts): Likewise.
5455
47aee066
JD
54562006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
5457
5458 In the grammar scanner, STRING_FINISH unclosed constructs and return
5459 them to the parser in order to improve error messages.
5460 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
5461 SC_BRACED_CODE, SC_PROLOGUE): Implement.
5462 * tests/input.at (Unclosed constructs): New test case.
5463 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
5464 seen.
5465
5466 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
5467 unused global.
5468
1f6b3679
JD
54692006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
5470
5471 Handle string aliases for character tokens correctly.
5472 * src/symtab.c (symbol_user_token_number_set): If the token has an
5473 alias, check and set its alias's user token number instead of its own,
5474 which is set to indicate the alias. Previously, every occurrence of
5475 the character token in the grammar overwrote that alias indicator with
5476 the character code.
5477 * tests/input.at (String aliases for character tokens): New test.
5478
219741d8
JD
54792006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
5480
5481 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
5482
11daa4e7
PE
54832006-08-11 Paul Eggert <eggert@cs.ucla.edu>
5484
5485 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
5486 to prevent failures when building on older platforms.
5487 Check for autopoint failure.
5488 Set XGETTEXT_OPTIONS to values that check for C format strings,
5489 so that translators are warned about them (this also helps
5490 prevent core dumps).
5491
5492 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
5493 function, since it simplifies our code a bit.
5494
5495 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
5496 rather than -W, so we don't get bogus warnings about sign comparisons.
5497 Add -Wpointer-arith, since that warning is useful (it reports code
5498 that does not conform to C89 and that some compilers reject).
5499 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
5500 since it's no longer needed.
5501
f9bfc42a
JD
55022006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
5503
5504 Clean up scanners a bit.
5505 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
5506 definitions so gcc won't warn when obstack_for_string is unused.
5507 * src/scan-code.l: config.h and system.h are already #include'd by
5508 scan-code-c.c, so get rid of them here.
5509 * src/scan-gram.l: Likewise.
5510 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
5511 definitions rather than duplicating the rest of it.
5512 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
5513
06e8700a
JD
55142006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
5515
5516 Suppress signed/unsigned comparison warnings for yycheck.
5517 * data/c.m4 (b4_safest_int_type): New macro.
5518 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
5519 a signed int type, cast it to b4_safest_int_type first.
5520 * data/yacc.c: Likewise.
5521 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
5522 also overwritten.
5523
9c437126
PE
55242006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5525
5526 * doc/bison.texinfo: Fix some typos.
5527
284d8a13
PE
55282006-08-02 Paul Eggert <eggert@cs.ucla.edu>
5529
5530 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
5531 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
5532
5533 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
5534 the latest gnulib does this a different way.
5535 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
5536 translation was patched, so stop omitting it.
5537
ec5479ce
JD
55382006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5539
5540 Enable declaration of default %printer/%destructor. Make the parser
5541 use these for all user-declared grammar symbols for which the user does
5542 not declare a specific %printer/%destructor. Thus, the parser uses it
5543 for token 0 if the user declares it but not if Bison generates it as
5544 $end. Discussed starting at
5545 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
5546 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
5547 and
5548 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
5549 * NEWS (2.3+): Mention.
5550 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
5551 declare a %destructor for a mid-rule's semantic value. It's just
5552 impossible to declare one specific to it.
5553 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
5554 code. Describe default %destructor form.
5555 * src/parse-gram.y (grammar_declaration): Parse default
5556 %printer/%destructor declarations.
5557 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
5558 and symbol_destructor_location_get rather than accessing the destructor
5559 and destructor_location members of struct symbol.
5560 (symbol_printers_output): Likewise but for %printer's.
5561 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
5562 again.
5563 * src/symtab.c (default_destructor, default_destructor_location,
5564 default_printer, default_printer_location): New static global
5565 variables to record the default %destructor and %printer.
5566 (symbol_destructor_get, symbol_destructor_location_get,
5567 symbol_printer_get, symbol_printer_location_get): New functions to
5568 compute the appropriate %destructor and %printer for a symbol.
5569 (default_destructor_set, default_printer_set): New functions to set the
5570 default %destructor and %printer.
5571 * src/symtab.h: Prototype all those new functions.
5572 * tests/actions.at (Default %printer and %destructor): New test to
5573 check that the right %printer and %destructor are called, that they're
5574 not called for $end, and that $$ and @$ work correctly.
5575 (Default %printer and %destructor for user-declared end token): New
5576 test to check that the default %printer and %destructor are called for
5577 a user-declared end token.
5578 * tests/input.at (Default %printer and %destructor redeclared, Unused
5579 values with default %destructor): New tests to check related grammar
5580 warnings and errors.
5581
868d2d96
JD
55822006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5583
5584 Clean up handling of %destructor for the end token (token 0).
5585 Discussed starting at
5586 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
5587 and
5588 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
5589
5590 Make the skeletons consistent in how they pop the end token and invoke
5591 its %destructor.
5592 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
5593 state, which has token number 0, since this would invoke the
5594 %destructor for the end token.
5595 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
5596 until after shifting the end token, or else it won't be popped.
5597 * data/yacc.c (yyparse): Likewise.
5598
5599 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
5600 it's the end token. Upon termination, destroy an unshifted lookahead
5601 even when it's the end token.
5602 * data/lalr1.cc (yy::parser::parse): Likewise.
5603 * data/yacc.c (yyparse): Likewise.
5604
5605 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
5606 value warnings for the end token when the user gives the end token a
5607 %destructor.
5608
5609 * tests/actions.at (Printers and Destructors): Test all the above.
5610
62a9592d
PE
56112006-07-24 Paul Eggert <eggert@cs.ucla.edu>
5612
5613 Update to latest gnulib and gettext versions.
5614 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
5615 Add fopen-safer.
5616 (gnulib_files): Add m4/warning.m4. Don't worry about files
5617 overwritten by autopoint.
5618 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
5619 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
5620 rejects them.
5621 Don't use autoreconf; instead, invoke autopoint etc. by hand,
5622 so that we can remove the intl files at a better time.
5623 (intl_files_to_remove): Remove aclocal.m4, since it gets
5624 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
5625 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
5626 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
5627 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
5628 Remove datarootdir hack; no longer needed.
5629 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
5630 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
5631 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
5632 strdup.h.
5633 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
5634 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
5635
10d6970f
PE
56362006-07-20 Paul Eggert <eggert@cs.ucla.edu>
5637
5638 * bootstrap: Adjust to today's change to gnulib-tool by invoking
5639 it with --assume-autoconf='latest-stable'.
5640
50a33993
JD
56412006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
5642
5643 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
5644 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
5645 YYSTYPE' and `{'.
5646 * src/muscle_tab.h (muscle_grow): Replace the header comments with
5647 those from muscle_tab.c since the old ones are misleading.
5648
2ce4ed68
AD
56492006-07-13 Akim Demaille <akim@epita.fr>
5650
5651 Support %define "KEY" {VALUE}.
5652 * src/scan-code.h, src/scan-code.l (translate_action)
5653 (translate_rule_action, translate_symbol_action, translate_code):
5654 Return char *, not const char *.
5655 * src/parse-gram.y (declaration): Rename as...
5656 (prologue_declaration): this.
5657 (string_content): Remove this nonterminal, use STRING.
5658 (braceless, content, content.opt): New nonterminal.
5659 Use them.
5660 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
5661 as value.
5662 * src/scan-gram.l (getargs.h): Don't include it.
5663
db7e5eb5
PE
56642006-07-12 Paul Eggert <eggert@cs.ucla.edu>
5665
5666 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
5667 rather than a for-loop that declares a local bool variable. This
5668 should work around a compatibility problem with a Cray x1e C++
5669 compiler reported by Hung Nguyen in
5670 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
5671 The for-loop was introduced in the 2004-11-17 change but I don't
5672 know why it was needed.
5673
a5d80ba5
AD
56742006-07-12 Akim Demaille <akim@epita.fr>
5675
5676 * data/c.m4: Comment changes.
5677
23eb2a69
AD
56782006-07-10 Akim Demaille <akim@lrde.epita.fr>
5679
5680 * src/complain.c (error_message, ERROR_MESSAGE): New.
5681 To factor...
5682 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
5683 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
5684
ddc8ede1
PE
56852006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5686
5687 * NEWS: Instead of %union, you can define and use your own union type
5688 YYSTYPE if your grammar contains at least one <type> tag.
5689 Your YYSTYPE need not be a macro; it can be a typedef.
5690 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
5691 (Union Decl, Decl Summary): Document this.
5692 * data/glr.c (YYSTYPE): Implement this.
5693 * data/glr.cc (YYSTYPE): Likewise.
5694 * data/lalr1.cc (YYSTYPE): Likewise.
5695 * data/yacc.c (YYSTYPE): Likewise.
5696 * src/output.c (prepare): Output tag_seen_flag.
5697 * src/parse-gram.y (declaration, grammar_declaration):
5698 Use 'union_seen' rather than 'typed' to determine whether
5699 %union has been seen, since grammars can now be typed without
5700 %union.
5701 (symbol_declaration, type.opt, symbol_def):
5702 Keep track of whether a tag has been seen.
5703 * src/reader.c (union_seen, tag_seen): New vars.
5704 (typed): remove.
5705 * src/reader.h (union_seen, tag_seen, typed): Likewise.
5706 * src/scan-code.l (untyped_var_seen): New variable.
5707 (handle_action_dollar): Adjust to above changes.
5708 (handle_action_dollar, handle_action_at):
5709 Improve overflow checking for outlandish numbers.
5710 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
5711 avoid new diagnostics generated by above changes.
5712 * tests/regression.at (YYSTYPE typedef): Add test to check
5713 for type tags without %union.
5714
5715 * src/symlist.c (symbol_list_length): Return int, not unsigned
5716 int, since callers expect int. This may need to get revisited
5717 once we have proper integer overflow checking.
5718
5719 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
5720 object is now static.
5721
5722 * src/getargs.c (flags_argmatch): Return void, not int,
5723 to pacify ./configure --enable-gcc-warnings.
5724
5725 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
5726 since last_string is already defined to FLEX_PREFIX (last_string).
5727
7b42569e
AD
57282006-07-09 Akim Demaille <akim@lrde.epita.fr>
5729
5730 Implement --warnings/-W.
5731 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
5732 replaced by...
5733 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
5734 Adjust callers.
5735 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
5736 (warnings_args, warnings_types): New.
5737 (getargs, short_options, long_options): Accept -W/--warnings.
5738 Sort the options by alphabetical order, upper case letter right
5739 before its lower case.
5740
3b452f4e
JD
57412006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5742
5743 Change %merge result type clash warnings to errors. Discussed at
5744 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
5745 * src/reader.c (record_merge_function_type): Use complain_at.
5746 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5747 declared later): Update test case results.
5748
b8a41559
AD
57492006-07-09 Akim Demaille <akim@lrde.epita.fr>
5750
5751 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
5752 to be in alphabetical order.
5753 (trace_args): Spelling fixes.
5754
cd9e1ba2
PE
57552006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5756
5757 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
5758 so they don't collide with user-defined macros.
5759 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
5760 this was never guaranteed, and now that we're using gnulib stdint,
5761 which defines int_fast16_t to long int, the problem is exposed.
5762
cb48f191
PE
57632006-07-08 Paul Eggert <eggert@cs.ucla.edu>
5764
b8445a15
PE
5765 * data/c.m4 (b4_basename): Simplify a bit, since we don't
5766 need the full POSIX semantics (and weren't implementing them
5767 anyway).
5768
cb48f191
PE
5769 Adjust to Autoconf 2.60 and today's gnulib.
5770 * bootstrap (gnulib_modules): Add stdint.
5771 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
5772 no longer copies it.
5773 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
5774 since stdint needs the former and wcwidth (which is now required
5775 by mbswidth) needs the latter.
5776 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
5777 work around a compatibility glitch between gettext 0.14.6 and
5778 Autoconf 2.60.
5779 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
5780 Do not check for uintptr_t, since new stdint module does the right
5781 thing.
5782 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
5783 Add stdint.h, stdint_.h, wcwidth.h.
5784 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
5785 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
5786 stdint.m4, wchar_t.m4, wcwidth.m4.
5787 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
5788 usual order for ../lib/*.h files.
5789 (file_name_split): Use last_component, not base_name, to adjust
5790 to gnulib changes.
5791 * src/parse-gram.h: Include <strverscmp.h> in the usual order
5792 for ../lib/*.h files.
5793 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
5794 Define unconditionally, since we now assume the stdint module.
5795 * src/scan-skel.l: Include <dirname.h>.
5796 (BASE_QPUTS): Use last_component, not base_name.
5797 * src/system.h: Include <unlocked-io.h> in the usual order
5798 for ../lib/*.h files. Include <stdint.h> unconditionally,
5799 since we now use the stdint module.
5800 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
5801 HAVE_UINTPTR_T, since we now use the stdint module.
5802 (base_name): Remove decl, since files now include <dirname.h>
5803 to get the decl.
5804
cd48d21d
AD
58052006-07-08 Akim Demaille <akim@lrde.epita.fr>
5806
5807 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
5808 New, default to 1.
5809 * data/yacc.c, data/glr.c, data/location.cc: Use them.
5810 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
5811 default.
5812 * tests/calc.at: Adjust.
5813
8ec0a172
AD
58142006-07-08 Akim Demaille <akim@lrde.epita.fr>
5815
b8445a15 5816 * data/c.m4 (b4_basename): New.
8ec0a172
AD
5817 (b4_syncline): Also output the location of its invocation (from
5818 the skeleton).
5819 (b4_user_action, b4_define_user_action, b4_user_actions)
5820 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
5821 (b4_user_stype): New.
5822 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
5823
4a678af8
JD
58242006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5825
5826 In the grammar file, the first column is 1 not 0 on the first line as
5827 on every other line.
5828 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
5829 * tests/input.at (Torturing the Scanner): Update output.
5830
5831 * src/scan-gram.l (scanner_cursor): Declare it static.
5832
dd60572a
JD
58332006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5834
5835 In warnings, say "previous declaration" rather than "first
5836 declaration".
5837 * src/symtab.c (redeclaration): Do that here.
5838 * src/reader.c (record_merge_function_type): In the case of a result
5839 type clash, report the previous declaration rather than the very first
5840 one in the grammar file.
5841 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5842 declared later): Add a third declaration to check this behavior.
5843 * tests/input.at (Incompatible Aliases): Update output.
5844
2073e1b6
AD
58452006-06-27 Akim Demaille <akim@epita.fr>
5846
5847 * doc/Doxyfile.in: New.
5848 * doc/Makefile.am: Use it.
5849 * src/lalr.h, src/symtab.h: Initial doxygenation.
5850
8ee5b538
JD
58512006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5852
5853 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
5854 declared after the %merge. This continues the effort of the previous
5855 patch.
8ee5b538
JD
5856 * src/reader.c (get_merge_function): Don't set the merger type yet.
5857 (record_merge_function_type): New function for setting the merger type
5858 and checking for clashes.
5859 (grammar_current_rule_merge_set): Set the location of the %merge for
5860 the current rule.
5861 (packgram): Invoke record_merge_function_type for each rule now that
5862 all symbol type declarations have been parsed.
5863 * src/reader.h (merger_list.type_declaration_location): New member
5864 storing the location of the first %merge from which the type for this
5865 merging function was derived.
5866 * src/symlist.h (symbol_list.merger_declaration_location): New member
5867 storing the location of a rule's %merge, if any.
5868 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5869 declared later): New test to catch the error fixed by the above patch.
5870
ffa4ba3a
JD
58712006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5872
5873 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
5874 declarations appear after the rules. Discussed at
5875 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
5876 and
5877 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
5878 Don't mistake the type of $$ in a midrule to be that of its parent
5879 rule's $$.
ffa4ba3a
JD
5880 * src/reader.c (grammar_current_rule_end): Don't invoke
5881 grammar_rule_check yet since not all symbol declarations may have been
5882 parsed yet.
5883 (grammar_midrule_action): Likewise.
5884 Don't record whether the midrule's $$ has been used yet since actions
5885 haven't been translated yet.
5886 Record the midrule's parent rule and its RHS index within the parent
5887 rule.
5888 (grammar_current_rule_action_append): Don't translate the action yet
5889 since not all symbol declarations may have been parsed yet and, thus,
5890 warnings about types for $$, $n, @$, and @n can't be reported yet.
5891 (packgram): Translate the action and invoke grammar_rule_check now that
5892 all symbol declarations have been parsed.
5893 * src/scan-code.l (handle_action_dollar): Now that this is invoked
5894 after parsing the entire grammar file, the symbol list here in the case
5895 of a midrule is actually the midrule's empty RHS, so reference its
5896 parent rule's RHS where necessary.
5897 On the other hand, now that you can already know it's a midrule, you
5898 aren't forced to think $$ has the same type as its parent rule's $$.
5899 (handle_action_at): In the case of a midrule, reference the parent rule
5900 where necessary.
5901 * src/symlist.c (symbol_list_new): Initialize new midrule-related
5902 members.
5903 (symbol_list_length): Now that this is invoked after all rules have
5904 been parsed, a NULL symbol (rather than a NULL symbol list node)
5905 terminates a rule. symbol_list_print already does this correctly.
5906 * src/symlist.h (symbol_list.midrule_parent_rule,
5907 symbol_list.midrule_parent_rhs_index): New members so that midrules can
5908 remember their relationships with their parents.
5909 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
5910 fixed by the above patch.
5911 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
5912 implementing...
5913 (Unused values): ... this old test case and...
5914 (Unused values before symbol declarations): ... this new test case.
5915 This one is the same as `Unused values' except that all symbol
5916 declarations appear after the rules in order to catch the rest of the
5917 errors fixed by the above patch.
5918
e256e17f
JD
59192006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5920
300a1930
JD
5921 More cleanup.
5922 * src/reader.c (current_rule): Declare it static since it's no longer
5923 used outside this file.
5924 (grammar_current_rule_action_append): Remove redundant arguments from
5925 translate_rule_action invocation.
5926 * src/reader.h (current_rule): Remove this unused extern.
5927 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
5928 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 5929
381ecb06
JD
59302006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
5931
5932 Clean up yesterday's patch.
5933 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
5934 to...
5935 * src/reader.c (grammar_current_rule_action_append): ... here for
5936 consistency with grammar_current_rule_symbol_append.
5937 * tests/regression.at (Braced code in declaration in rules section):
5938 Make yyerror and yylex static as usual.
5939
4210cd0b
JD
59402006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
5941
5942 Fix bug that mistakes braced code in a declaration in the rules section
5943 to be a rule action. Mentioned at
5944 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
5945 * src/scan-gram.l: Move midrule action detection from the start of the
5946 scanning of any braced code to...
5947 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
5948 action. For readability, use $2 and @2 rather than the equivalent
5949 global variables.
5950 * tests/regression.at (Braced code in declaration in rules section):
5951 New test to catch the error fixed by the above patch.
5952
5953 Work on code readability some.
5954 * src/scan-code.l (current_rule): Get rid of this misleading and
5955 redundant declaration: it's actually extern'ed in reader.h.
5956 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
5957 translate_action): Add a rule argument and use it instead of the global
5958 current_rule.
5959 (translate_rule_action): This already receives current_rule through an
5960 argument, so pass it on to translate_action instead of assigning
5961 current_rule to current_rule.
5962 (translate_symbol_action, translate_code): Pass rule = NULL to
5963 translate_action.
5964
34f98f46
JD
59652006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
5966
5967 Rename %before-definitions to %start-header and %after-definitions to
5968 %end-header. Don't use these declarations to separate pre-prologue
5969 blocks from post-prologue blocks. Add new order-independent
5970 declarations %before-header and %after-header as alternatives to the
5971 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
5972 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
5973 * NEWS (2.3+): Update for these changes.
5974 * data/glr.c (b4_before_definitions): Update to...
5975 (b4_start_header): ... this.
5976 (b4_after_definitions): Update to...
5977 (b4_end_header): ... this.
5978 * data/glr.cc: Likewise.
5979 * data/lalr1.cc: Likewise.
5980 * data/yacc.c: Likewise.
5981 * doc/bison.texinfo (The prologue): Update names, and replace remaining
5982 prologue blocks with %*-header declarations.
5983 (Calc++ Parser): Likewise.
91661ebb 5984 (Decl Summary): Update names.
148d66d8 5985 (Table of Symbols): Update description.
34f98f46
JD
5986 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
5987 (PERCENT_END_HEADER): ... this.
5988 (PERCENT_BEFORE_DEFINITIONS): Update to...
5989 (PERCENT_START_HEADER): ... this.
5990 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5991 (declaration): Update token names and m4 macro names.
5992 When parsing %end-header and %start-header, invoke translate_code
5993 before muscle_code_grow, and no longer set global booleans to remember
5994 whether these declarations have been seen.
5995 Parse new %after-header and %before-header.
5996 * src/reader.c (before_definitions, after_definitions): Remove.
5997 (prologue_augment): Accept a new bool argument to specify whether to
5998 augment the pre-prologue or post-prologue.
5999 * src/reader.h (before_definitions, after_definitions): Remove these
6000 extern's.
6001 (prologue_augment): Add new bool argument.
6002 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
6003 (PERCENT_END_HEADER): ... this.
6004 (PERCENT_BEFORE_DEFINITIONS): Update to...
6005 (PERCENT_START_HEADER): ... this.
6006 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6007 * tests/actions.at (Printers and Destructors): Update names.
6008
31b2b07e
JD
60092006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
6010
6011 Add comparison operators for C++ location classes. Discussed at
6012 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
6013 * data/c++.m4 (b4_define_location_comparison): New boolean %define
6014 declaration indicating whether filename_type has an operator==. If
6015 filename_type is `std::string', it defaults to `1', `0' otherwise.
6016 * data/location.cc: Iff b4_define_location_comparison is `1', add
6017 operator== and operator!= for class position and for class location.
6018
6019 Some minor fixes.
6020 * src/scan-action.l: Remove unused file.
6021 * src/symtab.c (symbol_printer_set): Use printer_location not
6022 destructor_location.
6023 * src/symtab.h (struct symbol): Replace incorrect source comment for
6024 printer members.
6025 * tests/input.at (Incompatible Aliases): Update output with correct
6026 printer location.
6027
9bc0dd67
JD
60282006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
6029
6030 Don't put the pre-prologue in the header file. For the yacc.c code
6031 file and the glr.c header and code files, move the pre-prologue before
6032 the token definitions. Add new %before-definitions and
6033 %after-definitions to declare code that will go in both the header file
6034 and code file. Discussed at
6035 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
6036 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
6037 and
6038 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
6039 * NEWS (2.3+): Describe these changes.
6040 * data/glr.c (b4_pre_prologue): Move from within to before...
6041 (b4_shared_declarations): ... this.
6042 Add new b4_before_definitions before b4_token_enums.
6043 Add new b4_after_definitions at the end.
6044 * data/glr.cc (b4_pre_prologue): Replace with...
6045 (b4_before_definitions): ... this in the header file.
6046 (b4_after_definitions): New near the end of the header file.
6047 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
6048 code file right before including the header file.
6049 (b4_before_definitions): New in the previous position of
6050 b4_pre_prologue in the header file.
6051 (b4_after_definitions): New near the end of the header file.
6052 * data/yacc.c: Clean up some m4 quoting especially in the header file.
6053 (b4_token_enums_defines): In the code file, move to right before
6054 YYSTYPE for consistency with the header file.
6055 (b4_before_definitions): New right before b4_token_enums_defines in
6056 both the header and code file.
6057 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
6058 header and code file.
6059 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
6060 of prologues for %union dependencies.
91661ebb
JD
6061 (Decl Summary): In %defines description, mention the effect of
6062 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
6063 (Calc++ Parser): Forward declare driver in a %before-definitions rather
6064 than in the pre-prologue so that make check succeeds.
148d66d8 6065 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
6066 %after-definitions.
6067 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
6068 %before-definitions.
6069 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
6070 (declaration): Parse those declarations and append to
6071 b4_before_definitions and b4_after_definitions, respectively.
6072 * src/reader.c (before_definitions, after_definitions): New bools to
6073 track whether those declarations have been seen.
6074 (prologue_augment): Add to the post-prologue if %union,
6075 %before-definitions, or %after-definitions has been seen.
6076 * src/reader.h (before_definitions, after_definitions): New extern's.
6077 * src/scan-gram.l: Scan the new declarations.
6078 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
6079 prologue block in a %before-definitions or a %after-definitions based
6080 on whether the %union is declared.
6081 * tests/regression.at (Early token definitions with --yacc, Early token
6082 definitions without --yacc): Move tests for token definitions into the
6083 post-prologue since token names are no longer defined in the
6084 pre-prologue.
6085
203b9274
AD
60862006-06-20 Akim Demaille <akim@epita.fr>
6087
6088 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
6089 (symbol_get): Use it.
6090 * src/parse-gram.y: Use it.
6091
a7ee59cf
JD
60922006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
6093
6094 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
6095 build succeeds when configured with --enable-gcc-warnings.
6096
5a2baae7
PE
60972006-06-19 Paul Eggert <eggert@cs.ucla.edu>
6098
33ad1a9c
PE
6099 * src/parse-gram.y (char_name): New function.
6100 (CHAR, STRING, string_content): For %printer, properly escape.
6101 (ID): Prefer fputs to fprintf.
6102 (id): Reindent to be consistent with other rules.
6103 Properly quote char.
6104
5a2baae7
PE
6105 The Translation Project changed its way of publishing translations
6106 to maintainers. I haven't received any responses to my request
6107 for supporting the old way, or for documenting the new way. I
6108 have modified 'bootstrap' to use screen scraping
6109 (in this case, HTML scraping). This is unreliable and inelegant,
6110 but I don't see any better way. Yuck.
6111 * bootstrap (TP_URL, WGET_COMMAND): New vars.
6112 (get_translations): New function, which uses HTML scraping to
6113 deduce locations of latest translations.
6114 Use this function to grab both bison and bison-runtime .po files.
6115 Don't bother priming the pump for the runtime-po domain any more,
6116 as it's now translated better than bison is.
6117
58d7a1a1
AD
61182006-06-19 Akim Demaille <akim@epita.fr>
6119
6120 * src/scan-gram.l: No longer "parse" things after `%union' until
6121 `{'. Rather, return a single "%union" token.
6122 No longer make symbols: return strings, and leave the conversion
6123 to symbols to the parser.
6124 (SC_PRE_CODE, token_type): Remove.
6125 * src/parse-gram.y (%union): New field `character'.
6126 Sort tokens.
6127 (CHAR): New token.
6128 (ID, ID_COLON): Now that the scanner no longer makes them
6129 identifiers, adjust all uses to invoke symbol_get.
6130 (id_colon): New, wraps the conversion from string to symbol.
6131 (%union): Accept a possible union_name.
6132 (symbol): Now can be a char.
6133 * data/c.m4 (b4_union_name): Leave a default value.
6134 * data/glr.c, data/yacc.c: Use it.
6135
b931235e
JD
61362006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
6137
6138 For associating token numbers with token names for "yacc.c", don't use
6139 #define statements unless `--yacc' is specified; always use enum
6140 yytokentype. Most important discussions start at:
6141 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
6142 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
6143 and
6144 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
6145 * NEWS (2.3+): Mention.
6146 * data/c.m4 (b4_yacc_if): New.
6147 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
6148 token #define's.
6149 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
6150 on token name definitions.
6151 * src/getargs.c (usage): Capitalize `Yacc' in English.
6152 * src/output.c (prepare): Define b4_yacc_flag.
6153 * tests/regression.at (Early token definitions): Test that tokens names
6154 are defined before the pre-prologue not just before the post-prologue.
6155 Remove this test case and copy to...
6156 (Early token definitions with --yacc): ... this to test #define's.
6157 (Early token definitions without --yacc): ... and this to test enums.
6158
9e6e7ed2
PE
61592006-06-11 Paul Eggert <eggert@cs.ucla.edu>
6160
6161 * NEWS: Reword the post-2.3 change to not be so optimistic about
6162 removing the old "look-ahead" spelling.
6163 Update previous look-ahead/lookahead change reports.
6164 * REFERENCES: look-ahead -> lookahead (since that's
6165 what he actually wrote).
6166 * doc/refcard.tex: look ahead -> lookahead,
6167 look-ahead -> lookahead
6168
742e4900
JD
61692006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
6170
6171 For consistency, use `lookahead' instead of `look-ahead' or
6172 `look_ahead'. Discussed starting at
6173 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
6174 and then at
6175 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
6176 * NEWS: For the next release, note the change to `--report'.
6177 * TODO, doc/bison.1: Update English.
6178 * doc/bison.texinfo: Update English.
6179 (Understanding Your Parser, Bison Options): Document as
6180 `--report=lookahead' rather than `--report=look-ahead'.
6181 * src/conflicts.c: Update English in comments.
6182 (lookahead_set): Rename from look_ahead_set.
6183 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
6184 (resolve_sr_conflict): Rename local look_ahead_tokens to
6185 lookahead_tokens, and update other uses.
6186 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
6187 count_rr_conflicts, conflicts_free): Update uses.
6188 * src/getargs.c (report_args): Move "lookahead" before alternate
6189 spellings.
6190 (report_types): Update uses.
6191 (usage): For `--report' usage description, state `lookahead' spelling
6192 rather than `look-ahead'.
6193 * src/getargs.h (report.report_lookahead_tokens): Rename from
6194 report_look_ahead_tokens.
6195 * src/lalr.c: Update English in comments.
6196 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
6197 (state_lookahead_tokens_count): Rename from
6198 state_look_ahead_tokens_count.
6199 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6200 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
6201 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6202 Update other uses.
6203 Update English in output.
6204 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
6205 * src/print.c: Update English in comments.
6206 (lookahead_set): Rename from look_ahead_set.
6207 (print_reduction): Rename argument lookahead_token from
6208 look_ahead_token.
6209 (print_core, state_default_rule, print_reductions, print_results):
6210 Update uses.
6211 * src/print_graph.c: Update English in comments.
6212 (print_core): Update uses.
6213 * src/state.c: Update English in comments.
6214 (reductions_new): Update uses.
6215 (state_rule_lookahead_tokens_print): Rename from
6216 state_rule_look_ahead_tokens_print, and update other uses.
6217 * src/state.h: Update English in comments.
6218 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
6219 (state_rule_lookahead_tokens_print): Rename from
6220 state_rule_look_ahead_tokens_print.
6221 * src/tables.c: Update English in comments.
6222 (conflict_row, action_row): Update uses.
6223 * tests/glr-regression.at
6224 (Incorrect lookahead during deterministic GLR,
6225 Incorrect lookahead during nondeterministic GLR): Rename
6226 print_look_ahead to print_lookahead.
6227 * tests/torture.at: Update English in comments.
6228 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
6229 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
6230 (Many lookahead tokens): Update uses.
6231 * data/glr.c: Update English in comments.
6232 * lalr1.cc: Likewise.
6233 * yacc.c: Likewise.
6234 * src/conflicts.h: Likewise.
6235 * src/lalr.h: Likewise.
6236 * src/main.c: Likewise.
6237 * src/output.c: Likewise.
6238 * src/parse-gram.c: Likewise.
6239 * src/tables.h: Likewise.
6240 * tests/calc.at: Likewise.
6241
3c40d0b5
JD
62422006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
6243
6244 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
6245
5d278082
PE
62462006-06-07 Paul Eggert <eggert@cs.ucla.edu>
6247
6248 * TODO: Add request from Nelson H. F. Beebe to be able to install
6249 Bison without installing the yacc script.
6250
9e668899
JD
62512006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6252
6253 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
6254 and yytext if they're already #define'd.
6255 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6256 * src/scan-code-c.c: ... here.
6257 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
6258 <config.h>.
6259
0c8e079f
JD
62602006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6261
6262 Get Bison to build again when configured with --enable-gcc-warnings.
6263 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
6264 missing #include's.
6265 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
6266 loc argument as it shadows a global.
6267 * src/scan-gram.l: Remove stray comma that prevents boundary_set
6268 invocation.
6269
6270 * src/.cvsignore: Add scan-code.c.
6271
2346344a
AD
62722006-06-07 Akim Demaille <akim@epita.fr>
6273
6274 * src/scan-gram.l: Move the "add a trailing ; to actions" code
6275 to...
6276 * src/scan-code.l: here.
6277 * tests/input.at (Torturing the Scanner): Fix another location
6278 error.
6279
4862bdfd
AD
62802006-06-07 Akim Demaille <akim@epita.fr>
6281
6282 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
6283
e9071366
AD
62842006-06-06 Akim Demaille <akim@epita.fr>
6285
6286 Extract the parsing of user actions from the grammar scanner.
6287 As a consequence, the relation between the grammar scanner and
6288 parser is much simpler. We can also split "composite tokens" back
6289 into simple tokens.
6290 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
6291 * src/scan-gram.l (add_column_width, adjust_location): Move to and
6292 rename as...
6293 * src/location.h, src/location.c (add_column_width)
6294 (location_compute): these.
6295 Fix the column count: the initial column is 0.
6296 (location_print): Be robust to ending column being 0.
6297 * src/location.h (boundary_set): New.
6298 * src/main.c: Adjust to scanner_free being renamed as
6299 gram_scanner_free.
6300 * src/output.c: Include scan-code.h.
6301 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
6302 Use boundary_set.
6303 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
6304 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
6305 which is now, again, a separate token.
6306 Adjust all dependencies.
6307 Whereever actions with $ and @ are used, use translate_code.
6308 (action): Remove this nonterminal which is now useless.
6309 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
6310 (grammar_current_rule_action_append): Use translate_code.
6311 (packgram): Bound check ruleno, itemno, and rule_length.
6312 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
6313 (last_string, last_braced_code_loc, max_left_semantic_context)
6314 (scanner_initialize, scanner_free, scanner_last_string_free)
6315 (gram_out, gram_lineno, YY_DECL_): Move to...
6316 * src/scan-gram.h: this new file.
6317 (YY_DECL): Rename as...
6318 (GRAM_DECL): this.
6319 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
6320 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6321 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6322 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6323 Move these declarations, and...
6324 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
6325 these to...
6326 * src/flex-scanner.h: this new file.
6327 * src/scan-gram.l (rule_length, rule_length_overflow)
6328 (increment_rule_length): Remove.
6329 (last_braced_code_loc): Rename as...
6330 (gram_last_braced_code_loc): this.
6331 Adjust to the changes of the parser.
6332 Move all the handling of $ and @ into...
6333 * src/scan-code.l: here.
6334 * src/scan-gram.l (handle_dollar, handle_at): Remove.
6335 (handle_action_dollar, handle_action_at): Move to...
6336 * src/scan-code.l: here.
6337 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
6338 scan-code.h, scan-code-c.c, scan-gram.h.
6339 (EXTRA_bison_SOURCES): Add scan-code.l.
6340 (BUILT_SOURCES): Add scan-code.c.
6341 (yacc): Be robust to white spaces.
6342
6343 * tests/conflicts.at, tests/input.at, tests/reduce.at,
6344 * tests/regression.at: Adjust the column numbers.
6345 * tests/regression.at: Adjust the error message.
7891a7c4 6346
184e42f0
JD
63472006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6348
6349 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6350 Use Akim's wording from
6351 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
6352
7891a7c4
JD
63532006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6354
6355 Between Bison releases, manually append `+' to the previous Bison
6356 release number, and use that as a signal to automatically print the
6357 ChangeLog's CVS Id keyword from --version. Discussed starting at
6358 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
6359 * ChangeLog: Add Id header.
6360 * configure.ac (AC_INIT): Append `+' to `2.3'.
6361 * src/.cvsignore: Add revision.c.
6362 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
6363 (BUILT_SOURCES): Add revision.c.
6364 (revision.c): New target rule. This file defines a new global variable
6365 named revision. It initializes it with either the Id from ChangeLog
6366 or, if VERSION doesn't contain `+', with the empty string.
6367 * src/getargs.c (version): Print the value of revision.
6368 * src/revision.h: Extern revision.
6369
4ad3ed84
PE
63702006-06-05 Paul Eggert <eggert@cs.ucla.edu>
6371
6372 * NEWS: Version 2.3.
6373 * configure.ac (AC_INIT): Likewise.
6374
02103984
PE
63752006-05-30 Paul Eggert <eggert@cs.ucla.edu>
6376
6377 * data/glr.c (YYRECOVERING): Define to be a function-like macro
6378 with no arguments, not as an object-like macro. This is for
6379 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
6380 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
6381 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
6382 Document this.
6383
2c08afa5
JD
63842006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
6385
6386 * src/getargs.c (usage): Back out yesterday's modification of the
6387 --help output so that we don't have to wait for translation before
6388 releasing 2.3.
6389
6077da58
PE
63902006-05-29 Paul Eggert <eggert@cs.ucla.edu>
6391
6392 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
6393 Problem reported by Akim Demaille.
6394
2a26b6c2
JD
63952006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6396
6397 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6398
aefef0d6
PE
63992006-05-26 Paul Eggert <eggert@cs.ucla.edu>
6400
6401 * data/yacc.c (yy_reduce_print): Omit trailing white space in
6402 generated source code. Problem reported by Frans Englich in
6403 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
6404
fcd8e201
PE
64052006-05-22 Paul Eggert <eggert@cs.ucla.edu>
6406
6407 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
6408 shell, not within 'make', so that 'make' by an ordinary builder
6409 (using GNU make) does not worry about configuring gzip. This also
6410 works around a bug reported independently by Keith Thompson and by
6411 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
6412 stderr rather than stdout, messing up the build logs.
6413
7b5cdcbd
JD
64142006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6415
6416 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
6417 to make sure that YYID will never be unused. This fixes a 'make
6418 maintainer-check' failure caused by the recent changes to the 'Trivial
6419 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
6420 not used.
6421 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
6422
5ad0a449
JD
64232006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6424
6425 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
6426 state before an empty RHS is always resolved here. Only the location
6427 of that state is guaranteed to be resolved, and that's enough. This
6428 fixes the remaining bug reported by Derek M. Jones in
6429 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6430 * tests/glr-regression.at (Uninitialized location when reporting
6431 ambiguity): Test the above case.
6432 Also, the embedded comments in this test case claim it checks the case
6433 of an empty RHS that has inherited the initial location. However, the
6434 corresponding LHS was already resolved, so yyresolveLocations didn't
6435 actually have reason to modify it. Fix this by forcing
6436 nondeterministic operation at the beginning of the parse.
6437
50cce58e
PE
64382006-05-20 Paul Eggert <eggert@cs.ucla.edu>
6439
6440 * data/c.m4 (b4_yy_symbol_print_generate):
6441 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
6442 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
6443 of the bugs reported today by Derek M Jones in
6444 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6445 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
6446 defined to be a type name without parens or brackets.
6447 (Location Type): Similarly for YYLTYPE.
6448 * tests/regression.at (Trivial grammars): Put in a test for this
6449 bug that will be caught by 'make maintainer-check' (though not,
6450 alas, by 'make check' unless your compiler is picky).
6451
ab8d9dc5
PE
64522006-05-19 Paul Eggert <eggert@cs.ucla.edu>
6453
0d2c8934 6454 * NEWS: Version 2.2.
ab8d9dc5
PE
6455 * configure.ac (AC_INIT): Likewise.
6456
9138c575
JD
64572006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
6458
6459 * data/glr.c (yyreportTree): Make room in yystates for the state
6460 preceding the RHS. This fixes the segmentation fault reported by Derek
6461 M. Jones in
6462 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
6463 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
6464 to the user. Reported for yyreportTree by Derek M. Jones later in the
6465 same thread.
6466 * THANKS: Add Derek M. Jones.
6467 Update my email address.
6468 Fix typo in Steve Murphy's name.
6469
276f48df
PE
64702006-05-14 Paul Eggert <eggert@cs.ucla.edu>
6471
d6645148
PE
6472 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
6473 checking against YYLAST that caused the parser to miss a potential
6474 alternative in its diagnostic.
6475 Problem reported by Maria Jose Moron Fernandez in
6476 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
6477 * data/lalr1.cc (yysyntax_error_): Likewise.
6478 * data/yacc.c (yysyntax_error): Likewise.
6479 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
6480 tokens, in case we run into an older C compiler.
6481 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
6482 Use them to check for the off-by-one error fixed above.
6483
276f48df
PE
6484 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
6485 YYSIZE_T, not size_t.
6486 * tests/regression.at (Trivial grammars): New test, to catch
6487 the error fixed by the above patch.
6488
cd8b5791
AD
64892006-05-14 Akim Demaille <akim@lrde.epita.fr>
6490
6491 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
6492 scheme.
6493 Reported by Steve Murphy.
6494
34376418
AD
64952006-05-14 Akim Demaille <akim@lrde.epita.fr>
6496
6497 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
6498 * data/glr.cc: b4_location_flag is now b4_locations_flag.
6499
327afc7c
AD
65002006-05-14 Akim Demaille <akim@lrde.epita.fr>
6501
6502 Implement --trace=m4.
6503 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
6504 * src/output.c (output_skeleton): When set, pass -dV to m4.
6505
6506 Factor the handling of flags in m4.
6507 * src/output.c (prepare): Rename the muscle names debug, defines,
6508 error_verbose to debug_flag, defines_flag, error_verbose_flag.
6509 * data/c.m4: Adjust.
6510 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
6511 Use b4_define_flag_if to define other b4_FLAG_if macros.
6512 (b4_location_if): As a consequence, rename as...
6513 (b4_locations_if): this, for consistency.
6514 Adjust all the skeletons.
6515
ba9ecd19
AD
65162006-05-14 Akim Demaille <akim@lrde.epita.fr>
6517
6518 * etc/bench.pm: Shorten bench names.
6519
4e83ea15
AD
65202006-05-14 Akim Demaille <akim@lrde.epita.fr>
6521
6522 * src/output.h, src/output.c (error_verbose): Move to...
6523 * src/getargs.h, src/getargs.c: here.
6524 Sort the flags.
6525 Adjust dependencies.
6526
6e93d810
PE
65272006-05-13 Paul Eggert <eggert@cs.ucla.edu>
6528
6529 * data/c.m4 (b4_copyright): Put the special exception for Bison
6530 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
6531 uses changed. Suggested by Akim Demaille. Also, wrap the
6532 copyright notice, in case it is longer than 80 columns. Replace
6533 comma by newline after title.
6e93d810 6534
eaea13f5
PE
65352006-05-11 Paul Eggert <eggert@cs.ucla.edu>
6536
6537 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
6538 incompatibility, not a bug. Mention that it wasn't fixed as of
6539 flex 2.5.33.
6540
3cf084ec
AD
65412006-05-11 Akim Demaille <akim@lrde.epita.fr>
6542
6543 * examples/extexi: Enforce the precedence of concatenation over
6544 >>.
0a9f1c7d 6545 Reported by Tommy Nordgren.
3cf084ec 6546
32c96bd7
AD
65472006-05-11 Akim Demaille <akim@lrde.epita.fr>
6548
6549 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
6550 with the member "token".
f94705b2 6551 Reported by Martin Nylin.
32c96bd7 6552
eaea13f5
PE
65532006-05-08 Paul Eggert <eggert@cs.ucla.edu>
6554
6555 * data/glr.c: Switch to Bison 2.2 special-exception language in
6556 the copyright notice. Use more-regular format for titles and
6557 copyright notices.
6558 * data/glr.cc: Likewise.
6559 * data/location.cc: Likewise.
6560 * data/yacc.cc: Likewise.
6561 * doc/bison.texinfo (Conditions): Document this.
6562 * NEWS: likewise. Upgrade version to 2.2.
6563
6e2d1146
AD
65642006-04-27 Akim Demaille <akim@lrde.epita.fr>
6565
6566 * data/glr.cc: Remove dead code.
6567
47671055
PE
65682006-04-25 Paul Eggert <eggert@cs.ucla.edu>
6569
6570 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
6571 that variable and the line breaks the bootstrap. Problem reported
6572 by Juan M. Guerrero.
6573
ed2e6384
AD
65742006-04-24 Akim Demaille <akim@lrde.epita.fr>
6575
6576 * doc/bison.texinfo (Multiple start-symbols): New.
6577
3cedc2dc
AD
65782006-04-24 Akim Demaille <akim@lrde.epita.fr>
6579
6580 * etc/README, etc/bench.pl: New.
6581
b2ddc3f3
AD
65822006-04-03 Akim Demaille <akim@lrde.epita.fr>
6583
6584 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
6585 rule.
6586 Reported by Mickael Labau.
6587 * tests/input.at (Torturing the Scanner): Test it.
6588
91e3ac9a
PE
65892006-03-16 Paul Eggert <eggert@cs.ucla.edu>
6590
6591 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
6592 Problem reported by Bob Rossi.
6593
65942006-03-13 Paul Eggert <eggert@cs.ucla.edu>
6595
6596 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
6597 and didn't really work.
6598 For the index, use @ifnotinfo, not @iftex.
6599 Minor cleanups of spacing and terminology.
6600
5cf61e93
AD
66012006-03-12 Akim Demaille <akim@lrde.epita.fr>
6602
6603 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
6604 of AT_NAME_PREFIX when %name-prefix is not used.
6605
aa08666d
AD
66062006-03-12 Akim Demaille <akim@lrde.epita.fr>
6607
6608 Apply --prefix to C++ skeletons too: they change the namespace.
6609 The test suite already exercize these cases.
6610 * data/c++.m4 (b4_namespace): New.
6611 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
6612 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
6613 * data/yacc.c, data/glr.c: Remove a useless `[]'.
6614 * doc/bison.texinfo: Document it.
6615 (Option Cross Key): Use @multitable in all formats. It looks
6616 nicer, even in TeX outputs.
6617 (Rules): Use the same code whatever the output type is.
6618 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
6619 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
6620 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 6621
45567173
AD
66222006-03-10 Akim Demaille <akim@lrde.epita.fr>
6623
6624 * TODO: Remove dead items.
6625
e9d8f881 66262006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
6627
6628 * doc/FAQ: Remove, merged into...
6629 * doc/bison.texinfo (FAQ): this.
6630 * doc/Makefile.am (EXTRA_DIST): Adjust.
6631
c095d689
AD
66322006-03-10 Akim Demaille <akim@lrde.epita.fr>
6633
6634 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
6635 even if empty.
6636 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
6637 * doc/bison.texinfo (Calc++ Scanner): Use it.
6638
6e0f8287
PE
66392006-03-09 Paul Eggert <eggert@cs.ucla.edu>
6640
6641 Fix two nits reported by twlevo, plus one more that I discovered.
6642
6643 * src/assoc.h (assoc_to_string): Give a name to the arg, as
6644 this is the usual Bison style.
6645 * src/location.h (location_print): Likewise.
6646
6647 * src/reader.h (token_name): Likewise.
6648
d6b771c3
PE
66492006-03-08 Paul Eggert <eggert@cs.ucla.edu>
6650
6651 Fix some nits reported by twlevo.
6652 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
6653 and "POSIX". Use more-modern syntax for URLs. Mention C++
6654 and ask for Java. Don't hardwire OS version numbers. Add
6655 copyright notice.
6656 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
6657 * src/conflicts.c (solved_conflicts_obstack): Now static.
6658
1e137b71
JD
66592006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
6660
6661 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
6662 page. Say "you can use it" not "you may use it" as on the web page;
6663 we're describing capabilities not granting permission.
6664
73f2e47e
PE
66652006-03-06 Paul Eggert <eggert@cs.ucla.edu>
6666
6d05403d
PE
6667 * data/glr.c (yyresolveLocations): Rename local variables to avoid
6668 shadowing warnings. Use usual patter for iterating through RHS.
6669 * tests/glr-regression.at
6670 (Uninitialized location when reporting ambiguity):
6671 Modify yylex so that it uses its argument, rather than trying
6672 to rely on ARGSUSED (which doesn't work for gcc with warnings).
6673 const char -> char const.
6674
73f2e47e
PE
6675 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
6676 Don't use tabs inside commands; it messes up 'ps'.
6677 Problem reported by twlevo.
6678
8710fc41
JD
66792006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
6680
6681 * tests/glr-regression.at (Uninitialized location when reporting
6682 ambiguity): New test case.
6683 * data/glr.c (yyresolveLocations): New function, which uses
6684 YYLLOC_DEFAULT.
6685 (yyresolveValue): Invoke yyresolveLocations before reporting an
6686 ambiguity.
6687 * doc/bison.texinfo (Default Action for Locations): Note
6688 YYLLOC_DEFAULT's usage for ambiguity locations.
6689 (GLR Semantic Actions): Cross-reference those notes.
6690
ae952af2
JD
66912006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
6692
6693 * tests/glr-regression.at (Leaked semantic values when reporting
6694 ambiguity): Remove unnecessary union and type declarations.
6695 (Leaked lookahead after nondeterministic parse syntax error): New test
6696 case.
6697 * data/glr.c (yyparse): Check for zero stacks remaining before
6698 attempting to shift the lookahead so that you don't lose it.
6699
35ee866a
JD
67002006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6701
6702 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
6703 * tests/glr-regression.at (Leaked semantic values when reporting
6704 ambiguity): New test case.
6705 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
6706 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
6707 now unnecessary yystackp parameter.
6708 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
6709 destructors can be called.
6710
6711 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
6712 in existing testcases.
6713
520181ab
JD
67142006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6715
6716 Don't leak semantic values for parent RHS when a user action cuts the
6717 parser, and clean up related code a bit.
6718 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
6719 cuts parse): Rename to...
6720 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
6721 for leaked parent RHS values.
6722 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
6723 between an unresolved state (non-empty chain of semantic options) and
6724 an incomplete one (signaled by an empty chain).
ae952af2 6725 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
6726 successfully or unsuccessfully resolved yyGLRState to...
6727 (yyresolveValue): ... here so that yyresolveValue always leaves a
6728 yyGLRState with consistent data and thus is easier to understand.
6729 Remove the yyvalp and yylocp parameters since they are always just
6730 taken from the yys parameter. When reporting a discarded merged value
6731 in debugging output, note that it is incompletely merged. Document the
6732 interface.
6733 (yyresolveAction): If resolving any of the RHS states fails, destroy
6734 them all rather than leaking them. Thus, as long as user actions are
6735 written to clean up the RHS correctly, yyresolveAction always cleans up
6736 the RHS of a semantic option. Document the interface.
6737
18d9185c
PE
67382006-02-27 Paul Eggert <eggert@cs.ucla.edu>
6739
6740 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
6741 led to a segmentation fault in GNU Pascal. Problem reported
6742 by Waldek Hebisch.
6743
841a7737
JD
67442006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
6745
6746 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
6747 mid-rule action inside a nonterminal symbol in order to declare a
6748 destructor for its semantic value.
6749
fc3f467f
PE
67502006-02-16 Paul Eggert <eggert@cs.ucla.edu>
6751
6752 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
6753 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
6754 __cplusplus && ! defined _STDLIB_H && !
6755 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
6756 defined free))]: Include <stdlib.h> rather than rolling our own
6757 declarations of malloc and free, to avoid problems with
6758 incompatible declarations (using 'throw') C++'s stdlib.h. This
6759 should fix Debian bug 340012
6760 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
6761 reported by Guillaume Melquiond.
6762
a3af26dd
PE
67632006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6764
4d7bc38c
PE
6765 * NEWS: Clarify symbols versus types in unused-value warnings.
6766
a3af26dd
PE
6767 * configure.ac (AC_INIT): Bump version number.
6768
4e26c69e
PE
67692006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6770
6771 * NEWS: Version 2.1a.
6772 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
6773 since C99 requires this.
6774
498e897c
PE
67752006-02-11 Paul Eggert <eggert@cs.ucla.edu>
6776
6777 * m4/c-working.m4: New file.
6778 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
6779
57bb17ca
PE
67802006-02-10 Paul Eggert <eggert@cs.ucla.edu>
6781
6782 * Makefile.maint: Merge from coreutils.
6783
0be105dc
PE
67842006-02-09 Paul Eggert <eggert@cs.ucla.edu>
6785
6786 More portability fixes for problems summarized by Nelson H. F. Beebe.
6787
6788 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
6789 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
6790 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
6791 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
6792 messes up because C++ code is compiled in 32-bit mode but linked
6793 in 64-bit mode.
6794
6fc0c024
PE
67952006-02-08 Paul Eggert <eggert@cs.ucla.edu>
6796
6797 More portability fixes for problems summarized by Nelson H. F. Beebe.
6798
7870f699
PE
6799 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
6800 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
6801
6fc0c024
PE
6802 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
6803 nodist_PROGRAMS, since we don't need to actually compile the
6804 example if we're just doing a plain 'make'. This avoids bothering
6805 the installer unnecessarily about problems due to weird C++
6806 compilers.
6807
fe6c2fde
PE
68082006-02-06 Paul Eggert <eggert@cs.ucla.edu>
6809
6810 More portability fixes for problems summarized by Nelson H. F. Beebe.
6811
6812 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
6813 than #include "...", and compile with -I'.'. The old method was
6814 not portable, according to Posix and the C standard, and it does
6815 not work with Sun C 5.7, where previous #line directives affect
6816 the working directory used in later #include "..." directives.
6817
927b425b
JMG
68182006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6819
6820 Various DJGGP specific issues in /djgpp
6821
d9735e9e
PE
68222006-02-02 Paul Eggert <eggert@cs.ucla.edu>
6823
6824 More portability fixes for problems summarized by Nelson H. F. Beebe.
6825
6826 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
6827 '#include <map>' works and that you can apply ++ to iterators.
6828
5a6755af
PE
68292006-02-01 Paul Eggert <eggert@cs.ucla.edu>
6830
67a0dc4f
PE
6831 Work around portability problems summarized by Nelson H. F. Beebe in
6832 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
6833
8c86f0ef
PE
6834 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6835 that '#include <string>' works.
6836
de35dd59
PE
6837 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
6838 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
6839 "warning: sorry: semantics of inline function static data `const
6840 unsigned char translate_table[262]' are wrong (you'll wind up with
6841 multiple copies)".
6842
67a0dc4f
PE
6843 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
6844 or, xor to not_, and_, or_, and xor_, respectively. This works
6845 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
6846 random system header somewhere that includes the equivalent of
6847 <iso646.h>.
6848
5a6755af
PE
6849 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
6850 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 6851 Suite Version 2.0.
5a6755af 6852
3f001415
JD
68532006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
6854
6855 During deterministic GLR operation, user actions should be able to
6856 influence the parse by changing yychar. To make this easier to fix and
6857 to make glr.c easier to evolve in general, don't maintain yytoken in
6858 parallel with yychar; just compute yytoken when needed.
6859 * tests/glr-regression.at (Incorrect lookahead during deterministic
6860 GLR): Check that setting yychar in a user action has the intended
6861 effect.
6862 * data/glr.c (yyGLRStack): Remove yytokenp member.
6863 (yyclearin): Don't set *yytokenp.
6864 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
6865 yychar rather than *yytokenp to determine the current lookahead.
6866 Compute yytoken locally when needed.
6867 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
6868 point to.
6869
6870 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
6871 after `--report' documentation.
6872
e2a8c0f5
PE
68732006-01-30 Paul Eggert <eggert@cs.ucla.edu>
6874
6875 * src/parse-gram.y (grammar_declaration): Location of printer
6876 symbol is @1, not list->location. Bug reported by twlevo.
6877 * tests/input.at (Incompatible Aliases): Adjust to above change.
6878
6b702268
PE
68792006-01-29 Paul Eggert <eggert@cs.ucla.edu>
6880
27622431
PE
6881 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
6882 all the test at once. This makes the output easier to read in the
6883 normal case.
6884
6b702268
PE
6885 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
6886 got from <http://bro-ids.org/download.html>. The bug is that
6887 when two actions appeared in succession, the second one was
6888 scanned before the first one was added to the grammar rule
6889 as a midrule action. Bison then output the incorrect warning
6890 "parse.y:905.17-906.36: warning: unused value: $3".
6891 * src/parse-gram.y (BRACED_CODE, action): These are no longer
6892 associated with a value.
6893 (rhs): Don't invoke grammar_current_rule_action_append.
6894 (action): Invoke it here instead.
6895 * src/reader.c (grammar_midrule_action): Now extern.
6896 (grammar_current_rule_action_append): Don't invoke
6897 grammar_midrule_action; that is now the scanner's job.
6898 * src/reader.h (last_string, last_braced_code_loc):
6899 (grammar_midrule_action): New decls.
6900 * src/scan-gram.l (last_string): Now extern, sigh.
6901 (last_braced_code_loc): New extern variable.
6902 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
6903 rule already has an action.
6904 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
6905 * tests/input.at (AT_CHECK_UNUSED_VALUES):
6906 Add some tests to check that the above changes fixed the bug.
6907
d40ba6c2
PE
69082006-01-27 Paul Eggert <eggert@cs.ucla.edu>
6909
6910 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
6911 All used changed. Check whether the symbol has a destructor,
6912 not whether it is typed.
6913 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
6914 that the values are still reported as unused. All line numbers
6915 adjusted.
6916
401aace6
PE
69172006-01-23 Paul Eggert <eggert@cs.ucla.edu>
6918
6919 Work around a bug in bro 0.8, which underparenthesizes its
6920 definition of YYLLOC_DEFAULT.
6921 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
6922 their arguments.
6923 * data/lalr1.cc: Likewise.
6924 * data/yacc.cc: Likewise.
6925
06f01bc4
PE
69262006-01-22 Paul Eggert <eggert@cs.ucla.edu>
6927
401aace6
PE
6928 Work around a bug in Pike 7.0, and give the Pike folks a
6929 better way to override the usual int widths.
6930 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
6931 user can override the types.
6932 (short): #undef, to work around a bug in Pike 7.0.
6933 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
6934 (union yyalloc.yyss): Use yytype_int16 rather than short.
6935 All uses changed.
6936 (yysigned_char): Remove.
6937 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
6938 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
6939 * tests/regression.at (Web2c Actions): Adjust to above changes.
6940
6941 * src/reader.c (check_and_convert_grammar): New function.
6942 (reader): Close the input file even if something went wrong during
6943 parsing. Minor file descriptor leak reported by twlevo.
6944
06f01bc4
PE
6945 * src/assoc.c (assoc_to_string): Use a default: abort (); case
6946 to pacify gcc -Wswitch-default.
6947 * src/scan-gram.l (adjust_location): Use a default: break; case
6948 to pacify gcc -Wswitch-default.
6949 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
6950 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6951 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6952 Move these decls to scan-skel.l, since they don't need to be
6953 visible elsewhere.
6954 * src/scan-skel.l: Accept the above decls.
6955 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
6956 is used.
6957
02650b7f
PE
69582006-01-21 Paul Eggert <eggert@cs.ucla.edu>
6959
6960 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
6961 since we don't want to insist on a version number at the start
6962 of the changelog every time.
6963 * Makefile.maint: Sync from coreutils a bit better.
6964 (sc_trailing_blank): Renamed from sc_trailing_space.
6965 All uses changed.
6966 (sc_no_if_have_config_h, sc_require_config_h):
6967 (sc_prohibit_assert_without_use): New rules.
6968 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
6969 (sc_dd_max_sym_length): Fix leading spaces in rule.
6970 (sc_system_h_headers): Prefix with @.
6971 (sc_useless_cpp_parens, m4-check): Output line numbers.
6972 (changelog-check): Allow version only in head.
6973 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
6974 satisfy new Makefile.maint rule.
6975 * data/glr.c: Likewise.
6976 * data/glr.cc: Likewise.
6977 * data/lalr1.cc: Likewise.
6978 * data/yacc.c: Likewise.
6979 * lib/ebitsetv.c: Likewise.
6980 * lib/lbitset.c: Likewise.
6981 * lib/subpipe.c: Likewise.
6982 * lib/timevar.c: Likewise.
6983 * src/system.h: Likewise.
6984 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
6985 * djgpp/Makefile.maint: Add copyright notice.
6986 * djgpp/README.in: Likewise.
6987 * djgpp/config.bat: Likewise.
6988 * djgpp/config.site: Likewise.
6989 * djgpp/config_h.sed: Likewise.
6990 * djgpp/djunpack.bat: Likewise.
6991 * djgpp/config.sed: Fix copyright notice to match standard format.
6992 * djgpp/subpipe.h: Likewise.
6993 * lib/bitsetv-print.c: Likewise.
6994 * lib/bitsetv.c: Likewise.
6995 * lib/subpipe.h: Likewise.
6996 * lib/timevar.c: Likewise.
6997 * lib/timevar.h: Likewise.
6998 * djgpp/subpipe.c: Use standard recipe for config.h.
6999 * lib/abitset.c: Likewise.
7000 * lib/bitset.c: Likewise.
7001 * lib/bitset_stats.c: Likewise.
7002 * lib/bitsetv-print.c: Likewise.
7003 * lib/bitsetv.c: Likewise.
7004 * lib/ebitsetv.c: Likewise.
7005 * lib/get-errno.c: Likewise.
7006 * lib/lbitset.c: Likewise.
7007 * lib/subpipe.c: Likewise.
7008 * lib/timevar.c: Likewise.
7009 * lib/vbitset.c: Likewise.
7010 * tests/local.at: Likewise.
7011 * src/scan-gram.l: Don't include verify.h, since system.h does
7012 that for us.
7013 * .x-sc_require_config_h: New file.
7014 * .x-sc_unmarked_diagnostics: New file.
7015
287c78f6
PE
70162006-01-20 Paul Eggert <eggert@cs.ucla.edu>
7017
287c78f6
PE
7018 Be a bit more systematic about using 'abort'.
7019 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
7020 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
7021 Put 'default: abort ();' before some other case, to satisfy older
7022 pedantic compilers.
7023 * lib/bitset_stats.c (bitset_stats_init): Likewise.
7024 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
7025 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
7026 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
7027 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
7028 (get_decision_str, get_orientation_str, get_node_alignment_str):
7029 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
7030 (get_linestyle_str, get_arrowstyle_str): Likewise.
7031 * src/conflicts.c (resolve_sr_conflict):
7032 Use a default case rather than one for the one remaining enum
7033 value, to catch invalid enum values as well.
7034 * src/lalr.c (set_goto_map, map_goto):
7035 Prefer "assert (FOO);" to "if (!FOO) abort ();".
7036 * src/nullable.c (nullable_compute, token_definitions_output):
7037 Likewise.
7038 * src/reader.c (packgram, reader): Likewise.
7039 * src/state.c (transitions_to, state_new, state_reduction_find):
7040 Likewise.
7041 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
7042 (symbol_pack): Likewise.
7043 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
7044 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
7045 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
7046 * src/system.h: Don't include <assert.h>.
7047 (assert): New macro.
7048
7049 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
7050 (Destructor Decl, Parser Function, Pure Calling):
7051 Describe rules for braces inside C code more carefully.
287c78f6 7052
c66dfadd
PE
70532006-01-19 Paul Eggert <eggert@cs.ucla.edu>
7054
c21493b8
PE
7055 Fix some porting glitches found by Nelson H. F. Beebe.
7056 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
7057 compilers that don't understand that abort () does not return.
7058 * src/state.c (transitions_to): Likewise.
7059 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7060 that '#include <cstdlib>' works.
7061 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
7062 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
7063 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
7064 for the benefit of some pre-C99 compilers.
7065
b6e3facf
PE
7066 * bootstrap: Undo changes to gnulib files that autoreconf made.
7067
c66dfadd
PE
7068 Minor fixups to get 'make maintainer-check' to work.
7069 * configure.ac: Don't use -Wnested-externs, as it's incompatible
7070 with the new verify.h implementation.
7071 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
7072 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
7073 * data/yacc.c (YYUSE): Likewise.
7074 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
7075 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
7076 * src/parse-gram.y (declaration): Don't pass a string constant
7077 to a function that expects char *, since GCC might complain
7078 about the constant value.
7079 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
7080 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
7081 before #defining them.
7082 * tests/glr-regression.at
7083 (Incorrectly initialized location for empty right-hand side in GLR):
7084 In yyerror, use the msg arg.
7085 (Corrupted semantic options if user action cuts parse):
7086 (Incorrect lookahead during deterministic GLR):
7087 (Incorrect lookahead during nondeterministic GLR):
7088 Don't name a local var 'index'; it shadows string.h's 'index'.
7089
ed94ef2a
AD
70902006-01-19 Akim Demaille <akim@epita.fr>
7091
7092 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
7093 location, not just parts of it.
7094
e9ad4aec
PE
70952006-01-18 Paul Eggert <eggert@cs.ucla.edu>
7096
d6ca7905
PE
7097 * NEWS: Document the fact that multiple %unions are now allowed.
7098 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
7099 * TODO: This feature is now implemented, so remove it from
7100 the wishlist.
d6ca7905 7101
ef1b70e0
PE
7102 * Makefile.maint: Merge with coreutils Makefile.maint.
7103 (CVS_LIST): Use build-aux version if available.
7104 (VERSION_REGEXP): New macro.
7105 (syntax-check-rules): Add sc_no_if_have_config_h,
7106 sc_prohibit_assert_without_use, sc_require_config_h,
7107 sc_useless_cpp_parens.
7108 (sc_obsolete_symbols): Check for O_NDELAY.
7109 (sc_dd_max_sym_length): Track coreutils.
7110 (sc_unmarked_diagnostics): Look in all files, not just *.c.
7111 (sc_useless_cpp_parens): New rule.
7112 (news-date-check): Look for version or today's date.
7113 (changelog-check): Don't require version number near head.
7114 (copyright-check): Use current year instead of hardwiring 2005.
7115 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
7116 (announcement): Add --gpg-key-ID.
7117
7118 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
7119 with "file system".
7120
2073ce56 7121 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
7122 array. Problem reported by twlevo.
7123 * src/reader.c (packgram): Prepend a new sentinel before ritem.
7124 * src/lalr.c (build_relations): Rely on new sentinel.
7125 * src/gram.c (gram_free): Adjust to new sentinel.
7126
b7691f15
JD
71272006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
7128
7129 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
7130 yylookaheadNeeds. All uses updated.
7131 (yysplitStack): Rename local yynewLookaheadStatuses to
7132 yynewLookaheadNeeds.
7133 * data/glr-regression.at (Incorrect lookahead during nondeterministic
7134 GLR): In comments, change `lookahead status' to `lookahead need'.
7135
ddee1b06
PH
71362006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7137
7138 * data/glr.c (yysplitStack): A little stylistic rewrite.
7139
12f4614d
PH
71402006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7141
7142 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
7143
32c29292
JD
71442006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
7145
7146 * doc/bison.texinfo: Fix some typos.
7147 (GLR Semantic Actions): New subsection discussing special
7148 considerations because GLR semantic actions might be deferred.
7149 (Actions): Mention look-ahead usage of yylval.
7150 (Actions and Locations): Mention look-ahead usage of yylloc.
7151 (Special Features for Use in Actions): Add YYEOF entry and mention it
7152 in the yychar entry.
7153 In the yychar entry, remove mention of the local yychar case (pure
7154 parser) since this is irrelevant information when writing semantic
148d66d8 7155 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
7156 yychar is otherwise described as an external variable.
7157 In the yychar entry, don't call it the `current' look-ahead since it
7158 isn't when semantic actions are deferred.
7159 In the yychar and yyclearin entries, add note about deferred semantic
7160 actions.
7161 Add yylloc and yylval entries discussing look-ahead usage.
7162 (Look-Ahead Tokens): When discussing yychar, don't call it the
7163 `current' look-ahead, and do mention yylval and yylloc.
7164 (Error Recovery): Cross-reference `Action Features' when mentioning
7165 yyclearin.
148d66d8 7166 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
7167 look-ahead.
7168 In the yylloc and yylval entries, mention look-ahead usage.
7169
de366a2f 71702006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
7171
7172 * tests/glr-regression.at: Update copyright year to 2006.
7173
bf70fa87
JD
71742006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7175
7176 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
7177 use during nondeterministic operation to track which stacks have
7178 actually needed the current lookahead.
7179 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
7180 Allocate, deallocate, resize, and otherwise shuffle space for
7181 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
7182 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
7183 appropriately during nondeterministic operation.
7184 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
7185 members to store the current lookahead to be used by the deferred
7186 user action.
7187 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
7188 from which the RHS is taken. Set the lookahead members of the new
7189 yySemanticOption according to the lookahead status for stack yyk.
7190 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
7191 yyaddDeferredAction.
7192 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
7193 members of yySemanticOption before invoking yyuserAction, and then set
7194 them back to their current values afterward.
7195 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
7196 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
7197 * tests/glr-regression.at: Remove `.' from the ends of recent test case
7198 titles for consistency.
7199 (Leaked merged semantic value if user action cuts parse): In order to
7200 suppress lint warnings, use arguments in merge function, and assign
7201 char value < 128 in main.
7202 (Incorrect lookahead during deterministic GLR): New test case.
7203 (Incorrect lookahead during nondeterministic GLR): New test case.
7204
05449a2c
JD
72052006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7206
de366a2f 7207 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
7208 !yyvaluep as signal that no semantic value is available to print.
7209 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
7210 to print a semantic value.
7211
4158e0a1 72122006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 7213
4158e0a1
JD
7214 * tests/glr-regression.at: For consistency with my newer test cases,
7215 don't thank myself.
7216
d659304d
JD
72172006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7218
7219 * data/glr.c (yyresolveValue): When merging semantic options, if at
7220 least one user action succeeds but a later one cuts the parse, then
7221 destroy the semantic value before returning rather than leaking it.
7222 (yyresolveStates): If a user action cuts the parse and thus
7223 yyresolveValue fails, ignore the (unset) semantic value rather than
7224 corrupting the yyGLRState, and empty the semantic options list since
7225 the user actions should have called all necessary destructors.
7226 Simplify code with YYCHK.
7227 * tests/glr-regression.at (Corrupted semantic options if user action
7228 cuts parse): New test case.
7229 (Undesirable destructors if user action cuts parse): New test case.
7230 Before applying any of this patch, this test case never actually failed
7231 for me... but only because the corrupted semantic options usually
7232 masked this bug.
7233 (Leaked merged semantic value if user action cuts parse): New test
7234 case.
7235
6ec2c0f2
AD
72362006-01-05 Akim Demaille <akim@epita.fr>
7237
7238 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
7239
1b9c21fb
PE
72402006-01-04 Paul Eggert <eggert@cs.ucla.edu>
7241
7242 * data/c.m4 (b4_c_modern): New macro, with a new provision for
7243 _MSC_VER. Problem reported by Cenzato Marco.
7244 (b4_c_function_def): Use it.
7245 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
7246 b4_c_modern.
7247 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
7248 than rolling our own.
7249
84866159
AD
72502006-01-04 Akim Demaille <akim@epita.fr>
7251
7252 Also warn about non-used mid-rule values.
7253 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
7254 member.
7255 (symbol_list_new): Adjust.
7256 * src/reader.c (symbol_typed_p): New.
7257 (grammar_rule_check): Use it.
7258 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
7259 Check its rule.
7260 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
7261 Use it.
7262 * tests/actions.at (Exotic Dollars): Adjust.
7263
378f4bd8
AD
72642006-01-04 Akim Demaille <akim@epita.fr>
7265
7266 * src/reader.c (grammar_midrule_action): If $$ is set in a
7267 mid-rule, move the `used' bit to its lhs.
7268 * tests/input.at (Unused values): New.
7269 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
7270
e2a21b6f
PE
72712006-01-03 Paul Eggert <eggert@cs.ucla.edu>
7272
54662697
PE
7273 * doc/bison.texinfo (Bison Options): Say more accurately what
7274 --yacc does.
7275 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
7276 about declarations in the grammar when in Yacc mode, as POSIX does
7277 not require a diagnostic when the grammar uses extensions.
7278
7279 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
7280
073f9288
PE
7281 Warn about dubious constructions like "%token T T".
7282 Reported by twlevo.
7283 * src/symtab.h (struct symbol.declared): New member.
7284 * src/symtab.c (symbol_new): Initialize it to false.
7285 (symbol_class_set): New arg DECLARING, specifying whether
7286 this is a declaration that we want to warn about, if there
7287 is more than one of them. All uses changed.
7288
1221b78a
PE
7289 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
7290 Allow multiple %union directives, whose contents concatenate.
7291 * src/parse-gram.y (grammar_declaration): Likewise.
7292 Use muscle_code_grow, so that we don't need stype_line any more.
7293 All uses changed.
7294
7295 * src/muscle_tab.c (muscle_grow): Fix comment.
7296
e2a21b6f
PE
7297 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
7298 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
7299 Update copyright year to 2006.
7300
8f7e3cf9
AD
73012006-01-03 Akim Demaille <akim@epita.fr>
7302
7303 Have glr.cc pass (some of) the calc.at tests.
7304 * data/glr.cc (b4_parse_param_orig): New.
7305 (b4_parse_param): Improve its definition, and bound it more
7306 clearly in the skeleton.
7307 (b4_epilogue): Append, instead of prepending, in order to keep
7308 #line consistency.
7309 Simplify the generation of auxiliary functions: locations and
7310 purity are mandated.
7311 (b4_global_tokens_and_yystype): Honor it.
7312 * data/location.cc (c++.m4): Don't include it.
7313 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
7314 and AT_SKEL_CC_IF.
7315 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
7316 AT_LALR1_CC_IF.
7317 Be sure to initialize the first position's filename.
7318 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
7319 mandated anyway.
7320 (AT_CHECK_CALC_GLR_CC): New.
7321 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
7322
3953ed88
AD
73232006-01-02 Akim Demaille <akim@epita.fr>
7324
7325 * src/output.c (output_skeleton): Don't hard wire the inclusion of
7326 c.m4.
0a96ba81 7327 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
7328 * data/glr.cc: Do not include stack.hh.
7329
9ecafbbf
AD
73302006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7331
7332 * data/glr.c: Reformat whitespace with tabs.
7333 (b4_lpure_formals): Remove this unused m4 macro.
7334 * tests/cxx-type.at: Reformat whitespace with tabs.
7335 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
7336 since it's a member. Rename type to isNterm for clarity.
7337
c4d497a0
AD
73382005-12-29 Akim <akim@sulaco.local>
7339
7340 Let glr.cc catch up with symbol_value_print.
7341 * data/glr.cc (b4_yysymprint_generate): Replace by...
7342 (b4_yy_symbol_print_generate): this.
7343 (yy_symbol_print, yy_symbol_value_print): Declare them.
7344
4517da37
PE
73452005-12-28 Paul Eggert <eggert@cs.ucla.edu>
7346
7347 * src/location.h (boundary): Note that a line or column equal
7348 to INT_MAX indicates an overflow.
7349 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
7350 (rule_length_overflow, increment_rule_length, add_column_width):
7351 New functions.
7352 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
7353 (<SC_BRACED_CODE>"}"):
7354 Use increment_rule_length rather than incrementing it by hand.
7355 (adjust_location, handle_syncline): Diagnose overflow.
7356 (handle_action_dollar, handle_action_at):
7357 Fix bug with monstrosities like $-2147483648.
7358 Remove now-unnecessary checks.
7359 (scan_integer): Verify assumptions and remove now-unnecessary checks.
7360 (convert_ucn_to_byte): Verify assumptions.
7361 (handle_syncline): New arg LOC. All callers changed.
7362 Don't store through a value derived from char const * pointer.
7363
7364 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
7365 GCC warnings.
7366
e3233bf6
PE
73672005-12-27 Paul Eggert <eggert@cs.ucla.edu>
7368
7369 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
7370 Remove unnecessary forward static decls.
7371
8f3596a6
AD
73722005-12-27 Akim Demaille <akim@epita.fr>
7373
7374 * src/reader.c (grammar_current_rule_check): Also check that $$
7375 is used.
7376 Take the rule to check as argument, hence rename as...
7377 (grammar_rule_check): this.
7378 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
7379 Rename as...
7380 (grammar_rule_begin, grammar_rule_end): these, for consistency.
7381 (grammar_midrule_action, grammar_symbol_append): Now static.
7382 * tests/torture.at (input): Don't rely on the default action
7383 being always performed.
7384 * tests/calc.at: "Set" $$ even when the action is "cut" with
7385 YYERROR or other.
7386 * tests/actions.at (Exotic Dollars): Instead of using unused
7387 values, check that the warning is issued.
7388
721be13c
PE
73892005-12-22 Paul Eggert <eggert@cs.ucla.edu>
7390
7391 * NEWS: Improve wording for unused-value warnings.
7392
a0af42fc
AD
73932005-12-22 Akim Demaille <akim@epita.fr>
7394
7395 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
7396 (b4_yysymprint_generate): Rename as...
7397 (b4_yy_symbol_print_generate): this.
7398 Generate yy_symbol_print instead of yysymprint.
7399 Generate also yy_symbol_value_print, and use it.
7400
affac613
AD
74012005-12-22 Akim Demaille <akim@epita.fr>
7402
721be13c 7403 * NEWS: Warn about unused values.
affac613
AD
7404 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
7405 a `used' member.
7406 (symbol_list_n_get, symbol_list_n_used_set): New.
7407 (symbol_list_n_type_name_get): Use symbol_list_n_get.
7408 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
7409 * src/reader.c (grammar_current_rule_check): Check that values are
7410 used.
7411 * src/symtab.c (symbol_print): Accept 0.
7412 * tests/existing.at: Remove the type information.
7413 Empty the actions.
7414 Remove useless actions (beware of mid-rule actions: perl -000
7415 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
7416 * tests/actions.at (Exotic Dollars): Use unused values.
7417 * tests/calc.at: Likewise.
7418 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7419 Likewise.
7420
7421 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
7422 rule_useful_p.
7423
9d9b8b70
PE
74242005-12-21 Paul Eggert <eggert@cs.ucla.edu>
7425
8bb4c753
PE
7426 Undo 2005-12-01 tentative license wording change. The wording is
7427 still being reviewed by the lawyers, and we don't want to wait for
7428 them before publishing a test release. For now, revert to the
7429 previous wording.
7430 * NEWS: Undo 2005-12-01 change.
7431 * data/glr.c: Revert to previous license wording.
7432 * data/glr.cc: Likewise.
7433 * data/lalr1.cc: Likewise.
7434 * data/location.cc: Likewise.
7435 * data/yacc.c: Likewise.
7436
9d9b8b70
PE
7437 * NEWS: Reword %destructor vs YYABORT etc.
7438 * data/glr.c: Use American spacing, for consistency.
7439 * data/glr.cc: Likewise.
7440 * data/lalr1.cc: Likewise.
7441 * data/yacc.c: Likewise.
7442 * data/yacc.c: Reformat comments slightly.
7443 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
7444 for consistency. Fix some spelling errors and reword recently-included
7445 text slightly.
7446 * tests/cxx-type.at: Cast results of malloc, for C++.
7447
2c3b392a
AD
74482005-12-21 Joel E. Denny <address@hidden>
7449
7450 * tests/cxx-type.at: Construct a tree, count the parents of shared
7451 nodes, and free each node once and only once. Previously, the memory
7452 for semantic values was leaked instead.
7453
d6cff4dc
AD
74542005-12-21 Joel E. Denny <address@hidden>
7455
7456 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
7457 (yylval, yylloc): If pure, #define to yystackp->yyval and
7458 yystackp->yyloc similar to yychar and yynerrs.
7459 (yyparse): If pure, remove local yylval and yylloc. Add local
7460 yystackp to accommodate pure definitions of yylval and yylloc.
7461 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
7462 yylvalp and yyllocp to &yylval and &yylloc.
7463 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
7464 namespace. Previously, nerrs and char were missing, but lval and lloc
7465 weren't necessary.
7466 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
7467 yylvalp and yyllocp parameters since, if pure, these are now always
7468 accessible through yystackp. If not pure, they are still accessible
7469 globally.
7470 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
7471 `if (YYID (N))' to pacify lint.
7472
a85284cf
AD
74732005-12-21 Akim Demaille <akim@epita.fr>
7474
7475 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
7476 destroy the RHS symbols of a rule.
7477 * data/yacc.c (yylen): Initialize to 0.
7478 Keep its value to the number of items to possibly shift.
7479 In particular, a regular successful parse that ends on YYFINAL by
7480 a (internal) YYACCEPT must not have yylen != 0.
7481 (yyerrorlab, yyreturn): Pop the RHS.
7482 Reorder a bit to emphasize the `shifting' bits of code.
7483 (YYPOPSTACK): Now accept a number of items to pop.
7484 * data/lalr1.cc: Likewise.
7485 * data/glr.c: Formatting changes.
7486 Use goto instead of fall through.
7487 * doc/bison.texinfo (Destructor Decl): Complete.
7488
d508c281
JMG
74892005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7490
7491 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7492 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
7493 * djgpp/config.bat: Replace every occurence of the file name
7494 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7495 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7496 * djgpp/config.sed: Replace every occurence of the file name
7497 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7498 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7499 * djgpp/djunpack.bat: DJGPP specific file.
7500 * djgpp/fnchange.lst: DJGPP specific file.
7501 * djgpp/README.in: Add new information about how to unpack the bison
7502 source on MSDOS and other systems which have 8.3 file name restrictions
7503 using djunpack.bat and fnchange.lst.
7504
3e7a2cd9
PE
75052005-12-12 Paul Eggert <eggert@cs.ucla.edu>
7506
7507 * bootstrap (build_cvs_prefix): Remove; unused.
7508 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
7509 when getting gnulib.
7510
75112005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
7512
7513 * data/glr.c: Reorder typedef declarations for structs to match order
7514 of struct declarations.
7515 Rename yystack everywhere to yystackp except in yyparse where it's not
7516 a pointer.
7517 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
7518 consistency.
7519 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
7520 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
7521 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
7522 lint.
7523
877519f8
PE
75242005-12-09 Paul Eggert <eggert@cs.ucla.edu>
7525
0eca5a39
PE
7526 * tests/sets.at (Accept): Fix typos in regular expression used to
7527 sed out the final state number.
7528
2cec9080
PE
7529 Work around portability problem on Solaris 10: flex-generated
7530 files include <stdio.h> before <config.h>, which messes up
7531 because the latter defines __EXTENSIONS__. Address the problem
7532 by creating two new little files that include <config.h> first,
7533 then include the flex-generated files. Rewrite everyone else
7534 to include <config.h> first, as well.
7535 * lib/timevar.c: Always include "config.h".
7536 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
7537 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
7538 (EXTRA_bison_SOURCES): New macro.
7539 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
7540 * src/system.h: Don't include config.h.
7541 * src/LR0.c: Include <config.h> first.
7542 * src/assoc.c: Likewise.
7543 * src/closure.c: Likewise.
7544 * src/complain.c: Likewise.
7545 * src/conflicts.c: Likewise.
7546 * src/derives.c: Likewise.
7547 * src/files.c: Likewise.
7548 * src/getargs.c: Likewise.
7549 * src/gram.c: Likewise.
7550 * src/lalr.c: Likewise.
7551 * src/location.c: Likewise.
7552 * src/main.c: Likewise.
7553 * src/muscle_tab.c: Likewise.
7554 * src/nullable.c: Likewise.
7555 * src/output.c: Likewise.
7556 * src/parse-gram.y: Likewise.
7557 * src/print.c: Likewise.
7558 * src/print_graph.c: Likewise.
7559 * src/reader.c: Likewise.
7560 * src/reduce.c: Likewise.
7561 * src/relation.c: Likewise.
7562 * src/state.c: Likewise.
7563 * src/symlist.c: Likewise.
7564 * src/symtab.c: Likewise.
7565 * src/tables.c: Likewise.
7566 * src/uniqstr.c: Likewise.
7567 * src/vcg.c: Likewise.
7568
877519f8
PE
7569 * src/parse-gram.y: Fix minor problems uncovered by lint.
7570 (current_lhs, current_lhs_location): Now static.
7571 (current_assoc): Remove unused variable.
7572
7573 Cleanups so that Bison-generated parsers have less lint.
7574 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
7575 Prepend /*ARGSUSED*/, for lint's sake.
7576 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
7577 definition if 'lint' is defined.
7578 (YYID): New macro (or function, if lint).
7579 All uses of /*CONSTCOND*/0 replaced by YYID(0).
7580 * data/yacc.c: Likewise.
7581 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
7582 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
7583 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
7584 is C++ only.
7585 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
7586 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
7587 Use YYID(0) rather than 0, for lint.
7588 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
7589 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
7590
f5228370
PE
75912005-12-07 Paul Eggert <eggert@cs.ucla.edu>
7592
7593 * tests/glr-regression.at
7594 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7595 Close memory leak reported by twlevo.
7596
69ce078b
PE
75972005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
7598
6ff99711
PE
7599 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
7600 all stacks.
7601 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
7602 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7603 New test case.
7604 (Duplicated user destructor for lookahead): This test now is expected
7605 to succeed.
7606
af3412cd
PE
76072005-12-01 Paul Eggert <eggert@cs.ucla.edu>
7608
32b5b719 7609 * NEWS: Document the following change.
af3412cd
PE
7610 * data/yacc.c: Say "parser skeleton" rather than "file", since
7611 it's no longer just a file.
7612 * data/glr.c: Grant a special exception for C GLR parsers, that
7613 reads like the already-existing exception for C LALR(1) parsers.
7614 * data/glr.cc: Likewise.
7615 * data/lalr1.cc: Likewise.
7616 * data/location.cc: Likewise.
7617 * data/yacc.c: Reword the "written by" statement to clarify that
7618 it was the parser skeleton, not the entire output file.
7619 * data/glr.c: Written by Paul Hilfinger.
7620 * data/glr.cc: Written by Akim Demaille.
7621 * data/lalr1.cc: Likewise.
7622
035aa4a0
PE
76232005-11-18 Paul Eggert <eggert@cs.ucla.edu>
7624
d9963c85
PE
7625 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
7626 Fix typos in previous change that broke 'make check'.
7627 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
7628 supported in C.
7629 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
7630 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
7631 We can revert this once things settle down.
7632
035aa4a0
PE
7633 * src/conflicts.c (conflicts_print): Don't print file name twice
7634 when %expect fails because there were no conflicts.
7635 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
7636 change.
7637 * tests/conflicts.at (%expect not enough, %expect too much):
7638 (%expect with reduce conflicts): Adjust to new behavior.
7639
76402005-11-18 Akim Demaille <akim@epita.fr>
7641
7642 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
7643 errors.
7644 * NEWS: Document this.
7645 * doc/bison.texinfo (Expect Decl): Likewise.
7646
d1ff7a7c
AD
76472005-11-16 Akim Demaille <akim@epita.fr>
7648
7649 Generalize the display of semantic values and locations in traces.
7650 * data/glr.c (yy_reduce_print): Fix indices (again).
7651 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
7652 literal integers.
7653 * data/lalr1.cc (yyreduce_print): Rename as...
7654 (yy_reduce_print): this.
7655 Display values and locations.
7656 * data/yacc.c (yy_reduce_print): Likewise.
7657 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
7658 (yysymprint): Move higher to be visible from yy_reduce_print).
7659 (yyparse): Adjust.
7660 * tests/calc.at: Adjust the expected length of the traces.
7661
6de5398d
AD
76622005-11-14 Akim Demaille <akim@epita.fr>
7663
7664 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
7665 from 1 to N, while values and location start at 0.
7666 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
7667
a1373f55
AD
76682005-11-14 Akim Demaille <akim@epita.fr>
7669
7670 * data/glr.c (yy_reduce_print): Fix the $ number.
7671
613d8952
AD
76722005-11-14 Akim Demaille <akim@epita.fr>
7673
7674 "Use" parse parameters.
7675 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
7676 * data/glr.c, data/glr.cc: Use them.
7677 * data/glr.c (YYUSE): Have a C++ definition that supports
7678 non-pointer types.
7679
b2741627
AD
76802005-11-14 Akim Demaille <akim@epita.fr>
7681
7682 * data/glr.c (yyexpandGLRStack): Declare only if defined.
7683
5059b5c8
AD
76842005-11-14 Akim Demaille <akim@epita.fr>
7685
42249483
AD
7686 * data/glr.cc: New.
7687 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 7688
4626a15d
AD
76892005-11-12 Akim Demaille <akim@epita.fr>
7690
7691 Let position and location be PODs.
7692 * data/location.cc (position::initialize, location::initialize): New.
7693 (position::position, location::location): Define only if
7694 b4_location_constructors is defined.
7695 * data/lalr1.cc (b4_location_constructors): Define it for backward
7696 compatibility.
7697 * doc/bison.texinfo (Initial Action Decl): Use initialize.
7698
76992005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
7700
7701 * data/lalr1.cc: Move the body of the ctor and dtor into the
7702 parser file (instead of the header).
7703 Wrap the implementations in a "namespace yy".
7704
77052005-11-12 Akim Demaille <akim@epita.fr>
7706
7707 Have glr.c include its header file when created.
7708 * data/glr.c (b4_shared_declarations): New.
7709 Output them verbatim in the parser if !%defines, otherwise
7710 output then in the header file, and include it instead.
7711
1989d947
AD
77122005-11-11 Akim Demaille <akim@epita.fr>
7713
7714 * data/glr.c: Comment changes.
7715
77162005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
7717
7718 When yydebug, report semantic and location values for reductions.
7719 * data/glr.c (yy_reduce_print): Report the semantic values and the
7720 locations.
7721 (YY_REDUCE_PRINT): Adjust.
7722 (yyglrReduce): Use them.
7723 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
7724 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
7725 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
7726 traces.
7727
02998094
AD
77282005-11-10 Akim Demaille <akim@epita.fr>
7729
7730 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
7731 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
7732 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
7733
5210672f
PE
77342005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
7735
7736 * m4/cxx.m4, examples/Makefile.am: Don't build
7737 examples/calc++ if no C++ compiler is available. (trivial change)
7738
a8991a1d
AD
77392005-11-09 Akim Demaille <akim@epita.fr>
7740
7741 * src/scan-skel.l: Use a couple of asserts.
7742
36b5e963
AD
77432005-11-03 Akim Demaille <akim@epita.fr>
7744
7745 In some (weird) cases, the final state number is incorrect.
7746 Reported by Alexandre Duret-Lutz.
7747 * src/LR0.c (state_list_append): Remove the computation of
7748 final_state.
7749 (save_reductions): Do it here.
7750 (get_state): Alpha conversion.
7751 (generate_states): Use a for loop.
7752 * src/gram.h (item_number_is_rule_number)
7753 (item_number_is_symbol_number): New.
7754 * src/state.c: Use assert.
7755 * src/system.h: Include assert.h.
7756 * tests/sets.at (Accept): New.
7757
44e7ead1
PH
77582005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7759
7760 * data/glr.c (yyfill): Adjust comment.
36b5e963 7761 (yyresolveAction): Initialize default location properly
44e7ead1
PH
7762 for empty right-hand sides.
7763 (yydoAction): Ditto.
7764 Add comment explaining apparently dead code.
36b5e963
AD
7765 * tests/glr-regression.at
7766 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 7767 New test.
36b5e963 7768
e10a80ee
PE
77692005-10-30 Paul Eggert <eggert@cs.ucla.edu>
7770
7771 * bootstrap (cleanup_gnulib): New function. Use it to clean up
7772 gnulib when interrupted. This fixes some race conditions and
7773 works around some portability problems (one noted by Paul
7774 Hilfinger).
7775
067b32ee
AD
77762005-10-22 Akim <akim@epita.fr>
7777
7778 * Makefile.cfg: Adjust to config -> build-aux.
7779 Reported by twledo.
7780
4b367315
AD
77812005-10-21 Akim Demaille <akim@epita.fr>
7782
7783 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
7784 the %parse-params.
7785 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
7786 * data/yacc.c (b4_Pure_if): Rename as...
7787 (b4_yacc_pure_if): this.
7788 (YY_SYMBOL_PRINT, yyparse): Adjust.
7789 * doc/bison.texinfo: Formatting changes.
7790
24cc23d9
AD
77912005-10-21 Akim Demaille <akim@epita.fr>
7792
7793 Finish the transition config -> build-aux.
7794 * configure.ac, Makefile.am: Use build-aux.
7795 * config/prev-version, config/announce-gen, config/Makefile.am:
7796 Move to...
7797 * build-aux/prev-version, build-aux/announce-gen,
7798 * build-aux/Makefile.am: here.
7799
d4476375
AD
78002005-10-14 Akim Demaille <akim@epita.fr>
7801
7802 * examples/calc++/test: Use set -x only when VERBOSE.
7803
302c0aee
PE
78042005-10-13 Paul Eggert <eggert@cs.ucla.edu>
7805
7806 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
7807 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
7808
7625ec2c
AD
78092005-10-13 Akim Demaille <akim@epita.fr>
7810
7811 * src/scan-skel.l: Output the base name parts of the parser and
7812 header file names.
302c0aee 7813 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
7814 additional checks.
7815 Use this to exercise C++ outputs in subdirs.
7816 Reported by Oleg Smolsky.
7817
ba0fe3c7
PE
78182005-10-12 Paul Eggert <eggert@cs.ucla.edu>
7819
7820 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
7821 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
7822 Problem reported by John P. Hartmann.
7823 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
7824 already defined it.
7825
9b8a5ce0
AD
78262005-10-12 Akim Demaille <akim@epita.fr>
7827
7828 * src/parse-gram.y (version_check): Exit 63 to please missing
7829 (stands for "version mismatch).
7830 * tests/input.at, doc/bison.texinfo: Adjust.
7831
4f6e011e
PE
78322005-10-10 Paul Eggert <eggert@cs.ucla.edu>
7833
7834 Work around portability problems with Visual Age C compiler
7835 (xlc and xlC_r) reported by John P. Hartmann.
7836 * data/location.cc (initial_column, initial_line): Remove.
7837 All uses replaced by 0 and 1.
7838 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
7839 that xlc complains about.
7840 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 7841 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 7842 as __STDC__.
4d7aa45e
PE
7843 * data/yacc.c (YYMODERN_C): New macro, which also looks at
7844 __STDC_VERSION__. Use it everywhere instead of looking at
7845 __STDC__ and __cplusplus.
4f6e011e 7846
a1b3bf8c
AD
78472005-10-10 Akim Demaille <akim@epita.fr>
7848
7849 * examples/calc++/test: Be quiet unless VERBOSE.
7850
412e44aa
PE
78512005-10-05 Paul Eggert <eggert@cs.ucla.edu>
7852
2a4647a3
PE
7853 * data/c.m4 (yydestruct, yysymprint):
7854 Use YYUSE instead of casting to void.
7855 * data/glr.c (YYUSE): New macro.
7856 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7857 Use it instead of rolling our own.
7858 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7859 (YYCHK1):
7860 Use /*CONSTCOND*/ to suppress lint warnings.
7861 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7862 (YY_STACK_PRINT): Use 'false' not '0'.
7863 (YYUSE): New macro.
7864 (yysymprint_, yydestruct_): Use it instead of rolling our own.
7865 * data/yacc.c (YYUSE): New macro.
7866 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
7867 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
7868 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
7869
7870
412e44aa
PE
7871 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
7872 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
7873
88c6637f
PE
78742005-10-04 Paul Eggert <eggert@cs.ucla.edu>
7875
2f4f028d
PE
7876 Undo the parts of the unlocked-I/O change that substituted
7877 putc or puts for printf. This might hurt performance a bit,
7878 but some people prefer the printf style.
7879 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
7880 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
7881 All uses replaced by YYFPRINTF and YYDPRINTF.
7882 * data/yacc.c: Likewise.
7883 * lib/bitset.c (bitset_print): Likewise.
7884 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
7885 putc and puts.
7886 * lib/lbitset.c (debug_lbitset): Likewise.
7887 * src/closure.c (print_firsts, print_fderives): Likewise.
7888 * src/gram.c (grammar_dump): Likewise.
7889 * src/lalr.c (look_ahead_tokens_print): Likewise.
7890 * src/output.c (escaped_output): Likewise.
7891 (user_actions_output): Break apart two printfs.
7892 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
7893 * src/reduce.c (reduce_print): Likewise.
7894 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7895 * src/system.h: Include unlocked-io.h rathe than stdio.h.
7896
88c6637f
PE
7897 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7898 Use assignments rather than casts-to-void to suppress
7899 unused-variable warnings. This pacifies 'lint'.
7900 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
7901 unused-variable warnings.
7902
fb32e373
JMG
79032005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7904
7905 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7906
edb8f44f
PE
79072005-10-02 Paul Eggert <eggert@cs.ucla.edu>
7908
fb9c0b33
PE
7909 Use unlocked I/O for a minor performance improvement on hosts like
7910 GNU/Linux and Solaris that support unlocked I/O. The basic idea
7911 is to use the gnlib unlocked-io module, and to prefer putc and
7912 puts to printf when either will work (since the latter doesn't
7913 come in an unlocked flavor).
7914 * bootstrap (gnulib_modules): Add unlocked-io.
7915 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
7916 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
7917 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
7918 and similarly for puts and putc and printf.
7919 * data/yacc.c: Likewise.
7920 * lib/bitset.c (bitset_print): Likewise.
7921 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
7922 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
7923 to printf.
7924 * lib/lbitset.c (debug_lbitset): Likewise.
7925 * src/closure.c (print_firsts, print_fderives): Likewise.
7926 * src/gram.c (grammar_dump): Likewise.
7927 * src/lalr.c (look_ahead_tokens_print): Likewise.
7928 * src/output.c (escaped_output): Likewise.
7929 (user_actions_output): Coalesce two printfs.
2f4f028d 7930 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
7931 * src/reduce.c (reduce_print): Likewise.
7932 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 7933 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 7934
edb8f44f
PE
7935 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
7936 this confuses xgettext.
7937
b50d2359
AD
79382005-10-02 Akim Demaille <akim@epita.fr>
7939
7940 * bootstrap (gnulib_modules): Add strverscmp.
7941 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
7942 * m4/.cvsignore: Add strverscmp.m4.
7943 * src/parse-gram.y (%require): New token, new rule.
7944 (version_check): New.
7945 * src/scan-gram.l (%require): Adjust.
7946 * tests/input.at (AT_REQUIRE): New.
7947 Use it.
7948 * doc/bison.texinfo (Require Decl): New.
7949 (Calc++ Parser): Use %require.
7950
21667f64
AD
79512005-10-02 Akim Demaille <akim@epita.fr>
7952
7953 * data/location.cc: New.
7954
2b81e969
AD
79552005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
7956 Akim Demaille <akim@epita.fr>
7957
7958 Make sure -odir/foo.cc creates dir/location.hh etc.
7959 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
7960 (spec_file_prefix, spec_verbose_file, spec_graph_file)
7961 (spec_defines_file): Now const.
7962 (dir_prefix): New.
7963 (short_base_name): Remove.
7964 * src/files.c: Adjust.
7965 (dirname.h): Include.
7966 (base_name): Don't prototype it.
7967 (finput): Remove, duplicates gram_in.
7968 (full_base_name, short_base_name): Replace by...
7969 (all_but_ext, all_but_tab_ext): these.
7970 (compute_base_names): Rename as...
7971 (compute_file_name_parts): this.
7972 Update to compute the new variables, including dir_prefix.
7973 Adjust dependencies.
7974 * src/output.c (prepare): Output them.
7975 * src/reader.c: Adjust to use gram_in, not finput.
7976 * src/scan-skel.l (@dir_prefix@): New.
7977
ad6a9b97
JMG
79782005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7979
7980 * lib/subpipe.c: New function end_of_output_subpipe() added
7981 to allow support for non-posix systems. This is a no-op function
7982 for posix systems.
7983
7984 * lib/subpipe.h: New function end_of_output_subpipe() added
7985 to allow support for non-posix systems. This is a no-op function
7986 for posix systems.
7987
7988 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
7989 handle the lack of pipe/fork functionality on non-posix systems.
7990
7991 * djgpp/Makefile.maint: DJGPP specific file.
7992
7993 * djgpp/README.in: DJGPP specific file.
7994
7995 * djgpp/config.bat: DJGPP specific configuration file.
7996
7997 * djgpp/config.sed: DJGPP specific configuration file.
7998
7999 * djgpp/config.site: DJGPP specific configuration file.
8000
8001 * djgpp/config_h.sed: DJGPP specific configuration file.
8002
8003 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
8004
8005 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
8006
fc695704
AD
80072005-10-02 Akim Demaille <akim@epita.fr>
8008
8009 * data/location.cc: New, extract from...
8010 * data/lalr1.cc: here.
8011 (location.hh): Include it after the user prologue, in case the
8012 filename type is defined by the user.
8013 Forward declation location and position before the pre-prologue.
8014 (yyresult_): Rename as...
8015 (yyresult): this, it's a local variable, not an attribute.
8016 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
8017
80182005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
8019
8020 * examples/extexi: Restore the #line generation.
8021
fb9712a9
AD
80222005-09-30 Akim Demaille <akim@epita.fr>,
8023 Alexandre Duret-Lutz <adl@gnu.org>
8024
8025 Move the token type and YYSTYPE in the parser class.
8026 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
8027 (parser::token): New, from the moved free definition of tokens.
8028 (parser::semantic_value): Now a full definition instead of an
8029 indirection to YYSTYPE.
8030 (b4_post_prologue): No longer included in the header file, but
8031 in the implementation file.
8032 * doc/bison.texi (C+ Language Interface): Update.
8033 * src/parse-gram.y: Support unary %define.
8034 * tests/actions.at: Define global_tokens_and_yystype for backward
8035 compatibility until we update the tests.
8036 * tests/calc.at: Idem.
8037 (first_line, first_column, last_line, last_column): Define for lalr1.cc
8038 to simplify the code.
8039
55f0c7b1
PE
80402005-09-29 Paul Eggert <eggert@cs.ucla.edu>
8041
8042 Port to SunOS 4.1.4, which lacks strtoul and strerror.
8043 Ah, the good old days! Problem reported by Peter Klein.
8044 * bootstrap (gnulib_modules): Add strerror, strtoul.
8045 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
8046 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
8047
fb9712a9 80482005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
8049
8050 * data/c.m4 (b4_error_verbose_if): New.
8051 * data/lalr1.cc: Use it.
8052 (YYERROR_VERBOSE_IF): Remove.
8053 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
8054 parser members, replaced by...
8055 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
8056 local variables.
8057 (yysyntax_error_): Takes the state number as argument.
8058 (yyreduce_print_): Use the argument yyrule, not the former
8059 attribute yyn_.
8060
8a6f72f3
PE
80612005-09-26 Paul Eggert <eggert@cs.ucla.edu>
8062
8063 * bootstrap (gnulib_modules): Add verify.
8064 * lib/.cvsignore: Add verify.h.
8065 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
8066 * src/system.h (verify): Remove.
8067 Include verify.h instead.
8068 * src/tables.c (tables_generate): Use new API for 'verify'.
8069
0d50976f
PE
80702005-09-21 Paul Eggert <eggert@cs.ucla.edu>
8071
ebc3737e
PE
8072 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
8073 local variables whose names begin with 'yy'.
8074 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8075 Trivial changes from Joel E. Denny.
8076
0d50976f
PE
8077 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
8078 it itself.
8079 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
8080 don't use alloca any more.
8081
8082 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
8083 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 8084 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
8085 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
8086 to match yacc.c, to test more hosts.
8087
a05b79df
PE
80882005-09-20 Paul Eggert <eggert@cs.ucla.edu>
8089
55289366
PE
8090 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
8091 doesn't affect behavior.
8092 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
8093 Solaris, AIX, MSC.
8094 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
8095 This works a bit better with glibc, if user code has already included
8096 stdlib.h.
8097 * doc/bison.texinfo (Bison Parser): Document that users can't
8098 arbitrarily use malloc and free for other purposes. Document
8099 that <alloca.h> and <malloc.h> might be included.
8100 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
8101 user must declare alloca.
8102
a05b79df
PE
8103 * HACKING (release): Forwarn the Translation Project about
8104 stable releses.
8105
3ab2ca22
AD
81062005-09-20 Akim Demaille <akim@epita.fr>
8107
8108 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
8109
a9739e7c
PE
81102005-09-19 Paul Eggert <eggert@cs.ucla.edu>
8111
a702593e
PE
8112 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
8113 (YYSTACK_ALLOC_MAXIMUM): Use it.
8114 (yysyntax_error): New function.
8115 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
8116 multiple syntax errors are reported, and alloca is being used.
8117 Instead, reallocate buffers twice as big each time, so that
8118 we waste at most half the allocated memory. Start with a small
8119 (128-byte) buffer that will suffice in most cases anyway.
8120 Use yysyntax_error to do most of the work.
8121
8122 * doc/bison.texinfo (Error Reporting, Table of Symbols):
8123 yynerrs is the number of errors reported, not the number of
8124 errors encountered.
8125
a9739e7c
PE
8126 * tests/glr-regression.at (Duplicated user destructor for lookahead):
8127 Mark it as expected to fail.
8128 Cast result of malloc; problem reported by twlevo@xs4all.nl.
8129 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
8130 Don't start user-code symbols with "yy", to avoid name space problems.
8131
f479c6c6
AD
81322005-09-19 Akim Demaille <akim@epita.fr>
8133
8134 Remove the traits, failed experiment.
8135 It never proved useful, and anyway because of the current
8136 definition, it was not possible to have several specialization of
8137 this traits, making it useless.
8138 * data/lalr1.cc (yy:traits): Remove.
8139 Inline its definitions in the parser class.
8140
e2586f82
AD
81412005-09-19 Akim Demaille <akim@epita.fr>
8142
8143 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
8144 least Mac OSX with a /usr/local install of gettext.
8145
2e8cf949
AD
81462005-09-19 Akim Demaille <akim@epita.fr>
8147
8148 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
8149 and yytoken for similarity with the other skeletons.
8150
c7fb0b90
AD
81512005-09-19 Akim Demaille <akim@epita.fr>
8152
4e26c69e 8153 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 8154
1bd0deda
PE
81552005-09-16 Paul Eggert <eggert@cs.ucla.edu>
8156
8157 * NEWS: Version 2.1.
8158
8159 * NEWS: Remove notice of yytname change, since it was never in an
8160 official release.
8161 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
8162 diagnostic.
8163 * src/output.c (prepare): Likewise.
8164 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
8165 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
8166 is not defined. This is an awful hack, but it's enough for now.
8167 All callers changed.
8168 * tests/glr-regression-at (make_value): Args are const pointers now,
8169 to avoid GCC warning.
8170 (Duplicated user destructor for lookahead): New test. Currently
8171 skipped. It fails on my host but I'm not sure it'll always fail.
8172
81732005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
8174
8175 * src/symtab.h (struct symbol): Declare the printer and destructor
8176 as const, to avoid accidental calls to free.
8177 (symbol_destructor_set, symbol_printer_set): Adjust.
8178 * src/symtab.c: Adjust.
8179
1bd0deda 81802005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
8181
8182 * data/c.m4 (b4_token_enums): New.
8183 (b4_token_defines): Rename as...
8184 (b4_token_enums_defines): this.
8185 (b4_token_defines): New, output only the #defines.
8186 * data/yacc.c, data/glr.c: Adjust.
8187 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
8188 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
8189 as default values.
8190
dbcdae2d
AD
81912005-09-16 Akim Demaille <akim@epita.fr>
8192
8193 * data/lalr1.cc (yylex_): Remove, inline its code.
8194 (yyreport_syntax_error_): Remove, replaced by...
8195 (yysyntax_error_): this which returns a string and leaves to the
8196 caller the call to the users' error function.
8197 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
8198 Move from members of the parser object...
8199 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
8200 to local variables of the parse function.
8201
70d8f291
AD
82022005-09-16 Akim Demaille <akim@epita.fr>
8203
8204 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
8205 since it's in Bison's name space.
8206
b47dbebe
PE
82072005-09-15 Paul Eggert <eggert@cs.ucla.edu>
8208
ae199bf1
PE
8209 * data/glr.c (yyresolveValue): Add default case to pacify
8210 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
8211
b47dbebe
PE
8212 * NEWS: Document when yyparse started to return 2.
8213 * doc/bison.texinfo (Parser Function): Document when yyparse
8214 returns 2.
8215
8216 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
8217 (b4_filename_type): Renamed back from b4_file_name_type. All uses
8218 changed.
8219 (class position): file_name -> filename (reverting). All uses changed.
8220
82212005-09-14 Paul Eggert <eggert@cs.ucla.edu>
8222
8223 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
8224 do anything if $@ exists. This reverts part of the 2005-07-07
8225 patch.
8226
00292f66
PE
82272005-09-11 Paul Eggert <eggert@cs.ucla.edu>
8228
8229 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
8230 contains obsolete information and isn't worth distributing as a
8231 separate file anyway.
8232 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
8233 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
8234 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
8235 (yyparse): Abort if user code uses longjmp to throw an unexpected
8236 value.
8237
a420f962
PE
82382005-09-09 Paul Eggert <eggert@cs.ucla.edu>
8239
00292f66
PE
8240 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
8241 Suggested by twlevo@xs4all.nl.
8242
127287e9
PE
8243 * data/glr.c (YYCHK1): Do not assume YYE is in range.
8244 This avoids a diagnostic from gcc -Wswitch-enum.
8245 Problem reported by twlevo@xs4all.nl.
8246
a420f962
PE
8247 * doc/bison.texinfo: Don't use "filename", as per GNU coding
8248 standards. Use "file name" or "file" or "name", depending on
8249 the context.
8250 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
8251 not to hack/foo.tab.c.
8252 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
8253 * data/glr.c: b4_filename -> b4_file_name.
8254 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
8255 All uses changed.
8256 (class position): filename -> file_name. All uses changed.
8257 * data/yacc.c: b4_filename -> b4_file_name.
8258 * lib/bitset.h: filename -> file_name in local vars.
8259 * lib/bitset_stats.c: Likewise.
8260 * src/files.c: Likewise.
8261 * src/scan-skel.l ("@output ".*\n): Likewise.
8262 * src/files.c (file_name_split): Renamed from filename_split.
8263 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
8264
82652005-09-08 Paul Eggert <eggert@cs.ucla.edu>
8266
8267 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
8268 to accommodate latest gnulib.
8269
8270 * tests/glr-regression.at (Duplicate representation of merged trees):
8271 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
8272
8273 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
8274 needed.
8275
42a6501d
PE
82762005-08-26 Paul Eggert <eggert@cs.ucla.edu>
8277
8278 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
8279 All uses changed. Invoke user destructor after an error during a
8280 split parse (trivial change from Joel E. Denny).
8281
8282 * tests/glr-regression.at
8283 (User destructor after an error during a split parse): New test case.
8284 Problem reported by Joel E. Denny in:
8285 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
8286
ef9a1faf
PE
82872005-08-25 Paul Eggert <eggert@cs.ucla.edu>
8288
5b4aaf78
PE
8289 * README-cvs: Give URLs for recommended tools.
8290 Mention Gzip version problem, and bootstrapping issues.
8291 Remove troubleshooting section, as it's somewhat obsolete.
8292
b5240ba5
PE
8293 * bootstrap (no_cache): New var, to accommodate different wget
8294 variants. Use it instead of '-C off'. Problem reported by
8295 twlevo@xs4all.nl.
8296
ef9a1faf
PE
8297 * data/glr.c (yydestroyStackItem): New function.
8298 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
8299 debugging information. Problem reported by Joel E. Denny.
8300
e6efa9da
AD
83012005-08-25 Akim Demaille <akim@epita.fr>
8302
8303 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
8304
adc90f13
PE
83052005-08-24 Paul Eggert <eggert@cs.ucla.edu>
8306
8307 * data/glr.c (yyrecoverSyntaxError, yyreturn):
8308 Don't invoke destructor on unresolved entries.
8309 * tests/glr-regression.at
8310 (User destructor for unresolved GLR semantic value): New test case.
8311 Problem reported by Joel E. Denny in:
8312 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
8313
f9315de5
PE
83142005-08-21 Paul Eggert <eggert@cs.ucla.edu>
8315
15d29c1f
PE
8316 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
8317 Add strnlen.c.
8318 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
8319 lib-prefix.m4, po.m4.
8320
dd5f2af2
PE
8321 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
8322 in yydestruct diagnostic, since it might not be an error.
8323 Problem reported by Joel Denny near end of
8324 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 8325 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
8326 * data/yacc.c (yyreturn): Likewise.
8327 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
8328
8329 * src/files.c: Remove obsolete FIXME comment.
8330
8331 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
8332 with the other templates, and to fix bogus run-on messages such
8333 as the one reported at the end of
8334 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8335 All callers changed to avoid the newline.
8336 (yyprocessOneStack): Output two lines rather than one, to accommodate
8337 the above change. This changes the debug output format slightly.
8338
f9315de5
PE
8339 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
8340 reported by Joel E. Denny in
8341 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
8342 (trivial change).
8343 * tests/glr-regression.at (Duplicate representation of merged trees):
8344 New test, from Joel E. Denny in:
8345 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
8346 * THANKS: Add Joel E. Denny.
8347
8348 * configure.ac (AC_INIT): Bump to 2.0c.
8349
04098407
PE
83502005-07-24 Paul Eggert <eggert@cs.ucla.edu>
8351
8352 * NEWS: Version 2.0b.
8353
ca5d2013
PE
8354 * Makefile.am (SUBDIRS): Put examples before tests, so that
8355 "make check" doesn't finish with "All 1 tests passed".
8356
3d54b576
PE
8357 * tests/regression.at (Token definitions): Don't rely on
8358 AT_PARSER_CHECK for data that contains backslashes. It currently
8359 uses 'echo', and 'echo' isn't portable if its argument contains
8360 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
8361 that the byte '\0xff' is not printable in the C locale; it is,
8362 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
8363 not printable, so use '\0x81' to test.
8364
d53ae497
PE
8365 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
8366 version of GCC, since the macro is used with non-GCC compilers.
8367
fc01665e
PE
8368 Fix core dump reported by Pablo De Napoli in
8369 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
8370 * tests/regression.at (Invalid inputs with {}): New test.
8371 * src/parse-gram.y (token_name): Translate type before using
8372 it as an index.
8373
04098407
PE
8374 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
8375 the user's name space. All uses changed to __attribute__
8376 ((__unused__)).
8377 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
8378 Add __attribute__ ((__noreturn__)).
8379
8380 * etc/clcommit: Remove. We weren't using it, and it failed
8381 "make maintainer-distcheck".
8382 * Makefile.maint: Merge from coreutils.
8383 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
8384 (syntax-check-rules): Change list of rules as described below.
8385 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
8386 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
8387 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
8388 (sc_trailing_space): New rules.
8389 (sc_xalloc_h_in_src): Remove.
8390 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
8391 (sc_space_tab, sc_error_exit_success, sc_changelog):
8392 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
8393 (makefile-check, po-check, author_mark_check):
8394 (makefile_path_separator_check, copyright-check):
8395 Use grep -n, to make it easier to find violations.
8396 Use CVS_LIST and CVS_LIST_EXCEPT.
8397 (header_regexp, h_re): Remove.
8398 (dd_c): New macro.
8399 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
8400 (my-distcheck): Use more-modern GCC flags.
8401 (signatures, %.asc): Remove.
8402 (rel-files, announcement): Remove signatures.
8403 Restore old updating code, even though we don't use it, so
8404 that we're the same as coreutils.
8405 (alpha, beta, major): Depend on news-date-check.
8406 Make the upload commands.
8407
8408 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
8409 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
8410 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
8411 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
8412 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
8413 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
8414 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
8415 * tests/sets.at: Likewise.
8416
8417 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
8418 we comment out the Autoconf version number.
8419 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
8420 it's error-prone and "make maintainer-distcheck" rejects it.
8421
8422 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
8423 Indent calls to "error" to pacify "make maintainer-distcheck",
8424 when the calls are not intended to be translated.
8425 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
8426
8427 * src/Makefile.am (DEFS): Use +=, to pacify
8428 "make maintainer-distcheck".
8429 (bison_SOURCES): Add scan-skel.h.
8430 (sc_tight_scope): New rule, from coreutils.
8431
8432 * src/files.c (src_extension, header_extension):
8433 Now static, not extern.
8434 * src/getargs.c (short_options): Likewise.
8435 * src/muscle_tab.c (muscle_table): Likewise.
8436 * src/parse-gram.y (current_class, current_type, current_prec):
8437 Likewise.
8438 * src/reader.c (grammar_end, previous_rule_end): Likewise.
8439 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
8440 * src/main.c (main): Cast bindtextdomain and textdomain calls to
8441 void, to avoid warning when NLS is disabled.
8442 * src/output.c: Include scan-skel.h.
8443 (scan_skel): Remove decl, since scan-skel.h does this.
8444 (output_skeleton):
8445 Indent calls to "error" to pacify "make maintainer-distcheck".
8446 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
8447 * src/reader.h (gram_end, gram_lineno): New decls to pacify
8448 "make maintainer-distcheck".
8449 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
8450 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
8451 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
8452 (skel_lex_destroy, scan_skel): Move these decls to...
8453 * src/scan-skel.h: New file.
8454 * src/uniqstr.c (uniqstr_assert):
8455 Indent calls to "error" to pacify "make maintainer-distcheck".
8456
8457 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
8458 not @VAR@.
8459
8460 * tests/torture.at: Revamp to avoid misuse of atoi that
8461 "make maintainer-distcheck" complained about.
8462
8463 * examples/extexi (message): Don't print a message more than once,
8464 and omit line-number decoration that makes Emacs compile think
8465 that informative messages are worth worrying about.
8466
84672005-07-22 Paul Eggert <eggert@cs.ucla.edu>
8468
8469 * configure.ac: Update version number.
8470
8471 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
8472 accidentally.
8473 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
8474 autogenerated by the maintainer.
8475 * examples/calc++/.cvsignore: Add *.yy.
8476
8477 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
8478 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8479 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8480
8481 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
8482
8483 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
8484 from maintainer-distcheck about casting the argument of 'free'.
8485
8486 * NEWS: Mention recent yytname changes.
8487 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
8488
8489 * bootstrap: For translations that have not yet been upgraded to
8490 the new runtime-po domain, prime the pump by extracting the
8491 relevant strings from the obsolete translations. This code can be
8492 removed once the bison-runtime domain has been translated by each
8493 team.
8494
8495 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
8496 now that token names are already quoted.
8497
8498 Fix problem reported by Anthony Heading.
8499 * data/glr.c (YYTOKEN_TABLE): New macro.
8500 (yytname): Define if YYTOKEN_TABLE.
8501 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
8502 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
8503 (YYERROR_VERBOSE): Define the same way the other skeletons do.
8504 * src/output.c (prepare_symbols): Output token_table_flag.
8505
0ffda363
PE
85062005-07-21 Paul Eggert <eggert@cs.ucla.edu>
8507
8508 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
8509 again if the first call fails.
8510
8511 * data/glr.c (yytnamerr): New function.
8512 (yyreportSyntaxError): Use it to dequote most string literals.
8513 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
8514 with other skeletons. All uses changed.
8515 (yytnameerr_): New function.
8516 (yyreport_syntax_error): Use it to dequote most string literals.
8517 * data/yacc.c (yytnamerr): New function.
8518 (yyerrlab): Use it to decode most string literals.
8519 * doc/bison.texinfo (Decl Summary, Calling Convention):
8520 Clarify quoting convention of yytname.
8521 * src/output.c (prepare_symbols): Quote all names. This undoes
8522 the 2005-04-17 change, which is now accomplished (mostly) via
8523 changes in the parsers as described above.
8524 * tests/regression.at (Token definitions, Web2c Actions):
8525 Undo most 2005-04-17 change here, too.
8526
85272005-07-20 Paul Eggert <eggert@cs.ucla.edu>
8528
8529 Fix more problems reported by twlevo@xs4all.nl.
8530 * tests/cxx-type.at: Don't pipe output of ./types through sed to
8531 remove trailing spaces. This loses the exit status of ./types,
8532 and isn't needed since ./types shouldn't be emitting trailing
8533 spaces.
8534 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
8535 as the stack isn't valid in that case.
8536
8537 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8538 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8539 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8540 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
8541 is used.
8542 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
8543 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8544 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8545 Likewise.
8546
8547 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
8548 overly-picky compilers that reject 'char *foo = "bar";'.
8549
8550 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
8551 to FILE * parameter, not to stderr. This fixes a typo introduced
8552 in the 2005-07-12 change.
8553
8554 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
8555 warnings from GCC 4.
8556
8557 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
8558 (yyglrShiftDefer, yysplitStack):
8559 Remove unused parameters b4_pure_formals. All uses changed.
8560 (yyglrShift): Remove unused parameters b4_user_formals.
8561 All uses changed.
8562 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
8563
6100a9aa
PE
85642005-07-18 Paul Eggert <eggert@cs.ucla.edu>
8565
258b75ca
PE
8566 Destructor cleanups and regularization among the three skeletons.
8567 * NEWS: Document the behavior changes.
8568 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
8569 stack before failing, as the cleanup code will do it for us now.
8570 * data/lalr1.cc (yyerrlab): Likewise.
8571 * data/glr.c (yyparse): Pop everything off the stack before
8572 freeing it, so that destructors get called properly.
8573 * data/lalr1.cc (yyreturn): Likewise.
8574 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
8575 This is more consistent.
8576 * doc/bison.texinfo (Destructor Decl): Mention more reasons
8577 why destructors might be called. 1.875 -> 2.1.
8578 (Destructor Decl, Decl Summary, Table of Symbols):
8579 Some English-language cleanups for %destructor.
8580 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8581 Add output line for destructor of start symbol.
8582 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
8583 because of that same extra output line.
8584
1a059451
PE
8585 * NEWS: Document minor wording changes in diagnostics of
8586 Bison-generated parsers.
8587 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
8588 Remove unused formals. All uses changed.
8589 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
8590 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
8591 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
8592 Rename yyoverflowab to yyexhaustedlab.
8593 When memory exhaustion occurs during syntax-error reporting,
8594 report it separately rather than in a single diagnostic; this
8595 eases translation.
8596 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
8597 (Memory Exhausted): Renamed from Parser Stack Overflow.
8598 Revamp wording slightly to prefer "memory exhaustion".
8599 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
8600
97460c78
PE
8601 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
8602
30757c8c
PE
8603 Add i18n support to the GLR skeleton. Partially fix the C++
8604 skeleton; a C++ expert needs to finish this. Remove debugging
8605 msgids; there's little point to having them translated, since they
8606 can be understood only by someone who can read the
8607 (English-language) source code.
8608
8609 Generate runtime-po/bison-runtime.pot automatically, so that we
8610 don't have to worry about garbage getting in that file. We'll
8611 make sure after the next official release that old msgids don't
8612 get lost. See
8613 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
8614
8615 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
8616 Now auto-generated.
8617 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
8618 Fix typos in explanations of the runtime file.
8619 * bootstrap: Change gettext keyword from YYI18N to YY_.
8620 Use standard Makefile.in.in in runtime-po, since we'll arrange
8621 for backward-compatible bison-runtime.po files in a different way.
8622 * data/glr.c (YY_): New macro, from yacc.c.
8623 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
8624 Translate messages intended for users.
8625 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
8626 the wording in the other skeletons. We don't know that the memory
8627 is virtual.
8628 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
8629 Use same method that yacc.c uses.
8630 Don't translate debugging messages.
8631 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
8632 it doesn't work (yet), and requires C++ expertise to fix.
8633 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
8634 Move defn to a more logical place, to be consistent with other
8635 skeletons.
8636 Don't translate debugging messages.
8637 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
8638 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
8639 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
8640 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
8641
ac8c5689
PE
8642 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
8643 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
8644 void, not int.
8645 * tests/glr-regression.at (Badly Collapsed GLR States):
8646 Likewise.
8647 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8648 yylex should return 0 at EOF rather than aborting.
8649
6100a9aa
PE
8650 Improve tests for stack overflow in GLR parser.
8651 Problem reported by twlevo@xs4all.nl.
8652 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
8653 All uses removed.
8654 (yyStackOverflow): Just longjmp, but with value 2 so that caller
8655 can handle the problem.
8656 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
8657 (yyparse): New local variable yyresult to record the result.
8658 Use result of setjmp to set it, rather than storing itinto
8659 struct.
8660 (yyDone): Remove label.
8661 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
8662 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
8663 if YYABORT is used).
8664 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
8665 yyparse status; put status > 1 into diagnostic.
8666 Check that status==2 works.
8667 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
8668 Use exit status 3 for failure to open (which shouldn't happen).
8669
15f40952
PE
86702005-07-17 Paul Eggert <eggert@cs.ucla.edu>
8671
67fd79c4
PE
8672 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
8673 1 on syntax error; just let yyparse do its thing.
8674 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
8675 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
8676 (Exploding the Stack Size with Alloca):
8677 (Exploding the Stack Size with Malloc):
8678 Expect exit status 2, not 1, since the parser is supposed to blow
8679 its stack. Problem reported by twlevo@xs4all.nl.
8680
15f40952
PE
8681 * data/glr.c (yyparse): Don't assume that the initial calls
8682 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
8683 Print a stack-overflow message and fail instead.
8684 Initialize the line-number information before creating the stack,
8685 so that the stack-overflow message can report line zero safely.
8686
f32c66b5
PE
86872005-07-14 Paul Eggert <eggert@cs.ucla.edu>
8688
a22ff96f 8689 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
8690 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
8691 (yyuserMerge): Provide a default case if b4_mergers is empty.
8692 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
8693 * tests/glr-regression.at
8694 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 8695 Add casts to pacify C++ compilers.
1beb0b24
PE
8696 * tests/glr-regression.at (Improper merging of GLR delayed action
8697 sets): Declare yylex before using it.
f32c66b5 8698 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
8699 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
8700 test for valgrind; valgrind is independent of g++.
8701 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
8702 for compatibility with POSIX 1003.1-2001 (if running coreutils).
8703 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
8704 Use a destructor, so that we can expand the stack. Change
8705 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 8706
d741bd1b
PE
87072005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8708
8709 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
8710 a valgrind failure. Problem reported by twlevo@xs4all.nl.
8711
0410a6e0
PE
87122005-07-13 Paul Eggert <eggert@cs.ucla.edu>
8713
8714 * PACKAGING: New file, suggested by Bruno Haible and taken from
8715 similar wording in gettext's PACKAGING file.
8716 * NEWS: Mention PACKAGING.
8717 * Makefile.am (EXTRA_DIST): Add PACKAGING.
8718
f7ab6a50
PE
87192005-07-12 Paul Eggert <eggert@cs.ucla.edu>
8720
baf785db 8721 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
8722 * bootstrap: Get runtime translations into runtime-po.
8723 Create runtime-po files automatically, if possible.
8724 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
8725 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
8726 does not infringe on the user's name space.
8727 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
8728 * doc/bison.texinfo (Internationalization): Revamp the English
8729 and Texinfo syntax a bit, to try to make it clearer.
8730 (Bison Options, Option Cross Key): Mention --print-localedir.
8731 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
8732 YYENABLE_NLS. Quote a bit more.
8733 * runtime-po/.cvsignore: New file.
8734 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
8735 * runtime-po/Rules-quot: Remove; now created by bootstrap.
8736 * runtime-po/quot.sed: Likewise.
8737 * runtime-po/boldquot.sed: Likewise.
8738 * runtime-po/en@quot.header: Likewise.
8739 * runtime-po/en@boldquot.header: Likewise.
8740 * runtime-po/insert-header.sin: Likewise.
8741 * runtime-po/remove-potcdate.sin: Likewise.
8742 * runtime-po/Makevars: Likewise.
8743 * runtime-po/LINGUAS: Likewise.
8744 * runtime-po/de.po: Likewise; we will rely on the translation project
8745 to maintain this, so "bootstrap" should get it.
0410a6e0 8746 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
8747 its value.
8748 * src/main.c (main): Bind the bison-runtime domain, too.
8749
87502005-07-12 Bruno Haible <bruno@clisp.org>
8751
8752 * data/yacc.c: Include <libintl.h> when NLS is enabled.
8753 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
8754 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
8755 * runtime-po: New directory.
8756 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
8757 $(DOMAIN).pot-update rule, so that old messages are never dropped.
8758 * runtime-po/Rules-quot: New file, copied from po/.
8759 * runtime-po/quot.sed: Likewise.
8760 * runtime-po/boldquot.sed: Likewise.
8761 * runtime-po/en@quot.header: Likewise.
8762 * runtime-po/en@boldquot.header: Likewise.
8763 * runtime-po/insert-header.sin: Likewise.
8764 * runtime-po/remove-potcdate.sin: Likewise.
8765 * runtime-po/Makevars: New file.
8766 * runtime-po/POTFILES.in: New file.
8767 * runtime-po/LINGUAS: New file.
8768 * runtime-po/bison-runtime.pot: New file.
8769 * runtime-po/de.po: New file.
8770 * m4/bison.m4: New file.
8771 * Makefile.am (SUBDIRS): Add runtime-po.
8772 (aclocaldir, aclocal_DATA): New variables.
8773 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
8774 Define aclocaldir.
8775 * src/getargs.c (usage): Document --print-localedir option.
8776 (PRINT_LOCALEDIR_OPTION): New enum item.
8777 (long_options): Add --print-localedir option.
8778 (getargs): Handle --print-localedir option.
8779 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
8780 (Internationalization): New section.
8781
22dda0f0
AD
87822005-07-12 Akim Demaille <akim@epita.fr>
8783
8784 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
8785 for consistency with the rest of the code.
8786 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
8787 Add separators.
8788
82b248ad
AD
87892005-07-12 Akim Demaille <akim@epita.fr>
8790
8791 * src/parse-gram.y: Use %printer instead of YYPRINT.
8792
fa0e9314
AD
87932005-07-12 Akim Demaille <akim@epita.fr>
8794
867a3e00
AD
8795 * src/symtab.h, src/symtab.c (symbol_print): New.
8796 * src/symlist.h, src/symlist.c (symbol_list_print): New.
8797 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
8798
87992005-07-12 Akim Demaille <akim@epita.fr>
8800
8801 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
8802 b4_at_dollar and b4_dollar_dollar.
8803
e054b190
PE
88042005-07-11 Paul Eggert <eggert@cs.ucla.edu>
8805
8806 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
8807 and Pennello's paper.
8808
34160ec4
PE
88092005-07-09 Paul Eggert <eggert@cs.ucla.edu>
8810
407d4a75
PE
8811 * data/yacc.c (yyparse): Undo previous patch. Instead,
8812 set yylsp[0] and yyvsp[0] only if the initial action
8813 sets yylloc and yylval, respectively.
8814
34160ec4
PE
8815 * data/yacc.c (yyparse): In the initial action, set
8816 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
8817 This avoids the use of undefined variables if the initial
8818 action does not set yylloc and/or yylval.
8819
c3d5a4a7
PE
88202005-07-07 Paul Eggert <eggert@cs.ucla.edu>
8821
b34d96c1
PE
8822 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
8823 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
8824 Remove from CVS. These files are automatically generated.
8825 * examples/extexi: Clarify that this file is now part of Bison,
8826 not GNU M4, and that it works with any POSIX-compatible Awk.
8827 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
8828 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
8829 so that we also get calc++-parser.yy. Geneate it.
8830 Use $(AWK), not gawk, since any conforming Awk will do.
8831 Put comment before action, since older 'make' can't handle comment
8832 in action.
8833 $(BUILT_SOURCES): List all built sources, not just some of them.
8834 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
8835 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
8836 $($(calc_sources_generated)): Remove unnecessary test for existence
8837 of target. (This had a shell syntax error anyway; a stray "x".)
8838 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
8839 calc++-parser.yy.
8840 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
8841
c3d5a4a7
PE
8842 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
8843 implied by the other modules.
8844
828c373b
AD
88452005-07-06 Akim Demaille <akim@epita.fr>
8846
8847 Bind examples/calc++ to the package.
8848 * examples/calc++/Makefile: Remove, replaced by...
8849 * examples/calc++/Makefile.am: ... this new file.
8850 * examples/calc++/test: Remove input.
8851 * examples/calc++/compile: Remove.
8852 * examples/Makefile.am: New.
8853 * configure.ac, Makefile.am: Adjust.
8854 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
8855
63cb01d6
PE
88562005-07-05 Paul Eggert <eggert@cs.ucla.edu>
8857
fd2df2ed
PE
8858 * data/glr.c (yyFail): Drastically simplify; since the format argument
8859 never had any % directives, we can simply pass it to yyerror.
8860 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
8861 be modified later, as that is the usual style in glr.c.
8862 Problems reported by Paul Hilfinger.
8863
63cb01d6
PE
8864 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
8865 and size overflow errors.
8866 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
8867 in case the user prolog sets feature-test macros like _GNU_SOURCE.
8868 (YYSIZEMAX): New macro.
8869 (yystpcpy): New function, taken from yacc.c.
8870 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
8871 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
8872 so that we don't have to maintain their signatures.
8873 (yyFail): Check for buffer overflow, by using vsnprintf rather
8874 than vsprintf. Allocate a bigger buffer if possible.
8875 Report an error if buffer allocation fails.
8876 (yyStackOverflow): New function.
8877 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
8878 the initialization was successful. It might fail if storage was
8879 exhausted.
8880 (yyexpandGLRStack): Add more checks for storage allocation failure.
8881 Use yyStackOverflow to report failures.
8882 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
8883 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
8884 Don't assume stack number fits in int.
8885 (yysplitStack): Check for storage allocation failure.
8886 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
8887 can print diagnostics on storage allocation failure. All callers
8888 changed.
8889 (yyresolveValue): Use yybool for boolean.
8890 (yyreportSyntaxError): Check for size-calculation overflow.
8891 This code is taken from yacc.c.
8892 (yyparse): Check for storage allocation errors when allocating
8893 the initial stack.
8894
1c59e0a1
AD
88952005-07-05 Akim Demaille <akim@epita.fr>
8896
8897 Extract calc++ from the documentation.
8898 * doc/bison.texinfo (Calc++): Add the extraction marks.
8899 * examples/extexi: New, from the aborted GNU Programming 2E.
8900 Separate the different paragraph of a file with empty lines.
8901 * examples/Makefile: Use it to extract the whole calc++ example.
8902
8a0adb01
AD
89032005-06-24 Akim Demaille <akim@epita.fr>
8904
8905 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
8906 class typedefs.
8907
12545799
AD
89082005-06-22 Akim Demaille <akim@epita.fr>
8909
8910 * doc/bison.texinfo (C++ Language Interface): First stab.
8911 (C++ Parsers): Remove.
8912
99be0235
AD
89132005-06-22 Akim Demaille <akim@epita.fr>
8914
8915 * data/lalr1.cc (yylex_): Honor %lex-param.
8916
0ffd4fd1
AD
89172005-06-22 Akim Demaille <akim@epita.fr>
8918
8919 Start a set of simple examples.
8920 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
8921 * examples/calc++/calc++-driver.hh,
8922 * examples/calc++/calc++-parser.yy,
8923 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
8924 * examples/calc++/compile, examples/calc++/test: New.
8925
0925ebb4
PE
89262005-06-09 Paul Eggert <eggert@cs.ucla.edu>
8927
8928 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
8929 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
8930 which stems from the 2005-05-27 patch.
8931
43d3b664
PH
89322005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8933
8934 * data/glr.c: Modify treatment of unused parameters to permit use
8935 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
8936
3062864d
PE
89372005-05-30 Paul Eggert <eggert@cs.ucla.edu>
8938
8939 Fix infringement on user name space reported by Janos Zoltan Szabo.
8940 * data/yacc.c (yyparse): strlen -> yystrlen.
8941
989b5b8e
AD
89422005-05-30 Akim Demaille <akim@epita.fr>
8943
8944 * data/lalr1.cc (_): New.
8945 Translate the various messages.
8946
bedf57f5
PE
89472005-05-27 Paul Eggert <eggert@cs.ucla.edu>
8948
8949 Fix infringement on user name space reported by Bruno Haible.
8950 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
8951 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
8952 the user's name space.
8953 (alloca): Include <stdlib.h> to get it, if it's not built in.
8954 (YYMALLOC, YYFREE): Define only if needed.
8955 (malloc, free): Declare, but only if needed, as this infringes on
8956 the user name space.
8957
4d1801f1
PE
89582005-05-25 Paul Eggert <eggert@cs.ucla.edu>
8959
8960 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
8961 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
8962 with %d format.
8963 * lib/ebitset.c (min, max): Undef before defining.
8964 * lib/vbitset.c (min, max): Likewise.
8965 * lib/subpipe.c (create_subpipe): Save local variables in case
8966 vfork clobbers them.
8967
89682005-05-24 Bruno Haible <bruno@clisp.org>
8969
8970 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
8971 error message syntax used by gcc-4.0.
8972
b94a9e1e
PE
89732005-05-23 Paul Eggert <eggert@cs.ucla.edu>
8974
85ac3861
PE
8975 * README: Mention m4 1.4.3. Remove obsolete advice about
8976 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
8977
b94a9e1e
PE
8978 * bootstrap: Remove workaround for problem I encountered with
8979 gettext 0.14.1; it seems to be fixed now.
8980
51c30d21
PE
89812005-05-22 Paul Eggert <eggert@cs.ucla.edu>
8982
009ce67d
PE
8983 * NEWS: Version 2.0a.
8984
f2a97c62
PE
8985 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
8986 the previous change.
8987
c8775f93
PE
8988 Various maintainer cleanups.
8989 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
8990 conftest*, for benefit of CVS commands run at the same time as
8991 "configure". Add build-aux, since "bootstrap" now creates it and
8992 its subfiles.
8993 * Makefile.cfg (move_if_change): Remove.
8994 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
8995 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
8996 (po_repo, do-po-update, po-update, wget_files, get-targets):
8997 (config.guess-url_prefix, config.sub-url_prefix):
8998 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
8999 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
9000 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
9001 Remove.
9002 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
9003 this is now the recommended name.
9004 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
9005 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
9006 ylwrap. These files now go into build-aux.
9007 * config/move-if-change: Remove.
9008 * config/prev-version.txt: Bump from 1.75 to 2.0.
9009
3ea5f0ec
PE
9010 * bootstrap: Add stdio-safer, unistd-safer modules.
9011 Remove m4/glibc2.m4 (introduced by latest gnulib, but
9012 we don't need it).
9013 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
9014 fopen-safer.c, stdio-safer.h, unistd-safer.h.
9015 * lib/subpipe.c: Include "unistd-safer.h".
9016 (create_subpipe): Make sure all the newly-created
9017 file descriptors are > 2, so that diagnostics don't
9018 get sent down them (which might cause Bison to hang, in theory).
9019 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
9020 * src/files.c (xfopen): Use fopen_safer, not fopen.
9021
51c30d21
PE
9022 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
9023 yesterday's yacc.c fix.
9024
cea1469d
PE
90252005-05-21 Paul Eggert <eggert@cs.ucla.edu>
9026
3ea5f0ec
PE
9027 * data/glr.c, data/lalr1.cc: Update copyright date.
9028
cea1469d
PE
9029 Fix a destructor bug reported by Wolfgang Spraul in
9030 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
9031 * data/yacc.c (yyabortlab): Don't call destructor, and
9032 don't set yychar to EMPTY.
9033 (yyoverflowlab): Don't call destructor.
9034 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
9035 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
9036 since we no longer output the message "discarding lookahead token
9037 end of input ()".
9038
5e6f62f2
PH
90392005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9040
9041 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
9042 fix a small glitch in debugging output.
9043 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
9044 after YY_SYMBOL_PRINT where needed.
9045
9046 (struct yyGLRState): Add some comments.
9047 (struct yySemanticOption): Add some comments.
9048 (union yyGLRStackItem): Add comment.
9049
9050 (yymergeOptionSets): Correct this to properly perform the union,
9051 avoiding infinite reported by Michael Rosien.
9052 Update comment.
9053
9054 * tests/glr-regression.at: Add test for GLR merging error reported
9055 by M. Rosien.
cea1469d 9056
0fb669f9
PE
90572005-05-13 Paul Eggert <eggert@cs.ucla.edu>
9058
9059 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
9060 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
9061 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
9062 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
9063 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
9064 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
9065 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
9066 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
9067 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
9068 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
9069 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
9070 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
9071 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
9072 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
9073 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
9074 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
9075 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
9076 src/derives.h, src/files.c, src/files.h, src/getargs.c,
9077 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
9078 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
9079 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
9080 src/output.h, src/parse-gram.c, src/parse-gram.h,
9081 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
9082 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
9083 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
9084 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
9085 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
9086 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
9087 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
9088 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
9089 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
9090 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
9091 tests/reduce.at, tests/regression.at, tests/sets.at,
9092 tests/synclines.at, tests/testsuite.at, tests/torture.at:
9093 Update FSF postal mail address.
9094
51f4735e
PE
90952005-05-11 Paul Eggert <eggert@cs.ucla.edu>
9096
9097 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
9098 Problem reported by Ralf Menzel.
9099
80ce3401
PE
91002005-05-01 Paul Eggert <eggert@cs.ucla.edu>
9101
9102 * tests/actions.at: Test that stack overflow invokes destructors.
9103 From Marcus Holland-Moritz.
9104 * data/yacc.c (yyerrlab): Move the code that destroys the stack
9105 from here....
9106 (yyreturn): to here. That way, destructors are called properly
9107 even if the stack overflows, or the user calls YYACCEPT or
9108 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
9109 (yyoverflowlab): Destroy the lookahead.
9110
91112005-04-24 Paul Eggert <eggert@cs.ucla.edu>
9112
9113 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
9114
72f000b0
PE
91152005-04-17 Paul Eggert <eggert@cs.ucla.edu>
9116
9117 * NEWS: Bison-generated C parsers no longer quote literal strings
9118 associated with tokens.
9119 * src/output.c (prepare_symbols): Don't escape strings,
9120 since users don't want to see C escapes.
9121 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
9122 in diagnostics.
c19683bb 9123 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
9124 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
9125
1094323f
PE
91262005-04-16 Paul Eggert <eggert@cs.ucla.edu>
9127
9128 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
9129 the data size is known to be too small and we can't increase it.
9130 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
9131
ca407bdf
PE
91322005-04-15 Paul Eggert <eggert@cs.ucla.edu>
9133
9134 * src/parse-gram.y: Include quotearg.h.
9135 (string_as_id): Quote $1 before using it as a key, since the
9136 lexer no longer quotes it for us.
9137 (string_content): Don't strip quotes, since lexer no longer
9138 quotes it for us.
9139 * src/scan-gram.l: Include quotearg.h.
9140 ("\""): Omit quote.
9141 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
9142 a key, since the rest of the lexer doesn't quote it.
9143 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
9144 * tests/regression.at (Token definitions): Check for backslashes
9145 in token strings.
9146
9147 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
9148 (YYSIZE_T): Define to unsigned long int when using an older compiler.
9149 (yyparse): Revamp code to generate long syntax error message, to
9150 make it easier to translate, and to avoid problems with arithmetic
9151 overflow. Change "virtual memory" to "memory" in diagnostic, since
9152 we don't know whether the memory is virtual.
9153
1ce59070
PE
91542005-04-13 Paul Eggert <eggert@cs.ucla.edu>
9155
9156 * NEWS: Bison-generated C parsers now use the _ macro to
9157 translate strings.
9158 * data/yacc.c (_) [!defined _]: New macro.
9159 All English strings wrapped inside this macro.
9160 * doc/bison.texinfo (Bison Parser): Document _.
9161 * po/POTFILES.in: Include src/parse-gram.c, since it now
9162 includes translateable strings that parse-gram.y doesn't.
9163
a749a695
PE
91642005-04-12 Paul Eggert <eggert@cs.ucla.edu>
9165
9166 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
9167 reverting the 2004-10-11 change to this function.
9168 (symbol_check_alias_consistency): Don't call symbol_type_set
9169 if the type name is already correct.
9170 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
9171
8fb1053b
PE
91722005-03-25 Paul Eggert <eggert@cs.ucla.edu>
9173
9174 * tests/regression.at (Token definitions): Don't use a token named
9175 c, as that generates a "#define c ..." that runs afoul of buggy
9176 stdlib.h that uses the identifier c as a member of struct
9177 drand48_data. Problem reported by Horst Wente.
9178
ff498c4a
PE
91792005-03-21 Paul Eggert <eggert@cs.ucla.edu>
9180
9181 * bootstrap: Change translation URL from
9182 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
9183 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
9184 redirection glitches. Problem reported by twlevo@xs4all.nl.
9185
65211d70
PE
91862005-03-20 Paul Eggert <eggert@cs.ucla.edu>
9187
9188 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
9189 after operands; POSIX says this isn't portable for the c99 command.
9190
9577fb1f
PE
91912005-03-18 Paul Eggert <eggert@cs.ucla.edu>
9192
9193 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
9194 immediately if a data overrun has occurred; this may help us track
9195 down what may be a spurious failure on MacOS.
9196
78b178f7
PE
91972005-03-17 Paul Eggert <eggert@cs.ucla.edu>
9198
a2599d0f
PE
9199 Respond to problems reported by twlevo@xs4all.nl.
9200
9201 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
9202
78b178f7
PE
9203 * src/vcg.h: Comment fix.
9204 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
9205 (G_CMAX): Change to -1 instead of INT_MAX.
9206
9207 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 9208
7296e729
PE
92092005-03-15 Paul Eggert <eggert@cs.ucla.edu>
9210
9211 * src/tables.c (state_number_to_vector_number): Put it inside an
9212 "#if 0", since it's not currently used. Problem reported by
9213 Roland McGrath.
9214
05ac60f3
PE
92152005-03-06 Paul Eggert <eggert@cs.ucla.edu>
9216
9217 * src/output.c (escaped_output): Renamed from
9218 escaped_file_name_output, since we now use it for symbol tags as
9219 well. All uses changed.
9220 (symbol_destructors_output, symbol_printers_output):
9221 Escape symbol tags too.
9222 Problem reported by Matyas Forstner in
9223 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
9224
9225 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
9226 not needed.
9227 * src/output.c (user_actions_output, token_definitions_output,
9228 symbol_destructors_output, symbol_printers_output): Likewise.
9229 * src/reader.c (prologue_augment): Likewise.
9230 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
9231
9232 * src/vcg.c (output_edge): Don't quote linestyle arg.
9233 Problem reported by twlevo@xs4all.nl.
9234
7eb453ac
PE
92352005-02-28 Paul Eggert <eggert@cs.ucla.edu>
9236
9237 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
9238 example, reported by Derek M Jones. Also, make the example even
9239 more outrageous, to better illustrate how bad the problem is.
9240
4c04c52a
PE
92412005-02-24 Paul Eggert <eggert@cs.ucla.edu>
9242
9243 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
9244 putsym. Typo reported by Sebastian Piping.
9245
a61e1620
PE
92462005-02-23 Paul Eggert <eggert@cs.ucla.edu>
9247
9248 * doc/bison.texinfo (Language and Grammar): some -> same
9249 (Epilogue): int he -> in the
9250 Typos reported by Sebastian Piping via Justin Pence.
9251
9ec93868
PE
92522005-02-07 Paul Eggert <eggert@cs.ucla.edu>
9253
9254 * tests/glr-regression.at (Improper handling of embedded actions
9255 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
9256 embedded actions and $-N in GLR parsers", work around an Autoconf bug
9257 with dollar signs in test names.
9258 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
9259 for a similar reason.
9260
73ce7e7e
PE
92612005-01-28 Paul Eggert <eggert@cs.ucla.edu>
9262
9263 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
9264 wants to redefine G_VIEW.
9265
2e72b98e
PE
92662005-01-27 Paul Eggert <eggert@cs.ucla.edu>
9267
9268 * src/vcg.c (get_view_str): Remove case for normal_view.
9269 Problem reported by twlevo@xs4all.nl.
9270
e0d634e5
PE
92712005-01-24 Paul Eggert <eggert@cs.ucla.edu>
9272
ccf830a4
PE
9273 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
9274 Problem reported by twlevo@xs4all.nl.
9275
e0d634e5
PE
9276 * doc/bison.texinfo: Change @dircategory from "GNU programming
9277 tools" to "Software development". Requested by Richard Stallman
9278 via Karl Berry.
9279
7bbc8cb0
PE
92802005-01-23 Paul Eggert <eggert@cs.ucla.edu>
9281
9282 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
9283 Problem reported by twlevo@xs4all.nl.
9284
08b770bc
PE
92852005-01-21 Paul Eggert <eggert@cs.ucla.edu>
9286
9287 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
9288 keyword; it's not needed with modern compilers, and it doesn't
9289 affect correctness with older compilers. Suggested by
9290 twlevo@xs4all.nl.
9291
95f22ad2
PE
92922005-01-17 Paul Eggert <eggert@cs.ucla.edu>
9293
9294 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
9295 gcc -Wswitch-default.
9296 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9297 * data/yacc.c (yyparse): Likewise.
9298
d229d15c
PE
92992005-01-12 Paul Eggert <eggert@cs.ucla.edu>
9300
9301 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
9302 already. Let config.h define any nonstandard values.
9303
ecadd90f
PE
93042005-01-10 Paul Eggert <eggert@cs.ucla.edu>
9305
9306 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
9307 for the benefit of slower hosts. Problem reported by
9308 Nelson H. F. Beebe.
9309
213744b5
PE
93102005-01-07 Paul Eggert <eggert@cs.ucla.edu>
9311
9312 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
9313 being defined and not used.
9314 * data/lalr1.cc (yyparse): Likewise.
9315 Use "if (false)" rather than "if (0)".
9316
249d3236
PE
93172005-01-05 Paul Eggert <eggert@cs.ucla.edu>
9318
9319 * TODO: Mention that we should allow NUL bytes in tokens.
9320
987cc1fb
PE
93212005-01-02 Paul Eggert <eggert@cs.ucla.edu>
9322
9323 * src/scan-skel.l (<<EOF>>): Don't close standard output.
9324 Problem reported by Hans Aberg.
9325
08fe02d9
PE
93262005-01-01 Paul Eggert <eggert@cs.ucla.edu>
9327
9328 * src/getargs.c (version): Happy new year; update overall
9329 program copyright date from 2004 to 2005.
9330
9331 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
9332 Problem reported by Hans Aberg.
9333 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
9334 (Output file names.): Add a test for the case when standard output
9335 is closed.
9336
010c0266
PE
93372004-12-26 Paul Eggert <eggert@cs.ucla.edu>
9338
9339 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
9340 to fix an oversight in the Bison 2.0 manual.
9341
da12206a
PE
93422004-12-25 Paul Eggert <eggert@cs.ucla.edu>
9343
9344 * NEWS: Version 2.0. Reformat the existing news items since
9345 1.875, so that related items are grouped together.
3a4734aa 9346 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
9347 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
9348
c935d934
PE
9349 * tests/torture.at (Exploding the Stack Size with Alloca): Set
9350 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
9351 otherwise, we're not testing alloca. Unfortunately there's no
9352 simple way to consult HAVE_ALLOCA here.
9353
da12206a
PE
9354 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
9355 for yymsg, too.
9356
9357 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
9358 hand. This avoids a warning about comparing int to size_t when
9359 GCC warnings are enabled.
9360
0a2c5137
PE
93612004-12-22 Paul Eggert <eggert@cs.ucla.edu>
9362
d7e14fc0
PE
9363 * NEWS: Bison-generated parsers no longer default to using the
9364 alloca function (when available) to extend the parser stack, due
9365 to widespread problems in unchecked stack-overflow detection.
9366 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
9367 responsibility to set it to a positive value. This lets the user
9368 specify a value that is not a preprocessor constant.
9369 * data/yacc.c (YYMAXDEPTH): Likewise.
9370 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
9371 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
9372 to be a compile-time constant. However, explain the constraints on it.
9373 Also, explain the constraints on YYINITDEPTH.
9374 (Table of Symbols): Explain that alloca is no longer the default.
9375 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
9376 to 1.
9377
0a2c5137
PE
9378 * doc/bison.texinfo (Location Default Action): Mention that n must
9379 be zero when k is zero. Suggested by Frank Heckenbach.
9380
e019c247
AD
93812004-12-22 Akim Demaille <akim@epita.fr>
9382
9383 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
9384 (parser::state_type, parser::semantic_type, parser::location_type):
9385 Private, not public.
9386 (parser::parse): Return ints, not bool.
9387 Returning a bool introduces a problem: 0 corresponds to false, and
9388 it seems weird to return false on success. Returning true changes
9389 the conventions for yyparse.
9390 Alternatively we could return void and send an exception.
9391 There is no clear consensus (yet?).
9392 (state_stack, semantic_stack, location_stack): Rename as...
9393 (state_stack_type, semantic_stack_type, location_stack_type): these.
9394 Private, not public.
9395 * tests/c++.at: New.
9396 * tests/testsuite.at, tests/Makefile.am: Adjust.
9397
72731bb7
AD
93982004-12-21 Akim Demaille <akim@epita.fr>
9399
9400 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
9401
9a0d8bec
AD
94022004-12-21 Akim Demaille <akim@epita.fr>
9403
9404 Don't impose std::string for filenames.
9405
9406 * data/lalr1.cc (b4_filename_type): New.
9407 (position::filename): Use it.
9408 (parser.hh): Move the inclusion of stack.hh and location.hh below
9409 the user code, so that needed headers for the filename type can be
9410 included first.
72731bb7
AD
9411 Forward declare them before the user code.
9412 * tests/Makefile.am (check-local, installcheck-local): Pass
9413 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 9414
99880de5
AD
94152004-12-20 Akim Demaille <akim@epita.fr>
9416
9417 Use more STL like names: my_class instead of MyClass.
9418
9419 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
9420 (SemanticStack, SemanticType, StateStack, StateType)
9421 (TokenNumberType, Stack, Slice, Traits, Parser::location)
9422 (Parser::value): Rename as...
9423 (location_stack, location_type, rhs_number_type, semantic_stack)
9424 (semantic_type, state_stack, state_type, token_number_type, stack)
9425 (slice, traits, parser::yylloc, parser::yylval): these.
9426
9427 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
9428
9bec482e
PE
94292004-12-19 Paul Eggert <eggert@cs.ucla.edu>
9430
9431 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
9432 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9433
f6fbd3da
PE
94342004-12-17 Paul Eggert <eggert@cs.ucla.edu>
9435
9436 Remove uses of 'short int' and 'unsigned short int'. This raises
9437 some arbitrary limits. It uses more memory but nowadays that's
9438 not much of an issue.
9439
9440 This change does not affect the generated parsers; that's a different
9441 task, as some users will want to conserve memory there.
9442
9443 Ideally we should use size_t to represent all object counts, and
9444 something like ptrdiff_t to represent signed differences of object
9445 counts; but that will require more code-cleanup than I have the
9446 time to do right now.
9447
9448 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
9449 Use size_t, not int or short int, to count objects.
9450 * src/closure.c (nritemset, closure): Likewise.
9451 * src/closure.h (nritemset, closure): Likewise.
9452 * src/nullable.c (nullable_compute): Likewise.
9453 * src/print.c (print_core): Likewise.
9454 * src/print_graph.c (print_core): Likewise.
9455 * src/state.c (state_compare, state_hash): Likewise.
9456 * src/state.h (struct state): Likewise.
9457 * src/tables.c (default_goto, goto_actions): Likewise.
9458
9459 * src/gram.h (rule_number, rule): Use int, not short int.
9460 * src/output.c (prepare_rules): Likewise.
9461 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
9462 errs, reductions): Likewise.
9463 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
9464 Likewise.
9465 * src/tables.c (vector_number, tally, action_number,
9466 ACTION_NUMBER_MINIMUM): Likewise.
9467 * src/output.c (muscle_insert_short_int_table): Remove.
9468
efeed023
AD
94692004-12-17 Akim Demaille <akim@epita.fr>
9470
9471 * data/lalr1.cc: Extensive Doxygenation.
9472 (error_): Rename as...
9473 (error): this, since it is visible to the user.
9474 Adjust callers.
9475 (Parser::message): Now an automatic variable from...
9476 (Parser::yyreport_syntax_error_): here.
9477 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
9478 Parser::error.
9479 * tests/input.at: Escape $.
9480
bc82c5a5
PE
94812004-12-16 Paul Eggert <eggert@cs.ucla.edu>
9482
9483 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
9484 Parenthesize rhs to avoid obscure problems with mistakes like
9485 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
9486 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9487 b4_rhs_location): Likewise.
9488 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9489 b4_rhs_location): Likewise.
9490
fd19f271
AD
94912004-12-16 Akim Demaille <akim@epita.fr>
9492
9493 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
9494 yacc.c: be sure to stay within yycheck_.
9495 * tests/actions.at: Re-enable C++ tests.
9496
10454ea4
AD
94972004-12-16 Akim Demaille <akim@epita.fr>
9498
9499 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
9500 real.
9501
c5b95ccf
AD
95022004-12-16 Akim Demaille <akim@epita.fr>
9503
9504 Use #define to handle the %name-prefix.
9505
9506 * data/glr.c, data/yacc.c: Comment changes.
9507 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
9508 so that one can refer to yylex in the parser file, and have it
9509 renamed, as is the case with other skeletons.
9510
617a8f12
AD
95112004-12-16 Akim Demaille <akim@epita.fr>
9512
9513 Move lalr1.cc internals into yy*.
9514
9515 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
9516 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
9517 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
9518 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
9519 (empty_, final_, terror_, errcode_, ntokens_)
9520 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
9521 (looka_, ilooka_, error_range_, nerrs_):
9522 Rename as...
9523 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
9524 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
9525 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
9526 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
9527 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
9528 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
9529 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
9530 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
9531 these.
9532
1e547e6e
PE
95332004-12-15 Paul Eggert <eggert@cs.ucla.edu>
9534
9535 Fix some problems reported by twlevo at xs4all.
9536 * src/symtab.c (symbol_new): Report an error if the input grammar
9537 contains too many symbols. This is better than calling abort() later.
9538 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
9539 (struct node, struct graph):
9540 Rename member expand to stretch. All uses changed.
9541 (struct graph): Remove member layoutalgorithm. All uses removed.
9542 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
9543 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
9544 All uses changed.
9545 (N_STRETCH): Rename from N_EXPAND. All uses changed.
9546
735d6bd4
AD
95472004-12-15 Akim Demaille <akim@epita.fr>
9548
9549 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
9550 Add more Doxygen comments.
9551 (symprint_, stack_print_, reduce_print_, destruct_, pop)
9552 (report_syntax_error_, translate_): Rename as...
9553 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
9554 (yypop_, yyreport_syntax_error_, yytranslate_): this.
9555
2e1f5829
AD
95562004-12-15 Akim Demaille <akim@epita.fr>
9557
9558 * data/lalr1.cc (lex_): Rename as...
9559 (yylex_): this.
9560 Move the trace here.
9561 Take the %name-prefix into account.
9562 Reported by Alexandre Duret-Lutz.
9563
a3cb6248
AD
95642004-12-15 Akim Demaille <akim@epita.fr>
9565
9566 Simplify the C++ parser constructor.
9567
9568 * data/lalr1.cc (debug_): Rename as...
9569 (yydebug_): so that the parser's internals are always in the yy*
9570 pseudo namespace.
9571 Adjust uses.
9572 (b4_parse_param_decl): Remove the leading comma as it is now only
9573 called as unique argument list.
9574 (Parser::Parser): Remove the constructor accepting a location and
9575 an initial debugging level.
9576 Remove from the other ctor the argument for the debugging level.
9577 (debug_level_type, debug_level, set_debug_level): New.
9578
9579 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
9580 constructor calls.
9581
07fed891
AD
95822004-12-15 Akim Demaille <akim@epita.fr>
9583
9584 Remove b4_root related material: failure experiment
a3cb6248 9585 (which goal was to allow to derive from a class).
07fed891
AD
9586
9587 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
9588 definitions and uses.
9589
e603eaa5
PE
95902004-12-14 Paul Eggert <eggert@cs.ucla.edu>
9591
9592 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
9593 not 2, since it's not portable to subtract 1 from the start of an
9594 array. The new item 0 is never set or used. All uses changed.
9595
9596 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
9597 the default definition of YYLLOC_DEFAULT. Problem reported
9598 by Frank Heckenbach.
9599
fafb007d
PE
96002004-12-12 Paul Eggert <eggert@cs.ucla.edu>
9601
9602 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
9603 the normal case and one for the error case. Just use the
9604 first one uniformly. Problem reported by Frank Heckenbach.
9605 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
9606 use exactly the same macro in both places.
9607 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
9608 so that the normal-case YYRHSLOC works for the error case too.
9609 All uses changed.
9610 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
9611 (YYLLOC_DEFAULT): Use the same macro as glr.c.
9612 * doc/bison.texinfo (Location Default Action): Don't claim that
9613 we have an array of locations. Use the same macro for both glr
9614 and lalr parsers. Mention YYRHSLOC. Mention what happens when
9615 the index is 0.
9616
48814dcd
PE
96172004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9618
a4e1a53b
PE
9619 * HACKING: Update email addresses to send announcements to.
9620
48814dcd
PE
9621 * configure.ac (AC_INIT): Bump version to 1.875f.
9622
337116ba
PE
96232004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9624
9625 * NEWS: Version 1.875e.
9626 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
9627
9628 * src/scan-skel.l: Include "complain.h", for "fatal".
9629
9630 * src/relation.h (relation_print, relation_digraph):
9631 Relation sizes are of type relation_node, not size_t (this is
9632 merely a doc fix, since the two types are equivalent).
9633 (relation_transpose): Relation sizes are of type relation_node,
9634 not int.
9635 * src/relation.c: Likewise.
9636 (top, infinity): Now of type relation_node, not int.
9637 (traverse, relation_transpose): Use relation_node, not int.
9638
9639 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
9640 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
9641 (yyparse): Remove unused local introduced in 2004-10-25 patch.
9642
9643 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 9644 specifying whether the test should be skipped. Use it tp
337116ba 9645 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 9646 fail on some hosts, and should be skipped.
337116ba 9647
da2a7671
PE
96482004-12-08 Paul Eggert <eggert@cs.ucla.edu>
9649
9650 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
9651 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
9652 unless otherwise specified below.
9653
9654 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
9655 to allocate kernel_base, kernel_items, kernel_size, since
9656 they needn't be initialized to 0.
9657 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
9658 * src/closure.c (new_closure): Likewise, for itemset.
9659 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
9660 * src/lalr.c (set_goto_map): Likewise, for temp_map.
9661 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
9662 (build_relations): Likewise for edge, states1, includes.
9663 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
9664 * src/reader.c (packgram): Likewise, for ritem, rules.
9665 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
9666 * src/relation.c (relation_digraph): Likewise for VERTICES.
9667 (relation_transpose): Likewise for new_R, end_R.
9668 * src/symtab.c (symbols_token_translations_init): Likewise for
9669 token_translations.
9670 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
9671 (token_actions): Likewise for yydefact, actrow, conflrow,
9672 conflict_list.
9673 (save_column): Likewise for froms[symno], tos[symno].
9674 (goto_actions): Likewise for state_count.
9675 (pack_table): Likewise for base, pos, check.
9676 (tables_generate): Likewise for width.
9677
9678 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
9679 for initial core. Just have a separate core, so we needn't worry
9680 about whether kernel_size and kernel_base are initialized.
9681
9682 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
9683 kernel_size, kernel_items): Remove unnecessary initialization.
9684 * src/conflicts.c (conflicts): Likewise.
9685 * src/derives.c (derives): Likewise.
9686 * src/muscle_tablc (muscle_insert): Likewise.
9687 * src/relation.c (relation_digraph): Likewise.
9688 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
9689 conflrow, conflict_table, conflict_list, table, check):
9690 Likewise.
9691
9692 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
9693 This is because all callers pass unsigned int.
9694 * src/closure.h (new_closure): Likewise.
9695
9696 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
9697 (build_relations): Initialize includes[i] in all cases.
9698 * src/reader.c (packgram): Always initialize rules[ruleno].prec
9699 and rules[ruleno].precsym. Initialize members in order.
9700 * src/relation.c (relation_transpose): Always initialize new_R[i]
9701 and end_R[i].
9702 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
9703
9704 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
9705 conflict_list[0] was always 0, but now it isn't initialized.
9706
9707 * src/table.c (table_grow): When conflict_table grew, the grown
9708 area wasn't cleared. Fix this.
9709
9710 * lib/.cvsignore: Add strdup.c, strdup.h.
9711 * m4/.cvsignore: Add strdup.m4.
9712
00baeeac
PE
97132004-12-07 Paul Eggert <eggert@cs.ucla.edu>
9714
9715 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
9716 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
9717 GOTO_NUMBER_MAXIMUM, since we occasionally compute
9718 ngotos + 1 without checking for overflow.
9719 (build_relations): Use END_NODE, not -1, to denote end of edges.
9720 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
9721 build_relations): Use goto_number, not int, for goto numbers.
9722 * src/tables.c (save_column, default_goto): Likewise.
9723
be3d9d42
AD
97242004-11-23 Akim Demaille <akim@epita.fr>
9725
9726 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
9727 of #defining from yystype.
9728 Don't typedef yystype, C++ does not need it.
9729 This lets it possible to forward declare it as union.
9730
78e526d5
PE
97312004-11-23 Paul Eggert <eggert@cs.ucla.edu>
9732
9733 * bootstrap (gnulib_modules): Add extensions.
9734 Problem reported by Jim Meyering.
9735
afbb696d
PE
97362004-11-22 Paul Eggert <eggert@cs.ucla.edu>
9737
9738 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
9739 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
9740 src/system.h, src/tables.c: XFREE -> free, to accommodate
9741 recent change to gnulib xalloc.h.
78e526d5 9742 Problem reported by Jim Meyering.
afbb696d 9743
c1f8f16a
AD
97442004-11-17 Akim Demaille <akim@epita.fr>
9745
9746 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
9747
db7e5eb5 97482004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
9749 Alexandre Duret-Lutz <adl@gnu.org>
9750
9751 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
9752 changes.
9753 (YYCDEBUG): Adjust.
9754 Use it instead of cdebug_.
9755 (Parser::debug_stream, Parser::set_debug_stream): New.
9756 (Parser::symprint_): Define cdebug_ for temporary backward
9757 compatibility.
9758 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
9759 debug_stream ().
9760
68e11668
AD
97612004-11-17 Akim Demaille <akim@epita.fr>
9762
9763 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
9764 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
9765 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
9766 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9767
97cbc73e
PE
97682004-10-27 Paul Eggert <eggert@cs.ucla.edu>
9769
9770 * data/glr.c (yyloc_default): Remove; not used.
9771 Problem reported by Frank Heckenbach.
9772
e342c3be
AD
97732004-10-25 Akim Demaille <akim@epita.fr>
9774
9775 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
9776 Introduce another definition to address simple location arrays.
9777 (yyGLRStack): New member: yyerror_range.
9778 (yyrecoverSyntaxError, yyparse): Update it.
9779 (yyrecoverSyntaxError): Use it when shifting the error token to
9780 have an accurate range, equivalent to the one computed by both
9781 yacc.c and lalr1.cc.
9782 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
9783 that column numbers start at column 0, as per GNU Coding
9784 Standards, the others tests, and the doc.
9785 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
9786 Adjust to the above change (first column is 0).
9787 And adjust the location of the "<error>", now covering the whole
9788 line.
9789
93602feb 97902004-10-22 Akim Demaille <akim@epita.fr>
04098407 9791 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
9792
9793 Remove some arbitrary limits on goto numbers and relations.
9794 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
9795 initial values, since they're never used.
9796 (set_goto_map): ngotos is now unsigned, so test for overflow
9797 by seeing whether it wraps around to zero.
9798 * src/lalr.h (goto_number): Now size_t, not short int.
9799 (GOTO_NUMBER_MAXIMUM): Remove.
9800 * src/relation.c (relation_print, traverse, relation_transpose):
9801 Check for END_NODE rather than looking at sign.
9802 * src/relation.h (END_NODE): New macro.
9803 (relation_node): Now size_t, not short int.
9804
dba08b04
PE
98052004-10-22 Paul Eggert <eggert@cs.ucla.edu>
9806
9807 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
9808 keyword, not an identifier. Problem reported by Baron Schwartz in
9809 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
9810
df09ef2e
AD
98112004-10-11 Akim Demaille <akim@epita.fr>
9812
9813 * src/symtab.c (symbol_check_alias_consistency): Also check
9814 type names, destructors, and printers.
9815 Reported by Alexandre Duret-Lutz.
9816 Recode the handling of associativity and precedence in terms
9817 of symbol_precedence_set.
9818 Accept no redeclaration at all, not even equal to the previous
9819 value.
9820 (redeclaration): New.
9821 Use it to factor redeclaration complaints.
9822 (symbol_make_alias): Don't set the type of the alias, let
9823 symbol_check_alias_consistency do it as for other features.
9824 * src/symtab.h (symbol): Add new member prec_location, and
9825 type_location.
9826 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
9827 * tests/input.at (Incompatible Aliases): New.
9828
146bc99d
PE
98292004-10-09 Paul Eggert <eggert@cs.ucla.edu>
9830
9831 .cvsignore fixes to accommodate gnulib changes,
9832 and the practice of naming build directories "_build".
9833 * .cvsignore: Add "_*". Sort.
9834 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
9835 * m4/.cvsignore: Add "*_gl.m4".
9836
e503aa60
AD
98372004-10-06 Akim Demaille <akim@epita.fr>
9838
9839 * src/parse-gram.y (add_param): Fix the truncation of trailing
9840 spaces.
9841
b4a20338
AD
98422004-10-05 Akim Demaille <akim@epita.fr>
9843
9844 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
9845 whether the reducion was empty or not. This leaves room to
9846 improve the use of YYLLOC_DEFAULT in such a case.
9847 lalr1.cc is still experimental, so changing this is acceptable.
9848 And finally, there are probably not many users who changed the
9849 handling of locations in GLR, so changing is admissible too.
9850
9851 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
9852 empty reduction, set @$ to an empty location ending the previously
9853 stacked symbol.
9854 Adjust uses to make sure the code is triggered on empty
9855 reductions.
9856 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
9857 expected output: empty reductions have empty locations.
9858
f85a5e6f
AD
98592004-09-29 Akim Demaille <akim@epita.fr>
9860
9861 * data/lalr1.cc: Move towards a more standard C++ coding style
9862 for templates: Class < T > -> Class<T>.
9863
b203fc2c
AD
98642004-09-29 Akim Demaille <akim@epita.fr>
9865
9866 * data/lalr1.cc: Reinstall the former ctor, for sake of
9867 compatibility, but warn it will be removed.
9868 Move towards a more standard C++ coding style (i.e., type *var ->
9869 type* var).
9870
5b7e1e73
PE
98712004-09-27 Paul Eggert <eggert@cs.ucla.edu>
9872
3fee967f
PE
9873 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
9874 since it's less likely to work if NULs are involved in the future.
5b7e1e73 9875
0dcca5c2
AD
98762004-09-27 Akim Demaille <akim@epita.fr>
9877
9878 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
9879
6dde1c82
AD
98802004-09-27 Akim Demaille <akim@epita.fr>
9881
9882 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 9883 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
9884 and argument names.
9885 (b4_cc_constructor_call): Likewise.
9886
b233d555
AD
98872004-09-24 Akim Demaille <akim@epita.fr>
9888
9889 * src/parse-gram.y (add_param): Strip the leading and trailing
9890 blanks from a formal argument declaration.
9891 (YY_LOCATION_PRINT): New.
9892
619404e3
AD
98932004-09-24 Akim Demaille <akim@epita.fr>
9894
9895 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
9896 after the location.
9897
dd8d9022
AD
98982004-09-24 Akim Demaille <akim@epita.fr>
9899
9900 * doc/bison.texinfo (Table of Symbols): Sort.
9901
0092f063
AD
99022004-09-21 Akim Demaille <akim@epita.fr>
9903
9904 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
9905 the useless parentheses.
9906 Suggested by Paul Eggert.
9907
451364ed
AD
99082004-09-20 Akim Demaille <akim@epita.fr>
9909
9910 Let the initial-action act on the look-ahead, and use it for the
9911 "initial push" (corresponding to an hypothetical beginning-of-file).
9912 And let lalr1.cc honor %initial-action.
9913
9914 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
9915 example.
9916 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
9917 (Parser::Parser): Remove the ctor that used to initialize it.
9918 (Parser::parse): Like in the other skeletons, issue the "starting
9919 parse" message before any action.
9920 Honor %initial-action.
9921 Initialize the stacks with the lookahead.
9922 * data/yacc.c: Let $$ and @$ in %initial-action designate the
9923 look-ahead.
9924 Push them in the stacks.
9925 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
9926
18d192f0
AD
99272004-09-20 Akim Demaille <akim@epita.fr>
9928
9929 * doc/bison.texinfo (Initial Action Decl): New.
9930
b8458aa5
AD
99312004-09-20 Akim Demaille <akim@epita.fr>
9932
9933 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
9934 clearer criterion to define it.
9935 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
9936 When reducing on an empty RHS, use the latest stacked location as
9937 location.
9938 yylloc is not always available.
9939 * data/glr.c: Likewise.
9940 Also, honor initial-actions.
9941
3fc16193
AD
99422004-09-20 Akim Demaille <akim@epita.fr>
9943
9944 * data/yacc.c (YY_LOCATION_PRINT): New.
9945 Define when we know YYLTYPE's structure, i.e., when the default
9946 YYLLOC_DEFAULT is used.
9947 * data/c.m4 (b4_yysymprint_generate): Use it.
9948 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
9949 value of the result.
9950 (error_start_): Replace with...
9951 (error_range_): this location array.
9952 This allows to replace code relying on the implementation of
9953 locations by portable code.
9954 * data/yacc.c (yylerrsp): Replace with...
9955 (yyerror_range): this.
9956 Every time a token is popped, update yyerror_range[0], to have an
9957 accurate location for the error token.
9958 * data/glr.c (YY_LOCATION_PRINT): New.
9959 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
9960 deference a pointer.
9961 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
9962 report the location in %printers.
9963
9964 * src/scan-skel.l: Instead of abort, report error messages to ease
9965 understanding skeleton scanning failures.
9966
ecfe33e7
AD
99672004-09-16 Akim Demaille <akim@epita.fr>
9968
9969 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
9970 (iterator, const_iterator): these, to be more in the C++ spirit.
9971 Also, return reverse iterators so that when displaying the stack
9972 we display its bottom first.
9973 (Parser::stack_print_, Parser::reduce_print_): Match the messages
9974 from yacc.c.
9975 We should probably use vector here though.
9976
1576d44d
AD
99772004-09-16 Akim Demaille <akim@epita.fr>
9978
9979 Have more complete shift traces.
9980
9981 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
9982 to report Shifts instead of ad hoc YYDPRINTF invocations,
9983 including for the error token.
9984 * data/lalr1.cc (symprint_): Output the location.
9985 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
9986 output the location within the %printer.
9987 Activate GLR tests, at least to make sure they compile properly.
9988 They still don't pass though.
9989 * tests/calc.at: Adjust expect verbose output, since now "Entering
9990 state..." is on a different line than the "Shifting" message.
9991
9c66f418
AD
99922004-09-08 Akim Demaille <akim@epita.fr>
9993
9994 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
9995 Bison directive from the Bison file to the invocation of this
9996 macro, so that these directives are passed to
9997 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
9998 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
9999 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
10000 the extra Bison directives instead of the whole series.
10001 Change the grammar so that there are recoverable errors, and
10002 unrecoverable errors. Now we can have the parser give up before
10003 consuming the whole input. As a result we now can observe that
10004 the lookahead is freed when needed.
10005 Change the parser source to parse argv[1] instead of a hard coded
10006 string.
10007 Simplify yylex, and give a value and location to EOF.
10008 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
10009 passed directives already coded in the file.
10010 Add some tests to check the location of "error".
10011 For some tests, the C++ parser is correct, and not yacc.c.
10012 For other tests, they provide different, but unsatisfying, values,
10013 so keep the C++ value so that at least one parser is "correct"
10014 according to the test suite.
10015 (Actions after errors): Remove, this is subsumed by the
10016 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
10017
52d5733f
AD
100182004-09-06 Akim Demaille <akim@epita.fr>
10019
10020 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 10021 (Parser::pop): New.
52d5733f
AD
10022 Use it.
10023
a0e68930
AD
100242004-09-06 Akim Demaille <akim@epita.fr>
10025
10026 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
10027 argument, an informative message.
10028 Call YY_SYMBOL_PRINT.
10029 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
10030 * data/lalr1.cc (destruct_): Likewise.
10031 In addition, no longer depend on b4_yysymprint_generate and
10032 b4_yydestruct_generate to generate these functions, do it "by
10033 hand".
10034
e757bb10
AD
100352004-09-03 Akim Demaille <akim@epita.fr>
10036
10037 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
10038 invoked, yydestruct the lookahead.
10039 * tests/calc.at (Calculator $1): Update the expected lengths of
10040 traces: there is an added line for the discarded lookahead.
10041 * doc/bison.texinfo (Destructor Decl): Some rewording.
10042 Define "discarded" symbols.
10043
0fe1f06d
AD
100442004-09-02 Akim Demaille <akim@epita.fr>
10045
10046 * data/lalr1.cc (translate_, destruct_): No reason to be static.
10047
284acc8b
AD
100482004-09-02 Akim Demaille <akim@epita.fr>
10049
10050 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
10051 (YYDSYMPRINTF): Rename as...
10052 (YY_SYMBOL_PRINT): this.
10053 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
10054 two.
10055 Use it instead of direct symprint_ calls.
10056 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
10057 one.
10058
a5eb1ed2
AD
100592004-09-02 Akim Demaille <akim@epita.fr>
10060
b7c72fe1
AD
10061 * data/lalr1.cc (b4_yysymprint_generate): New.
10062 (symprint_): New member function, defined when YYDEBUG.
10063 Use it consistently instead of token/nterm debugging output by
10064 hand.
a5eb1ed2
AD
10065 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
10066 %printer calls to use cdebug_ when using lalr1.cc.
10067
417141dd
AD
100682004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
10069
10070 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
10071 with #ifdef YYDEBUG.
10072
2fa09258
AD
100732004-08-26 Akim Demaille <akim@epita.fr>
10074
10075 * doc/bison.texinfo (Implementing Loops): Rename as...
10076 (Implementing Gotos/Loops): this.
10077
9378b508
PE
100782004-08-13 Paul Eggert <eggert@cs.ucla.edu>
10079
10080 Adjust to latest gnulib.
10081 * bootstrap (gnulib_modules): Add xalloc-die.
10082 Set LC_ALL=C so that file names sort consistently.
10083 Prefer the gnulib copies of gettext.m4, glibc21.m4,
10084 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
10085 uintmax_t.m4, ulonglong.m4.
10086 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
10087 po.m4 since we are now using _gl.m4 instead.
10088
87a8ad5c
PE
100892004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
10090
10091 * src/scan-action.l: Remove. Scanning of semantic actions is
10092 handled in scan-gram.l.
10093
dca81a78
PE
100942004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
10095
10096 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
10097
10098 * src/location.h (struct): The file member is a uniqstr.
10099 (equal_boundaries): Use UNIQSTR_EQ for comparison.
10100
c9cbf7c5
PE
101012004-07-22 Paul Eggert <eggert@cs.ucla.edu>
10102
10103 Fix bug with non-%union parsers that have printers or destructors,
10104 which led to a Bison core dump. Reported by Peter Fales in
10105 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 10106
c9cbf7c5
PE
10107 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
10108 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
10109 not to our own type.
10110 * src/output.c (symbol_destructors_output, symbol_printers_output):
10111 Don't assume %union.
10112 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
10113 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
10114 UNION-FLAG. All callers changed.
10115 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
10116 Use type char, not unsigned int, when declaring an array of char;
10117 this lets us remove a cast.
10118 (Printers and Destructors): Add non-%union test cases.
10119
fa7e68c3
PE
101202004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10121
10122 * doc/bison.texinfo: Minor editorial changes, mostly to the new
10123 GLR writeups. E.g., avoid frenchspacing and the future tense,
10124 change "lookahead" to "look-ahead", and change "wrt" to "with
10125 respect to".
2fa09258 10126
fa7e68c3
PE
101272004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10128
10129 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
10130 New sections, split off from the GLR Parsers section. Put the new
10131 Simple GLR Parser near the start of the GLR section, for clarity.
10132 Rewrite connective text.
10133
99a9344e
PE
101342004-06-21 Frank Heckenbach <frank@g-n-u.de>
10135
10136 * doc/bison.texinfo (Simple GLR Parsers): New section.
10137
8dd162d3
PE
101382004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10139
10140 * NEWS, TODO, doc/bison.texinfo:
10141 Use "look-ahead" instead of "lookahead", to be consistent.
10142 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
10143 while we're fixing "look-ahead".
10144 * src/conflicts.c (shift_set): Renamed from shiftset.
10145 (look_ahead_set): Renamed from lookaheadset.
10146 * src/print.c: Likewise.
10147 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
10148 name for "lookahead".
10149 (report_types, usage): Likewise.
10150 * src/getargs.h (report_look_ahead_tokens): Renamed from
10151 report_lookaheads.
10152 * src/lalr.c (compute_look_ahead_tokens): Renamed from
10153 compute_lookaheads.
10154 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
10155 (look_ahead_tokens_print): Renamed from lookaheads_print.
10156 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
10157 state_rule_lookaheads_print.
10158 * src/state.h: Likewise.
10159 (reductions.look_ahead_tokens): Renamed from lookaheads.
10160 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
10161 AT_DATA_LOOKAHEADS_GRAMMAR.
10162
57a90331
PE
101632004-06-03 Paul Eggert <eggert@cs.ucla.edu>
10164
10165 * README: Update location of patched M4 distribution.
10166
8ed3234a
PE
101672004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
10168
10169 Don't assume the C++ compiler takes the same arguments as the C compiler
10170 (trivial change).
10171 * configure.ac (O0CXXFLAGS): New var.
10172 * tests/atlocal.in (CXXFLAGS): Use it.
10173
07971983
PE
101742004-05-29 Paul Eggert <eggert@cs.ucla.edu>
10175
10176 Fix some "make check" problems with C++ reported by
10177 Albert Chin-A-Young for Tru64 C++ in this thread:
10178 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
10179
10180 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
10181 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10182 Output to a .cc file for C++, not to a .c file.
10183 * tests/calc.at (AT_CHECK_CALC): Likewise.
10184 * tests/regression.at (AT_CHECK_DANCER): Likewise.
10185 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
10186
29058652
PE
101872004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
10188
10189 * tests/calc.at, tests/actions.at: Workaround for SGI
10190 C++ compiler. (trivial change)
10191
62cb8a99
PE
101922004-05-27 Paul Eggert <eggert@cs.ucla.edu>
10193
fd418816
PE
10194 Spent a few hours checking out which prerequisite versions the
10195 current sources actually require. I went all the way back to
10196 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
10197 a seemingly endless set of combinations of versions more recent
10198 than that. The bottom line is that the current sources require
10199 fairly recent versions of the build tools, and it'll be some work
10200 to change this.
10201 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
10202 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
10203 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
10204 Add comments explaining why those particular versions are
10205 currently needed.
2fa09258 10206
62cb8a99
PE
10207 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
10208 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 10209 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
10210
10211 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
10212 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
10213
caa52c10
PE
102142004-05-26 Paul Eggert <eggert@cs.ucla.edu>
10215
10216 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
10217 0.11.5. Suggested by Bruno Haible.
10218 * bootstrap: Remove gettext version checking.
10219
10220 * doc/bison.texinfo (Decl Summary): Also mention that %union
10221 can depend on prerequisite types. Problem reported by Tim
10222 Van Holder.
10223
4bfd5e4e
PE
102242004-05-25 Paul Eggert <eggert@cs.ucla.edu>
10225
2cef3017
PE
10226 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
10227 * README-alpha: Don't tell people not to package this.
10228
b9c85d5c
PE
10229 * bootstrap: Don't assume $(...) works; use `...` instead.
10230 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
10231 gettext better.
10232
4bfd5e4e
PE
10233 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
10234 put into the -d output file, and mention what to do if YYSTYPE is
10235 defined as a macro.
10236
6a36ff94
PE
102372004-05-24 Paul Eggert <eggert@cs.ucla.edu>
10238
6712933e
PE
10239 Undo change made earlier today: it caused autopoint to not bring
10240 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
10241 autopoint's.
10242
10243 * bootstrap: Check that gettext version matches what's in
10244 configure.ac. Warn users to ignore robots.txt ERROR 404.
10245 * bootstrap: Undo today's earlier change (logged below).
10246 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 10247
6a36ff94
PE
10248 The gettext version checking is causing more trouble than it's
10249 curing; remove it. Problem reported by Paul Hilfinger.
10250
10251 * bootstrap: Issue a warning that one can expect a message
10252 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
10253 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
10254
209ea708
PE
102552004-05-23 Paul Eggert <eggert@cs.ucla.edu>
10256
10257 Ensure that the C++ compiler used for testing actually works on a
10258 simple test program; if not, skip the C++-related tests. Problem
10259 reported by Vin Shelton in:
161a71f3 10260 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
10261
10262 * m4/cxx.m4: New file.
10263 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
10264 * tests/atlocal.in (BISON_CXX_WORKS): Add.
10265 * tests/local.at (AT_COMPILE_CXX): Use it.
10266
41ca2549
PE
102672004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10268
383e69dc
PE
10269 * data/glr.c (yylloc): Output this macro even if locations are not
10270 being generated, as the GLR parser needs it even in that case.
10271 Problem reported by Troy A. Johnson
10272 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
10273
41ca2549
PE
10274 * configure.ac (AC_INIT): Update to 1.875e.
10275
e476c87d
PE
102762004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10277
10278 * NEWS: Version 1.875d.
10279 * configure.ac (AC_INIT): Likewise.
10280 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
10281
10282 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
10283 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
10284 lalr1.cc runs afoul of the first, and the last two are no longer
10285 supported by GCC 3.4.0.
10286 * README: Mention GNU m4 1.4 or later; mention m4 patches.
10287 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
10288
233a88ad
PE
102892004-05-06 Paul Eggert <eggert@cs.ucla.edu>
10290
10291 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
10292 unsigned int, for compatibility with latest gnulib hash module.
10293 * src/state.c (state_hash, state_hasher): Likewise.
10294 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
10295 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 10296
12ffdd28
PE
102972004-05-03 Paul Eggert <eggert@cs.ucla.edu>
10298
10299 * NEWS: Unescaped newlines are no longer allowed in char & strings.
10300
10301 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
10302 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
10303 character and string literals.
10304 (unexpected_end): New function.
10305 (unexpected_eof): Use it.
10306 (unexpected_newline): New function.
10307 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
10308 actions.
e476c87d 10309
12ffdd28
PE
10310 * NEWS: Document %expect-rr.
10311
10312 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
10313 Fix typo by replacing $1 with $option.
10314 Remove more 'intl'-related files.
9668e2be 10315 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
10316
10317 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
10318 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
10319 strtoul.c.
10320 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
10321 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
10322 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
10323 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
10324 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
10325 * src/.cvsignore: Add *.output.
10326
10327 * src/parse-gram.y: Put copyright notice inside %{ %} so it
10328 gets copied to the output file.
e476c87d 10329
1f65350a
PE
103302004-04-28 Paul Eggert <eggert@twinsun.com>
10331
10332 Get files from the gnulib and po repositories, instead of relying
10333 on them being in our CVS. Upgrade to latest versions of gnulib
10334 and Automake.
10335
10336 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
10337 * bootstrap: Bootstrap from gnulib and po repositories.
10338 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
10339 * README-cvs: Document these changes. Remove version numbers from
10340 mentions of build tools, since they change so often. Mention Flex.
10341
10342 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
10343 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
10344 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
10345 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 10346 does this for us.
12ffdd28
PE
10347 (AC_ISC_POSIX): Remove; we no longer support this
10348 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
10349 (AC_HEADER_STDC): Remove: we now assume C89 or better.
10350 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
10351 Do not check for C89 headers, except for locale.h which is used
10352 by the Yacc library and must port to K&R hosts.
10353 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
10354 Do not check for C89 functions, except for setlocale which is
10355 used by the Yacc library.
10356 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
10357 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
10358 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
10359 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
10360 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
10361 AM_GNU_GETTEXT): Remove; now done by:
10362 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
10363 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
10364 for us.
10365
10366 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
10367 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
10368 Define to empty, as gnulib.mk will do the rest for us.
10369 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
10370 for us.
10371 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
10372 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
10373
10374 * src/files.c: Include gnulib's xstrndup.h.
10375
10376 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
10377 (REALLOC): Use xnrealloc, for likewise.
10378 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
10379 (strnlen, memrchr): Remove decls; functions no longer used.
10380 Include <stpcpy.h>.
10381
10382 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
10383 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10384 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
10385 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
10386 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
10387 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
10388 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
10389 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
10390 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
10391 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
10392 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
10393 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10394 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
10395 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
10396 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
10397 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
10398 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
10399 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
10400 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
10401 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
10402 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
10403 Remove, as these files are now generated automatically
10404 by bootstrap or automake.
10405
10406 * po/ChangeLog: Remove: all but one entry was a duplicate
10407 of this file, and I moved that 2000-11-02 entry here.
10408
10409 * config/.cvsignore: Add Makefile, depcomp, install-sh.
10410 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
10411 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
10412 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
10413 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
10414 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
10415 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
10416 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
10417 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
10418 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
10419 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
10420 xstrndup.h.
10421 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
10422 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
10423 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
10424 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
10425 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
10426 * src/.cvsignore: Remove *_.c.
10427
10428
10429 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
10430 support it. (The latest stable gzip doesn't.)
10431
104322004-04-27 Paul Eggert <eggert@twinsun.com>
10433
10434 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
10435 case, as stos_ is now used by destructors due to the 2004-02-09
10436 change.
10437
10438 Remove more K&R C support.
10439 * lib/libiberty.y (PARAMS): Remove. All uses removed.
10440 * lib/subpipe.c (errno): Remove decl.
10441 Include <stdlib.h> unconditionally.
10442 (EXIT_FAILURE): Remove macro.
10443 * src/complain.c (vfprintf, strerror): Remove.
10444 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
10445 unconditionally.
10446 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
10447 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
10448 (strchr, strspn, memchr): Remove decls.
10449 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
10450 unconditionally. Do not declare perror.
10451 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
10452 unconditionally.
10453
10454 * src/complain.c (_): Remove useless defn, as system.h defines this.
10455
10456 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
10457 with latest obstack.h.
10458 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
10459 to procedure types, as obstack.h now does that for us.
10460 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
10461
10462 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
10463 so that this include file can stand alone.
10464 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
10465 does this now. Include subpipe.h first after config.h, to
10466 test whether it can stand alone.
10467
10468 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
10469 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
10470 unused declaration.
10471
10472 * tests/synclines.at (%union synch line): Put a dummy member in
10473 the union, because empty unions aren't allowed in C. Caught
10474 by GCC 3.4.0.
10475
4f16766c
PE
104762004-04-13 Jim Meyering <jim@meyering.net>
10477
10478 * src/conflicts.c (conflicts_print): Correct format string typo:
10479 use `%%' to produce literal `%'. (trivial change)
10480
779e7ceb
PE
104812004-03-30 Paul Eggert <eggert@twinsun.com>
10482
10483 * src/getargs.c (version): Update copyright year to 2004.
10484
10485 * data/c.m4 (b4_int_type): Use 'short int' rather than
10486 'short', and similarly for 'long', 'unsigned', etc.
10487 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
10488 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
10489 yy_yypstack, yydumpstack): Likewise.
10490 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
10491 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
10492 Likewise.
10493 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
10494 yy_stack_print, yyparse): Likewise.
10495 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
10496 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
10497 * lib/bitset.c (bitset_print): Likewise.
10498 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
10499 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10500 * lib/bitsetv.c (bitsetv_dump): Likewise.
10501 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
10502 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
10503 Likewise.
10504 * src/LR0.c (allocate_itemsets): Likewise.
10505 * src/gram.h (rule_number, rule): Likewise.
10506 * src/lalr.h (goto_number): Likewise.
10507 * src/nullable.c (nullable_compute): Likewise.
10508 * src/output.c (prepare_rules): Likewise.
10509 * src/relation.c (relation_print, relation_digraph): Likewise.
10510 * src/relation.h (relation_node): Likewise.
10511 * src/state.h (state_number, transitions, errs, reductions,
10512 struct state): Likewise.
10513 * src/symtab.h (symbol_number, struct symbol): Likewise.
10514 * src/tables.c (vector_number, tally, action_number,
10515 default_goto, goto_actions): Likewise.
10516 * tests/existing.at (GNU Cim Grammar): Likewise.
10517 * tests/regression.at (Web2c Actions): Likewise.
10518
10519 * src/output.c (muscle_insert_short_int_table): Renamed from
10520 muscle_insert_short_table. All uses changed.
10521
d6328241
PH
105222004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10523
10524 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
10525 (declaration): Replace expected_conflicts with expected_sr_conflicts.
10526 Add %expect-rr rule.
4f16766c 10527
d6328241
PH
10528 * src/scan-gram.l: Recognize %expect-rr.
10529
4f16766c 10530 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 10531 expected_conflicts.
4f16766c 10532 (expected_rr_conflicts): Declare.
d6328241
PH
10533
10534 * src/conflicts.c (expected_sr_conflicts): Rename from
10535 expected_conflicts.
10536 (expected_rr_conflicts): Define.
10537 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
10538 for GLR parsers.
10539 Use expected_sr_conflicts in place of expected_conflicts.
10540 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 10541
d6328241 10542 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 10543
1452af69
PE
105442004-03-08 Paul Eggert <eggert@gnu.org>
10545
10546 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 10547 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
10548
10549 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
10550 in lalr1.cc.
10551 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
10552 * src/scan-gram.l (scan_integer): New function.
10553 ({int}): Use it.
10554 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
10555 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
10556 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
10557 Say "long int", not "long", for uniformity with GNU style.
10558
006d217d
PE
105592004-02-25 Paul Eggert <eggert@twinsun.com>
10560
10561 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
10562 compilers. This fixes a problem with Intel's C++ compiler being
10563 chatty, reported by Guido Trentalancia in
161a71f3 10564 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 10565
c2729758
ADL
105662004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
10567
10568 Support %destructor and merge error locations in lalr1.cc.
10569
10570 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
10571 (Parser::stos_): Define unconditionally.
10572 (Parser::destruct_): New method. Generate its body with
10573 b4_yydestruct_generate.
10574 (Parser::error_start_): New attribute.
10575 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
10576 token which are discarded.
10577 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
10578 error_start_ when erroneous token are discarded.
10579 (Parser::parse) <yyerrlab1>: Compute the location of the error
10580 token so that it covers all the discarded tokens.
10581 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
10582 it can be called with `%skeleton "lalr1.cc"', and do that.
10583
dd0e0635
PE
105842004-02-02 Paul Eggert <eggert@twinsun.com>
10585
10586 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
10587 $(top_srcdir)/lib and ../lib. This fixes a bug reported
10588 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
10589 There's no need to mention top_builddir since Automake does that
10590 for us.
10591 (INCLUDES): Remove, as Automake says it's obsolescent.
10592 Contents migrated into AM_CPPFLAGS as described above.
10593 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
10594
105952004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10596
10597 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
10598 (yyreportSyntaxError): Handle case where lookahead token is
10599 YYEMPTY.
10600
be16239b
PH
106012004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10602
10603 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
10604 resulting parsers are compilable with C++.
10605
5fa90832
PE
106062003-12-23 Paul Eggert <eggert@twinsun.com>
10607
10608 * config/depcomp, config/install-sh: Sync with Automake 1.8.
10609 * src/output.c (output_skeleton): Rename local var.
10610 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
10611 Bison tokens, as this runs afoul of the 2003-10-07 change that
10612 disallowed NUL bytes in character constants or string literals.
10613
10614 * tests/local.at: Require Autoconf 2.59's Autotest.
10615 * tests/testsuite.at: Don't include local.at, since we now assume
10616 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
10617 including it.
10618 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
10619 multiple inclusion warnings.
dd0e0635 10620
b165c324
AD
106212003-12-02 Akim Demaille <akim@epita.fr>
10622
10623 * doc/bison.texinfo (How Can I Reset the Parser): More about start
10624 conditions.
10625 From Bruno Haible.
10626
26e06a21
ADL
106272003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
10628
10629 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
10630
92ac3705
PE
106312003-10-07 Paul Eggert <eggert@twinsun.com>
10632
6a5ecb38
PE
10633 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
10634 if testsuite doesn't exist.
10635
92ac3705
PE
10636 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
10637 literals, unfortunately.
10638 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
10639 Complain about NUL bytes in character constants or string literals.
10640
91d2c560
PE
106412003-10-05 Paul Eggert <eggert@twinsun.com>
10642
10643 * NEWS: Don't document %no-default-prec, as it's still
10644 too experimental.
10645 * doc/bison.texinfo: Document %no-default-prec only if
10646 the defaultprec flag is set. Normally it's not.
10647
0cc3da3a
PE
106482003-10-04 Paul Eggert <eggert@twinsun.com>
10649
10650 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
10651 non-modifiable lvalue, instead of a modifiable one.
10652 * doc/bison.texinfo (Actions): Document that $$ can
10653 be assigned to. Do not claim that $$ and $N are
10654 array element references: user code should not rely on this.
10655
22fccf95
PE
106562003-10-01 Paul Eggert <eggert@twinsun.com>
10657
10658 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
10659 (grammar_declaration): Use it.
10660 * src/scan-gram.l: New token %no-default-prec.
10661 * tests/conflicts.at: Revamp tests to use %no-default-prec.
10662 * NEWS, doc/bison.texinfo: Document the above.
10663
fc8f2965
AD
106642003-10-01 Akim Demaille <akim@epita.fr>
10665
10666 VCG no longer supports long_straight_phase.
10667
10668 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
10669 * src/print_graph.c (print_graph): Adjust.
10670
39a06c25
PE
106712003-09-30 Frank Heckenbach <frank@g-n-u.de>
10672 and Paul Eggert <eggert@twinsun.com>
10673
10674 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
10675 Table of Symbols): Document %default-prec.
10676 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
10677 (grammar_declaration): Set default_prec on %default-prec.
10678 * src/scan-gram.l (%default-prec): New token.
10679 * src/reader.h (default_prec): New flag.
10680 * src/reader.c: Likewise.
10681 (packgram): Handle it.
10682 * tests/conflicts.at (%default-prec without %prec,
10683 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 10684
39a06c25
PE
106852003-09-30 Paul Eggert <eggert@twinsun.com>
10686
10687 * tests/testsuite.at: Include local.at, not input.at, fixing
10688 a typo in the 2003-08-25 patch.
10689
62b6aef9
AD
106902003-08-27 Akim Demaille <akim@epita.fr>
10691
10692 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
10693 GCC warnings.
10694
89e1cc61
AD
106952003-08-26 Akim Demaille <akim@epita.fr>
10696
10697 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
10698 "<\#" to avoid magic from Gnus when posting parts of this script.
10699
a08460b0
AD
107002003-08-26 Akim Demaille <akim@epita.fr>
10701
10702 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
10703 (Parser::parse): here.
10704 Adjust: nerrs and errstatus is now replaced by...
10705 (Parser::nerrs_, Parser::errstatus_): New.
10706
603f1cfd
AD
107072003-08-25 Akim Demaille <akim@epita.fr>
10708
10709 * config/announce-gen, Makefile.cfg: New.
10710 * Makefile.am: Adjust.
10711 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
10712 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
10713
cd3684cf
AD
107142003-08-25 Akim Demaille <akim@epita.fr>
10715
10716 When reducing initial empty rules, Bison parser read an initial
10717 location that is not defined. This results in garbage, and that
10718 affects Bison's own parser. Therefore we need (i) to extend Bison
10719 to support a means to initialize this location, and (ii) to use
10720 this CVS Bison to fix CVS Bison's parser.
10721
10722 * src/reader.h, reader.c (epilogue_augment): Remove, replace
10723 with...
10724 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
10725 * src/parse-gram.y: Adjust.
10726 (%initial-action): New.
10727 (%error-verbose): Since we require CVS Bison, there is no reason
10728 not to use it.
10729 * src/scan-gram.l: Adjust.
10730 * src/Makefile.am (YACC): New, to make sure we use our own parser.
10731 * data/yacc.c (yyparse): Use b4_initial_action.
10732
4e03e201
AD
107332003-08-25 Akim Demaille <akim@epita.fr>
10734
10735 * doc/bison.texinfo: Don't promote stdout for error messages.
10736
8c182d05
AD
107372003-08-25 Akim Demaille <akim@epita.fr>
10738
10739 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
10740 From Alexandre Duret-Lutz.
10741
6a60c4cf
PE
107422003-08-25 Akim Demaille <akim@epita.fr>
10743
10744 Version 1.875c.
10745
25f66e1a
AD
107462003-08-25 Akim Demaille <akim@epita.fr>
10747
10748 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
10749 Use them.
10750
5348bfbe
AD
107512003-08-25 Akim Demaille <akim@epita.fr>
10752
10753 * data/lalr1.cc (Parser::reduce_print_): New.
10754 Use it.
10755
47301314
AD
107562003-08-25 Akim Demaille <akim@epita.fr>
10757
10758 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
10759 error recovery loops. This patch is based on
161a71f3 10760 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
10761 Also, augment the similarity between lalr1.cc and yacc.c.
10762 Note: the locations of error recovery rules are not correct yet.
10763
10764 * data/lalr1.cc: Comment changes to augment the similarity between
10765 lalr1.cc and yacc.c.
10766 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
10767 (yyerrlab1): Remove, but where it used to be (now the bottom part of
10768 yyerrlab), when hitting EOF, pop the whole stack here instead of
10769 merely falling thru the default error handling mechanism.
10770 (yyerrorlab): New label, with the old contents of YYERROR,
10771 plus the following change: pop the stack of rhs corresponding
10772 to the production that invoked YYERROR. That is how Yacc
10773 behaves (required by POSIX).
10774 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
10775 fail.
10776
1f7a61ff
AD
107772003-08-25 Akim Demaille <akim@epita.fr>
10778
10779 Tune local.at so that people can "autom4te -l autotest calc.at -o
10780 calc" for instance, to extract a sub test suite.
10781
10782 * tests/testsuite.at: Move the initialization, Autotest version
10783 requirement, and AT_TESTED invocation into...
10784 * tests/local.at: here.
10785 * tests/testsuite.at: Include it for compatibility with Autoconf
10786 2.57.
10787 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
10788 be ignore.
10789
327b5b56
PE
107902003-08-04 Paul Eggert <eggert@twinsun.com>
10791
10792 Rework code slightly to avoid gcc -Wtraditional warnings.
10793 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
10794 The returned value is now stored in *YY0. All callers changed.
10795 * src/output.c (merge_output): Adjust to the above change.
10796
0051e3ed
PE
107972003-07-26 Paul Eggert <eggert@twinsun.com>
10798
10799 * data/glr.c (YYASSERT): New macro.
10800 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
10801 yyresolveStates, yyprocessOneStack):
10802 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
10803 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 10804
137437c6
PE
108052003-07-25 Paul Eggert <eggert@twinsun.com>
10806
5b620e06
PE
10807 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
10808 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 10809 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
10810 by Frank Heckenbach, though I have omitted the structure-initialization
10811 part of his glr-knr.diff patch since I recall that the Portable
10812 C Compiler didn't require that change.
10813
137437c6
PE
10814 Let the user specify how to allocate and free memory.
10815 Derived from a suggestion by Frank Heckenbach in
161a71f3 10816 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
10817 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
10818 All uses of free, malloc, realloc changed to use these macros,
10819 and unnecessary casts removed.
10820 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
10821
ddb85ca5
PE
108222003-07-06 Matthias Mann <MatthiasMann@gmx.de>
10823
10824 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
10825 use s.empty() rather than s == "" to test for empty string; see
161a71f3 10826 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
10827 (trivial change)
10828
39910e09
AD
108292003-06-25 Akim Demaille <akim@epita.fr>
10830
10831 * config/depcomp, config/install-sh: Update from masters.
10832
0ae99356
PE
108332003-06-20 Paul Eggert <eggert@twinsun.com>
10834
10835 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
10836 and return properly parenthesized result.
10837 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
10838 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10839 Remove unnecessary parentheses from uses.
10840 * doc/bison.texinfo (Location Default Action): Describe the
10841 conventions for parentheses.
10842
cd05d13c
PE
108432003-06-19 Paul Eggert <eggert@twinsun.com>
10844
81fd08ca
PE
10845 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
10846 yyreportTree): Do not assume that size_t is the same width as int,
10847 when printing sizes. Print sizes using an unsigned format.
10848 Problem reported by Frank Heckenbach in
161a71f3 10849 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 10850
cd05d13c
PE
10851 Port to Forte Developer 7 C compiler.
10852 * data/glr.c (struct YYLTYPE): If locations are not being used,
10853 declare a single dummy member, as empty structs do not conform
10854 to the C standard.
10855 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
10856 the Forte Developer 7 C compiler complains that end-of-loop
10857 code is not reached.
10858
4dcf140b
PE
108592003-06-17 Paul Eggert <eggert@twinsun.com>
10860
10861 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
10862 avoid warnings from picky compilers about redefinition of PARAMS.
10863
8dd76bee
PE
108642003-06-17 Paul Eggert <eggert@twinsun.com>
10865
10866 Version 1.875b.
10867
10868 * NEWS: Document 1.875b.
10869
10870 * lib/bbitset.h: Do not include config.h; that's the includer's job.
10871 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
10872 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
10873 Don't use 'index' in comments, as it's a builtin fn on some hosts.
10874 * lib/bitset_stats.c: Include gettext.h unconditionally, as
10875 per recent gettext manual's suggestion.
10876 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
10877 Use prototypes, not old-style definitions.
10878 * lib/lbitset.c (lbitset_unused_clear): Likewise.
10879 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
10880 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
10881 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
10882 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
10883 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
10884 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
10885 vbitset_or_and_cmp, vbitset_copy): Likewise.
10886
10887 * lib/libiberty.h: Do not include config.h; that's the includer's job.
10888 Do not include <stdlib.h>.
10889 (PARAMS): Define unconditionally for C89.
10890 (ATTRIBUTE_NORETURN): Remove.
10891 (ATTRIBUTE_UNUSED): Define unconditionally.
10892
10893 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 10894 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
10895 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
10896 * lib/vbitset.c, lib/vbitset.h: New files.
10897 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10898 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
10899 from libbitset.
10900
10901 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
10902 `How Can I Reset @code{yyparse}', since texinfo does not allow
10903 arbitrary @ in node names.
10904
10905 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
10906 shouldn't be needed according to the gettext 0.12.1 documentation
10907 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 10908 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 10909 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 10910 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 10911
8dd76bee
PE
10912 * lib/.cvsignore: Add stdbool.h.
10913 * m4/.cvsignore: Add nls.m4, po.m4.
10914
10915 Upgrade to CVS gnulib.
10916 * stdbool_.h: File renamed from stdbool.h.in.
10917 * configure.ac (AM_STDBOOL_H): Invoke this instead of
10918 AC_HEADER_STDBOOL.
10919 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
10920 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
10921 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
10922 (MOSTLYCLEANFILES): New var.
10923 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
10924 (stdbool.h): New rule.
10925 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
10926 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
10927 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
10928 m4/quote.m4: Upgrade to today's gnulib.
10929
10930 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
10931 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
10932 the tests right now.
10933 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
10934 yyerror are declared before use; C99 requires this.
10935
25005f6a
PH
109362003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10937
10938 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
10939 first.
10940 (yyrecoverSyntaxError): Correct the logic for setting and testing
10941 yyerrState.
10942 Correct comment on handling EOF.
10943 Allow states with only a default reduction, rather than failing
8dd76bee 10944 (I can't quite reconstruct why these were not allowed before).
25005f6a 10945
137437c6 10946 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 10947 buffer overruns, corrupting state.
8dd76bee
PE
10948
10949 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
10950 definition.
10951 * src/reader.h (max_left_semantic_context): New variable declaration.
10952 * src/scan-gram.l (max_left_semantic_context): Define.
10953 (handle_action_dollar): Update max_left_semantic_context.
10954 * data/glr.c (YYMAXLEFT): New definition.
10955 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
10956 (yyresolveAction): Ditto.
10957
10958 Fixes to problems with location handling in GLR parsers reported by
10959 Frank Heckenbach (2003/06/05).
10960
10961 * data/glr.c (YYLTYPE): Make trivial if locations not used.
10962 (YYRHSLOC): Add parentheses, and define only if locations used.
10963 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
10964 locations not used.
10965 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
10966 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 10967
25005f6a
PH
10968 * tests/cxx-type.at: Exercise location information; update tests
10969 to differentiate output with and without locations.
8dd76bee 10970 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
10971 because default YYLTYPE not yet defined.
10972 Change semantic actions to compute strings, rather than printing
10973 them directly (to test proper passing of semantics values). Change
10974 output to prefix notation and update test data and expected results.
10975 (yylex): Track locations.
10976 (stmtMerge): Return value rather than printing, and include arguments
10977 in value.
8dd76bee 10978
711f40b7
PE
109792003-06-03 Paul Eggert <eggert@twinsun.com>
10980
10981 Avoid warnings generated by GCC 2.95.4 when Bison is
10982 configured with --enable-gcc-warnings.
10983 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
10984 yy::]b4_parser_class_name[::translate_,
10985 yy::Stack::operator[] (unsigned),
10986 yy::Stack::operator[] (unsigned) const,
10987 yy::Slice::operator[] (unsigned),
10988 yy::Slice::operator[] (unsigned) const):
10989 Rename local vars to avoid warnings.
10990 * tests/glr-regression.at (Improper handling of embedded actions
10991 and $-N in GLR parsers): Remove unused local variable from yylex.
10992 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
10993 (void) as arg when not pure, since we now assume C89 when building
10994 Bison. Pacify GCC by using parameter.
10995
ac695f7d
PE
109962003-06-02 Paul Eggert <eggert@twinsun.com>
10997
10998 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
10999 yy::Location::lines, yy::Location::columns): Rename arguments
11000 to avoid shadowing; this removes a warning generated by GCC 3.3.
11001
26ec81e0
PE
110022003-06-01 Paul Eggert <eggert@twinsun.com>
11003
11004 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
11005 to g++, as GCC 3.3 complains if you do it.
11006 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
11007 everything that WARNING_CFLAGS has, except omit warnings
11008 not suitable for C++.
11009 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
11010 * tests/atlocal.in (CXXFLAGS): New var.
11011 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
11012
11013 Fix a GLR parser bug I reported in February; see
161a71f3 11014 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
11015 The problem was that GLR parsers did not conform to the C standard,
11016 because actions like { $1 = $2 + $3; } expanded to expressions
11017 that invoked YYFILL in separate subexpressions, and YYFILL assigned
11018 to a local variable. The C standard says that expressions
11019 like (var = f ()) + (var = f ()) have undefined behavior.
11020 Another problem was that GCC sometimes issues warnings that
11021 yyfill and its parameters are unused.
11022
11023 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
11024 as possibly unused.
11025 (yyfill): New function.
11026 (YYFILL): Use it.
11027 (yyuserAction): Change type of yynormal to bool, so that it matches
11028 the new yyfill signature. Mark it as possibly unused.
11029
11030
11031 Follow up on a bug I reported in February, where a Bison-generated
11032 parser can loop. Provide a test case and a fix for yacc.c. I
11033 don't have a fix for lalr1.cc or for glr.c, unfortunately.
11034 The original bug report is in:
161a71f3 11035 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
11036
11037 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
11038 macro's size was becoming unwieldy.
11039 (yyerrlab): Do not discard an empty lookahead symbol, as this
11040 might destroy garbage.
11041 (yyerrorlab): New label, with the old contents of YYERROR,
11042 plus the following change: pop the stack of rhs corresponding
11043 to the production that invoked YYERROR. That is how Yacc
11044 behaves, and POSIX requires this behavior.
11045 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
11046 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
11047 Define 'alarm' to do nothing if unistd.h is not available.
11048 Add a new rule "exp: '-' error;" to test the above change to
11049 data/yacc.c. Use 'alarm' to abort any test taking longer than
11050 10 seconds, as it's probably looping.
11051 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
11052 Also, the new yacc.c generates two fewer diagnostics for an
11053 existing test.
11054
d0829076
PE
110552003-05-24 Paul Eggert <eggert@twinsun.com>
11056
c6ae27df
PE
11057 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
11058 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
11059 This fixes a problem reported by John Bowman when the Compaq/HP
11060 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
11061 -ansi -Wall -gall).
11062 * data/yacc.c (union yyalloc): Likewise.
11063 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 11064
d0829076
PE
11065 Switch from 'int' to 'bool' where that makes sense.
11066
11067 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
11068 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
11069 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
11070 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
11071 Return or accept bool, not int. All callers changed.
11072 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
11073 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
11074 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
11075 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
11076 bitset_or_and_cmp_): Likewise.
11077 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
11078 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
11079 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
11080 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
11081 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
11082 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
11083 bitset_stats_or_and_cmp): Likewise.
11084 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
11085 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
11086 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
11087 ebitset_xor_cmp): Likewise.
11088 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
11089 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
11090 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
11091 lbitset_xor_cmp): Likewise.
11092 * lib/bbitset.h: Include <stdbool.h>.
11093 (struct bitset_vtable): The following members now return bool, not
11094 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
11095 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
11096 or_and_cmp).
11097 * src/conflicts.c (count_rr_conflicts): Likewise.
11098 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
11099 All uses changed.
11100 * lib/ebitset.c (ebitset_obstack_init): Likewise.
11101 * lib/lbitset.c (lbitset_obstack_init): Likewise.
11102 * src/getargs.c (debug_flag, defines_flag, locations_flag,
11103 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11104 graph_flag): Likewise.
11105 * src/getargs.h (debug_flag, defines_flag, locations_flag,
11106 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11107 graph_flag): Likewise.
11108 * src/output.c (error_verbose): Likewise.
11109 * src/output.h (error_verbose): Likewise.
11110 * src/reader.c (start_flag, typed): Likewise.
11111 * src/reader.h (typed): Likewise.
11112 * src/getargs.c (LOCATIONS_OPTION): New constant.
11113 (long_options, getargs): Use it.
11114 * src/lalr.c (build_relations): Use bool, not int.
11115 * src/nullable.c (nullable_compute): Likewise.
11116 * src/print.c (print_reductions): Likewise.
11117 * src/tables.c (action_row, pack_vector): Likewise.
11118 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
11119 * src/output.c (prepare): Use it.
11120 * src/output.c (token_definitions_output,
11121 symbol_destructors_output, symbol_destructors_output): Use string,
11122 not boolean integer, to keep track of whether to output separator.
11123 * src/print_graph.c (print_core): Likewise.
11124 * src/state.c (state_rule_lookaheads_print): Likewise.
11125
11126 * config/install-sh: Sync from automake 1.7.5.
11127
6b2584b7
PE
111282003-05-14 Paul Eggert <eggert@twinsun.com>
11129
11130 * src/parse-gram.y (rules_or_grammar_declaration): Require a
11131 semicolon after a grammar declaration, in the interest of possible
11132 future changes to the Bison input language.
11133 Do not allow a stray semicolon at the start of the grammar.
11134 (rhses.1): Allow one or more semicolons after any rule, including
11135 just before "|" as required by POSIX.
11136 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
11137 grammar.
11138
caf37a36
ADL
111392003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
11140
11141 %parse-param support for lalr1.cc.
11142
11143 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
11144 b4_cc_constructor_calls, b4_cc_constructor_call,
11145 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
11146 definitions.
11147 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
11148 parse-param arguments.
11149 (yy::b4_parser_class_name): Declare instance variables to
11150 hold parse-param arguments.
11151 * tests/calc.at: s/value/semantic_value/ because value clashes
11152 with a member of yy::b4_parser_class_name. Adjust C++ code
11153 to handle %parse-param. Enable %parse-param test in C++.
11154
3ab37077
PE
111552003-05-12 Paul Eggert <eggert@twinsun.com>
11156
11157 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
11158 English a bit. Fix fclose typo. Change "const char" to "char
11159 const", and use ANSI C rather than K&R for "main". Suggest
11160 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
11161 and suggest yy_switch_to_buffer.
11162
111632003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
11164
11165 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
11166 C89. This avoids a diagnostic on compilers that define __STDC__
11167 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 11168 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 11169
e743727f
PE
111702003-05-03 Paul Eggert <eggert@twinsun.com>
11171
11172 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
11173 Do not overrun array bounds.
11174 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 11175 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 11176
916708d5
AD
111772003-04-29 Akim Demaille <akim@epita.fr>
11178
11179 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
11180 * src/getargs.c, src/getargs.h: here, as bool, not int.
11181 (nondeterministic_parser): New.
11182 * src/parse-gram.y, src/scan-gram.l: Support
11183 %nondeterministic-parser.
11184 * src/output.c (prepare): Use nondeterministic_parser instead
11185 of glr_parser where appropriate.
11186 * src/tables.c (conflict_row, action_row, save_row)
11187 (token_actions, token_actions, pack_vector): Ditto.
11188
a06ea4aa
AD
111892003-04-29 Akim Demaille <akim@epita.fr>
11190
11191 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
11192
211074ca
AD
111932003-04-29 Akim Demaille <akim@epita.fr>
11194
11195 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
11196 with %pure-parser and %locations to exercise the patch from Yakov
11197 Markovitch below.
11198
6175ffe3
PE
111992003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
11200
11201 * data/yacc.c: (b4_lex_param): Corrected for the case where
11202 %lex-param is provided and %pure-parser isn't.
11203
b1e95857
PE
112042003-04-27 Paul Eggert <eggert@twinsun.com>
11205
11206 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 11207 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
11208 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
11209 if it is not defined.
11210 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
11211
acda9df6
PE
112122003-04-26 Paul Eggert <eggert@twinsun.com>
11213
3470c57b
PE
11214 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
11215 Declare to be of type suitable for the ninf value itself, not of
11216 type suitable for the corresponding table, since the latter might
11217 be unsigned but the ninf value might be negative. This fixes a
11218 bug reported by Alexandre Duret-Lutz in
161a71f3 11219 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 11220
acda9df6
PE
11221 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
11222 invokes it. We shouldn't invoke it twice because it will attempt
11223 to put error.o in the archive twice. This fixes a glitch reported
11224 by Martin Mokrejs in
161a71f3 11225 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 11226
b5250f26
PE
112272003-04-21 Paul Eggert <eggert@twinsun.com>
11228
11229 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
11230 to gnulib.
11231
089ac0f1
PE
112322003-04-21 Yakov Markovitch <Markovitch@iso.ru>
11233
11234 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
11235 Fix obvious typo that results in uncompilable GLR parsers
11236 when both %pure-parser and %locations are used. (trivial change)
11237
5ededac6
PE
112382003-04-17 Paul Eggert <eggert@twinsun.com>
11239
1b8f2fff
PE
11240 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
11241 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
11242 Do not insert the expected token via unput, as this runs afoul
11243 of a POSIX-compatibility bug in flex 2.5.31.
11244 All uses changed to BEGIN the parent state,
11245 since we no longer insert the expected token via unput.
11246 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
11247 that is no longer emitted after the above change.
11248
5ededac6
PE
11249 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
11250 the first one. This change is from Paul Hilfinger, and it fixes
11251 regression reported by Werner Lemberg in
161a71f3 11252 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
11253
11254 (resolve_sr_conflict): Don't invoke state_errs_set
11255 unless one or more tokens have been explicitly made errors.
11256 Otherwise, the above change causes Bison to abort.
11257
11258 * tests/existing.at (GNU pic Grammar): New test case, taken from
11259 Lemberg's email.
11260
b8be9132
AD
112612003-03-31 Akim Demaille <akim@epita.fr>
11262
11263 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
11264
d423d460
AD
112652003-03-31 Akim Demaille <akim@epita.fr>
11266
11267 * src/output.c (prepare_symbols): Avoid trailing spaces in the
11268 output.
11269
c7e441b4
AD
112702003-03-31 Akim Demaille <akim@epita.fr>
11271
11272 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
11273 From Paul Hilfinger.
11274
231897ad
AD
112752003-03-29 Akim Demaille <akim@epita.fr>
11276
11277 * m4/error.m4: Do not put under dynamic conditions some code which
11278 expansion is under static control.
11279
5b066063
AD
112802003-03-29 Akim Demaille <akim@epita.fr>
11281
11282 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
11283
22a74fec
AD
112842003-03-29 Akim Demaille <akim@epita.fr>
11285
11286 * doc/bison.texinfo (Strings are Destroyed): New.
11287
0eee27e7
PE
112882003-03-13 Paul Eggert <eggert@twinsun.com>
11289
11290 * .cvsignore: Add configure.lineno.
11291 * src/.cvsignore: Add yacc.
11292 * tests/.cvsignore: Add testsuite.log.
11293 * doc/fdl.texi: Sync with latest FSF version.
11294
f61aad93
PE
112952003-03-12 Paul Eggert <eggert@twinsun.com>
11296
537636c7
PE
11297 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
11298 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
11299 cursor, instead of leaving it undefined. This fixes a bug
11300 reported by Tim Van Holder in
161a71f3 11301 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
11302 * tests/input.at (Torturing the Scanner): Test the scanner on
11303 an empty input file, which was Tim Van Holder's test case.
11304
11305 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
11306 <sys/resource.h> can be included, include sys/time.h and
11307 sys/times.h first, if available. This works around the SunOS
11308 4.1.4 porting bug reported by Bruce Becker in
161a71f3 11309 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
11310
11311 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
11312 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
11313 AC_HEADER_SYS_WAIT.
11314
f61aad93
PE
11315 Merge changes from gnulib. This was prompted because the CVS
11316 snapshot didn't build on Solaris 7 due to strnlen problems.
11317
11318 These changes need to be merged back into gnulib:
11319 * lib/hash.c: Include <stdbool.h> unconditionally.
11320 * m4/onceonly.m4 (m4_quote): New macro.
11321 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
11322 Quote AC_FOREACH variable-expansions properly.
11323 The 2003-01-03 obstack.h change also needs merging.
11324 {end of changes requiring merging}
5b066063 11325
f61aad93
PE
11326 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11327 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
11328 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
11329 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
11330 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
11331 New files, imported from gnulib.
11332 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
11333 above.
11334
11335 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
11336 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
11337 gnulib sources.
11338
11339 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
11340 Add.
11341 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
11342 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
11343 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
11344 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
11345 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
11346 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
11347 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
11348 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
11349 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
11350 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
11351 (jm_PREREQ_ARGMATCH): Remove.
11352 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
11353 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
11354
11355 * src/system.h: Include <stdbool.h> unconditionally.
11356
11357 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
11358 assuming at least C89 in the bitset code for some time now.
11359
d2ffe116
AD
113602003-03-03 Akim Demaille <akim@epita.fr>
11361
11362 * ro.po: New.
11363
052826fd
AD
113642003-03-02 Akim Demaille <akim@epita.fr>
11365
11366 * doc/bison.texinfo (Table of Symbols): Reactivate the
11367 documentation for %lex-param, and %parse-param.
11368
c4749565
AD
113692003-03-02 Akim Demaille <akim@epita.fr>
11370
11371 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
11372 generate verbose error messages.
11373 Use the number of tokens as an upper bound in yytname, as it
11374 cannot be a non terminal.
11375
d5286af1
AD
113762003-03-02 Akim Demaille <akim@epita.fr>
11377
11378 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
11379 message.
11380
22e304a6
AD
113812003-03-02 Akim Demaille <akim@epita.fr>
11382
22e304a6
AD
11383 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
11384 Use them to exercise yycheck overrun.
11385 Based on Andrew Suffield's grammar.
11386
67a25fed
AD
113872003-03-02 Akim Demaille <akim@epita.fr>
11388
11389 Create tests/local.at for Bison generic testing macros.
11390
11391 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
11392 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
11393 This new file.
11394 * tests/calc.at (AT_CHECK_CALC): Adjust.
11395 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
11396 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
11397 * tests/local.at: here.
11398 (AT_COMPILE_CXX): Tags the tests using it as c++.
11399 Ignore the test if CXX is not functional.
11400
9c2b381f
PE
114012003-03-01 Paul Eggert <eggert@twinsun.com>
11402
11403 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
11404 not loc->end, since loc->end might contain garbage and this leads
11405 to undefined behavior on some platforms.
11406 (id_loc, token_start): Use (IF_LINTed) initial values that do not
11407 depend on *loc, so that the reader doesn't give the the false
11408 impression that *loc is initialized.
11409 (<INITIAL>"%%"): Do not bother setting code_start, since its value
11410 does not survive the return.
11411
0433ba88
AD
114122003-03-01 Akim Demaille <akim@epita.fr>
11413
11414 * src/scan-gram.l (code_start): Always initialize it when entering
11415 into yylex, as SC_EPILOGUE is activated *before* the corresponding
11416 yylex invocation. An alternative would be making it static, but
11417 then it starts with the second %%'s beginning, instead of its end.
11418
b305ea69
PE
114192003-02-28 Paul Eggert <eggert@twinsun.com>
11420
11421 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
11422 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 11423 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 11424
c3d25e01
PE
114252003-02-26 Paul Eggert <eggert@twinsun.com>
11426
11427 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
11428 Remove Sequent/Pyramid discussion (nobody uses them any more).
11429 Merge VMS and MS-DOS discussion; these ports may well be dead
11430 but let's keep mentioning them for now. Put <> around email
11431 addresses. Add copyright notice.
11432
c267ffbc
PE
114332003-02-24 Paul Eggert <eggert@twinsun.com>
11434
11435 * data/glr.c (yy_reduce_print): yylineno -> yylno,
11436 to avoid collision with flex use of yylineno.
11437 Problem reported by Bruce Lilly in
161a71f3 11438 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
11439 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11440 * data/yacc.c (yy_reduce_print): Likewise.
11441
11442 * config/depcomp: Sync with Automake 1.7.3.
11443
f939fc12
AD
114442003-02-21 Akim Demaille <akim@epita.fr>
11445
11446 * data/lalr1.cc: Use temporary variables instead of casts to
11447 change integer types.
11448 Suggested by Paul Eggert.
11449
95923bd6
AD
114502003-02-21 Akim Demaille <akim@epita.fr>
11451
11452 * doc/bison.texinfo: Use "location" consistently to refer to @n,
11453 to avoid confusions with lalr1.cc's notion of Position.
11454 Suggested by Paul Eggert.
11455
2cdc240e
AD
114562003-02-20 Akim Demaille <akim@epita.fr>
11457
11458 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
11459 before initial_columns.
11460 (location.hh): Use consistent variable names when defining the
11461 operator<<.
11462 Use "last" so that we subtract from Positions, not from unsigned.
11463
5d003116
AD
114642003-02-20 Akim Demaille <akim@epita.fr>
11465
11466 * data/lalr1.cc (position.hh): New subfile, including the extended
11467 and Doxygen'ed documentation of class Position.
11468 (location.hh): Use it.
11469 Document a` la Doxygen.
ba1ecc07 11470 With the help of Benoit Perrot.
5d003116 11471
d02b25f9
AD
114722003-02-20 Akim Demaille <akim@epita.fr>
11473
11474 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
11475 AT_YACC_IF.
11476 Redefine AT_YYERROR_SEES_LOC_IF using it.
11477 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
11478 not defined.
11479 Don't use the location in yy::Parser::error_ and
11480 yy::Parser::print_ when not %locations.
11481 Activate more lalr1.cc tests.
11482
0d1c3a04
AD
114832003-02-19 Akim Demaille <akim@epita.fr>
11484
11485 * data/lalr1.cc: When displaying a line number, be sure to make it
11486 an int.
11487
60a777aa
AD
114882003-02-19 Akim Demaille <akim@epita.fr>
11489
11490 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
11491 Remove, useless.
11492 (YYABORT, YYACCEPT, YYERROR): New.
11493 * tests/calc.at: Renable the lalr1.cc test.
11494
0b86fc41
AD
114952003-02-19 Akim Demaille <akim@epita.fr>
11496
11497 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
11498 error recovery, mixing with/without pops and discarding of the
11499 lookahead.
11500 Exercise YYERROR.
11501 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
11502
da99a5dc
PE
115032003-02-17 Paul Eggert <eggert@twinsun.com>
11504
11505 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
11506 * tests/testsuite.at (AT_COMPILE): Use them.
11507 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 11508 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 11509
93b8c255
PE
115102003-02-12 Paul Eggert <eggert@twinsun.com>
11511
11512 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
11513 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 11514 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
11515 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
11516 Check for malloc failure, for consistency with yacc.c.
11517 (yytname_size): Remove, for consistency with yacc.c.
11518
11519 The bug still remains in data/lalr1.cc, as I didn't have time
11520 to fix it there.
11521
7548fed2
AD
115222003-02-06 Akim Demaille <akim@epita.fr>
11523
11524 * configure.ac (GXX): Rename as...
11525 (CXX): this, to keep the original Autoconf semantics.
11526 Require 2.57.
11527 * data/lalr1.cc: Fix b4_copyright invocations.
11528 If YYDEBUG is not defined, don't depend upon name_ being defined.
11529 (location.hh): Include string and iostream.
11530 (Position::filename): New member.
11531 (Position::Position ()): New.
11532 (operator<< (Position)): New.
11533 (operator- (Position, int)): New.
11534 (Location::first, Location::last): Rename as...
11535 (Location::begin, Location::end): these, to mock the conventional
11536 iterator names.
11537 (operator<< (Location)): New.
11538 * tests/atlocal.in (CXX): New.
11539 * tests/testsuite.at (AT_COMPILE_CXX): New.
11540 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
11541 locations in a more synthetic way.
11542 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
11543 lalr1.cc is used.
11544 Adjust the C locations to match those from Emacs: first column is
11545 column 0.
11546 Change all the expected results.
11547 Conform to the GCS: simplify the locations when applicable.
11548 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
11549 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
11550 these CPP macros with the m4 macros new defined by...
11551 (AT_CHECK_PUSHDEFS): this, i.e.:
11552 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 11553 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
11554 New macros.
11555 (AT_CHECK_POPDEFS): Undefine them.
11556 (AT_CHECK_CALC_LALR1_CC): New.
11557 Use it for the first lalr1.cc test.
11558
43a176ef
AD
115592003-02-04 Akim Demaille <akim@epita.fr>
11560
11561 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
11562 Location as is defined.
11563
fc049e9c
AD
115642003-02-04 Akim Demaille <akim@epita.fr>
11565
11566 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
11567 name_ being defined.
11568
a737b216
PE
115692003-02-03 Paul Eggert <eggert@twinsun.com>
11570
11571 * src/gram.h (start_symbol): Remove unused decl.
11572
11573 Use more-consistent naming conventions for local vars.
11574
11575 * src/derives.c (derives_compute): Change type of local var from
11576 int to rule_number.
11577 * src/gram.c (grammar_rules_partial_print): Likewise.
11578 * src/print.c (print_core): Likewise.
11579 * src/reduce.c (reduce_grammar_tables): Likewise.
11580
11581 * src/gram.c (grammar_dump): Change name of item_number *
11582 local var from r to rp.
11583 * src/nullable.c (nullable_compute): Likewise.
11584
11585 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
11586
11587 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
11588 for symbol or symbol_number var.
11589 * src/reader.c (grammar_start_symbol_set): Likewise.
11590 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
11591 Likewise.
11592 * src/state.c (transitions_to): Likewise.
11593 * src/state.h: Likewise.
11594 * src/tables.c (symbol_number_to_vector_number): Likewise.
11595
11596 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
11597 char * var.
11598
11599 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
11600 var.
11601
11602 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
11603 var.
11604
11605 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
11606 Use str, not s, for char * var. Use ch, not c, for character var.
11607 Use size for size var.
11608
11609 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
11610 char * var.
11611 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
11612 uniqstr var.
11613 * src/uniqstr.h: Likewise.
11614
11615 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11616 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11617 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
11618 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
11619 param to have same name as that of enum, so that we don't use
11620 "s" to stand for a non-state.
11621
68e93ad5
AD
116222003-02-02 Akim Demaille <akim@epita.fr>
11623
11624 * src/scan-skel.l: Scan more than one inert character per yylex
11625 invocation.
11626
92898986
PE
116272003-02-01 Paul Eggert <eggert@twinsun.com>
11628
11629 Version 1.875a.
11630
1d9d5d71
PE
11631 * po/LINGUAS: Add ms.
11632
0435d061
AD
116332003-01-30 Akim Demaille <akim@epita.fr>
11634
11635 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
11636
6029a57f
PH
116372003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11638
11639 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
11640 of $1.
0435d061
AD
11641
11642 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 11643 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 11644 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 11645
6029a57f
PH
11646 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
11647 (b4_rhs_location): Ditto.
0435d061 11648 (yyfill): New function to copy from stack tree into array
6029a57f 11649 incrementally.
0435d061
AD
11650 (yyuserAction): Modify to allow incremental move of semantic values
11651 to rhs array when in GLR mode.
11652 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
11653 as needed.
11654 Remove dummy use of yystack, as there is now a guaranteed use.
11655 (yydoAction): Modify to allow incremental move of semantic values
11656 to rhs array when in GLR mode.
11657 (yyresolveAction): Ditto.
11658 (yyglrShiftDefer): Update comment.
0435d061 11659 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
11660 (yyglrReduce): Ditto.
11661 (yydoAction): Ditto
0435d061 11662
6029a57f
PH
11663 * tests/glr-regr1.at: Rename to ...
11664 * tests/glr-regression.at: Add new regression test for the problems
11665 described above (adapted from S. Eken).
11666 Update copyright notice.
11667 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
11668 * tests/Makefile.am: Ditto.
11669
6cee6297
PE
116702003-01-28 Paul Eggert <eggert@twinsun.com>
11671
11672 * data/lalr1.cc: Do not use @output_header_name@ unless
11673 b4_defines_flag is set. This fixes two bugs reported by
11674 Tim Van Holder in
161a71f3
PE
11675 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
11676 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 11677
b2a836b5
PE
116782003-01-21 Paul Eggert <eggert@twinsun.com>
11679
11680 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
11681 we don't need to worry about yyerrlab1 being reported as an
11682 "unused label" by non-GCC C compilers. The downside is that if
11683 locations are used then a couple of statements are duplicated each
11684 time YYERROR is invoked, but the upside is that the warnings
11685 should vanish.
11686 (yyerrlab1): Move code to YERROR.
11687 (yyerrlab2): Remove. Change uses back to yyerrlab1.
11688 This reverts some of the 2002-12-27 change.
11689
4196b931
PE
116902003-01-17 Paul Eggert <eggert@twinsun.com>
11691
11692 * src/output.c (symbol_printers_output): Fix typo that led
11693 to core dump. Problem reported by Antonio Rus in
161a71f3 11694 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 11695
3ae831b4
AD
116962003-01-13 Akim Demaille <akim@epita.fr>,
11697 Quoc Peyrot <chojin@lrde.epita.fr>,
11698 Robert Anisko <anisko_r@lrde.epita.fr>
11699
11700 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
11701 when the stacks contain one element, as the loop would otherwise
11702 free the last state, and then use the top state (the one we just
11703 popped). This means that the initial elements will not be freed
11704 explicitly, as is the case in yacc.c; it is not a problem, as
11705 these elements have fake values.
11706
e3aa65c5
PE
117072003-01-11 Paul Eggert <eggert@twinsun.com>
11708
11709 * NEWS: %expect-violations are now just warnings, reverting
11710 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
11711 bootstrapping problem reported by Matthias Klose; see
161a71f3 11712 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
11713 * src/conflicts.c (conflicts_print): Likewise.
11714 * tests/conflicts.at (%expect not enough, %expect too much,
11715 %expect with reduce conflicts): Likewise.
11716 * doc/bison.texinfo (Expect Decl): Document this. Also mention
11717 that the warning is enabled if the number of conflicts changes
11718 (not necessarily increases).
11719
11720 * src/getargs.c (version): Update copyright year.
11721
f0057011
AD
117222003-01-09 Akim Demaille <akim@epita.fr>
11723
11724 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
11725
1ee6d2a0
PE
117262003-01-08 Paul Eggert <eggert@twinsun.com>
11727
11728 * Makefile.maint (WGETFLAGS):
11729 New macro, containing "-C off" to disable proxy caches.
11730 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
11731 (rel-check): Use $(WGET) instead of wget.
11732
d4fd77c4
PE
117332003-01-06 Paul Eggert <eggert@twinsun.com>
11734
11735 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
11736 the GLR paper of Scott, Johnstone and Hussain.
11737
464c6927
PE
117382003-01-04 Paul Eggert <eggert@twinsun.com>
11739
d600ee67
PE
11740 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
11741 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
11742 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
11743 (EXTRA_LIBRARIES): New var, for liby.a.
11744 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
11745 (EXTRA_SCRIPTS): New var, for yacc.
11746
464c6927
PE
11747 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
11748 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
11749 Problem reported by Nelson H. F. Beebe.
11750
117512003-01-03 Paul Eggert <eggert@twinsun.com>
11752
11753 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
11754 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
11755 when compiling Bison 1.875's `bitset bset = obstack_alloc
11756 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
11757
11758 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
11759 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
11760 grow to a huge size with typical invocation.
d600ee67 11761
464c6927
PE
11762 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
11763 Use the pattern recommended by Autoconf 2.57, except also protect
11764 against double-definition.
11765 * src/system.h: Likewise.
11766 Portability issues reported by Nelson H. F. Beebe.
d600ee67 11767
464c6927
PE
11768 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
11769 All uses changed. Provide a definition in both C and C++.
11770 (yytrue, yyfalse): Define even if defined (__cplusplus).
11771
11772 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
11773 Reported by Nelson H. F. Beebe.
d600ee67 11774
464c6927
PE
11775 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
11776
0f42c7d5
PE
117772003-01-02 Paul Eggert <eggert@twinsun.com>
11778
11779 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
11780 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
11781 Bug reported by Nelson H. F. Beebe.
11782
dc546b0f
PE
117832003-01-01 Paul Eggert <eggert@twinsun.com>
11784
11785 * Version 1.875.
11786
2c09b6a7
PE
117872002-12-30 Paul Eggert <eggert@twinsun.com>
11788
11789 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
11790 Moved here from...
11791 (<INITIAL>","): Here. This causes stray "," to be treated
11792 more uniformly.
11793
dc546b0f 11794 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
11795 last brace in braced code when not in Yacc mode, for compatibility
11796 with Bison 1.35. This resurrects the 2001-12-15 patch to
11797 src/reader.c.
11798
11799 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
11800 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
11801
535c0f63
PE
118022002-12-28 Paul Eggert <eggert@twinsun.com>
11803
11804 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
11805 that of SYM's type. This fixes Debian bug 168069, reported by
11806 Thomas Olsson.
d600ee67 11807
963fcc17
PE
118082002-12-28 Paul Eggert <eggert@twinsun.com>
11809
11810 Version 1.75f.
11811
11812 Switch back to the Yacc style of conflict reports, undoing some
11813 of the 2002-07-30 change.
11814 * doc/bison.texinfo (Understanding): Use Yacc style for
11815 conflict reports. Also, use new way of locating rules.
11816 * src/conflicts.c (conflict_report):
11817 Renamed from conflict_report_yacc, removing the old
11818 'conflict_report'. Translate the entire conflict report at once,
11819 so that we don't assume that "," has the same interpretation in
11820 all languages.
11821 (conflicts_output): Use Yacc-style conflict report for each state,
11822 instead of our more-complicated style.
11823 (conflicts_print): Use Yacc-style conflict report, except print
11824 the input file name when not emulating Yacc.
11825 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
11826 Conflicted Reduction, %expect not enough, %expect too much,
11827 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
11828 * tests/existing.at (GNU Cim Grammar): Likewise.
11829 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
11830
11831 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
11832 fatal): Don't invoke fflush; it's not needed and it might even be
11833 harmful for stdout, as stdout might not be open.
11834 * src/reduce.c (reduce_print): Likewise.
11835
b1efe548
PE
118362002-12-27 Paul Eggert <eggert@twinsun.com>
11837
11838 Fix a bug where error locations were not being recorded correctly.
11839 This problem was originally reported by Paul Hilfinger in
161a71f3 11840 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
11841
11842 * data/yacc.c (yyparse): New local var yylerrsp, to record the
11843 top of the location stack's error locations.
11844 (yyerrlab): Set it. When discarding a token, push its location
11845 onto yylerrsp so that we don't lose track of the error's end.
11846 (yyerrlab1): Now is only the target of YYERROR, so that we can
11847 properly record the location of the action that failed. For GCC
11848 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
11849 GCC warning about yyerrlab1 being unused if YYERROR is unused.
11850 (yyerrlab2): New label, which yyerrlab now falls through to.
11851 Compute the error's location by applying YYLLOC_DEFAULT to
11852 the locations of all the symbols that went into the error.
11853 * doc/bison.texinfo (Location Default Action): Mention that
11854 YYLLOC_DEFAULT is also invoked for syntax errors.
11855 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11856 Error locations include the locations of all the tokens that were
11857 discarded, not just the last token.
d600ee67 11858
983c5c2c
PE
118592002-12-26 Paul Eggert <eggert@twinsun.com>
11860
b1efe548
PE
11861 * src/files.c: Include quote.h.
11862 (compute_output_file_names): Warn if we detect conflicting
11863 outputs to the same file. This should catch the misunderstanding
11864 exemplified by Debian Bug 165349, reported by Bruce Stephens..
11865
11866 * src/conflicts.c (conflicts_print): If the user specifies
11867 "%expect N", report an error if there are any reduce/reduce
11868 conflicts. This is what the manual says should happen.
11869 This fixes Debian bug 130890, reported by Anthony DeRobertis.
11870 * tests/conflicts.at (%expect with reduce conflicts): New test.
11871
983c5c2c
PE
11872 Don't use m4_include on relative file names, as it doesn't work as
11873 desired if there happens to be a file with that name under ".".
d600ee67 11874
983c5c2c
PE
11875 * m4sugar/version.m4: Remove; it was included but it wasn't used.
11876 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
11877 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
11878 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
11879 * src/output.c (output_skeleton): Use full path names when
11880 specifying a file to include; don't rely on include path, as
11881 it's unreliable when the working file contains a file with
11882 that name.
d600ee67 11883
983c5c2c
PE
118842002-12-25 Paul Eggert <eggert@twinsun.com>
11885
11886 Remove obsolete references to bison.simple and bison.hairy.
11887 Problem mentioned by Aubin Mahe in
161a71f3 11888 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
11889 * data/glr.c: Comment fix.
11890 * doc/bison.1: Remove references. Also, mention "yacc".
11891
11892 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
11893 with -g option.
11894
11895 * src/parse-gram.y (declaration): Use enum "report_states" rather
11896 than its numeric value 1.
11897
11898 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
11899 opening a new one. This fixes Debian bug 165349, reported by
11900 Bruce Stephens.
11901
23f2d9dc
PE
119022002-12-24 Paul Eggert <eggert@twinsun.com>
11903
11904 Version 1.75e.
11905
11906 * Makefile.maint (cvs-update): Don't assume that the shell
11907 supports $(...), as Solaris sh doesn't.
11908
11909 * src/parse-gram.y (lloc_default): Remove test for empty
11910 nonterminals at the end, since it didn't change the result.
11911
119122002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
11913
11914 If the user does not define YYSTYPE as a macro, Bison now declares it
11915 using typedef instead of defining it as a macro. POSIX requires this.
11916 For consistency, YYLTYPE is also declared instead of defined.
11917
11918 %union directives can now have a tag before the `{', e.g., the
11919 directive `%union foo {...}' now generates the C code
11920 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
11921 The default union tag is `YYSTYPE', for compatibility with Solaris 9
11922 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
11923 instead of `yyltype'.
11924
11925 `yystype' and `yyltype' are now obsolescent macros instead of being
11926 typedefs or tags; they are no longer documented and will be
11927 withdrawn in a future release.
11928
11929 * data/glr.c (b4_location_type): Remove.
11930 (YYSTYPE): Renamed from yystype.
11931 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
11932 (struct YYLTYPE): Renamed from struct yyltype.
11933 (YYLTYPE): Renamed from yyltype.
11934 (yyltype, yystype): New (and obsolescent) macros,
11935 for backward compatibility.
11936 * data/yacc.c: Likewise.
11937
11938 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
11939 does not specify a union tag. This is for compatibility with
11940 Solaris 9 yacc.
11941
11942 * src/parse-gram.y (add_param): 2nd arg is now char * not char
11943 const *, since it is now modified by stripping surrounding { }.
11944 (current_braced_code): Remove.
11945 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
11946 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
11947 trailing " {...}". Now of type <chars>.
11948 (grammar_declaration): Adjust to bundled tokens.
11949 (code_content): Remove; stripping is now done by add_param.
11950 (print_token_value): Print contents of bundled tokens.
11951 (token_name): New function.
11952
11953 * src/reader.h (braced_code, current_braced_code): Remove.
11954 (token_name): New decl.
11955
11956 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
11957 token_type, not braced_code code_kind. All uses changed.
11958 (SC_PRE_CODE): New state, for scanning after a keyword that
11959 has (or usually has) an immediately-following braced code.
11960 (token_type): New local var, to keep track of which token type
11961 to return when scanning braced code.
11962 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 11963 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
11964 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
11965 instead of returning a token type immediately.
11966 (<INITIAL>"{"): Set token type.
11967 (<SC_BRACED_CODE>"}"): Use it.
11968 (handle_action_dollar, handle_action_at): Now returns bool
11969 indicating success. Fail if ! current_rule; this prevents a core dump.
11970 (handle_symbol_code_dollar, handle_symbol_code_at):
11971 Remove; merge body into caller.
11972 (handle_dollar, handle_at): Complain in invalid contexts.
11973
11974 * NEWS, doc/bison.texinfo: Document the above.
11975 * NEWS: Fix years and program names in copyright notice.
11976
879ca4f8
PE
119772002-12-17 Paul Eggert <eggert@twinsun.com>
11978
11979 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
11980 Reporting, Table of Symbols): Omit mentions of %lex-param and
11981 %parse-param from the documentation for now.
11982
1c5fe69d
PE
119832002-12-15 Paul Eggert <eggert@twinsun.com>
11984
11985 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
11986 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
11987 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
11988 disagreed with the Bison documentation. Bug
11989 reported by Andrew Walrond.
d600ee67 11990
1c5fe69d
PE
11991 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
11992 as the caller now does that.
11993 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
11994 (YYEMPTY): Parenthesize right hand side, since others use it.
11995 (yyparse): Don't assume that our generated code is the only code
11996 that sets yychar.
11997
d1de5372
PE
119982002-12-13 Paul Eggert <eggert@twinsun.com>
11999
12000 Version 1.75d.
12001
12002 POSIX requires a "yacc" command.
12003 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
12004 (MOSTLYCLEANFILES): Add yacc.
12005 (yacc): New rule.
1c5fe69d 12006 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
12007 as an alias for bison y.
12008
12009 * po/LINGUAS: Add da.
d600ee67 12010
d1de5372
PE
12011 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
12012 problem with latest <getopt.h>.
12013 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
12014
12015 * doc/fdl.texi: Upgrade to 1.2.
12016 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
12017 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
12018 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
12019 gnulib.
12020 * config/install-sh: Sync with autotools.
12021
12022 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 12023 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
12024 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
12025 locations are requested.
12026 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
12027 locations are requested.
12028
d0f3fe23
PE
120292002-12-12 Paul Eggert <eggert@twinsun.com>
12030
12031 Remove unportable casts and storage allocation tricks.
12032 While we're at it, remove almost all casts, since they
12033 usually aren't needed and are a sign of trouble.
12034
12035 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
12036
12037 * src/derives.c (derives_compute): Do not subtract NTOKENS from
12038 the pointer DSET returned by malloc; this isn't portable.
12039 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
12040 Similarly for DERIVES.
12041 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
12042 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
12043 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
12044
12045 * src/derives.c (derives_compute): Do not bother invoking
12046 int_of_rule_number, since rule numbers are integers.
12047
12048 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
12049 rather than XMALLOC (char, N).
12050
12051 * src/files.c (filename_split): Rewrite to avoid cast.
12052
12053 * src/gram.h (symbol_number_as_item_number,
12054 item_number_as_symbol_number, rule_number_as_item_number,
12055 item_number_as_rule_number):
12056 Now inline functions rather than macros, to avoid casts.
12057 * src/state.h (state_number_as_int): Likewise.
12058 * src/tables.c (state_number_to_vector_number,
12059 symbol_number_to_vector_number): Likewise.
12060
12061 * src/gram.h (int_of_rule_number): Remove; no longer used.
12062
12063 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
12064 since the resulting storage is always stored into.
12065
12066 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
12067 where it's needed.
12068
12069 * src/muscle_tab.c (muscle_m4_output):
12070 Now inline. Return bool, not int.
12071 * src/state.c (state_compare): Likewise.
12072 * src/symtab.c (symbol_check_defined,
12073 symbol_check_alias_consistency, symbol_pack, symbol_translation,
12074 hash_compare_symbol, hash_symbol):
12075 Likewise.
12076 * src/uniqstr.c (uniqstr_print): Likewise.
12077 * src/muscle_tab.c (muscle_m4_output_processor):
12078 New function, to avoid casts.
12079 * src/state.c (state_comparator, stage_hasher): Likewise.
12080 * src/symtab.c (symbol_check_defined_processor,
12081 symbol_check_alias_consistency_processor, symbol_pack_processor,
12082 symbol_translation_processor, hash_symbol_comparator,
12083 hash_symbol_hasher): Likewise.
12084 * src/uniqstr.c (uniqstr_print_processor): Likewise.
12085 * src/muscle_tab.c (muscles_m4_output):
12086 Use new functions instead of casting old functions unportably.
12087 * src/state.c (state_hash_new): Likewise.
12088 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
12089 symbols_token_translations_init):
12090 Likewise.
12091 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
12092
12093 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
12094 var instead of casting to long, to avoid casts.
12095 (prepare_states): Use MALLOC rather than alloca, so that we don't
12096 have to worry about alloca.
12097 * src/state.c (state_hash_lookup): Likewise.
12098
12099 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
12100 local var instead of casting to unsigned char, to avoid casts.
12101
12102 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
12103 STATE_ALLOC): Remove.
12104 (transitions_new, errs_new, reductions_new, state_new): Use malloc
12105 rather than calloc, and use offsetof to avoid allocating slightly
12106 too much storage.
12107 (state_new): Initialize all members.
12108
12109 * src/state.c (state_hash): Use unsigned accumulator, not signed.
12110
12111 * src/symtab.c (symbol_free): Remove; unused.
12112 (symbol_get): Remove cast in lhs of assignment.
12113 (symbols_do): Now static. Accept generic arguments, not
12114 hashing-related ones.
12115
12116 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
12117 (symbol_processor): Remove.
12118 (symbols_do): Remove decl; now static.
12119
12120 * src/system.h (alloca): Remove; decl no longer needed.
12121 (<stddef.h>): Include, for offsetof.
12122 (<inttypes.>, <stdint.h>): Include if available.
12123 (uintptr_t): New type, if system lacks it.
12124 (CALLOC, MALLOC, REALLOC): New macros.
12125 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
12126 new macros.
12127
12128 * src/tables.c (table_size): Now int, to pacify GCC.
12129 (table_grow, table_ninf_remap): Use signed table size.
12130 (save_row): Don't bother initializing locals when not needed.
12131 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
12132 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
12133
12134 * src/vcg.h: Correct misspellings.
12135
12136 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
12137
12138
12139 * src/getargs.c (getargs): Don't assume EOF == -1.
12140
26b4a969
PE
121412002-12-09 Paul Eggert <eggert@twinsun.com>
12142
12143 Change identifier spellings to avoid collisions with names
12144 that are reserved by POSIX.
12145
12146 Don't use names ending in _t, since POSIX reserves them.
12147 For consistency, remove _e and _s endings -- they're weren't
12148 needed to remove ambiguity. All uses changed.
12149 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
12150 turn was just renamed from struniq_t.
12151 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
12152 which in turn was just renamed from struniq_processor_t.
12153 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
12154 in turn was renamed from hash_compare_struniq_t.
12155 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
12156 (state_list): Renamed from state_list_t.
12157 * src/assoc.h (assoc): Renamed from assoc_t.
12158 * src/conflicts.c (enum conflict_resolution): Renamed from
12159 enum conflict_resolution_e.
12160 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
12161 (rule_list): Renamed from rule_list_t.
12162 * src/getargs.h (enum trace): Renamed from enum trace_e.
12163 (enum report): Renamed from enum report_e.
12164 * src/gram.h (item_number): Renamed from item_number_t.
12165 (rule_number): Renamed from rule_number_t.
12166 (struct rule_s): Remove the "rule_s" part; not used.
12167 (rule): Renamed from rule_t.
12168 (rule_filter): Renamed from rule_filter_t.
12169 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
12170 (goto_list): Renamed from goto_list_t.
12171 * src/lalr.h (goto_number): Renamed from goto_number_t.
12172 * src/location.h (location): Renamed from location_t.
12173 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
12174 and moved here from:
12175 * src/muscle_tab.h (muscle_entry_t): here.
12176 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
12177 (rule_list): Renamed from rule_list_t.
12178 * src/print_graph.c (static_graph): Renamed from graph.
12179 * src/reader.h (braced_code): Renamed from braced_code_t.
12180 Remove brace_code_e tag.
12181 * src/relation.h (relation_node): Renamed from relation_node_t.
12182 (relation_nodes): Renamed from relation_nodes_t.
12183 (relation): Renamed from relation_t.
12184 * src/state.h (state_number): Renamed from state_number_t.
12185 (struct state): Renamed from struct state_s.
12186 (state): Renamed from state_t.
12187 (transitions): Renamed from transitions_t. Unused (and
12188 misspelled) transtion_s tag removed.
12189 (errs): Renamed from errs_t. Unused errs_s tag removed.
12190 (reductions): Renamed from reductions_t. Unused tag
12191 reductions_s removed.
12192 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
12193 (struct symbol_list): Renamed from struct symbol_list_s.
12194 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
12195 (struct symbol): Renamed from struct symbol_s.
12196 (symbol): Renamed from symbol_t.
12197 * src/tables.c (vector_number): Renamed from vector_number_t.
12198 (action_number): Renamed from action_t.
12199 * src/tables.h (base_number): Renamed from base_t.
12200 * src/vcg.h (enum color): Renamed from enum color_e.
12201 (enum textmode): Renamed from enum textmode_e.
12202 (enum shape): Renamed from enum shape_e.
12203 (struct colorentry): Renamed from struct colorentry_s.
12204 (struct classname): Renamed from struct classname_s.
12205 (struct infoname): Renamed from struct infoname_s.
12206 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
12207 (enum decision): Renamed from enum decision_e.
12208 (enum orientation): Renamed from enum orientation_e.
12209 (enum alignment): Renamed from enum alignment_e.
12210 (enum arrow_mode): Renamed from enum arrow_mode_e.
12211 (enum crossing_type): Renamed from enum crossing_type_e.
12212 (enum view): Renamed from enum view_e.
12213 (struct node): Renamed from struct node_s.
12214 (node): Renamed from node_t.
12215 (enum linestyle): Renamed from enum linestyle_e.
12216 (enum arrowstyle): Renamed from enum arrowstyle_e.
12217 (struct edge): Renamed from struct edge.
12218 (edge): Renamed from edge_t.
12219 (struct graph): Renamed from struct graph_s.
12220 (graph): Renamed from graph_t.
12221 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
12222 Rename value_t -> value.
12223 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
12224 value_t_as_yystype -> value_as_yystype.
12225
12226 Don't include <errno.h> in the mainstream code, since it
12227 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
12228 * lib/get-errno.c, lib/get-errno.h: New files.
12229 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
12230 get-errno.c.
12231 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
12232 * src/output.c (output_skeleton): Likewise.
12233 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
12234 instead of errno.
12235 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
12236 Likewise.
12237 (handle_action_dollar, handle_action_at): Likewise.
12238 * src/system.h: Do not include <errno.h>.
12239 (TAB_EXT): Renamed from EXT_TAB.
12240 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
12241
12242 Avoid str[a-z]*, since <string.h> reserves that name space.
12243 Change all instances of "struniq" in names to "uniqstr", and
12244 likewise for "STRUNIQ" and "UNIQSTR".
12245 * src/uniqstr.c: Renamed from src/struniq.c.
12246 * src/uniqstr.h: Renamed from src/struniq.h.
12247 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
12248 * src/files.c (strsuffix): Remove; unused.
12249 (concat2): Renamed from stringappend. Now static.
12250 * src/files.h (strsuffix, stringappend): Remove; unused.
12251 * src/parse-gram.y (<chars>): Renamed from <string>.
12252 (<uniqstr>): Renamed from <struniq>.
12253 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
12254 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
12255 (struct graph_s.expand): Renamed from struct graph_s.stretch.
12256 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
12257 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
12258 (N_EXPAND): Renamed from N_STRETCH.
12259
12260 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
12261 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
12262 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
12263 Remove; unused.
12264 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
12265 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
12266 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
12267 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
12268 (BASE_MAXIMUM): Renamed from BASE_MAX.
12269 (BASE_MINIMUM): Renamed from BASE_MIN.
12270 (ACTION_MAX): Remove; unused.
12271 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
12272 Unnecessary casts removed from above defines.
12273
12274
12275 Fix misspelling in names.
12276 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
12277 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
12278 G_NODE_ALIGNEMENT.
12279
12280
12281 * lib/timevar.c (timevar_report): Renamed from time_report,
12282 for consistency with other names.
12283 * lib/timevar.h (timevar_report): New decl.
12284 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
12285
12286
12287 Sort include-file uses.
12288
12289 Reorder all include files under src to be in the order "system.h".
12290 then the ../lib include files in angle brackets (alphabetized),
12291 then the . include files in double-quotes (alphabetized). Fix
12292 dependency breakages encountered in this process, as follows:
12293 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
12294 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
12295 * src/state.h: Include "symtab.h".
12296
996b1c7e
PE
122972002-12-08 Paul Eggert <eggert@twinsun.com>
12298
12299 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
12300 since this causes problems when __file__ contains character
12301 sequences like "@" that are treated specially by src/scan-skel.l.
12302 Instead, just use the file's basename. This fixes the bug
12303 reported by Martin Mokrejs in
161a71f3 12304 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 12305
e19c4e5d
PE
123062002-12-06 Paul Eggert <eggert@twinsun.com>
12307
12308 Add support for rules that do not have trailing semicolons, as
12309 POSIX requires. Improve the quality of locations in Bison
12310 diagnostics.
26b4a969 12311
e19c4e5d
PE
12312 * src/location.c: Include <quotearg.h>.
12313 (empty_location): Now const.
12314 (location_print): New function. Follow the recommendation of the
12315 GNU Coding Standards for locations that span file boundaries.
12316 * src/location.h: Do not include <quotearg.h>; no longer needed.
12317 (boundary): New type.
12318 (location_t): Use it. This allows locations to span file boundaries.
12319 All member uses changed: file -> start.file or end.file (as needed),
12320 first_line -> start.line, first_column -> start.column,
12321 last_line -> end.line, last_column -> end.column.
12322 (equal_boundaries): New function.
12323 (LOCATION_RESET, LOCATION_STEP): Remove.
12324 (LOCATION_PRINT): Remove. All callers changed to use location_print.
12325 (empty_location): Now const.
12326 (location_print): New decl.
12327 * src/parse-gram.y (lloc_default): New function, which handles
12328 empty locations more accurately.
12329 (YYLLOC_DEFAULT): Use it.
12330 (%token COLON): Remove.
12331 (%token ID_COLON): New token.
26b4a969 12332 (rules): Use it.
e19c4e5d
PE
12333 (declarations, rules): Remove trailing semicolon.
12334 (declaration, rules_or_grammar_declaration):
12335 Allow empty (";") declaration.
12336 (symbol_def): Remove empty actions; no longer needed.
12337 (rules_or_grammar_declaration): Remove trailing semicolon.
12338 (semi_colon.opt): Remove.
12339 * src/reader.h: Include location.h.
12340 (scanner_cursor): New decl.
12341 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
12342 rolling our own.
12343 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
12344 of *loc.
12345 (STEP): Remove. No longer needed, now that adjust_location does
12346 the work. All uses removed.
12347 (scanner_cursor): New var.
12348 (adjust_location): Renamed from extend_location. It now sets
12349 *loc and adjusts the scanner cursor. All uses changed.
12350 Don't bother testing for CR.
12351 (handle_syncline): Remove location arg; now updates scanner cursor.
12352 All callers changed.
12353 (unexpected_end_of_file): Now accepts start boundary of token or
12354 comment, not location. All callers changed. Update scanner cursor,
12355 not the location.
12356 (SC_AFTER_IDENTIFIER): New state.
12357 (context_state): Renamed from c_context. All uses changed.
12358 (id_loc, code_start, token_start): New local vars.
12359 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
12360 processing of Yacc white space and equivalents here.
12361 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
12362 instead of returning ID immediately, since we need to search for
12363 a subsequent colon.
12364 (<INITIAL>"'", "\""): Save token_start.
12365 (<INITIAL>"%{", "{", "%%"): Save code_start.
12366 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
12367 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
12368 BEGIN context_state at end, not INITIAL.
12369 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
12370 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
12371 Return correct token start.
12372 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
12373 the start of a character, string or multiline comment is found.
12374 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
12375 Reduction): Adjust reported locations to match the more-precise
12376 results now expected.
12377 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
12378 * tests/reduce.at (Useless Rules, Reduced Automaton,
12379 Underivable Rules): Likewise.
12380 * tests/regression.at (Invalid inputs): No longer `expecting ";"
12381 or "|"' now that so many other tokens are allowed by the new grammar.
12382
12383 * src/complain.h (current_file): Remove duplicate decl;
12384 current_file is now owned by files.h.
12385 * src/complain.c, src/scan-gram.l: Include files.h.
12386
123872002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 12388
e19c4e5d
PE
12389 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
12390 promotes to int; it might be unsigned int.
12391 * data/yacc.c (yy_reduce_print): Likewise.
12392
12393 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
12394 be #defined in the prologue, not in the Bison declarations.
12395 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 12396
b64755e3
PE
123972002-12-02 Paul Eggert <eggert@twinsun.com>
12398
12399 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
12400 * lib/strtoul.c: New file, from gnulib.
12401 This fixes a porting bug reported by Peter Klein in
161a71f3 12402 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 12403
6e746484
PE
124042002-11-30 Paul Eggert <eggert@twinsun.com>
12405
b64755e3
PE
12406 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
12407 and put only a forward declaration in the prologue. This is for
12408 consistency with the other scanner helper functions.
12409
6ba55592
PE
12410 Type clashes now generate warnings, not errors, since it
12411 appears that POSIX may allow some grammars with type clashes.
12412 * src/reader.c (grammar_current_rule_check): Warn about
12413 type clashes instead of complaining.
12414 * tests/input.at (Type Clashes): Expect warnings, not complaints.
12415
6e746484
PE
12416 Add Yacc library, since POSIX requires it.
12417 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
12418 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
12419 * lib/main.c, lib/yyerror.c: New files.
12420
12421 gram_error can be static; it need not be extern.
12422 * src/reader.h (gram_error): Remove decl.
12423 * src/parse-gram.y (gram_error): Now static. Add static decl.
12424 (print_token_value): Omit parameter names from forward decl,
12425 for consistency.
12426
88510f9c
PE
124272002-11-29 Paul Eggert <eggert@twinsun.com>
12428
6e746484
PE
12429 * doc/bison.texinfo: Emphasize that yylex and yyerror must
12430 be declared before being used. E.g., one should typically
12431 declare them in the prologue. Use GNU coding style in examples.
12432 Put "const" consistently after the type it modifies. Mention
12433 that C99 supports "inline". Mention that yyerror traditionally
12434 returns "int".
12435
88510f9c
PE
12436 %parse-param and %lex-param now take just one argument, the
12437 declaration; the argument name is deduced from the declaration.
12438
12439 * doc/bison.texinfo (Parser Function, Pure Calling, Error
12440 Reporting, Table of Symbols): Document this.
12441 * src/parse-gram.y (add_param): New function.
12442 (COMMA): Remove.
12443 (declaration): Implement new rule for %parse-param and %lex-param.
12444 * src/scan-gram.l: "," now elicits a warning, rather than being
12445 a token; this is more compatible with byacc.
12446 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
12447
bb92250c
PE
124482002-11-27 Paul Eggert <eggert@twinsun.com>
12449
12450 Rename identifiers to avoid real and potential collisions.
12451
12452 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
12453 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 12454 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
12455 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12456 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
12457 * src/parse-gram.y (print_token_value): Renamed from yyprint.
12458 All uses changed.
12459 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
12460 The name "yycontrol" violates the name space rules, and this stuff
12461 wasn't being used anyway.
12462 (input): Remove action; this stuff wasn't being used.
12463 (gram_error): Rename local variable yylloc -> loc.
12464 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
12465 (YY_DECL): Don't use "yy" at start of local variables.
12466 All uses changed, e.g., yylloc -> loc.
12467 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
12468 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
12469 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
12470 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
12471
12472 * src/parse-gram.y (gram_error): loc is now const *.
12473 * src/reader.h (gram_error): Likewise.
12474
3af4feb2
PE
124752002-11-24 Paul Eggert <eggert@twinsun.com>
12476
12477 Version 1.75c.
12478
12479 * tests/actions.at (Actions after errors): Use an output format
12480 more similar to that of the Printers and Destructors test.
12481 Test the position of the ';' token too.
12482 (Printers and Destructors): Likewise.
12483 (Printers and Destructors: %glr-parser): Remove for now, to avoid
12484 unnecessarily alarming people when the test fails.
12485
12486 * data/yacc.c (yyerrlab1): Move this label down, so that the
12487 parser does not discard the lookahead token if the user code
12488 invokes YYERROR. This change is required for POSIX conformance.
12489
12490 * lib/error.c: Sync with gnulib.
12491
124922002-11-22 Paul Eggert <eggert@twinsun.com>
12493
12494 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
12495 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
12496 * lib/xmalloc.c: Likewise.
26b4a969 12497
58004308
PE
124982002-11-20 Paul Eggert <eggert@twinsun.com>
12499
12500 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
12501
125022002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 12503
58004308
PE
12504 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
12505 should use `if (! x) abort ();' rather than `assert (x);', and
12506 anyway it's one less thing to worry about configuring.
12507
12508 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
12509 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
12510 and replace all instances of assert with abort.
12511 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
12512 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
12513
12514 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
12515 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
12516 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
12517 hash_find_entry, hash_rehash, hash_insert): Likewise.
12518 * src/conflicts.c (resolve_sr_conflict): Likewise.
12519 * src/lalr.c (set_goto_map, map_goto): Likewise.
12520 * src/nullable.c (nullable_compute): Likewise.
12521 * src/output.c (prepare_rules, token_definitions_output): Likewise.
12522 * src/reader.c (packgram, reader): Likewise.
12523 * src/state.c (state_new, state_free, state_transitions_set,
12524 state_reduction_find): Likewise.
12525 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
12526 symbol_pack): Likewise.
12527 * src/tables.c (conflict_row, pack_vector): Likewise.
12528 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12529 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12530 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
12531 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
12532
12533 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
12534 (ARGMATCH_CONSTRAINT): New macro.
12535 (ARGMATCH_ASSERT): Use it.
12536
12537 * src/system.h (verify): New macro.
12538 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
12539 rather than assert.
12540 * src/tables.c (tables_generate): Likewise.
12541
12542 * src/struniq.c (struniq_assert): Now returns void, and aborts
12543 if the assertion is false.
12544 (struniq_assert_p): Remove.
12545 * src/struniq.h: Likewise.
12546
76ae8198
PE
125472002-11-18 Paul Eggert <eggert@twinsun.com>
12548
12549 * data/glr.c (yygetLRActions): Replace `yyindex' with
12550 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
12551 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 12552 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 12553
d3c4e709
AD
125542002-11-18 Akim Demaille <akim@epita.fr>
12555
12556 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
12557 space.
12558 From Tim Van Holder.
12559
8d8a7238
PE
125602002-11-17 Paul Eggert <eggert@twinsun.com>
12561
12562 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
12563 to "SyntaxError" for consistency with my 2002-11-15 change.
12564
12565 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
12566 not define to {}, since this breaks the common use of `YYDPRINTF
12567 ((...));' if a single statement is desired (e.g. before `else').
12568 Work around GCC warnings by surrounding corresponding calls with
12569 {} if needed.
12570 (yyhasResolvedValue): Remove unused function.
12571 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
12572 loop body.
12573 (yyreportSyntaxError): Renamed from yyreportParseError.
12574 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
12575 All uses changed.
12576 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
12577 extern when possible. Remove unused initializations.
12578
b0937b22
AD
125792002-11-16 Akim Demaille <akim@epita.fr>
12580
12581 Augment the similarity between GLR and LALR traces.
12582
12583 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
12584 (YY_REDUCE_PRINT): New.
12585 (yyparse): Use them.
12586 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
12587 YYDPRINT here.
12588 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
12589 state reached after the reduction/recovery, since...
12590 (yyparse, yyprocessOneStack): Report the state we are entering in.
12591
c5e3e510
AD
125922002-11-16 Akim Demaille <akim@epita.fr>
12593
12594 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
12595 Add support for --trace=skeleton.
12596 * src/scan-skel.l: %option debug.
12597 Scan strings of non-@ or \n instead of character by character.
12598 (scan_skel): Handle trace_skeleton.
12599 (QPUTS): New.
12600 (@output_parser_name@, @output_header_name@): ``Restore'' their
12601 support (used to be M4 macros).
12602 * data/yacc.c: Quote larger chunks, a la glr.c.
12603 * data/lalr1.cc: Likewise.
12604 The header guards are no longer available, so use some other
12605 string than `YYLSP_NEEDED'.
12606
4c6cc1db
AD
126072002-11-16 Akim Demaille <akim@epita.fr>
12608
12609 Make the ``Printers and Destructors'' test more verbose, taking
12610 `yacc.c''s behavior as (possibly wrong) reference.
12611
12612 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
12613 instead of fprint on stdout.
12614 Set and report the last_line of the symbols.
12615 Consistently display values and locations.
12616
6d9e8019
PE
126172002-11-16 Paul Eggert <eggert@twinsun.com>
12618
12619 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
12620
6e649e65
PE
126212002-11-15 Paul Eggert <eggert@twinsun.com>
12622
b25d88f6
PE
12623 * tests/actions.at (Actions after errors): New test case.
12624
6e649e65
PE
12625 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
12626 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
12627 tests/action.at, tests/calc.at, tests/conflicts.at,
12628 tests/cxx-type.at, tests/regression.at:
12629 "parse error" -> "syntax error" for POSIX compatibility.
12630 "parsing stack overflow..." -> "parser stack overflow" so
12631 that code matches Bison documentation.
12632
0f39aab9
AD
126332002-11-15 Akim Demaille <akim@epita.fr>
12634
12635 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
12636 take two BRACED_CODE, not two string_content.
12637 Free the scanner's obstack when we are done.
12638 (code_content): New.
12639 * tests/calc.at: Adjust.
12640 * doc/bison.texinfo: Adjust.
12641 Also, make sure to include the `,' for these declarations.
12642
761c1926
AD
126432002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
12644
12645 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
12646 definition; avoids potential autoreconf problems.
12647
b0f98b10
AD
126482002-11-15 Akim Demaille <akim@epita.fr>
12649
12650 Always check the value returned by yyparse.
12651
12652 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
12653 returned by yyparse.
12654 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
12655 Adjust calls.
12656 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
12657 returned by yyparse.
12658
970785f1
PH
126592002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12660
12661 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
12662 on input.at test.
12663
8fcc7db1
PE
126642002-11-14 Paul Eggert <eggert@twinsun.com>
12665
7ec1b48e
PE
12666 * src/output.c (output_skeleton): Call xfopen instead of
12667 duplicating xfopen's body.
12668
cfff7583 12669 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 12670 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 12671
8fcc7db1
PE
12672 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
12673 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
12674 Group compiler. Instead, use "$CC -E bar.c". Include the .h
12675 file twice in the grammar, as an extra check.
12676
12677 * tests/input.at (Torturing the Scanner): Surround the
12678 backslash-newline tests with "#if 0", to make it less likely that
12679 we'll run into compiler bugs. Bring back solitary \ inside
12680 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 12681 test backslash-newline in C character constant.
8fcc7db1 12682
4e8d992c
AD
126832002-11-14 Akim Demaille <akim@epita.fr>
12684
12685 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
12686 status of the compiler.
f32b346d 12687 Calling `exit 1' is no longer needed.
4e8d992c
AD
12688 Reported by Nelson H. F. Beebe.
12689
9501dc6e
AD
126902002-11-14 Akim Demaille <akim@epita.fr>
12691
12692 * tests/atlocal.in (CPPFLAGS): We have config.h.
12693 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
12694 New.
12695 * tests/actions.at, tests/calc.at, tests/conflicts.at,
12696 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
12697 * tests/regression.at, tests/torture.at: Use them for all the
12698 grammars that are to be compiled.
12699 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
12700 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
12701 * doc/bison.texinfo (GLR Parsers): Document `inline'.
12702
18b519c0
AD
127032002-11-14 Akim Demaille <akim@epita.fr>
12704
12705 * doc/bison.texinfo: Various formatting changes (alignments in
12706 samples, additional @group/@end group, GCS in samples.
12707 Use @deffn instead of simple @table to define the directives,
12708 macros, variables etc.
12709
9a86cdb9
PE
127102002-11-13 Paul Eggert <eggert@twinsun.com>
12711
daa33def 12712 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 12713 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 12714
daa33def 12715 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 12716 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
12717 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
12718 * tests/headers.at (export YYLTYPE): Likewise.
12719
12720 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 12721 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 12722
9a86cdb9
PE
12723 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
12724 comments, since they're not portable. Use GNU coding style.
12725
9c1e26bd
AD
127262002-11-13 Akim Demaille <akim@epita.fr>
12727
12728 * data/yacc.c: Leave bigger chunks of quoted text.
12729 (YYDSYMPRINTF): New.
12730 Use it to report symbol activities.
12731 * data/glr.c (YYDSYMPRINTF): New.
12732 Use it.
12733
87f721cc
PE
127342002-11-12 Paul Eggert <eggert@twinsun.com>
12735
12736 Version 1.75b.
12737
12738 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
12739 (yyglrReduce): Return yyok, not 0.
12740 This should avoid the enumerated-type warnings reported
464c6927 12741 by Nelson H. F. Beebe in
161a71f3 12742 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
12743
12744 * lib/bbitset.h (BITSET_INLINE): Remove.
12745 * lib/bitset.h [! BITSET_INLINE]: Remove.
12746 (bitset_set, bitset_reset, bitset_test): Rename local vars
12747 to avoid shadowing warnings by GCC.
12748
12749 * data/glr.c (inline): Remove #define. It's the user's
12750 responsibility to #define it away, just like 'const'.
464c6927 12751 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 12752 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 12753
87f721cc
PE
12754 * Makefile.maint (po-check): Scan .l and .y files instead of the
12755 .c and the .h files that they generate. This fixes the bug
12756 reported by Tim Van Holder in:
161a71f3 12757 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
12758 Look for N_ as well as for _. Try to avoid matching #define for
12759 N_ and _.
12760 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
12761 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
12762 * src/scan-gram.l: Revamp regular expressions so that " and '
12763 do not confuse xgettext.
12764
12765 * src/struniq.h (struniq_new): Do not declare the return type
12766 to be 'const'; this violates the C standard.
12767 * src/struniq.c (struniq_new): Likewise.
12768
be14ade5
AD
127692002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
12770
12771 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
12772 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
12773 linker.
12774
05291fbc
AD
127752002-11-12 Akim Demaille <akim@epita.fr>
12776
12777 * Makefile.maint: Sync with Autoconf:
12778 (local_updates): New.
12779
1f5fd52e
AD
127802002-11-12 Akim Demaille <akim@epita.fr>
12781
12782 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
12783
283f1e64
AD
127842002-11-12 Akim Demaille <akim@epita.fr>
12785
12786 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
12787 locations.
12788
886b69d1
AD
127892002-11-12 Akim Demaille <akim@epita.fr>
12790
12791 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
12792 not yyvalue.
12793
3df37415
AD
127942002-11-12 Akim Demaille <akim@epita.fr>
12795
12796 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
12797 Use it to test the GLR parser.
12798
7bd6c77e
AD
127992002-11-12 Akim Demaille <akim@epita.fr>
12800
12801 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
12802 defines it.
12803 * data/glr.c (yystos): New.
12804 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
12805 (YYDSYMPRINT): New.
12806 (yyval): Don't define it, it is handled via M4.
12807 (yyrecoverParseError): Free verbosely the discarded symbols.
12808 * data/yacc.c (yysymprint): Remove, rather...
12809 (b4_yysymprint_generate): invoke.
12810 * data/c.m4 (b4_yysymprint_generate): New.
12811 Accept pointers as arguments, as opposed to the version from
12812 yacc.c.
12813 (b4_yydestruct_generate): Likewise.
12814 * tests/cations.at (Printers and Destructors): Use Bison directives
12815 instead of CPP macros.
12816 Don't rely on internal details.
12817
b0400cc6
AD
128182002-11-12 Akim Demaille <akim@epita.fr>
12819
12820 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
12821 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
12822 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
12823 it against YYEMPTY and so forth), work on yytoken (i.e., set
12824 it to YYEMPTY etc.).
12825 (yydestruct): Replace with a b4_yydestruct_generate invocation.
12826 (b4_symbol_actions): Remove.
12827 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
12828 for 0, end-of-input.
12829
72f889cc
AD
128302002-11-12 Akim Demaille <akim@epita.fr>
12831
12832 * doc/bison.texinfo (Destructor Decl): New.
12833
b1ae9233
AD
128342002-11-12 Akim Demaille <akim@epita.fr>
12835
12836 * src/tables.c (tables_generate): Use free for pointers that
12837 cannot be NULL, not XFREE.
12838 (pack_vector): Use assert, not fatal, for bound violations.
12839 * src/state.c (state_new): Likewise.
12840 * src/reader.c (reader): Likewise.
12841 * src/lalr.c (set_goto_map): Likewise.
72f889cc 12842 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
12843 the file name.
12844
7ec2d4cd
AD
128452002-11-12 Akim Demaille <akim@epita.fr>
12846
12847 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
12848 Restore.
12849 * src/scan-gram.l (last_string): Is global to the file, not to
12850 yylex.
12851 * src/parse-gram.y (input): Don't append the epilogue here,
12852 (epilogue.opt): do it here, and free the scanner's obstack.
12853 * src/reader.c (epilogue_set): Rename as...
12854 (epilogue_augment): this.
12855 * data/c.m4 (b4_epilogue): Defaults to empty.
12856
573a6cd3
AD
128572002-11-12 Akim Demaille <akim@epita.fr>
12858
12859 * src/getargs.c (long_options): Remove duplicates.
12860 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
12861 Remove.
12862 * doc/bison.rnh: Remove.
12863 * doc/bison.texinfo (VMS Invocation): Remove.
12864
95612cfa
AD
128652002-11-12 Akim Demaille <akim@epita.fr>
12866
12867 * src/struniq.h, src/struniq.c (struniq_t): Is const.
12868 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
12869
12870 Use struniq for symbols.
12871
12872 * src/symtab.h (symbol_t): The tag member is a struniq.
12873 (symbol_type_set): Adjust.
12874 * src/symtab.c (symbol_new): Takes a struniq.
12875 (symbol_free): Don't free the tag member.
12876 (hash_compare_symbol_t, hash_symbol_t): Rename as...
12877 (hash_compare_symbol, hash_symbol): these.
12878 Use the fact that tags as struniqs.
12879 (symbol_get): Use struniq_new.
12880 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
12881 Returns a strniq.
12882 * src/reader.h (merger_list, grammar_currentmerge_set): The name
12883 and type members are struniqs.
12884 * src/reader.c (get_merge_function)
12885 (grammar_current_rule_merge_set): Adjust.
12886 (TYPE, current_type): Are struniq.
12887
12888 Use struniq for file names.
12889
12890 * src/files.h, src/files.c (infile): Split into...
12891 (grammar_file, current_file): these.
12892 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
12893 * src/reduce.c (reduce_print): Likewise.
12894 * src/getargs.c (getargs): Likewise.
12895 * src/complain.h, src/complain.c: Likewise.
12896 * src/main.c (main): Call struniqs_new early enough to use it for
12897 file names.
12898 Don't free the input file name.
12899
3e6656f9
AD
129002002-11-12 Akim Demaille <akim@epita.fr>
12901
12902 * src/symtab.c (symbol_free): Remove dead deactivated code:
12903 type_name are properly removed.
12904 Don't use XFREE to free items that cannot be NULL.
12905 * src/struniq.h, src/struniq.c: New.
12906 * src/main.c (main): Initialize/free struniqs.
12907 * src/parse-gram.y (%union): Add astruniq member.
12908 (yyprint): Adjust.
12909 * src/scan-gram.l (<{tag}>): Return a struniq.
12910 Free the obstack bit that used to store it.
12911 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
12912
7672019c
PE
129132002-11-11 Paul Eggert <eggert@twinsun.com>
12914
12915 Revamp to fix many (but not all) of the C- and M4-related quoting
12916 problems. Among other things, this fixes the Bison bug reported
12917 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 12918 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
12919
12920 Use new @ escapes consistently. Represent brackets with @{ and @}
12921 rather than @<:@ and @:>@, since this works a bit better with dumb
12922 editors like vi. Represent @ with @@, since @ is now consistently
12923 an escape. Use @oline@ and @ofile@ rather than __oline__ and
12924 __ofile__, to avoid unexpected expansions. Similarly, use @output
12925 rather than #output.
12926
12927 * data/c.m4 (b4_copyright): Omit file name from comment, since
12928 the file name could contain "*/".
12929 (b4_synclines_flag): Don't quote the 2nd argument; it should already
12930 be quoted. All uses changed.
12931
12932 * data/glr.c: Use new @ escapes consistently.
12933 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
12934 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
12935 Remove, since they couldn't handle arbitrary characters in file
12936 names.
12937 * data/lalr1.cc: Likewise.
12938 * data/yacc.c: Likewise.
12939
12940 * src/files.c (output_infix): Remove; all uses removed.
12941 * src/files.h: Likewise.
12942
12943 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
12944 mishandled funny characters in file names, and anyway it isn't
12945 needed any more.
12946 * data/yacc.c: Likewise.
12947 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
12948
12949 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
12950 * data/yacc.c: Likewise.
12951
12952 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
12953 strings now.
12954 (muscle_init): Quote filename as a C string.
12955 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
12956 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
12957 * src/output.c (escaped_file_name_output): New function.
12958 (prepare_symbols): Quote tokens for M4.
12959 (prepare): Don't insert output_infix, output_prefix,
12960 output_parser_name, output_header_name; this is now down by scan-skel.
12961 Insert skeleton as a C string.
12962
12963 * src/output.c (user_actions_output, symbol_destructors_output,
12964 symbol_printers_output): Quote filenames for C and M4.
12965 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12966
12967 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
12968 escapes other than \\ and \'; this simplifies the code.
12969 (<SC_STRING>): Likewise, for \\ and \".
12970 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
12971 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
12972 Use new escapes @{ and @} for [ and ].
12973
12974 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
12975 them with auto vars.
12976 Switch to new escape scheme, where @ is the escape character uniformly.
12977 Abort if a stray escape character is found. Avoid unbounded input
12978 buffer when parsing non-escaped text.
12979
12980 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
12981 __oline__, #output, $@, and @{ do not have unintended meanings.
12982
acea4f3b
PE
129832002-11-09 Paul Eggert <eggert@twinsun.com>
12984
12985 Fix the test failure due to GCC warnings described in
161a71f3 12986 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
12987 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
12988 evaluate to 0 if it's impossible for NINF to be in the respective
12989 table.
12990 (yygetLRActions, yyrecoverParseError): Use them.
12991
12992 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
12993 counted in the token inserted at end of file. Now takes
12994 location_t *, not location_t, so that the location can be
12995 adjusted. All uses changed.
12996
12997 * tests/regression.at (Invalid inputs): Adjust wording in
12998 diagnostic to match the new behavior.
12999
13000 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
13001 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
13002 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
13003 abort ();'. This reduces the runtime of the "Many lookaheads"
13004 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
13005 GCC 3.2.
13006
20ef1ad5
PE
130072002-11-07 Paul Eggert <eggert@twinsun.com>
13008
13009 * src/parse-gram.y (CHARACTER): Remove unused token.
13010 All uses removed.
13011
13012 * src/scan-gram.l: Remove stack option. We no longer use the
13013 stack, since the stack was never deeper than 1; instead, use the
13014 new auto var c_context to record the stacked value.
13015
13016 Remove nounput option. At an unexpected end of file, we now unput
13017 the minimal input necessary to end cleanly; this simplifies the
13018 code.
13019
13020 Avoid unbounded token sizes where this is easy.
13021
13022 (unexpected_end_of_file): New function.
13023 Use it to systematize the error message on unexpected EOF.
13024 (last-string): Now auto, not static.
13025 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
13026 (scanner_last_string_free): Remove; not used.
13027 (percent_percent_count): Move decl to just before use.
13028 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
13029 not the (never otherwised-used) CHARACTER.
13030
93724f13
AD
130312002-11-07 Akim Demaille <akim@epita.fr>
13032
13033 Let yyerror always receive the msg as last argument, so that
13034 yyerror can be variadic.
13035
13036 * data/yacc.c (b4_yyerror_args): New.
13037 Use it when calling yyerror.
13038 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
13039 Use it when calling yyerror.
13040 * doc/bison.texinfo (Error Reporting): Adjust.
13041 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
13042 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
13043
6e40b4eb
AD
130442002-11-06 Akim Demaille <akim@epita.fr>
13045
13046 #line should have quoted strings.
13047 Ideally, this should be done by m4_quotearg.
13048
13049 * src/scan-skel.l: Include quotearg.h.
13050 Quote __ofile__.
13051 * src/output.c (symbol_printers_output)
13052 (symbol_destructors_output): Quote the file name.
13053
2dfbfc12
AD
130542002-11-06 Akim Demaille <akim@epita.fr>
13055
13056 * tests/regression.at (Invalid inputs): Adjust to the recent
13057 messages.
13058
437c2d80
AD
130592002-11-06 Akim Demaille <akim@epita.fr>
13060
13061 Restore --no-lines.
13062 Reported by Jim Kent.
13063
13064 * data/c.m4 (b4_syncline): New.
13065 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
13066 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
13067 * src/output.c (user_actions_output): Likewise.
13068 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 13069 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 13070
900c5db5
AD
130712002-11-06 Akim Demaille <akim@epita.fr>
13072
13073 * src/main.c (main): Free `infile'.
13074 * src/scan-gram.l (handle_syncline): New.
13075 Recognize `#line'.
13076 * src/output.c (user_actions_output, symbol_destructors_output)
13077 (symbol_printers_output): Use the location's file name, not
13078 infile.
13079 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13080
e183b123 130812002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 13082
e183b123 13083 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 13084 either has GLR conflict entries.
e183b123 13085
193eb6b7
PE
130862002-11-05 Paul Eggert <eggert@twinsun.com>
13087
e183b123
PE
13088 * src/scan-gram.l: Use more accurate diagnostics, e.g.
13089 "integer out of range" rather than "invalid value".
13090 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
13091 accordingly.
13092
193eb6b7
PE
13093 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
13094 Also, remove one static variable in the scanner.
13095
13096 * src/scan-gram.l (braces_level): Now auto, not static.
13097 Initialize to zero if the compiler is being picky.
13098 (INITIAL): Clear braces_level instead of incrementing it.
13099 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
13100 as POSIX 1003.1-2001 requires.
13101 * src/system.h (IF_LINT): New macro, taken from coreutils.
13102 * configure.ac: Define "lint" if --enable-gcc-warnings.
13103
29c01725
AD
131042002-11-05 Akim Demaille <akim@epita.fr>
13105
13106 * src/scan-gram.l: When it starts with `%', complain about the
13107 whole directive, not just that `invalid character: %'.
13108
8aeac3ca
AD
131092002-11-04 Akim Demaille <akim@epita.fr>
13110
13111 * Makefile.maint: Update from Autoconf.
13112 (update, cvs-update, po-update, do-po-update): New.
13113
793a58bb
AD
131142002-11-04 Akim Demaille <akim@epita.fr>
13115
13116 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
13117 and yyerror.
13118 Have yyerror `use' its arguments.
13119 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
13120 returns true when location & yacc & pure & parse-param.
13121 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
13122
c4d720cd
AD
131232002-11-04 Akim Demaille <akim@epita.fr>
13124
13125 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
13126 clashes.
13127 * src/scan-gram.l: Use [\'] instead of ['] to pacify
13128 font-lock-mode.
13129 Use complain_at.
13130 Use quote, not quote_n since LOCATION_PRINT no longer uses the
13131 slot 0.
13132
613a0dc5
PE
131332002-11-03 Paul Eggert <eggert@twinsun.com>
13134
13135 * src/reader.c (get_merge_function, grammar_current_rule_check):
13136 Use consistent diagnostics for reporting type name clashes.
13137 Quote the types with <>, for consistency with Yacc.
13138 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
13139
2a8d363a
AD
131402002-11-03 Akim Demaille <akim@epita.fr>
13141
13142 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
13143 New.
13144 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
13145 (b4_parse_param): Remove.
13146 Use b4_identification.
13147 Propagate b4_pure_args where needed to pass them to yyerror.
13148 * data/glr.m4 (b4_parse_param): Remove.
13149 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
13150 (b4_lpure_formals): New.
13151 Use b4_identification.
13152 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
13153 b4_user_formals and b4_user_args.
13154 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
13155 (yyreportAmbiguity): When using a pure parser, also need
13156 the location, and the parse-params.
13157 Adjust callers.
13158 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
13159 When using a pure parser, also need the parse-params.
13160 Adjust callers.
13161 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
13162 (%pure-parser + %parse-param) LALR and GLR parsers.
13163 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
13164 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
13165 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
13166 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
13167 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
13168 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
13169 * doc/bison.texinfo: Untabify the whole file.
13170 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
13171 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
13172 (Error Reporting): Adjust to these new directives.
13173 Document %error-verbose, deprecate YYERROR_VERBOSE.
13174
9e32add8
AD
131752002-11-03 Akim Demaille <akim@epita.fr>
13176
13177 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
13178 AT_CHECK_CALC_GLR invocations to use % directives, instead of
13179 command line options.
13180 * tests/cxx-type.at: Formatting changes.
13181
b02d90a5
PE
131822002-11-03 Paul Eggert <eggert@twinsun.com>
13183
13184 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
13185 to count columns correctly, and to check for invalid inputs.
9e32add8 13186
b02d90a5
PE
13187 Use mbsnwidth to count columns correctly. Account for tabs, too.
13188 Include mbswidth.h.
13189 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
13190 (extend_location): New function.
13191 (YY_LINES): Remove.
13192
13193 Handle CRLF in C code rather than in Lex code.
13194 (YY_INPUT): New macro.
13195 (no_cr_read): New function.
13196
13197 Scan UCNs, even though we don't fully handle them yet.
13198 (convert_ucn_to_byte): New function.
13199
13200 Handle backslash-newline correctly in C code.
13201 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
13202 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
13203 all uses changed.
13204 (tag, splice): New EREs. Do not allow NUL or newline in tags.
13205 Use {splice} wherever C allows backslash-newline.
13206 YY_STEP after space, newline, vertical-tab.
13207 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 13208
b02d90a5
PE
13209 (letter, id): Don't assume ASCII; e.g., spell out a-z.
13210
13211 ({int}, handle_action_dollar, handle_action_at): Check for integer
13212 overflow.
9e32add8 13213
b02d90a5
PE
13214 (YY_STEP): Omit trailing semicolon, so that it's more like C.
13215
13216 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
13217 as well as \000. Check for UCHAR_MAX, not 255.
13218 Allow \x with an arbitrary positive number of digits, as in C.
13219 Check for overflow here.
13220 Allow \? and UCNs, for compatibility with C.
13221
13222 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
13223 with quote slot used by complain_at.
13224
13225 * tests/input.at: Add tests for backslash-newline, m4 quotes
13226 in symbols, long literals, and funny escapes in strings.
13227
13228 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
13229 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
13230 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
13231 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
13232 * m4/mbswidth.m4: New file, from GNU coreutils.
13233
13234 * doc/bison.texinfo (Grammar Outline): Document // comments.
13235 (Symbols): Document that trigraphs have no special meaning in Bison,
13236 nor is backslash-newline allowed.
13237 (Actions): Document that trigraphs have no special meaning.
13238
13239 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
13240 no longer used.
13241
132422002-11-02 Paul Eggert <eggert@twinsun.com>
13243
13244 * src/reader.c: Don't include quote.h; not needed.
13245 (get_merge_function): Reword warning to be consistent with
13246 type clash diagnostic in grammar_current_rule_check.
13247
13248 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
13249 bug in trigraph handling.
13250
13251 * src/output.c (prepare_symbols): When printing token names,
13252 escape "[" as "@<:@" and likewise for "]".
13253
13254 * src/system.h (errno): Remove declaration, as we are now
13255 assuming C89 or better, and C89 guarantees errno.
13256
762b212b
PE
132572002-10-30 Paul Eggert <eggert@twinsun.com>
13258
13259 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
13260 Check for close failures.
13261 * src/files.h (xfclose): Return void, not int, since it always
13262 returned zero.
13263 * src/files.c (xfclose): Likewise. Report I/O error if ferror
13264 indicates one.
13265 * src/output.c (output_skeleton): Use xfclose rather than fclose
13266 and ferror. xfclose now checks ferror.
13267
13268 * data/glr.c (YYLEFTMOST_STATE): Remove.
13269 (yyreportTree): Use a stack-based leftmost state. This avoids
13270 our continuing battles with bogus warnings about initializers.
13271
56100c60
AD
132722002-10-30 Akim Demaille <akim@epita.fr>
13273
13274 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
13275 #if.
13276
51b4a04c
PH
132772002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13278
13279 * tests/glr-regr1.at: New test for reported regressions.
13280 * tests/testsuite.at: Add glr-regr1.at test.
13281 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 13282
bf1ebda2
PE
132832002-10-24 Paul Eggert <eggert@twinsun.com>
13284
5c16c6b1
PE
13285 Version 1.75a.
13286
bf1ebda2
PE
13287 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
13288 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
13289 we use malloc. Don't assume 'A' through 'Z' are contiguous.
13290 Don't assume strdup exists; POSIX says its an XSI extension.
13291 Check for buffer overflow on input.
13292
b526ee61
AD
132932002-10-24 Akim Demaille <akim@epita.fr>
13294
13295 * src/output.c (output_skeleton): Don't disable M4sugar comments
13296 too soon: it results in comments being expanded.
13297 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
13298 first output.
13299
f1886bb2
AD
133002002-10-24 Akim Demaille <akim@epita.fr>
13301
13302 * data/yacc.c (m4_int_type): New.
13303 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
13304 char' as only yacc.c wants K&R portability.
13305 * data/glr.c (yysigned_char): Remove.
13306 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
13307 Reported by Quoc Peyrot.
13308
c5576256
PE
133092002-10-23 Paul Eggert <eggert@twinsun.com>
13310
13311 * src/main.c (main): With --trace=time, report times even if a
13312 non-fatal error occurs. Formerly, the times were reported in some
13313 such cases but not in others.
13314 * src/reader.c (reader): Just return if a complaint has been issued,
13315 instead of exiting, so that 'main' can report times.
13316
27b0ffea
AD
133172002-10-22 Akim Demaille <akim@epita.fr>
13318
13319 * src/system.h: Include sys/types.
13320 Reported by Bert Deknuydt.
13321
223a7883
PE
133222002-10-23 Paul Eggert <eggert@twinsun.com>
13323
13324 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
13325 Suggested by Art Haas.
13326
133272002-10-22 Paul Eggert <eggert@twinsun.com>
13328
13329 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
13330 decl; not needed any more.
13331 * src/main.c (main): Use return to exit, undoing yesterday's change.
13332 The last OS that we could find where this wouldn't work is
13333 SunOS 3.5, and that's too old to worry about now.
13334
13335 * data/glr.c (struct yyltype): Define members even when not
13336 doing locations. This is more consistent with yacc.c, and it
13337 works around the following bug reports:
161a71f3
PE
13338 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
13339 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 13340
223a7883
PE
13341 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
13342 @acronym consistently. Standardize on "Yacc" instead of "YACC",
13343 "Algol" instead of "ALGOL". Give a bit more history about BNF.
13344
8b76775a
AD
133452002-10-22 Akim Demaille <akim@epita.fr>
13346
13347 * data/README: New.
13348
6db10d14
PE
133492002-10-21 Paul Eggert <eggert@twinsun.com>
13350
13351 Be consistent about 'bool'; the old code used an enum in one
13352 module and an int in another, and this violates the C standard.
13353 * m4/stdbool.m4: New file, from coreutils 4.5.3.
13354 * configure.ac (AC_HEADER_STDBOOL): Add.
13355 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
13356 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
13357 * src/symtab.c (hash_compare_symbol_t): Likewise.
13358 * src/system.h (bool, false, true): Use a definition consistent
13359 with ../lib/hash.c. All uses changed.
13360
13361 * src/complain.c (warning_issued): Renamed from warn_message_count,
13362 so that we needn't worry about integer overflow (!).
13363 Now of type bool. All uses changed.
13364 (complaint_issued): Renamed from complain_message_count; likewise.
13365
13366 * src/main.c (main): Use exit to exit with failure.
27b0ffea 13367
6db10d14
PE
13368 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
13369 rather than 1 and 0.
13370 * src/main.c (main): Likewise.
13371 * src/getargs.c (getargs): Likewise.
13372 * src/reader.c (reader): Likewise.
13373
13374 * src/getarg.c (getargs): Remove duplicate code for
13375 "Try `bison --help'".
13376
13377 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
13378 What was that "2" for?
13379
13380 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
13381 * src/getargs.c (usage): Likewise.
13382
13383 * src/getargs.c (getargs): When there are too few operands, report
13384 the last one. When there are too many, report the first extra
13385 one. This is how diffutils does it.
13386
92a060fd
PE
133872002-10-20 Paul Eggert <eggert@twinsun.com>
13388
13389 Remove K&R vestiges.
13390 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
13391 * src/complain.c (VA_START): Remove. Assume prototypes.
13392 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
13393 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
13394 fatal): Assume prototypes.
13395 * src/complain.h: Assume prototypes.
13396 * src/system.h (PARAMS): Remove.
13397 Include <limits.h> unconditionally, since it's guaranteeed even
13398 for a freestanding C89 compiler.
13399 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
13400 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 13401
e7cb57c0
AD
134022002-10-20 Akim Demaille <akim@epita.fr>
13403
13404 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
13405 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
13406 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
13407 (yyresolveStates, yyresolveAction, yyresolveStack)
13408 (yyprocessOneStack): Use them.
13409 (yy_reduce_print): New.
13410 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
13411
0245f82d
AD
134122002-10-20 Akim Demaille <akim@epita.fr>
13413
13414 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
13415 arguments and output `void'.
13416 (b4_c_function): Rename as...
13417 (b4_c_function_def): this.
13418 (b4_c_function_decl, b4_c_ansi_function_def)
13419 (b4_c_ansi_function_decl): New.
13420 Change the interpretation of the arguments: before `int, foo', now
13421 `int foo, foo'.
13422 * data/yacc.c (yyparse): Prototype and define thanks to these.
13423 Adjust b4_c_function_def uses.
13424 * data/glr.c (yyparse): Likewise, but ANSI only.
13425
39912f52
AD
134262002-10-20 Akim Demaille <akim@epita.fr>
13427
13428 * src/output.c (prepare): Move the definition of `tokens_number',
13429 `nterms_number', `undef_token_number', `user_token_number_max'
13430 to...
13431 (prepare_tokens): Here.
13432 (prepare_tokens): Rename as...
13433 (prepare_symbols): this.
13434 (prepare): Move the definition of `rules_number' to...
13435 (prepare_rules): here.
13436 (prepare): Move the definition of `last', `final_state_number',
13437 `states_number' to...
13438 (prepare_states): here.
13439 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
13440
20c1e2ad
AD
134412002-10-20 Akim Demaille <akim@epita.fr>
13442
13443 * src/tables.h, src/tables.c, src/output.c: Comment changes.
13444
21964f43
AD
134452002-10-20 Akim Demaille <akim@epita.fr>
13446
13447 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
13448 * data/c.m4: here.
13449
66d30cd4
AD
134502002-10-20 Akim Demaille <akim@epita.fr>
13451
13452 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
13453 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
13454 `pair'.
13455 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
13456 `name' to...
13457 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
13458 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
13459 These.
13460
95f2c9fe
PE
134612002-10-19 Paul Eggert <eggert@twinsun.com>
13462
13463 Do not create a temporary file, as that involves security and
13464 cleanup headaches. Instead, use a pair of pipes.
13465 Derived from a suggestion by Florian Krohm.
13466 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
13467 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
13468 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
13469 (BISON_PREREQ_SUBPIPE): Add.
13470 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
13471 Add subpipe.h, subpipe.c.
13472 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
13473 * po/POTFILES.in: Add lib/subpipe.c.
13474 * src/output.c: Include "subpipe.h".
13475 (m4_invoke): Remove decl.
13476 (scan_skel): New decl.
13477 (output_skeleton): Use pipe rather than temporary file for m4 input.
13478 Check that m4sugar.m4 is readable, to avoid deadlock.
13479 Check for pipe I/O error.
13480 * src/scan-skel.l (readpipe): Remove decl.
13481 (scan_skel): New function, to be used in place of m4_invoke.
13482 Read from stream rather than file.
66d30cd4 13483
95f2c9fe
PE
13484 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
13485 float, as this generates a warning on Solaris 8 + GCC 3.2 with
13486 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
13487 this generates a more-accurate value anyway.
13488
13489 * lib/timevar.c (timervar_accumulate): Rename locals to
13490 avoid confusion with similarly-named more-global.
13491 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
13492
13493 * src/output.c (prepare): Use xstrdup to convert char const *
13494 to char *, to avoid GCC warning.
13495
c19988b7
AD
134962002-10-19 Akim Demaille <akim@epita.fr>
13497
13498 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
13499 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
13500 Use them to have `calc.y' ready for %pure-parser.
13501 * data/yacc.c (YYLEX): Pass a yylex return type to
13502 b4_c_function_call.
13503
ae7453f2
AD
135042002-10-19 Akim Demaille <akim@epita.fr>
13505
13506 Prototype support of %lex-param and %parse-param.
13507
13508 * src/parse-gram.y: Add the definition of the %lex-param and
13509 %parse-param tokens, plus their rules.
13510 Drop the `_' version of %glr-parser.
13511 Add the "," token.
13512 * src/scan-gram.l (INITIAL): Scan them.
13513 * src/muscle_tab.c: Comment changes.
13514 (muscle_insert, muscle_find): Rename `pair' as `probe'.
13515 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
13516 (muscle_entry_s): The `value' member is no longer const.
13517 Adjust all dependencies.
13518 * src/muscle_tab.c (muscle_init): Adjust: use
13519 MUSCLE_INSERT_STRING.
13520 Initialize the obstack earlier.
13521 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
13522 (muscle_pair_list_grow): New.
13523 * data/c.m4 (b4_c_function_call, b4_c_args): New.
13524 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
13525 * tests/calc.at: Use %locations, not --locations.
13526 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
13527
0e575721
AD
135282002-10-19 Akim Demaille <akim@epita.fr>
13529
13530 * src/getargs.c (usage): Take status as argument and exit
13531 accordingly.
13532 Report the traditional `Try ... --help' message when status != 0.
13533 (usage, version): Don't take a FILE * as arg, it is pointless.
13534 (getargs): When there is an incorrect number of arguments, make it
13535 an error, and report it GNUlically thanks to `usage ()'.
13536
724ce7f5
PE
135372002-10-18 Paul Eggert <eggert@twinsun.com>
13538
3a781eb2
PE
13539 * data/glr.c (yyreportParseError): Don't assume that sprintf
13540 yields the length of the printed string, as this is not true
13541 on SunOS 4.1.4. Reported by Peter Klein.
13542
724ce7f5
PE
13543 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
13544 * tests/conflicts.at (%nonassoc and eof): Likewise.
13545 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
13546
473d0a75
AD
135472002-10-17 Akim Demaille <akim@epita.fr>
13548
13549 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
13550 * src/getargs.c (trace_types, trace_args): Adjust.
13551 * src/reader.c (grammar_current_rule_prec_set)
13552 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
13553 Standardize error messages.
13554 And s/@prec/%prec/!
13555 (reader): Use trace_flag to enable scanner/parser debugging,
13556 instead of an adhoc scheme.
13557 * src/scan-gram.l: Remove trailing debugging code.
13558
e76d2469
PE
135592002-10-16 Paul Eggert <eggert@twinsun.com>
13560
93e2236a
PE
13561 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
13562 MUSCLE_TAB_H.
13563
e76d2469
PE
13564 * NEWS: Officially drop support for building Bison with K&R C,
13565 since it didn't work anyway and it's not worth worrying about.
13566 * Makefile.maint (wget_files): Remove ansi2knr.c.
13567 (ansi2knr.c-url_prefix): Remove.
13568 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
13569 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13570 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13571
5bd1c419
PE
135722002-10-15 Paul Eggert <eggert@twinsun.com>
13573
13574 Stop using the "enum_" trick for K&R-style function definitions;
13575 it confused me, and I was the author! Instead, assume that people
13576 who want to use K&R C compilers (when using these modules in GCC,
13577 perhaps?) will run ansi2knr.
13578
13579 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
13580 All uses of "enum_" changed to "enum ".
13581 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13582 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 13583
5bd1c419
PE
13584 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
13585 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
13586 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
13587 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
13588 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
13589 abitset_not, abitset_ones, abitset_or, abitset_or_and,
13590 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
13591 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
13592 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
13593 Use function prototypes; this removes the need for declaring
13594 static functions simply to provide their prototypes.
13595 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
13596 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
13597 bitset_count_, bitset_create, bitset_dump, bitset_first,
13598 bitset_free, bitset_init, bitset_last, bitset_next,
13599 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
13600 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
13601 bitset_print, bitset_release_memory, bitset_toggle_,
13602 bitset_type_choose, bitset_type_get, bitset_type_name_get,
13603 debug_bitset): Likewise.
13604 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
13605 * lib/bitset_stats.c (bitset_log_histogram_print,
13606 bitset_percent_histogram_print, bitset_stats_and,
13607 bitset_stats_and_cmp, bitset_stats_and_or,
13608 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
13609 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
13610 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
13611 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
13612 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
13613 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
13614 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
13615 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
13616 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
13617 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
13618 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
13619 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
13620 bitset_stats_zero): Likewise.
13621 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13622 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13623 bitsetv_dump, debug_bitsetv): Likewise.
13624 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
13625 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
13626 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
13627 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
13628 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
13629 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
13630 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
13631 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
13632 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
13633 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
13634 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
13635 Likewise.
13636 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
13637 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
13638 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
13639 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
13640 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
13641 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
13642 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
13643 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
13644 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
13645 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
13646 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 13647
ae26e1f0
AD
136482002-10-14 Akim Demaille <akim@epita.fr>
13649
13650 Version 1.75.
13651
d43baf71
AD
136522002-10-14 Akim Demaille <akim@epita.fr>
13653
13654 * tests/Makefile.am (maintainer-check-posix): New.
13655
7ebc83e3
AD
136562002-10-14 Akim Demaille <akim@epita.fr>
13657
13658 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
13659 member.
13660
05846dae
AD
136612002-10-14 Akim Demaille <akim@epita.fr>
13662
13663 * src/tables.c (table_ninf_remap): base -> tab.
13664 Reported by Matt Rosing.
13665
1318e37d
PE
136662002-10-14 Paul Eggert <eggert@twinsun.com>
13667
447fbb17
PE
13668 * tests/action.at, tests/calc.at, tests/conflicts.at,
13669 tests/cxx-type.at, tests/headers.at, tests/input.at,
13670 tests/regression.at, tests/synclines.at, tests/torture.at:
13671 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
13672 so that the tests still work even if POSIXLY_CORRECT is set.
13673 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 13674
1318e37d
PE
13675 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
13676 for portability to K&R hosts. Fix typo: signed char is guaranteed
13677 only to 127, not to 128.
13678 * data/glr.c (yysigned_char): New type.
13679 * data/yacc.c (yysigned_char): Likewise.
13680 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
13681
cc0f0794
PE
136822002-10-13 Paul Eggert <eggert@twinsun.com>
13683
5038f418
PE
13684 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
13685 true due to limited range of data type" warning from GCC.
13686
cc0f0794
PE
13687 * data/c.m4 (b4_token_defines): Protect against double-inclusion
13688 by wrapping enum yytokentype's definition inside #ifndef
13689 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
13690
6fed0802
AD
136912002-10-13 Akim Demaille <akim@epita.fr>
13692
13693 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
13694 Un yy- yyrhs to avoid the name clash with the global YYRHS.
13695
32f0598d
AD
136962002-10-13 Akim Demaille <akim@epita.fr>
13697
13698 * Makefile.maint: Update from Autoconf 2.54.
13699 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
13700
7ea9a33f
AD
137012002-10-13 Akim Demaille <akim@epita.fr>
13702
13703 * src/print.c (print_state): Separate the list of solved conflicts
13704 from the other items.
13705 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
13706
ea99527d
AD
137072002-10-13 Akim Demaille <akim@epita.fr>
13708
13709 Let nondeterministic skeletons be usable with deterministic
13710 tables.
13711
13712 With the patch, GAWK compiled by GCC without -O2 passes its test
13713 suite using a GLR parser driven by LALR tables. It fails with -O2
13714 because `struct stat' gives two different answers on my machine:
13715 88 (definition of an auto var) and later 96 (memset on this var).
13716 Hence the stack is badly corrumpted. The headers inclusion is to
13717 blame: if I move the awk.h inclusion before GLR's system header
13718 inclusion, the two struct stat have the same size.
13719
13720 * src/tables.c (pack_table): Always create conflict_table.
13721 (token_actions): Always create conflict_list.
13722 * data/glr.c (YYFLAG): Remove, unused.
13723
f377f69f
AD
137242002-10-13 Akim Demaille <akim@epita.fr>
13725
13726 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
13727 (O0FLAGS): New.
13728 (VALGRIND, GXX): New.
13729 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
13730 * tests/bison.in: Run $PREBISON a pre-command.
13731 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
13732 (maintainer-check-g++): New.
13733 * Makefile.am (maintainer-check): New.
13734
2a1fe6ed
AD
137352002-10-13 Akim Demaille <akim@epita.fr>
13736
13737 * data/glr.c: Formatting changes.
13738 Tweak some trace messages to match yacc.c's.
13739
f50adbbd
AD
137402002-10-13 Akim Demaille <akim@epita.fr>
13741
13742 GLR parsers sometimes raise parse errors instead of performing the
13743 default reduction.
13744 Reported by Charles-Henry de Boysson.
13745
13746 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 13747 check the length of the traces when %glr.
f50adbbd
AD
13748 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
13749 GLR's traces.
13750 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
13751 Test GLR parsers.
13752 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
13753 (yyltype): Remove the yy prefix from the member names.
13754 (yytable): Complete its comment.
13755 (yygetLRActions): Map error action number from YYTABLE from
13756 YYTABLE_NINF to 0.
13757 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
13758 (which was a bug: it should have been YYTABEL_NINF, and yet it was
13759 not satisfying as we could compare an YYACTION computed from
13760 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
13761 only value for error actions.
13762 (yyreportParseError): In verbose parse error messages, don't issue
13763 `error' in the list of expected tokens.
13764 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
13765 next action to perform to match glr.c's decoding.
13766 (yytable): Complete its comment.
13767
bcbad5b9
PE
137682002-10-13 Paul Eggert <eggert@twinsun.com>
13769
13770 Fix problem reported by Henrik Grubbstroem in
161a71f3 13771 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
13772 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
13773 because the Bison parser reads the second action before reducing
13774 the first one.
13775 * src/scan-gram.l (rule_length): New static var.
13776 Use it to keep track of the rule length in the scanner, since
13777 we can't expect the parser to be in lock-step sync with the scanner.
13778 (handle_action_dollar, handle_action_at): Use this var.
13779 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 13780
14904b89
PE
137812002-10-12 Paul Eggert <eggert@twinsun.com>
13782
1fe611e5
PE
13783 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
13784 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
13785 Include <sys/time.h> when checking for clock_t and struct tms.
13786 Use same include order as source.
13787 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 13788 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 13789
1fe611e5
PE
13790 * lib/timevar.c: Update copyright date and clarify comments.
13791 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 13792
1fe611e5
PE
13793 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
13794 GCC version as of today, then merge Bison's changes.
13795 Change "GCC" to "Bison" in copyright notice. timevar.def's
13796 author is Akim, so change that too.
13797
98194095
PE
13798 * src/reader.c (grammar_current_rule_check):
13799 Don't worry about the default action if $$ is untyped.
13800 Prevents bogus warnings reported by Jim Gifford in
161a71f3 13801 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 13802
14904b89
PE
13803 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
13804 * data/glr.c, data/lalr1.cc, data/yacc.c:
13805 Output token definitions before the first part of user declarations.
13806 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 13807 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 13808
ff6dca18
PE
138092002-10-11 Paul Eggert <eggert@twinsun.com>
13810
13811 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
13812 (yyparse): here. This undoes some of the 2002-07-25 change.
13813 Compatibility problem reported by Ralf S. Engelschall with
13814 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
13815
eb714592
AD
138162002-10-11 Akim Demaille <akim@epita.fr>
13817
13818 * tests/regression.at Characters Escapes): New.
13819 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
13820 characters.
13821 Reported by Jan Nieuwenhuizen.
13822
b7195100
AD
138232002-10-11 Akim Demaille <akim@epita.fr>
13824
13825 * po/id.po: New.
13826
f28a0f2d
PE
138272002-10-10 Paul Eggert <eggert@twinsun.com>
13828
13829 Portability fixes for bitsets; this also avoids several GCC
13830 warnings.
13831
13832 * lib/abitset.c: Include <stddef.h>, for offsetof.
13833 * lib/lbitset.c: Likewise.
13834
13835 * lib/abitset.c (abitset_bytes): Return a size that is aligned
13836 properly for vectors of objects. Do not assume that adding a
13837 header size to a multiple of a word size yields a value that is
13838 properly aligned for the whole union.
13839 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13840
13841 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
13842 unique names for structures.
13843 * lib/ebitset.c (ebitset_bytes): Likewise.
13844 * lib/lbitset.c (lbitset_bytes): Likewise.
13845
13846 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
13847 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
13848 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
13849 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
13850 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
13851 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
13852 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
13853 to improve the type-checking that GCC can do.
13854 * lib/bitset.c (bitset_op4_cmp): Likewise.
13855 * lib/bitset_stats.c (bitset_stats_count,
13856 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
13857 bitset_stats_copy, bitset_stats_disjoint_p,
13858 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
13859 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
13860 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
13861 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
13862 bitset_stats_and_or_cmp, bitset_stats_andn_or,
13863 bitset_stats_andn_or_cmp, bitset_stats_or_and,
13864 bitset_stats_or_and_cmp): Likewise.
13865 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
13866 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
13867 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
13868 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
13869
13870 * lib/abitset.h: Include bitset.h, not bbitset.h.
13871 * lib/ebitset.h: Likewise.
13872 * lib/lbitset.h: Likewise.
13873
13874 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
13875 All instances of parameters of type enum bitset_opts are now of
13876 type enum_bitset_opts, to conform to the C Standard, and similarly
13877 for enum_bitset_type.
13878 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13879 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13880
13881 Do not use "struct bitset_struct" to mean different things in
13882 different modules. Not only is this confusing, it violates
13883 the C Standard, which requires that structure types in different
13884 modules must be compatible if one is to be passed to the other.
13885 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
13886 All instances of "struct bitset_struct *" replaced with "bitset".
13887 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
13888 (union bitset_union, struct abitset_struct, struct ebitset_struct,
13889 struct lbitset_struct, struct bitset_stats_struct): New types.
13890 All uses of struct bitset_struct changed to union bitset_union,
13891 etc.
ba0fe3c7 13892 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
13893 struct bitset_struct): Remove.
13894 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
13895 struct bitset_struct): Remove.
13896 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
13897 bitset_struct): Remove.
13898 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
13899 Likewise.
13900
13901 Do not call a function of type T using a call that assumes the
13902 function is of a different type U. Standard C requires that a
13903 function must be called with a type that is compatible with its
13904 definition.
13905 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13906 New decls.
13907 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13908 New functions.
13909 * lib/ebitset.c (PFV): Remove.
13910 * lib/lbitset.c (PFV): Likewise.
13911 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
13912 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
13913 decls.
13914 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
13915 (ebitset_vtable): Use them.
13916 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
13917 lbitset_xor): New functions.
13918 (lbitset_vtable): Use them.
13919
13920 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
13921 Declare.
13922
13923 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
13924 GCC warning.
13925 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
13926 Use offsetof, for simplicity.
13927
6fbe4984
PE
139282002-10-06 Paul Eggert <eggert@twinsun.com>
13929
13930 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
13931 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 13932 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
13933 which was inadvertently undone by the 2002-09-30 patch.
13934 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
13935 the same width as int.
13936
420f93c8
PE
139372002-10-04 Paul Eggert <eggert@twinsun.com>
13938
13939 Version 1.50.
13940
13941 * configure.ac (AC_INIT), NEWS: Increment version number.
13942
13943 * doc/bison.texinfo: Minor spelling, grammar, and white space
13944 fixes.
13945 (Symbols): Mention that any negative value returned from yylex
13946 signifies end-of-input. Warn about negative chars. Mention
13947 the portable Standard C character set.
13948
13949 The GNU coding standard says CFLAGS and YFLAGS are reserved
13950 for the installer to set.
13951 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
13952 * src/Makefile.am (AM_CFLAGS): Likewise.
13953 (AM_YFLAGS): Renamed from YFLAGS.
13954
13955 Fix some MAX and MIN problems.
13956 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
13957 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
13958 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
13959 * src/reader.c (reader): Use it.
13960
13961 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
13962 POSIX 1003.1-2001 has removed fgrep.
13963
139642002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
13965
13966 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
13967 interpreted as signed.
13968 * lib/ebitset.c (ebitset_list): Fix bug.
13969
ff68026d
PE
139702002-10-01 Paul Eggert <eggert@twinsun.com>
13971
13972 More fixes for 64-bit hosts and large bitsets.
13973
13974 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
13975 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
13976 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
13977 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
13978 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
13979 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
13980 bitset_count_): Likewise.
13981 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
13982 bitset_first, bitset_last): Likewise.
13983 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
13984 bitset_stats_list_reverse, bitset_stats_size,
13985 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
13986 Likewise.
13987 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13988 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13989 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13990 bitsetv_reflexive_transitive_closure): Likewise.
13991 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
13992 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
13993 Likewise.
13994 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
13995 Likewise.
420f93c8 13996
ff68026d
PE
13997 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
13998 Use size_t, not unsigned int, to count bytes.
13999 * lib/abitset.h (abitset_bytes): Likewise.
14000 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
14001 Likewise.
14002 * lib/bitset.h (bitset_bytes): Likewise.
14003 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
14004 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
14005 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14006 * lib/ebitset.c (ebitset_bytes): Likewise.
14007 * lib/ebitset.h (ebitset_bytes): Likewise.
14008 * lib/lbitset.c (lbitset_bytes): Likewise.
14009 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 14010
ff68026d
PE
14011 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
14012 abitset_subset_p, abitset_disjoint_p, abitset_and,
14013 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
14014 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
14015 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
14016 abitset_or_and, abitset_or_and_cmp):
14017 Use bitset_windex instead of unsigned int.
14018 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14019 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
14020 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
14021 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
14022 Likewise.
14023 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 14024
ff68026d
PE
14025 * lib/bitset.c (bitset_print):
14026 Use proper printf formats for widths of integer types.
14027 * lib/bitset_stats.c (bitset_percent_histogram_print,
14028 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
14029 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14030 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14031 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 14032
ff68026d
PE
14033 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
14034 BITSET_SIZE_MAX): New macros.
14035 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
14036 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
14037 to BITSET_WINDEX_MAX.
14038
14039 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
14040 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
14041 since we now return the bitset_bindex type (not int).
14042
14043 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
14044 when computing sizes.
14045 * lib/ebitset.c (ebitset_elts_grow): Likewise.
14046
14047 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
14048 and avoid cast to unsigned.
14049
6aa452a6
AD
140502002-09-30 Akim Demaille <akim@epita.fr>
14051
14052 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14053 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
14054 Updates from Michael Hayes.
14055
927f7817
AD
140562002-09-30 Art Haas <ahaas@neosoft.com>
14057
14058 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
14059 invocations.
14060 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
14061 defined.
14062
9738f41e
AD
140632002-09-27 Akim Demaille <akim@epita.fr>
14064
14065 Version 1.49c.
14066
a5c75d7f
AD
140672002-09-27 Akim Demaille <akim@epita.fr>
14068
14069 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
14070 (Because of AC_LIBSOURCE).
14071
8280e179
AD
140722002-09-27 Akim Demaille <akim@epita.fr>
14073
14074 Playing with Autoscan.
14075
14076 * configure.ac: Remove the old LIBOBJ tweaks.
14077 (AC_REPLACE_FUNCS): Add strrchr and strtol.
14078 * lib/strrchr.c: New.
14079 * lib/strtol.c: New, from the Coreutils 4.5.1.
14080
ae64af35
AD
140812002-09-27 Akim Demaille <akim@epita.fr>
14082
14083 Playing with Autoscan.
14084
14085 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
14086 * lib/Makefile.am (libbison_a_SOURCES): No longer include
14087 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
14088 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
14089 Coreutils 4.5.1.
14090
d1a1114f
AD
140912002-09-24 Akim Demaille <akim@epita.fr>
14092
14093 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
14094 (Frequently Asked Questions, Parser Stack Overflow): New.
14095
b906441c
AD
140962002-09-13 Akim Demaille <akim@epita.fr>
14097
14098 Playing with autoscan.
14099
14100 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
14101 * src/files.c (skeleton_find): Remove, unused.
14102 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
14103 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
14104
bd701811
AD
141052002-09-13 Akim Demaille <akim@epita.fr>
14106
14107 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
14108 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
14109
e0a13e7b
AD
141102002-09-13 Akim Demaille <akim@epita.fr>
14111
14112 * configure.ac: Require 2.54.
14113 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
14114 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
14115 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
14116 Remove, provided by Autoconf macros.
14117
c97011bf
AD
141182002-09-12 Akim Demaille <akim@epita.fr>
14119
14120 * m4/prereq.m4: Update, from Coreutils 4.5.1.
14121
d862b1be
AD
141222002-09-12 Akim Demaille <akim@epita.fr>
14123
14124 * m4/prereq.m4: Update, from Fileutils 4.1.5.
14125 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
14126 Reported by Martin Mokrejs.
14127
3d38c03a
AD
141282002-09-10 Akim Demaille <akim@epita.fr>
14129
14130 * src/parse-gram.y: Associate a human readable string to each
14131 token type.
14132 * tests/regression.at (Invalid inputs): Adjust.
14133
b6347355
AD
141342002-09-10 Gary V. Vaughan <gary@gnu.org>
14135
14136 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
14137 with an Autoconf-2.5x style configure.ac.
14138
09ba4ab2
PE
141392002-09-06 Paul Eggert <eggert@twinsun.com>
14140
14141 * doc/bison.texinfo (Conditions): Make explicit that the GPL
14142 exception applies only to yacc.c. This is a modification of a
14143 patch originally suggested by Akim Demaille.
14144
21846f69
AD
141452002-09-06 Akim Demaille <akim@epita.fr>
14146
09ba4ab2
PE
14147 * data/c.m4 (b4_copyright): Move the GPL exception comment from
14148 here to...
14149 * data/yacc.c: here.
14150
21846f69
AD
14151 * data/lalr1.cc (struct yyltype): Don't define it, since we use
14152 LocationType.
14153 (b4_ltype): Default to yy::Location from location.hh.
14154
c0ad8bf3
AD
141552002-09-04 Jim Meyering <jim@meyering.net>
14156
14157 * data/yacc.c: Guard the declaration of yytoknum also with
14158 `#ifdef YYPRINT', so it is declared only when used.
14159
3a93251e
AD
141602002-09-04 Akim Demaille <akim@epita.fr>
14161
14162 * configure.in: Rename as...
14163 * configure.ac: this.
14164 Bump to 1.49c.
14165
427c0dda
AD
141662002-09-04 Akim Demaille <akim@epita.fr>
14167
14168 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
14169 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
14170 translate maintainer only messages.
14171
6a254321
PE
141722002-08-12 Paul Eggert <eggert@twinsun.com>
14173
645e30d1
PE
14174 Version 1.49b.
14175
6a254321
PE
14176 * Makefile.am (SUBDIRS): Remove intl.
14177 (DISTCLEANFILES): Remove.
14178 * NEWS: Mention that GNU M4 is now required. Clarify what is
14179 meant by "larger grammars". Mention the pt_BR translation.
14180 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
14181 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
14182 Bump version from 0.11.2 to 0.11.5.
14183 (BISON_PREREQ_STAGE): Remove.
14184 (AM_GNU_GETTEXT): Use external gettext.
14185 (AC_OUTPUT): Remove intl/Makefile.
14186
14187 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
14188
14189 * data/glr.c: Include string.h, for strlen.
14190 (yyreportParseError): Use size_t for yysize.
14191 (yy_yypstack): No longer nested inside yypstates, as nested
14192 functions are not portable. Do not assume size_t is the
14193 same width as int.
14194 (yypstates): Do not assume that ptrdiff_t is the same width
14195 as int, and similarly for yyposn and YYINDEX.
14196
14197 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
14198
14199 * lib/Makefile.am (INCLUDES): Do not include from the intl
14200 directory, which has been removed.
14201 * src/Makefile.am (INCLUDES): Likewise.
14202
14203 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
14204 (bitsets_sources, additional_bitsets_sources, timevars_sources):
14205 New vars.
14206
14207 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
14208 * tests/Makefile.am (EXTRA_DIST): Likewise.
14209
14210 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
14211 Do not assume that bitset_windex is the same width as unsigned.
14212
14213 * lib/abitset.c (abitset_unused_clear): Do not assume that
14214 bitset_word is the same width as int.
14215 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
14216 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
14217 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
14218 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
14219 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
14220
14221 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
14222 portability to one's complement hosts!).
14223 * lib/ebitset.c (ebitset_op1): Likewise.
14224 * lib/lbitset.c (lbitset_op1): Likewise.
14225
14226 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
14227 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14228 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
14229 Sync with fileutils.
14230 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
14231 lib/gettext.h: Sync with diffutils.
14232
14233 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
14234 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
14235
14236 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
14237 PROTOTYPES to check for prototypes, and "defined __STDC__" to
14238 check for void *.
14239
14240 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
14241 size_t; the old version tried to do this but casted improperly.
14242 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
14243 (bitset_test): Now returns int, not unsigned long.
14244
14245 * lib/bitset_stats.c: Include "gettext.h".
14246 (_): New macro.
14247 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
14248 name locals "index", as it generates unnecessary warnings on some
14249 hosts that have an "index" function.
14250
14251 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
14252 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
14253 they need translation.
14254 * src/LR0.c (state_list_append, new_itemsets, get_state,
14255 append_states, generate_states): Likewise.
14256 * src/assoc.c (assoc_to_string): Likewise.
14257 * src/closure.c (print_closure, set_firsts, closure): Likewise.
14258 * src/gram.c (grammar_dump): Likewise.
14259 * src/injections.c (injections_compute): Likewise.
14260 * src/lalr.c (lookaheads_print): Likewise.
14261 * src/relation.c (relation_transpose): Likewise.
14262 * src/scan-gram.l: Likewise.
14263 * src/tables.c (table_grow, pack_vector): Likewise.
14264
14265 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
14266 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
14267 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
14268 * m4/mbstate_t.m4: Sync with fileutils.
14269 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
14270
14271 * po/LINGUAS: Add pt_BR.
14272 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
14273 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
14274 lib/timevar.c.
14275 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
14276 manual recommends.
14277 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
14278
14279 * src/complain.c (strerror_r): Remove decl; not needed.
14280 (strerror): Use same pattern as ../lib/error.c.
14281
14282 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
14283
14284 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
14285
14286 * src/main.c (main): Cast result of bindtextdomain and textdomain
14287 to void, to avoid a GCC warning when --disable-nls is in effect.
14288
14289 * src/scan-gram.l: Use strings rather than escapes when possible,
14290 to minimize the number of warnings from xgettext.
14291 (handle_action_dollar, handle_action_at): Don't use isdigit,
14292 as it mishandles negative chars and it may not work as expected
14293 outside the C locale.
14294
14295 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
14296 this is a GCC extension and is not portable to other compilers.
14297
14298 * src/system.h (alloca): Use same pattern as ../lib/error.c.
14299 Do not include <ctype.h>; no longer needed.
14300 Do not include <malloc.h>; no longer needed (and generates
14301 warnings on OpenBSD 3.0).
14302
14303 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
14304 it's not portable.
14305
14306 * tests/regression.at: Do not use 'cc -c input.c -o input';
14307 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
14308
14309 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
14310 exit status as failure, not just exit status 1. Sun C exits
14311 with status 2 sometimes.
14312
14313 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
14314 Use it for the two large tests.
14315
c8f002c7
AD
143162002-08-02 Akim Demaille <akim@epita.fr>
14317
14318 * src/conflicts.c (conflicts_output): Don't output rules never
14319 reduced here, since anyway that computation doesn't work.
14320 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
14321 (rule_useless_p, rule_never_reduced_p): New.
14322 (grammar_rules_partial_print): Use a filter instead of a range.
14323 Display the title only if needed.
14324 (grammar_rules_print): Adjust.
14325 (grammar_rules_never_reduced_report): New.
14326 * src/tables.c (action_row): Move the computation of rules never
14327 reduced to...
14328 (token_actions): here.
14329 * src/main.c (main): Make the parser before making the report, so
14330 that rules never reduced are computed.
14331 Call grammar_rules_never_reduced_report.
14332 * src/print.c (print_results): Report rules never reduced.
14333 * tests/conflicts.at, tests/reduce.at: Adjust.
14334
cd08e51e
AD
143352002-08-01 Akim Demaille <akim@epita.fr>
14336
14337 Instead of attaching lookaheads and duplicating the rules being
14338 reduced by a state, attach the lookaheads to the reductions.
14339
14340 * src/state.h (state_t): Remove the `lookaheads',
14341 `lookaheads_rule' member.
14342 (reductions_t): Add a `lookaheads' member.
14343 Use a regular array for the `rules'.
14344 * src/state.c (reductions_new): Initialize the lookaheads member
14345 to 0.
14346 (state_rule_lookaheads_print): Adjust.
14347 * src/state.h, src/state.c (state_reductions_find): New.
14348 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
14349 (count_rr_conflicts): Adjust.
14350 * src/lalr.c (LArule): Remove.
14351 (add_lookback_edge): Adjust.
14352 (state_lookaheads_count): New.
14353 (states_lookaheads_initialize): Merge into...
14354 (initialize_LA): this.
14355 (lalr_free): Adjust.
14356 * src/main.c (main): Don't free nullable and derives too early: it
14357 is used by --verbose.
14358 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
14359
bb0027a9
AD
143602002-08-01 Akim Demaille <akim@epita.fr>
14361
14362 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
14363 `rule_number_t**'.
14364 (set_derives, free_derives): Rename as...
14365 (derives_compute, derives_free): this.
14366 Adjust all dependencies.
14367 * src/nullable.c (set_nullable, free_nullable): Rename as...
14368 (nullable_compute, nullable_free): these.
14369 (rule_list_t): Store rule_t *, not rule_number_t.
14370 * src/state.c (state_rule_lookaheads_print): Directly compare rule
14371 pointers, instead of their numbers.
14372 * src/main.c (main): Call nullable_free, and derives_free earlier,
14373 as they were lo longer used.
14374
3325ddc4
AD
143752002-08-01 Akim Demaille <akim@epita.fr>
14376
14377 * lib/timevar.c (get_time): Include children time.
14378 * src/lalr.h (LA, LArule): Don't export them: used with the
14379 state_t.
14380 * src/lalr.c (LA, LArule): Static.
14381 * src/lalr.h, src/lalr.c (lalr_free): New.
14382 * src/main.c (main): Call it.
14383 * src/tables.c (pack_vector): Check whether loc is >= to the
14384 table_size, not >.
14385 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
14386 (tables_generate): do it, since that's also it which allocates
14387 them.
14388 Don't free LA and LArule, main does.
14389
c6f1a33c
AD
143902002-07-31 Akim Demaille <akim@epita.fr>
14391
14392 Separate parser tables computation and output.
14393
14394 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
14395 (conflict_list, conflict_list_cnt, table, check, table_ninf)
14396 (yydefgoto, yydefact, high): Move to...
14397 * src/tables.h, src/tables.c: here.
14398 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14399 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14400 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
14401 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
14402 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
14403 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
14404 (action_row, save_row, token_actions, save_column, default_goto)
14405 (goto_actions, sort_actions, matching_state, pack_vector)
14406 (table_ninf_remap, pack_table, prepare_actions): Move to...
14407 * src/tables.c: here.
14408 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
14409 * src/output.c (token_actions, output_base, output_conflicts)
14410 (output_check): Merge into...
14411 (prepare_actions): this.
14412 (actions_output): Rename as...
14413 (user_actions_output): this.
14414 * src/main.c (main): Call tables_generate and tables_free.
14415
1509d42f
AD
144162002-07-31 Akim Demaille <akim@epita.fr>
14417
14418 Steal GCC's --time-report support.
14419
14420 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
14421 stolen/adjusted from GCC.
14422 * m4/stage.m4: Remove time related checks.
14423 * m4/timevar.m4: New.
14424 * configure.in: Adjust.
14425 * src/system.h: Adjust to using timevar.h.
14426 * src/getargs.h, src/getargs.c: Support trace_time for
14427 --trace=time.
14428 * src/main.c (stage): Remove.
14429 (main): Replace `stage' invocations with timevar calls.
14430 * src/output.c: Insert pertinent timevar calls.
14431
273a74fa
AD
144322002-07-31 Akim Demaille <akim@epita.fr>
14433
14434 Let --trace have arguments.
14435
14436 * src/getargs.h (enum trace_e): New.
14437 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
14438 (long_options, short_options): --trace/-T takes an optional
14439 argument.
14440 Change all the uses of trace_flag to reflect the new flags.
14441 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
14442
14443 Strengthen `stage' portability.
14444
14445 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
14446 * configure.in: Use it.
14447 Don't check for malloc.h and sys/times.h.
14448 * src/system.h: Include them when appropriate.
14449 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
14450 times and struct tms are available.
14451
217598da
AD
144522002-07-30 Akim Demaille <akim@epita.fr>
14453
14454 In verbose parse error message, don't report `error' as an
14455 expected token.
14456 * tests/actions.at (Printers and Destructors): Adjust.
14457 * tests/calc.at (Calculator $1): Adjust.
14458 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
14459 error message, do not report the parser accepts the error token in
14460 that state.
14461
52489d44
AD
144622002-07-30 Akim Demaille <akim@epita.fr>
14463
14464 Normalize conflict related messages.
14465
14466 * src/complain.h, src/complain.c (warn, complain): New.
14467 * src/conflicts.c (conflicts_print): Use them.
14468 (conflict_report_yacc): New, extracted from...
14469 (conflicts_print): here.
14470 * tests/conflicts.at, tests/existing.at: Adjust.
14471
e8832397
AD
144722002-07-30 Akim Demaille <akim@epita.fr>
14473
14474 Report rules which are never reduced by the parser: those hidden
14475 by conflicts.
14476
14477 * src/LR0.c (save_reductions): Don't make the final state too
14478 different: save its reduction (accept) instead of having a state
14479 without any action (no shift or goto, no reduce).
14480 Note: the final state is now a ``regular'' state, i.e., the
14481 parsers now contain `reduce 0' as default reduction.
14482 Nevertheless, since they decide to `accept' when yystate =
14483 final_state, they still will not reduce rule 0.
14484 * src/print.c (print_actions, print_reduction): Adjust.
14485 * src/output.c (action_row): Track reduced rules.
14486 (token_actions): Report rules never reduced.
14487 * tests/conflicts.at, tests/regression.at: Adjust.
14488
caf23d24
AD
144892002-07-30 Akim Demaille <akim@epita.fr>
14490
14491 `stage' was accidently included in a previous patch.
14492 Initiate its autoconfiscation.
14493
14494 * configure.in: Look for malloc.h and sys/times.h.
14495 * src/main.c (stage): Adjust.
14496 Report only when trace_flag.
14497
640748ee
AD
144982002-07-29 Akim Demaille <akim@epita.fr>
14499
14500 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
14501 state_number_t.
14502 (errs_t): symbol_t*, not symbol_number_t.
14503 (reductions_t): rule_t*, not rule_number_t.
14504 (FOR_EACH_SHIFT): New.
14505 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
14506 * src/print.c, src/print_graph.c: Adjust.
14507
88bce5a2
AD
145082002-07-29 Akim Demaille <akim@epita.fr>
14509
14510 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
14511
14512 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
14513 (endtoken, accept): these.
14514 * src/reader.c (reader): Set endtoken's default tag to "$end".
14515 Set undeftoken's tag to "$undefined" instead of "$undefined.".
14516 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
14517 Adjust.
14518
1bfb97db
AD
145192002-07-29 Akim Demaille <akim@epita.fr>
14520
14521 * src/reduce.c (reduce_grammar): When the language is empty,
14522 complain about the start symbol, not the axiom.
14523 Use its location.
14524 * tests/reduce.at (Empty Language): New.
14525
fc5734fe
AD
145262002-07-26 Akim Demaille <akim@epita.fr>
14527
14528 * src/reader.h, src/reader.c (gram_error): ... can't get
14529 yycontrol without making too strong assumptions on the parser
14530 itself.
14531 * src/output.c (prepare_tokens): Use the real 0th value of
14532 token_translations instead of `0'.
14533 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
14534 visible here.
14535 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
14536 for the time being: %locations ought to provide it to yyerror.
14537
3650b4b8
AD
145382002-07-25 Akim Demaille <akim@epita.fr>
14539
14540 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
14541 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
14542 * tests/regression.at (Web2c Actions): Adjust.
14543
4b3d3a8e
AD
145442002-07-25 Akim Demaille <akim@epita.fr>
14545
14546 Stop storing rules from 1 to nrules + 1.
14547
14548 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
14549 * src/nullable.c, src/output.c, src/print.c, src/reader.c
14550 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
14551 Iterate from 0 to nrules.
14552 Use rule_number_as_item_number and item_number_as_rule_number.
14553 Adjust to `derive' now containing possibly 0.
14554 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
14555 Handle the `- 1' part in rule numbers from/to item numbers.
14556 * src/conflicts.c (log_resolution): Fix the message which reversed
14557 shift and reduce.
14558 * src/output.c (action_row): Initialize default_rule to -1.
14559 (token_actions): Adjust.
14560 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
14561 expected output.
14562 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
14563
4a2a22f4
AD
145642002-07-25 Akim Demaille <akim@epita.fr>
14565
14566 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
14567 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
14568 (b4_c_knr_arg_decl): New.
14569 * data/yacc.c: Use it to define yysymprint, yydestruct, and
14570 yyreport_parse_error.
14571
b8df3223
AD
145722002-07-25 Akim Demaille <akim@epita.fr>
14573
14574 * data/yacc.c (yyreport_parse_error): New, extracted from...
14575 (yyparse): here.
14576 (yydestruct, yysymprint): Move above yyparse.
14577 Be K&R compliant.
14578
a762e609
AD
145792002-07-25 Akim Demaille <akim@epita.fr>
14580
14581 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
14582 replace...
14583 (b4_sint_type, b4_uint_type): these.
14584 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
14585 * tests/regression.at (Web2c Actions): Adjust.
14586
12b0043a
AD
145872002-07-25 Akim Demaille <akim@epita.fr>
14588
14589 * src/gram.h (TIEM_NUMBER_MAX): New.
14590 (item_number_of_rule_number, rule_number_of_item_number): Rename
14591 as...
14592 (rule_number_as_item_number, item_number_as_rule_number): these.
14593 Adjust dependencies.
14594 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14595 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14596 (symbol_number_to_vector_number): New.
14597 (order): Of vector_number_t* type.
14598 (base_t, BASE_MAX, BASE_MIN): New.
14599 (froms, tos, width, pos, check): Of base_t type.
14600 (action_number_t, ACTION_MIN, ACTION_MAX): New.
14601 (actrow): Of action_number_t type.
14602 (conflrow): Of unsigned int type.
14603 (table_ninf, base_ninf): New.
14604 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
14605 (muscle_insert_int_table, muscle_insert_base_table)
14606 (muscle_insert_rule_number_table): New.
14607 (prepare_tokens): Output `toknum' as int_table.
14608 (action_row): Returns a rule_number_t.
14609 Use ACTION_MIN, not SHRT_MIN.
14610 (token_actions): yydefact is rule_number_t*.
14611 (table_ninf_remap): New.
14612 (pack_table): Use it for `base' and `table'.
14613 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
14614 replaced with...
14615 (YYPACT_NINF, YYTABLE_NINF): these.
14616 (yypact, yytable): Compute their types instead of hard-coded
14617 `short'.
14618 * tests/regression.at (Web2c Actions): Adjust.
14619
5dde258a
AD
146202002-07-19 Akim Demaille <akim@epita.fr>
14621
14622 * src/scan-gram.l (id): Can start with an underscore.
14623
a945ec39
AD
146242002-07-16 Akim Demaille <akim@epita.fr>
14625
14626 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
14627 Adjust all former `associativity' dependencies.
14628 * src/symtab.c (symbol_new): Default associativity is `undef', not
14629 `right'.
14630 (symbol_check_alias_consistence): Adjust.
14631
fae437e8
AD
146322002-07-09 Akim Demaille <akim@epita.fr>
14633
14634 * doc/bison.texinfo: Properly set the ``header'' part.
14635 Use @dircategory ``GNU programming tools'' as per Texinfo's
14636 documentation.
14637 Use @copying.
14638
1a715ef2
AD
146392002-07-09 Akim Demaille <akim@epita.fr>
14640
14641 * lib/quotearg.h: Protect against multiple inclusions.
14642 * src/location.h (location_t): Add a `file' member.
14643 (LOCATION_RESET, LOCATION_PRINT): Adjust.
14644 * src/complain.c (warn_at, complain_at, fatal_at): Drop
14645 `error_one_per_line' support.
14646
a5d50994
AD
146472002-07-09 Akim Demaille <akim@epita.fr>
14648
14649 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
14650 * src/reader.c (lineno): Remove.
14651 Adjust all dependencies.
14652 (get_merge_function): Take a location and use complain_at.
14653 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
14654 * tests/regression.at (Invalid inputs, Mixing %token styles):
14655 Adjust.
14656
b275314e
AD
146572002-07-09 Akim Demaille <akim@epita.fr>
14658
14659 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
14660 recovery rule, and forbid extensions when --yacc.
14661 (gram_error): Use complain_at.
14662 * src/reader.c (reader): Exit if there were parse errors.
14663
865b9df1
AD
146642002-07-09 Akim Demaille <akim@epita.fr>
14665
14666 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
14667 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
14668 Reported by R Blake <blakers@mac.com>.
14669
c76e14da
AD
146702002-07-09 Akim Demaille <akim@epita.fr>
14671
14672 * data/yacc.c: Output the copyright notive in the header.
14673
7db2ed2d
AD
146742002-07-03 Akim Demaille <akim@epita.fr>
14675
14676 * src/output.c (froms, tos): Are state_number_t.
14677 (save_column): sp, sp1, and sp2 are state_number_t.
14678 (prepare): Rename `final' as `final_state_number', `nnts' as
14679 `nterms_number', `nrules' as `rules_number', `nstates' as
14680 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
14681 unused.
14682 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
14683 * data/lalr1.cc (nsym_): Remove, unused.
14684
e68e0410
AD
146852002-07-03 Akim Demaille <akim@epita.fr>
14686
14687 * src/lalr.h, src/lalr.c (goto_number_t): New.
14688 * src/lalr.c (goto_list_t): New.
14689 Propagate them.
14690 * src/nullable.c (rule_list_t): New.
14691 Propagate.
14692 * src/types.h: Remove.
14693
e1a4f3a4
AD
146942002-07-03 Akim Demaille <akim@epita.fr>
14695
14696 * src/closure.c (print_fderives): Use rule_rhs_print.
14697 * src/derives.c (print_derives): Use rule_rhs_print.
14698 (rule_list_t): New, replaces `shorts'.
14699 (set_derives): Add comments.
14700 * tests/sets.at (Nullable, Firsts): Adjust.
14701
536545f3
AD
147022002-07-03 Akim Demaille <akim@epita.fr>
14703
14704 * src/output.c (prepare_actions): Free `tally' and `width'.
14705 (prepare_actions): Allocate and free `order'.
14706 * src/symtab.c (symbols_free): Free `symbols'.
14707 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
14708 * src/output.c (m4_invoke): Move to...
14709 * src/scan-skel.l: here.
14710 (<<EOF>>): Close yyout, and free its name.
14711
8b752b00
AD
147122002-07-03 Akim Demaille <akim@epita.fr>
14713
14714 Fix some memory leaks, and fix a bug: state 0 was examined twice.
14715
14716 * src/LR0.c (new_state): Merge into...
14717 (state_list_append): this.
14718 (new_states): Merge into...
14719 (generate_states): here.
14720 (set_states): Don't ensure a proper `errs' state member here, do it...
14721 * src/conflicts.c (conflicts_solve): here.
14722 * src/state.h, src/state.c: Comment changes.
14723 (state_t): Rename member `shifts' as `transitions'.
14724 Adjust all dependencies.
14725 (errs_new): For consistency, also take the values as argument.
14726 (errs_dup): Remove.
14727 (state_errs_set): New.
14728 (state_reductions_set, state_transitions_set): Assert that no
14729 previous value was assigned.
14730 (state_free): New.
14731 (states_free): Use it.
14732 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
14733 temporary storage: use `errs' and `nerrs' as elsewhere.
14734 (set_conflicts): Allocate and free this `errs'.
14735
613f5e1a
AD
147362002-07-02 Akim Demaille <akim@epita.fr>
14737
14738 * lib/libiberty.h: New.
14739 * lib: Update the bitset implementation from upstream.
14740 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
14741 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
14742 * src/main.c: Adjust bitset stats calls.
14743
26e0cadc
PE
147442002-07-01 Paul Eggert <eggert@twinsun.com>
14745
14746 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
14747 char, so that negative chars don't collide with $.
14748
1154cced
AD
147492002-06-30 Akim Demaille <akim@epita.fr>
14750
14751 Have the GLR tests be `warning' checked, and fix the warnings.
14752
14753 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
14754 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
14755 (yyremoveDeletes): `yyi' and `yyj' are size_t.
14756 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
14757 (yyaddDeferredAction): static.
14758 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
14759 (yyreportParseError): yyprefix is const.
14760 yytokenp is used only when verbose.
14761 (yy__GNUC__): Replace with __GNUC__.
14762 (yypdumpstack): yyi is size_t.
14763 (yypreference): Un-yy local variables and arguments, to avoid
14764 clashes with `yyr1'. Anyway, we are not in the user name space.
14765 (yytname_size): be an int, as is compared with ints.
14766 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
14767 Use them.
14768 * tests/cxx-gram.at: Use quotation to protect $1.
14769 Use AT_COMPILE to enable warnings hunts.
14770 Prototype yylex and yyerror.
14771 `Use' argc.
14772 Include `string.h', not `strings.h'.
14773 Produce and prototype stmtMerge only when used.
14774 yylex takes a location.
14775
97650f4e
AD
147762002-06-30 Akim Demaille <akim@epita.fr>
14777
14778 We spend a lot of time in quotearg, in particular when --verbose.
14779
14780 * src/symtab.c (symbol_get): Store a quoted version of the key.
14781 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
14782 Adjust all callers.
14783
d2576365
AD
147842002-06-30 Akim Demaille <akim@epita.fr>
14785
14786 * src/state.h (reductions_t): Rename member `nreds' as num.
14787 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
14788 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
14789
ccaf65bc
AD
147902002-06-30 Akim Demaille <akim@epita.fr>
14791
14792 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
14793 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
14794 (shifts_to): Rename as...
14795 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
14796 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
14797 (TRANSITION_IS_DISABLED, transitions_to): these.
14798
87675353
AD
147992002-06-30 Akim Demaille <akim@epita.fr>
14800
14801 * src/print.c (print_shifts, print_gotos): Merge into...
14802 (print_transitions): this.
14803 (print_transitions, print_errs, print_reductions): Align the
14804 lookaheads columns.
14805 (print_core, print_transitions, print_errs, print_state,
14806 print_grammar): Output empty lines separator before, not after.
14807 (state_default_rule_compute): Rename as...
14808 (state_default_rule): this.
14809 * tests/conflicts.at (Defaulted Conflicted Reduction),
14810 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
14811 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
14812
ce4ccb4b
AD
148132002-06-30 Akim Demaille <akim@epita.fr>
14814
14815 Display items as we display rules.
14816
14817 * src/gram.h, src/gram.c (rule_lhs_print): New.
14818 * src/gram.c (grammar_rules_partial_print): Use it.
14819 * src/print.c (print_core): Likewise.
14820 * tests/conflicts.at (Defaulted Conflicted Reduction),
14821 (Unresolved SR Conflicts): Adjust.
14822 (Unresolved SR Conflicts): Adjust and rename as...
14823 (Resolved SR Conflicts): this, as was meant.
14824 * tests/regression.at (Web2c Report): Adjust.
14825
bc933ef1
AD
148262002-06-30 Akim Demaille <akim@epita.fr>
14827
14828 * src/print.c (state_default_rule_compute): New, extracted from...
14829 (print_reductions): here.
14830 Pessimize, but clarify the code.
14831 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
14832
53d4308d
AD
148332002-06-30 Akim Demaille <akim@epita.fr>
14834
14835 * src/output.c (action_row): Let default_rule be always a rule
14836 number.
14837
574fb2d5
AD
148382002-06-30 Akim Demaille <akim@epita.fr>
14839
14840 * src/closure.c (print_firsts, print_fderives, closure):
14841 Use BITSET_EXECUTE.
14842 * src/lalr.c (lookaheads_print): Likewise.
14843 * src/state.c (state_rule_lookaheads_print): Likewise.
14844 * src/print_graph.c (print_core): Likewise.
14845 * src/print.c (print_reductions): Likewise.
14846 * src/output.c (action_row): Likewise.
14847 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
14848
05811fd7
AD
148492002-06-30 Akim Demaille <akim@epita.fr>
14850
14851 * src/print_graph.c: Use report_flag.
14852
0e4d5753
AD
148532002-06-30 Akim Demaille <akim@epita.fr>
14854
14855 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
14856 to...
14857 * src/relation.h, src/relation.c (traverse, relation_digraph)
14858 (relation_print, relation_transpose): New.
14859
24c7d800
AD
148602002-06-30 Akim Demaille <akim@epita.fr>
14861
14862 * src/state.h, src/state.c (shifts_to): New.
14863 * src/lalr.c (build_relations): Use it.
14864
9222837b
AD
148652002-06-30 Akim Demaille <akim@epita.fr>
14866
14867 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
14868 (item_number_of_rule_number, rule_number_of_item_number): New.
14869 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
14870 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14871 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
14872 Propagate their use.
14873 Much remains to be done, in particular wrt `shorts' from types.h.
14874
260008e5
AD
148752002-06-30 Akim Demaille <akim@epita.fr>
14876
14877 * src/symtab.c (symbol_new): Initialize the `printer' member.
14878
8a731ca8
AD
148792002-06-30 Akim Demaille <akim@epita.fr>
14880
14881 * src/LR0.c (save_reductions): Remove, replaced by...
14882 * src/state.h, src/state.c (state_reductions_set): New.
14883 (reductions, errs): Rename as...
14884 (reductions_t, errs_t): these.
14885 Adjust all dependencies.
14886
32e1e0a4
AD
148872002-06-30 Akim Demaille <akim@epita.fr>
14888
14889 * src/LR0.c (state_list_t, state_list_append): New.
14890 (first_state, last_state): Now symbol_list_t.
14891 (this_state): Remove.
14892 (new_itemsets, append_states, save_reductions): Take a state_t as
14893 argument.
14894 (set_states, generate_states): Adjust.
14895 (save_shifts): Remove, replaced by...
14896 * src/state.h, src/state.c (state_shifts_set): New.
14897 (shifts): Rename as...
14898 (shifts_t): this.
14899 Adjust all dependencies.
14900 * src/state.h (state_t): Remove the `next' member.
14901
e5fb6710
AD
149022002-06-30 Akim Demaille <akim@epita.fr>
14903
14904 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
14905 escaped in slot 0.
14906
c7ca99d4
AD
149072002-06-30 Akim Demaille <akim@epita.fr>
14908
14909 Use hash.h for the state hash table.
14910
14911 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
14912 (allocate_storage): Use state_hash_new.
14913 (free_storage): Use state_hash_free.
14914 (new_state, get_state): Adjust.
14915 * src/lalr.h, src/lalr.c (states): Move to...
14916 * src/states.h (state_t): Remove the `link' member, no longer
14917 used.
14918 * src/states.h, src/states.c: here.
14919 (state_hash_new, state_hash_free, state_hash_lookup)
14920 (state_hash_insert, states_free): New.
14921 * src/states.c (state_table, state_compare, state_hash): New.
14922 * src/output.c (output_actions): Do not free states now, since we
14923 still need to know the final_state number in `prepare', called
14924 afterwards. Do it...
14925 * src/main.c (main): here: call states_free after `output'.
14926
df0e7316
AD
149272002-06-30 Akim Demaille <akim@epita.fr>
14928
14929 * src/state.h, src/state.c (state_new): New, extracted from...
14930 * src/LR0.c (new_state): here.
14931 * src/state.h (STATE_ALLOC): Move to...
14932 * src/state.c: here.
14933 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
14934 * src/state.h, src/state.c: here.
14935
39f41916
AD
149362002-06-30 Akim Demaille <akim@epita.fr>
14937
14938 * src/reader.c (gensym): Rename as...
14939 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
14940 (getsym): Rename as...
14941 (symbol_get): this.
14942
d57650a5
AD
149432002-06-30 Akim Demaille <akim@epita.fr>
14944
14945 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
14946 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
14947 * src/output.c, src/print.c, src/print_graph.c: Propagate.
14948 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
14949
5a08f1ce
AD
149502002-06-30 Akim Demaille <akim@epita.fr>
14951
14952 Make the test suite pass with warnings checked.
14953
14954 * tests/actions.at (Printers and Destructors): Improve.
14955 Avoid unsigned vs. signed issues.
14956 * tests/calc.at: Don't exercise the scanner here, do it...
14957 * tests/input.at (Torturing the Scanner): here.
14958
720623af
PH
149592002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14960
88e7e941 14961 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
14962 reorganize first lines parallel to yacc.c.
14963
fb8135fa
AD
149642002-06-28 Akim Demaille <akim@epita.fr>
14965
14966 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
14967 (b4_token_enum, b4_token_defines): New, factored from...
14968 * data/lalr1.cc, data/yacc.c, glr.c: here.
14969
41442480
AD
149702002-06-28 Akim Demaille <akim@epita.fr>
14971
14972 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
14973 unused variables.
14974 * src/output.c (merger_output): static.
14975
e0e5bf84
AD
149762002-06-28 Akim Demaille <akim@epita.fr>
14977
ba0fe3c7 14978 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
14979 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
14980 pacify GCC.
14981 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 14982
676385e2
PH
149832002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14984
14985 Accumulated changelog for new GLR parsing features.
14986
6a254321 14987 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
14988 conflicts_total_count.
14989 * src/conflicts.h: Ditto.
14990 * src/output.c (token_actions): Use the new name.
14991 (output_conflicts): Change conflp => conflict_list_heads, and
14992 confl => conflict_list for better readability.
14993 * data/glr.c: Use the new names.
14994 * NEWS: Add self to GLR announcement.
e0e5bf84 14995
676385e2
PH
14996 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
14997
14998 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
14999 Akim Demaille.
15000
15001 * data/bison.glr: Change name to glr.c
15002 * data/glr.c: Renamed from bison.glr.
15003 * data/Makefile.am: Add glr.c
e0e5bf84
AD
15004
15005 * src/getargs.c:
15006
676385e2 15007 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 15008 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 15009
676385e2
PH
15010 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15011
15012 * data/bison.glr: Be sure to restore the
15013 current #line when returning to the skeleton contents after having
15014 exposed the input file's #line.
15015
15016 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15017
15018 * data/bison.glr: Bring up to date with changes to bison.simple.
15019
15020 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15021
15022 * data/bison.glr: Correct definitions that use b4_prefix.
15023 Various reformatting.
15024 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
15025 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
15026 yytokenp argument; now part of stack.
15027 (yychar): Define to behave as documented.
15028 (yyclearin): Ditto.
e0e5bf84 15029
676385e2
PH
15030 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15031
15032 * src/reader.h: Add declaration for free_merger_functions.
15033
15034 * src/reader.c (merge_functions): New variable.
15035 (get_merge_function): New function.
15036 (free_merger_functions): New function.
15037 (readgram): Check for %prec that is not followed by a symbol.
15038 Handle %dprec and %merge declarations.
15039 (packgram): Initialize dprec and merger fields in rules array.
15040
15041 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
15042 conflict_list_cnt, conflict_list_free): New variables.
15043 (table_grow): Also grow conflict_table.
e0e5bf84 15044 (prepare_rules): Output dprec and merger tables.
676385e2 15045 (conflict_row): New function.
e0e5bf84 15046 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
15047 default reduction in conflicted states for GLR parser so that there
15048 are spaces for the conflict lists.
15049 (save_row): Also save conflict information.
15050 (token_actions): Allocate conflict list.
15051 (merger_output): New function.
15052 (pack_vector): Pack conflict table, too.
15053 (output_conflicts): New function to output yyconflp and yyconfl.
15054 (output_check): Allocate conflict_tos.
15055 (output_actions): Output conflict tables, also.
15056 (output_skeleton): Output b4_mergers definition.
15057 (prepare): Output b4_max_rhs_length definition.
15058 Use 'bison.glr' as default skeleton for GLR parsers.
15059
15060 * src/gram.c (glr_parser): New flag.
15061 (grammar_free): Call free_merger_functions.
15062
15063 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
15064 all pairs of conflicting reductions, rather than just all tokens
15065 causing conflicts. Needed to size conflict tables.
e0e5bf84 15066 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
15067 interface.
15068 (conflicts_print): Ditto.
15069 (count_total_conflicts): New function.
15070
15071 * src/reader.h (merger_list): New type.
15072 (merge_functions): New variable.
15073
15074 * src/lex.h (tok_dprec, tok_merge): New token types.
15075
15076 * src/gram.h (rule_s): Add dprec and merger fields.
15077 (glr_parser): New flag.
15078
15079 * src/conflicts.h (count_total_conflicts): New function.
15080
15081 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
15082
15083 * doc/bison.texinfo (Generalized LR Parsing): New section.
15084 (GLR Parsers): New section.
15085 (Language and Grammar): Mention GLR parsing.
15086 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
15087 Correct typo ("tge" -> "the").
15088
15089 * data/bison.glr: New skeleton for GLR parsing.
15090
15091 * tests/cxx-gram.at: New tests for GLR parsing.
15092
15093 * tests/testsuite.at: Include cxx-gram.at.
15094
15095 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 15096
676385e2
PH
15097 * src/parse-gram.y:
15098
15099 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
15100
15101 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 15102
b5480d74 151032002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
15104
15105 * src/options.h, src/options.c: Remove.
15106 * src/getargs.c (short_options, long_options): New.
15107
60491a94
AD
151082002-06-27 Akim Demaille <akim@epita.fr>
15109
15110 * data/bison.simple, data/bison.c++: Rename as...
15111 * data/yacc.c, data/lalr1.cc: these.
15112 * doc/bison.texinfo (Environment Variables): Remove.
15113
9be0c25b
AD
151142002-06-25 Raja R Harinath <harinath@cs.umn.edu>
15115
15116 * src/getargs.c (report_argmatch): Initialize strtok().
15117
1ae72863
AD
151182002-06-20 Akim Demaille <akim@epita.fr>
15119
15120 * data/bison.simple (b4_symbol_actions): New, replaces...
15121 (b4_symbol_destructor, b4_symbol_printer): these.
15122 (yysymprint): Be sure to call YYPRINT only for tokens, and using
15123 user token numbers.
15124
87542d29
AD
151252002-06-20 Akim Demaille <akim@epita.fr>
15126
15127 * data/bison.simple (yydestructor): Rename as...
15128 (yydestruct): this.
15129
1a31ed21
AD
151302002-06-20 Akim Demaille <akim@epita.fr>
15131
15132 * src/symtab.h, src/symtab.c (symbol_type_set)
15133 (symbol_destructor_set, symbol_precedence_set): The location is
15134 the last argument.
15135 Adjust all callers.
15136
e776192e
AD
151372002-06-20 Akim Demaille <akim@epita.fr>
15138
15139 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
15140 internals.
15141 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
15142 Takes a location.
15143 * src/symtab.h, src/symtab.c (symbol_class_set)
15144 (symbol_user_token_number_set): Likewise.
15145 Adjust all callers.
15146 Promote complain_at.
15147 * tests/input.at (Type Clashes): Adjust.
15148
5c1180b3
AD
151492002-06-20 Akim Demaille <akim@epita.fr>
15150
15151 * data/bison.simple (YYLEX): Fix the declaration when
15152 %pure-parser.
15153
e3170060
AD
151542002-06-20 Akim Demaille <akim@epita.fr>
15155
15156 * data/bison.simple (yysymprint): Don't print the token number,
15157 just its name.
15158 * tests/actions.at (Destructors): Rename as...
15159 (Printers and Destructors): this.
15160 Also exercise %printer.
15161
253862fd
AD
151622002-06-20 Akim Demaille <akim@epita.fr>
15163
15164 * data/bison.simple (YYDSYMPRINT): New.
15165 Use it to remove many of the #if YYDEBUG/if (yydebug).
15166
366eea36
AD
151672002-06-20 Akim Demaille <akim@epita.fr>
15168
15169 * src/symtab.h, src/symtab.c (symbol_t): printer and
15170 printer_location are new members.
15171 (symbol_printer_set): New.
15172 * src/parse-gram.y (PERCENT_PRINTER): New token.
15173 Handle its associated rule.
15174 * src/scan-gram.l: Adjust.
15175 (handle_destructor_at, handle_destructor_dollar): Rename as...
15176 (handle_symbol_code_at, handle_symbol_code_dollar): these.
15177 * src/output.c (symbol_printers_output): New.
15178 (output_skeleton): Call it.
15179 * data/bison.simple (yysymprint): New. Cannot be named yyprint
15180 since there are already many grammar files with a user `yyprint'.
15181 Replace the calls to YYPRINT to calls to yysymprint.
15182 * tests/calc.at: Adjust.
15183 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
15184 taking advantage of parser very internal details (stack size!).
15185
4f25ebb0
AD
151862002-06-20 Akim Demaille <akim@epita.fr>
15187
15188 * src/scan-gram.l: Complete the scanner with the missing patterns
15189 to pacify Flex.
15190 Use `quote' and `symbol_tag_get' where appropriate.
15191
93b68a0e
AD
151922002-06-19 Akim Demaille <akim@epita.fr>
15193
15194 * tests/actions.at (Destructors): Augment to test locations.
15195 * data/bison.simple (yydestructor): Pass it the current location
15196 if locations are enabled.
15197 Prototype only when __STDC__ or C++.
15198 Change the argument names to move into the yy name space: there is
15199 user code here.
15200
58612f1d
AD
152012002-06-19 Akim Demaille <akim@epita.fr>
15202
74310291
AD
15203 * data/bison.simple (b4_pure_if): New.
15204 Use it instead of #ifdef YYPURE.
15205
152062002-06-19 Akim Demaille <akim@epita.fr>
15207
15208 * data/bison.simple (b4_location_if): New.
58612f1d
AD
15209 Use it instead of #ifdef YYLSP_NEEDED.
15210
f25bfb75
AD
152112002-06-19 Akim Demaille <akim@epita.fr>
15212
15213 Prepare @$ in %destructor, but currently don't bind it in the
15214 skeleton, as %location use is not cleaned up yet.
15215
15216 * src/scan-gram.l (handle_dollar, handle_destructor_at)
15217 (handle_action_at): New.
15218 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
15219 a braced_code_t and a location as additional arguments.
15220 (handle_destructor_dollar): Instead of requiring `b4_eval', just
15221 unquote one when outputting `b4_dollar_dollar'.
15222 Adjust callers.
15223 * data/bison.simple (b4_eval): Remove.
15224 (b4_symbol_destructor): Adjust.
15225 * tests/input.at (Invalid @n): Adjust.
15226
c732d2c6
AD
152272002-06-19 Zack Weinberg <zack@codesourcery.com>
15228
15229 * doc/bison.texinfo: Document ability to have multiple
15230 prologue sections.
15231
8c165d89
AD
152322002-06-18 Akim Demaille <akim@epita.fr>
15233
15234 * src/files.c (compute_base_names): When computing the output file
15235 names from the input file name, strip the directory part.
15236
ca98bf57
AD
152372002-06-18 Akim Demaille <akim@epita.fr>
15238
15239 * data/bison.simple.new: Comment changes.
15240 Reported by Andreas Schwab.
15241
0bfb02ff
AD
152422002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
15243
15244 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
15245 there are no `label `yyoverflowlab' defined but not used' warnings
15246 when yyoverflow is defined.
15247
24c0aad7
AD
152482002-06-18 Akim Demaille <akim@epita.fr>
15249
15250 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
15251 new member.
15252 (symbol_destructor_set): Adjust.
15253 * src/output.c (symbol_destructors_output): Output the destructor
15254 locations.
15255 Output the symbol name.
15256 * data/bison.simple (b4_symbol_destructor): Adjust.
15257
5719c109
AD
152582002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
15259 and Akim Demaille <akim@epita.fr>
15260
15261 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
15262 what's left on the stack when the error recovery hits EOF.
15263 * tests/actions.at (Destructors): Complete to exercise this case.
15264
9280d3ef
AD
152652002-06-17 Akim Demaille <akim@epita.fr>
15266
15267 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
15268 arguments is really empty, not only equal to `[]'.
15269 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
15270 member.
15271 (symbol_destructor_set): New.
15272 * src/output.c (symbol_destructors_output): New.
15273 * src/reader.h (brace_code_t, current_braced_code): New.
15274 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
15275 (handle_dollar): Rename as...
15276 (handle_action_dollar): this.
15277 (handle_destructor_dollar): New.
15278 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
15279 (grammar_declaration): Use it.
15280 * data/bison.simple (yystos): Is always defined.
15281 (yydestructor): New.
15282 * tests/actions.at (Destructors): New.
15283 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
15284
dafdc66f
AD
152852002-06-17 Akim Demaille <akim@epita.fr>
15286
15287 * src/symlist.h, src/symlist.c (symbol_list_length): New.
15288 * src/scan-gram.l (handle_dollar, handle_at): Compute the
15289 rule_length only when needed.
15290 * src/output.c (actions_output, token_definitions_output): Output
15291 the full M4 block.
15292 * src/symtab.c: Don't access directly to the symbol tag, use
15293 symbol_tag_get.
15294 * src/parse-gram.y: Use symbol_list_free.
15295
56c47203
AD
152962002-06-17 Akim Demaille <akim@epita.fr>
15297
15298 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
15299 (symbol_list_prepend, get_type_name): Move to...
15300 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
15301 (symbol_list_prepend, symbol_list_n_type_name_get): here.
15302 Adjust all callers.
15303 (symbol_list_free): New.
15304 * src/scan-gram.l (handle_dollar): Takes a location.
15305 * tests/input.at (Invalid $n): Adjust.
15306
1e0bab92
AD
153072002-06-17 Akim Demaille <akim@epita.fr>
15308
15309 * src/reader.h, src/reader.c (symbol_list_new): Export it.
15310 (symbol_list_prepend): New.
15311 * src/parse-gram.y (%union): `list' is a new member.
15312 (symbols.1): New, replaces...
15313 (terms_to_prec.1, nterms_to_type.1): these.
15314 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
15315 Take a location as additional argument.
15316 Adjust all callers.
15317
04e60654
AD
153182002-06-15 Akim Demaille <akim@epita.fr>
15319
15320 * src/parse-gram.y: Move %token in the declaration section so that
15321 we don't depend upon CVS Bison.
15322
10e5b8bd
AD
153232002-06-15 Akim Demaille <akim@epita.fr>
15324
15325 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
15326 * src/print.c (print_core): Use it.
15327
9801d40c
AD
153282002-06-15 Akim Demaille <akim@epita.fr>
15329
15330 * src/conflicts.c (log_resolution): Accept the rule involved in
15331 the sr conflicts instead of the lookahead number that points to
15332 that rule.
15333 (flush_reduce): Accept the current lookahead vector as argument,
15334 instead of the index in LA.
15335 (resolve_sr_conflict): Accept the current number of lookahead
15336 bitset to consider for the STATE, instead of the index in LA.
15337 (set_conflicts): Adjust.
15338 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
15339
c0263492
AD
153402002-06-15 Akim Demaille <akim@epita.fr>
15341
15342 * src/state.h (state_t): Replace the `lookaheadsp' member, a
15343 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
15344 Adjust all dependencies.
15345 * src/lalr.c (initialize_lookaheads): Split into...
15346 (states_lookaheads_count, states_lookaheads_initialize): these.
15347 (lalr): Adjust.
15348
9757c359
AD
153492002-06-15 Akim Demaille <akim@epita.fr>
15350
15351 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
15352 out of...
15353 (grammar_rules_print): here.
15354 * src/reduce.c (reduce_output): Use it.
15355 * tests/reduce.at (Useless Rules, Reduced Automaton)
15356 (Underivable Rules): Adjust.
15357
6b98e4b5
AD
153582002-06-15 Akim Demaille <akim@epita.fr>
15359
15360 Copy BYacc's nice way to report the grammar.
15361
15362 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
15363 New.
15364 Don't print the rules' location, it is confusing and useless.
15365 (rule_print): Use grammar_rhs_print.
15366 * src/print.c (print_grammar): Use grammar_rules_print.
15367
6b98e4b5
AD
153682002-06-15 Akim Demaille <akim@epita.fr>
15369
15370 Complete and rationalize `useless thing' warnings.
15371
15372 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
15373 (symbol_tag_print): New.
15374 Use them everywhere in place of accessing directly the tag member.
15375 * src/gram.h, src/gram.c (rule_print): New.
15376 Use it where a rule used to be printed `by hand'.
15377 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
15378 (reduce_grammar_tables): Report the useless rules.
15379 (reduce_print): Useless things are a warning, not an error.
15380 Report it as such.
15381 * tests/reduce.at (Useless Nonterminals, Useless Rules):
15382 (Reduced Automaton, Underivable Rules): Adjust.
15383 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
15384 * tests/conflicts.at (Unresolved SR Conflicts)
15385 (Solved SR Conflicts): Adjust.
15386
ee000ba4
AD
153872002-06-15 Akim Demaille <akim@epita.fr>
15388
15389 Let symbols have a location.
15390
15391 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
15392 (getsym): Adjust.
15393 Adjust all callers.
15394 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
15395 Use location_t, not int.
15396 * src/symtab.c (symbol_check_defined): Take advantage of the
15397 location.
15398 * tests/regression.at (Invalid inputs): Adjust.
15399
8efe435c
AD
154002002-06-15 Akim Demaille <akim@epita.fr>
15401
15402 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
15403 (input): Don't try to initialize yylloc here, do it in the
15404 scanner.
15405 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
15406 * src/gram.h (rule_t): Change line and action_line into location
15407 and action_location, of location_t type.
15408 Adjust all dependencies.
15409 * src/location.h, src/location.c (empty_location): New.
15410 * src/reader.h, src/reader.c (grammar_start_symbol_set)
15411 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
15412 (grammar_current_rule_symbol_append)
15413 (grammar_current_rule_action_append): Expect a location as argument.
15414 * src/reader.c (grammar_midrule_action): Adjust to attach an
15415 action's location as dummy symbol location.
15416 * src/symtab.h, src/symtab.c (startsymbol_location): New.
15417 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
15418 the line numbers.
15419
1921f1d7
AD
154202002-06-14 Akim Demaille <akim@epita.fr>
15421
15422 Grammar declarations may be found in the grammar section.
15423
15424 * src/parse-gram.y (rules_or_grammar_declaration): New.
15425 (declarations): Each declaration may end with a semicolon, not
15426 just...
15427 (grammar_declaration): `"%union"'.
15428 (grammar): Branch to rules_or_grammar_declaration.
15429
4515534c
AD
154302002-06-14 Akim Demaille <akim@epita.fr>
15431
15432 * src/main.c (main): Invoke scanner_free.
15433
f958596b
AD
154342002-06-14 Akim Demaille <akim@epita.fr>
15435
15436 * src/output.c (m4_invoke): Extracted from...
15437 (output_skeleton): here.
15438 Free tempfile.
15439
2c569025
AD
154402002-06-14 Akim Demaille <akim@epita.fr>
15441
15442 * src/parse-gram.y (directives, directive, gram)
15443 (grammar_directives, precedence_directives, precedence_directive):
15444 Rename as...
15445 (declarations, declaration, grammar, grammar_declaration)
15446 (precedence_declaration, precedence_declarator): these.
15447 (symbol_declaration): New.
15448
592e8d4d
AD
154492002-06-14 Akim Demaille <akim@epita.fr>
15450
15451 * src/files.c (action_obstack): Remove, unused.
15452 (output_obstack): Remove it, and all its dependencies, as it is no
15453 longer needed.
15454 * src/reader.c (epilogue_set): Build the epilogue in the
15455 muscle_obstack.
15456 * src/output.h, src/output.c (muscle_obstack): Move to...
15457 * src/muscle_tab.h, src/muscle_tab.h: here.
15458 (muscle_init): Initialize muscle_obstack.
15459 (muscle_free): New.
15460 * src/main.c (main): Call it.
15461
0c15323d
AD
154622002-06-14 Akim Demaille <akim@epita.fr>
15463
15464 * src/location.h: New, extracted from...
15465 * src/reader.h: here.
15466 * src/Makefile.am (noinst_HEADERS): Merge into
15467 (bison_SOURCES): this.
15468 Add location.h.
15469 * src/parse-gram.y: Use location_t instead of Bison's.
15470 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
15471 Use location_t instead of ints.
15472
e96c9728
AD
154732002-06-14 Akim Demaille <akim@epita.fr>
15474
15475 * data/bison.simple, data/bison.c++: Be sure to restore the
15476 current #line when returning to the skeleton contents after having
15477 exposed the input file's #line.
15478
75d1fe16
AD
154792002-06-12 Akim Demaille <akim@epita.fr>
15480
15481 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
15482 eager.
15483 * tests/actions.at (Exotic Dollars): New.
15484
6c35d22c
AD
154852002-06-12 Akim Demaille <akim@epita.fr>
15486
15487 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
15488 ['"/] too eagerly.
15489 * tests/input.at (Torturing the Scanner): New.
15490
1d6412ad
AD
154912002-06-11 Akim Demaille <akim@epita.fr>
15492
15493 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
15494 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
15495 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
15496 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
15497 * src/reader.c (reader): Use it.
15498
4cdb01db
AD
154992002-06-11 Akim Demaille <akim@epita.fr>
15500
15501 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
15502 Adjust all callers.
15503 (scanner_last_string_free): New.
15504
44995b2e
AD
155052002-06-11 Akim Demaille <akim@epita.fr>
15506
15507 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
15508 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
15509 (last_string, YY_OBS_FREE): New.
15510 Use them when returning an ID.
15511
e9955c83
AD
155122002-06-11 Akim Demaille <akim@epita.fr>
15513
15514 Have Bison grammars parsed by a Bison grammar.
15515
15516 * src/reader.c, src/reader.h (prologue_augment): New.
15517 * src/reader.c (copy_definition): Remove.
15518
15519 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
15520 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
15521 (grammar_current_rule_prec_set, grammar_current_rule_check)
15522 (grammar_current_rule_symbol_append)
15523 (grammar_current_rule_action_append): Export.
15524 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
15525 (symbol_list_action_append): Remove.
15526 Hook the routines from reader.
15527 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
15528 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
15529
15530 * src/reader.c (read_declarations): Remove, unused.
15531
15532 * src/parse-gram.y: Handle the epilogue.
15533 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
15534 (grammar_start_symbol_set): this.
15535 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
15536 * src/reader.c (readgram): Remove, unused.
15537 (reader): Adjust to insert eoftoken and axiom where appropriate.
15538
15539 * src/reader.c (copy_dollar): Replace with...
15540 * src/scan-gram.h (handle_dollar): this.
15541 * src/parse-gram.y: Remove `%thong'.
15542
15543 * src/reader.c (copy_at): Replace with...
15544 * src/scan-gram.h (handle_at): this.
15545
15546 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
15547 New.
15548
15549 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
15550 time being.
15551
15552 * src/reader.h, src/reader.c (grammar_rule_end): New.
15553
15554 * src/parse.y (current_type, current_class): New.
15555 Implement `%nterm', `%token' support.
15556 Merge `%term' into `%token'.
15557 (string_as_id): New.
15558 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
15559 type name.
15560
15561 * src/parse-gram.y: Be sure to handle properly the beginning of
15562 rules.
15563
15564 * src/parse-gram.y: Handle %type.
15565 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
15566
15567 * src/parse-gram.y: More directives support.
15568 * src/options.c: No longer handle source directives.
15569
15570 * src/parse-gram.y: Fix %output.
15571
15572 * src/parse-gram.y: Handle %union.
15573 Use the prologue locations.
15574 * src/reader.c (parse_union_decl): Remove.
15575
15576 * src/reader.h, src/reader.c (epilogue_set): New.
15577 * src/parse-gram.y: Use it.
15578
15579 * data/bison.simple, data/bison.c++: b4_stype is now either not
15580 defined, then default to int, or to the contents of %union,
15581 without `union' itself.
15582 Adjust.
15583 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
15584
15585 * src/output.c (actions_output): Don't output braces, as they are
15586 already handled by the scanner.
15587
15588 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
15589 characters to themselves.
15590
15591 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
15592 that the epilogue has a proper #line.
15593
15594 * src/parse-gram.y: Handle precedence/associativity.
15595
15596 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
15597 a terminal.
15598 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
15599 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
15600 at all to define terminals that cannot be emitted.
15601
15602 * src/scan-gram.l: Escape M4 characters.
15603
15604 * src/scan-gram.l: Working properly with escapes in user
15605 strings/characters.
15606
15607 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
15608 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
15609 grammar.
15610 Use more modest sizes, as for the time being the parser does not
15611 release memory, and therefore the process swallows a huge amount
15612 of memory.
15613
15614 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
15615 stricter %token grammar.
15616
15617 * src/symtab.h (associativity): Add `undef_assoc'.
15618 (symbol_precedence_set): Do nothing when passed an undef_assoc.
15619 * src/symtab.c (symbol_check_alias_consistence): Adjust.
15620
15621 * tests/regression.at (Invalid %directive): Remove, as it is now
15622 meaningless.
15623 (Invalid inputs): Adjust to the new error messages.
15624 (Token definitions): The new grammar doesn't allow too many
15625 eccentricities.
15626
15627 * src/lex.h, src/lex.c: Remove.
15628 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
15629 (copy_character, copy_string2, copy_string, copy_identifier)
15630 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
15631 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
15632 (parse_action): Remove.
15633 * po/POTFILES.in: Adjust.
15634
2e047461
AD
156352002-06-11 Akim Demaille <akim@epita.fr>
15636
cd05d13c 15637 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
15638 rule's action member: return the action as a string.
15639 Don't require `rule_length' as an argument: compute it.
15640 (grammar_current_rule_symbol_append)
15641 (grammar_current_rule_action_append): New, eved out from
15642 (readgram): here.
15643 Remove `action_flag', `rulelength', unused now.
15644
9af3fbce
AD
156452002-06-11 Akim Demaille <akim@epita.fr>
15646
15647 * src/reader.c (grammar_current_rule_prec_set).
15648 (grammar_current_rule_check): New, eved out from...
15649 (readgram): here.
15650 Remove `xaction', `first_rhs': useless.
15651 * tests/input.at (Type clashes): New.
15652 * tests/existing.at (GNU Cim Grammar): Adjust.
15653
1485e106
AD
156542002-06-11 Akim Demaille <akim@epita.fr>
15655
15656 * src/reader.c (grammar_midrule_action): New, Eved out from
15657 (readgram): here.
15658
da4160c3
AD
156592002-06-11 Akim Demaille <akim@epita.fr>
15660
15661 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
15662 New.
15663 (readgram): Use them as replacement of inlined code, crule and
15664 crule1.
15665
f6d0f937
AD
156662002-06-11 Akim Demaille <akim@epita.fr>
15667
15668 * src/reader.c (grammar_end, grammar_symbol_append): New.
15669 (readgram): Use them.
15670 Make the use of `p' as local as possible.
15671
69078d4b
AD
156722002-06-10 Akim Demaille <akim@epita.fr>
15673
15674 GCJ's parser requires the tokens to be defined before the prologue.
15675
15676 * data/bison.simple: Output the token definition before the user's
15677 prologue.
15678 * tests/regression.at (Braces parsing, Duplicate string)
15679 (Mixing %token styles): Check the output from bison.
15680 (Early token definitions): New.
15681
5e424082
AD
156822002-06-10 Akim Demaille <akim@epita.fr>
15683
15684 * src/symtab.c (symbol_user_token_number_set): Don't complain when
15685 assigning twice the same user number to a token, so that we can
15686 use it in...
15687 * src/lex.c (lex): here.
15688 Also use `symbol_class_set' instead of hand written code.
15689 * src/reader.c (parse_assoc_decl): Likewise.
15690
44536b35
AD
156912002-06-10 Akim Demaille <akim@epita.fr>
15692
15693 * src/symtab.c, src/symtab.c (symbol_class_set)
15694 (symbol_user_token_number_set): New.
15695 * src/reader.c (parse_token_decl): Use them.
15696 Use a switch instead of ifs.
15697 Use a single argument.
15698
8b9f2372
AD
156992002-06-10 Akim Demaille <akim@epita.fr>
15700
15701 Remove `%thong' support as it is undocumented, unused, duplicates
15702 `%token's job, and creates useless e-mail traffic with people who
15703 want to know what it is, why it is undocumented, unused, and
15704 duplicates `%token's job.
15705
15706 * src/reader.c (parse_thong_decl): Remove.
15707 * src/options.c (option_table): Remove "thong".
15708 * src/lex.h (tok_thong): Remove.
15709
3ae2b51f
AD
157102002-06-10 Akim Demaille <akim@epita.fr>
15711
15712 * src/symtab.c, src/symtab.c (symbol_type_set)
15713 (symbol_precedence_set): New.
15714 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
15715 (value_components_used): Remove, unused.
15716
2f1afb73
AD
157172002-06-09 Akim Demaille <akim@epita.fr>
15718
15719 Move symbols handling code out of the reader.
15720
15721 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
15722 (axiom): Move to...
15723 * src/symtab.h, src/symtab.c: here.
15724
15725 * src/gram.c (start_symbol): Remove: use startsymbol->number.
15726 * src/reader.c (startval): Rename as...
15727 * src/symtab.h, src/symtab.c (startsymbol): this.
15728 * src/reader.c: Adjust.
15729
15730 * src/reader.c (symbol_check_defined, symbol_make_alias)
15731 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15732 (token_translations_init)
15733 Move to...
15734 * src/symtab.c: here.
15735 * src/reader.c (packsymbols): Move to...
15736 * src/symtab.h, src/symtab.c (symbols_pack): here.
15737 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
15738 argument.
15739
e9bca3ad
AD
157402002-06-03 Akim Demaille <akim@epita.fr>
15741
15742 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
15743 then statements.
15744
86eff183
AD
157452002-06-03 Akim Demaille <akim@epita.fr>
15746
15747 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
15748 structs with non literals.
15749 * src/scan-skel.l: never-interactive.
15750 * src/conflicts.c (enum conflict_resolution_e): No trailing
15751 comma.
15752 * src/getargs.c (usage): Split long literal strings.
15753 Reported by Hans Aberg.
15754
717be197
AD
157552002-05-28 Akim Demaille <akim@epita.fr>
15756
15757 * data/bison.c++: Use C++ ostreams.
15758 (cdebug_): New member.
15759
670ddffd
AD
157602002-05-28 Akim Demaille <akim@epita.fr>
15761
15762 * src/output.c (output_skeleton): Be sure to allocate enough room
15763 for `/' _and_ for `\0' in full_skeleton.
15764
769b430f
AD
157652002-05-28 Akim Demaille <akim@epita.fr>
15766
15767 * data/bison.c++: Catch up with bison.simple:
15768 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15769 and Paul Eggert <eggert@twinsun.com>: `error' handing.
15770 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
15771 and popping traces.
15772
7067cb36
PH
157732002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15774
15775 * src/output.c (output_skeleton): Put an explicit path in front of
15776 the skeleton file name, rather than relying on the -I directory,
15777 to partially alleviate effects of having a skeleton file lying around
15778 in the current directory.
769b430f 15779
4a713ec2
PH
157802002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15781
769b430f 15782 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
15783 obstack_printf should be obstack_fgrow1.
15784
b408954b
AD
157852002-05-26 Akim Demaille <akim@epita.fr>
15786
15787 * src/state.h (state_t): `solved_conflicts' is a new member.
15788 * src/LR0.c (new_state): Set it to 0.
15789 * src/conflicts.h, src/conflicts.c (print_conflicts)
15790 (free_conflicts, solve_conflicts): Rename as...
15791 (conflicts_print, conflicts_free, conflicts_solve): these.
15792 Adjust callers.
15793 * src/conflicts.c (enum conflict_resolution_e)
15794 (solved_conflicts_obstack): New, used by...
15795 (log_resolution): this.
15796 Adjust to attach the conflict resolution to each state.
15797 Complete the description with the precedence/associativity
15798 information.
15799 (resolve_sr_conflict): Adjust.
15800 * src/print.c (print_state): Output its solved_conflicts.
15801 * tests/conflicts.at (Unresolved SR Conflicts)
15802 (Solved SR Conflicts): Exercise --report=all.
15803
a49aecd5
AD
158042002-05-26 Akim Demaille <akim@epita.fr>
15805
15806 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15807 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15808 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
15809 (token_number_t, item_number_as_token_number)
15810 (token_number_as_item_number, muscle_insert_token_number_table):
15811 Rename as...
15812 (symbol_number_t, item_number_as_symbol_number)
15813 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
15814 these, since it is more appropriate.
15815
5504898e
AD
158162002-05-26 Akim Demaille <akim@epita.fr>
15817
15818 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
15819 `Error:' lines.
15820 * data/bison.simple (yystos) [YYDEBUG]: New.
15821 (yyparse) [YYDEBUG]: Display the symbols which are popped during
15822 error recovery.
15823 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
15824
ec3bc396
AD
158252002-05-25 Akim Demaille <akim@epita.fr>
15826
15827 * doc/bison.texinfo (Debugging): Split into...
15828 (Tracing): this new section, its former contents, and...
15829 (Understanding): this new section.
15830 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
15831 by...
15832 (report_flag): this.
15833 Adjust all dependencies.
15834 (report_args, report_types, report_argmatch): New.
15835 (usage, getargs): Report/support -r, --report.
15836 * src/options.h
15837 (struct option_table_struct): Rename as..,
15838 (struct option_table_s): this.
15839 Rename the `set_flag' member to `flag' to match with getopt_long's
15840 struct.
15841 * src/options.c (option_table): Split verbose into an entry for
15842 %verbose, and another for --verbose.
15843 Support --report/-r, so remove -r from the obsolete --raw.
15844 * src/print.c: Attach full item sets and lookaheads reports to
15845 report_flag instead of trace_flag.
15846 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
15847
78df8250
PE
158482002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15849 and Paul Eggert <eggert@twinsun.com>
769b430f 15850
78df8250
PE
15851 * data/bison.simple (yyparse): Correct error handling to conform to
15852 POSIX and yacc. Specifically, after syntax error is discovered,
15853 do not reduce further before shifting the error token.
15854 Clean up the code a bit by removing the labels yyerrdefault,
15855 yyerrhandle, yyerrpop.
15856 * NEWS: Document the above.
15857
c0c9ea05
PH
158582002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15859
15860 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
15861 type; it isn't always big enough, since it doesn't necessarily
15862 include non-terminals.
769b430f 15863 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
15864 the latter can be removed.
15865 (yy_token_number_type): Remove, only one use.
15866 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
15867 don't use TokenNumberType as element type.
769b430f 15868
c0c9ea05
PH
15869 * tests/regression.at: Modify expected output to agree with change
15870 to yyr1 and yytranslate.
769b430f 15871
6390a83f
FK
158722002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
15873
15874 * src/reader.c (parse_action): Use copy_character instead of
15875 obstack_1grow.
15876
db7c8e9a
AD
158772002-05-13 Akim Demaille <akim@epita.fr>
15878
15879 * tests/regression.at (Token definitions): Prototype yylex and
15880 yyerror.
15881
fcc61800
PH
158822002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15883
158c687b 15884 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
15885 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
15886 32-bit arithmetic.
15887 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
15888
5683e9b2
AD
158892002-05-07 Akim Demaille <akim@epita.fr>
15890
15891 * tests/synclines.at: Be sure to prototype yylex and yyerror to
15892 avoid GCC warnings.
15893
0c2d3f4c
AD
158942002-05-07 Akim Demaille <akim@epita.fr>
15895
15896 Kill GCC warnings.
15897
15898 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
15899 over the RHS of each rule.
15900 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
15901 * src/state.h (state_t): Member `nitems' is unsigned short.
15902 * src/LR0.c (get_state): Adjust.
15903 * src/reader.c (packgram): Likewise.
15904 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
15905 `Type'.
15906 (muscle_insert_int_table): Remove, unused.
15907 (prepare_rules): Remove `max'.
15908
1565b720
AD
159092002-05-06 Akim Demaille <akim@epita.fr>
15910
15911 * src/closure.c (print_firsts): Display of the symbol tags.
15912 (bitmatrix_print): Move to...
15913 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
15914 here.
15915 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
15916
cfaee611
AD
159172002-05-06 Akim Demaille <akim@epita.fr>
15918
15919 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
15920 hash_do_for_each.
15921
458be8e0
AD
159222002-05-06 Akim Demaille <akim@epita.fr>
15923
15924 * src/LR0.c (new_state, get_state): Instead of using the global
15925 `kernel_size' and `kernel_base', have two new arguments:
15926 `core_size' and `core'.
15927 Adjust callers.
15928
a900a624
AD
159292002-05-06 Akim Demaille <akim@epita.fr>
15930
15931 * src/reader.c (packgram): No longer end `ritem' with a 0
15932 sentinel: it is not used.
15933
d4e7d3a1
AD
159342002-05-05 Akim Demaille <akim@epita.fr>
15935
15936 New experimental feature: display the lookaheads in the report and
15937 graph.
15938
15939 * src/print (print_core): When --trace-flag, display the rules
15940 lookaheads.
15941 * src/print_graph.c (print_core): Likewise.
15942 Swap the arguments.
15943 Adjust caller.
15944
39ceb25b
AD
159452002-05-05 Akim Demaille <akim@epita.fr>
15946
15947 * tests/torture.at (Many lookaheads): New test.
15948
5372019f
AD
159492002-05-05 Akim Demaille <akim@epita.fr>
15950
15951 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
15952 (GENERATE_MUSCLE_INSERT_TABLE): this.
15953 (output_int_table, output_unsigned_int_table, output_short_table)
15954 (output_token_number_table, output_item_number_table): Replace with...
15955 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
15956 (muscle_insert_short_table, muscle_insert_token_number_table)
15957 (muscle_insert_item_number_table): these.
15958 Adjust all callers.
15959 (prepare_tokens): Don't free `translations', since...
15960 * src/reader.h, src/reader.c (grammar_free): do it.
15961 Move to...
15962 * src/gram.h, src/gram.c (grammar_free): here.
15963 * data/bison.simple, data/bison.c++: b4_token_number_max is now
15964 b4_translate_max.
15965
5df5f6d5
AD
159662002-05-05 Akim Demaille <akim@epita.fr>
15967
15968 * src/output.c (output_unsigned_int_table): New.
15969 (prepare_rules): `i' is unsigned.
15970 `prhs', `rline', `r2' are unsigned int.
15971 Rename muscle `rhs_number_max' as `rhs_max'.
15972 Output muscles `prhs_max', `rline_max', and `r2_max'.
15973 Free rline and r1.
15974 * data/bison.simple, data/bison.c++: Adjust to use these muscles
15975 to compute types instead of constant types.
15976 * tests/regression.at (Web2c Actions): Adjust.
15977
b87f8b21
AD
159782002-05-04 Akim Demaille <akim@epita.fr>
15979
15980 * src/symtab.h (SALIAS, SUNDEF): Rename as...
15981 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
15982 Adjust dependencies.
15983 * src/output.c (token_definitions_output): Be sure not to output a
15984 `#define 'a'' when fed with `%token 'a' "a"'.
15985 * tests/regression.at (Token definitions): New.
15986
8bb936e4
PE
159872002-05-03 Paul Eggert <eggert@twinsun.com>
15988
15989 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
15990 for K&R C.
15991
159922002-05-03 gettextize <bug-gnu-gettext@gnu.org>
15993
15994 * Makefile.am (SUBDIRS): Remove intl.
15995 (EXTRA_DIST): Add config/config.rpath.
15996
53c71a12
AD
159972002-05-03 Akim Demaille <akim@epita.fr>
15998
15999 * data/bison.simple (m4_if): Don't output empty enums.
16000 And actually, output valid enum definitions :(.
16001
289dd0cf
AD
160022002-05-03 Akim Demaille <akim@epita.fr>
16003
16004 * configure.bat: Remove, completely obsolete.
16005 * Makefile.am (EXTRA_DIST): Adjust.
16006 Don't distribute config.rpath...
16007 * config/Makefile.am (EXTRA_DIST): Do it.
16008
db85e524
AD
160092002-05-03 Akim Demaille <akim@epita.fr>
16010
16011 * configure.in (GETTEXT_VERSION): New.
16012 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
16013
83ccf991
AD
160142002-05-03 Akim Demaille <akim@epita.fr>
16015
16016 * data/bison.simple (b4_token_enum): New.
16017 (b4_token_defines): Use it to output tokens both as #define and
16018 enums.
16019 Suggested by Paul Eggert.
16020 * src/output.c (token_definitions_output): Don't output spurious
16021 white spaces.
16022
1f418995
AD
160232002-05-03 Akim Demaille <akim@epita.fr>
16024
16025 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16026
45119f04
RA
160272002-05-02 Robert Anisko <robert@lrde.epita.fr>
16028
16029 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
16030 Update the stack class, give a try to deque as the default container.
16031
b2d52318
AD
160322002-05-02 Akim Demaille <akim@epita.fr>
16033
16034 * data/bison.simple (yyparse): Do not implement @$ = @1.
16035 (YYLLOC_DEFAULT): Adjust to do it.
16036 * doc/bison.texinfo (Location Default Action): Fix.
16037
3a8b4109
AD
160382002-05-02 Akim Demaille <akim@epita.fr>
16039
16040 * src/reader.c (parse_braces): Merge into...
16041 (parse_action): this.
16042
84614e13
AD
160432002-05-02 Akim Demaille <akim@epita.fr>
16044
16045 * configure.in (ALL_LINGUAS): Remove.
16046 * po/LINGUAS, hr.po: New.
16047
fdbcd8e2
AD
160482002-05-02 Akim Demaille <akim@epita.fr>
16049
16050 Remove the so called hairy (semantic) parsers.
16051
16052 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
16053 * src/gram.h, src/gram.c (semantic_parser): Remove.
16054 (rule_t): Remove the guard and guard_line members.
16055 * src/lex.h (token_t): remove tok_guard.
16056 * src/options.c (option_table): Remove %guard and %semantic_parser
16057 support.
16058 * src/output.c, src/output.h (guards_output): Remove.
16059 (prepare): Adjust.
16060 (token_definitions_output): Don't output the `T'
16061 tokens (???).
16062 (output_skeleton): Don't output the guards.
16063 * src/files.c, src/files.c (attrsfile): Remove.
16064 * src/reader.c (symbol_list): Remove the guard and guard_line
16065 members.
16066 Adjust dependencies.
16067 (parse_guard): Remove.
16068 * data/bison.hairy: Remove.
16069 * doc/bison.texinfo (Environment Variables): Remove occurrences of
16070 BISON_HAIRY.
16071
82b6cb3f
AD
160722002-05-02 Akim Demaille <akim@epita.fr>
16073
16074 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
16075 (parse_guard): Rename the formal argument `stack_offset' as
16076 `rule_length', which is more readable.
16077 Adjust callers.
16078 (copy_at, copy_dollar): Instead of outputting the hard coded
16079 values of $$, $n and so forth, output invocation to b4_lhs_value,
16080 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
16081 Note: this patch partially drops `semantic-parser' support: it
16082 always does `rule_length - n', where semantic parsers ought to
16083 always use `-n'.
82b6cb3f
AD
16084 * data/bison.simple, data/bison.c++ (b4_lhs_value)
16085 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
16086
6cbfbcc5
AD
160872002-05-02 Akim Demaille <akim@epita.fr>
16088
16089 * configure.in (AC_INIT): Bump to 1.49b.
16090 (AM_INIT_AUTOMAKE): Short invocation.
16091
b8548114
AD
160922002-05-02 Akim Demaille <akim@epita.fr>
16093
16094 Version 1.49a.
16095
c20cd1fa
AD
160962002-05-01 Akim Demaille <akim@epita.fr>
16097
16098 * src/skeleton.h: Remove.
16099
8a9566d4
AD
161002002-05-01 Akim Demaille <akim@epita.fr>
16101
16102 * src/skeleton.h: Fix the #endif.
16103 Reported by Magnus Fromreide.
16104
8c6d399a
PE
161052002-04-26 Paul Eggert <eggert@twinsun.com>
16106
16107 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
16108 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 16109 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 16110
2b7ed18a
RA
161112002-04-25 Robert Anisko <robert@lrde.epita.fr>
16112
16113 * src/scan-skel.l: Postprocess quadrigraphs.
16114
16115 * src/reader.c (copy_character): New function, used to output
16116 single characters while replacing `[' and `]' with quadrigraphs, to
16117 avoid troubles with M4 quotes.
16118 (copy_comment): Output characters with copy_character.
16119 (read_additionnal_code): Likewise.
16120 (copy_string2): Likewise.
16121 (copy_definition): Likewise.
16122
16123 * tests/calc.at: Exercise M4 quoting.
16124
34a89c50
AD
161252002-04-25 Akim Demaille <akim@epita.fr>
16126
16127 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
16128 between `!' and the command.
16129 Reported by Paul Eggert.
16130
0dd1580a
RA
161312002-04-24 Robert Anisko <robert@lrde.epita.fr>
16132
16133 * tests/calc.at: Exercise prologue splitting.
16134
16135 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
16136 `b4_post_prologue' instead of `b4_prologue'.
16137
16138 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
16139 muscles.
16140 (output): Free pre_prologue_obstack and post_prologue_obstack.
16141 * src/files.h, src/files.c (attrs_obstack): Remove.
16142 (pre_prologue_obstack, post_prologue_obstack): New.
16143 * src/reader.c (copy_definition): Add a parameter to specify the
16144 obstack to fill, instead of using attrs_obstack unconditionally.
16145 (read_declarations): Pass pre_prologue_obstack to copy_definition if
16146 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
16147
83c1796f
PE
161482002-04-23 Paul Eggert <eggert@twinsun.com>
16149
16150 * data/bison.simple: Remove unnecessary commentary and white
16151 space differences from 1_29-branch.
16152 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
16153
16154 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
16155 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
16156 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
16157 constructors or destructors.
16158
16159 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
16160
1207eeac
AD
161612002-04-23 Akim Demaille <akim@epita.fr>
16162
16163 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
16164 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
16165 location with columns.
16166 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
16167 All reported by Paul Eggert.
16168
78ab8f67
AD
161692002-04-22 Akim Demaille <akim@epita.fr>
16170
16171 * src/reduce.c (dump_grammar): Move to...
16172 * src/gram.h, src/gram.c (grammar_dump): here.
16173 Be sure to separate long item numbers.
16174 Don't read the members of a rule's prec if its nil.
16175
133c20e2
AD
161762002-04-22 Akim Demaille <akim@epita.fr>
16177
16178 * src/output.c (table_size, table_grow): New.
16179 (MAXTABLE): Remove, replace uses with table_size.
16180 (pack_vector): Instead of dying when the table is too big, grow it.
16181
9515e8a7
AD
161822002-04-22 Akim Demaille <akim@epita.fr>
16183
16184 * data/bison.simple (yyr1): Its type is that of a token number.
16185 * data/bison.c++ (r1_): Likewise.
16186 * tests/regression.at (Web2c Actions): Adjust.
16187
23c5a174
AD
161882002-04-22 Akim Demaille <akim@epita.fr>
16189
16190 * src/reader.c (token_translations_init): 256 is now the default
16191 value for the error token, i.e., it will be assigned another
16192 number if the user assigned 256 to one of her tokens.
16193 (reader): Don't force 256 to error.
16194 * doc/bison.texinfo (Symbols): Adjust.
16195 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
16196 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
16197 etc. instead of 10, 20, 30 (which was used to `jump' over error
16198 (256) and undefined (2)).
16199
5fbb0954
AD
162002002-04-22 Akim Demaille <akim@epita.fr>
16201
16202 Propagate more token_number_t.
16203
16204 * src/gram.h (token_number_as_item_number)
16205 (item_number_as_token_number): New.
16206 * src/output.c (GENERATE_OUTPUT_TABLE): New.
16207 Use it to create output_item_number_table and
16208 output_token_number_table.
16209 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16210 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
16211 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
16212 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
16213
4f940944
AD
162142002-04-22 Akim Demaille <akim@epita.fr>
16215
16216 * src/output.h, src/output.c (get_lines_number): Remove.
16217
3ded9a63
AD
162182002-04-19 Akim Demaille <akim@epita.fr>
16219
16220 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
16221 as Lex/Flex'.
16222 (Debugging): More details about enabling the debugging features.
16223 (Table of Symbols): Describe $$, $n, @$, and @n.
16224 Suggested by Tim Josling.
16225
e0c471a9
AD
162262002-04-19 Akim Demaille <akim@epita.fr>
16227
16228 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
16229
fecc10cd
AD
162302002-04-10 Akim Demaille <akim@epita.fr>
16231
16232 * src/system.h: Rely on HAVE_LIMITS_H.
16233 Suggested by Paul Eggert.
16234
51dec47b
AD
162352002-04-09 Akim Demaille <akim@epita.fr>
16236
16237 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
16238 full stderr, and strip it according to the bison options, instead
16239 of composing the error message from different bits.
16240 This makes it easier to check for several error messages.
16241 Adjust all the invocations.
16242 Add an invocation exercising the error token.
16243 Add an invocation demonstrating a stupid error message.
16244 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
16245 Adjust the tests.
16246 Error message are for stderr, not stdout.
16247
007a50a4
AD
162482002-04-09 Akim Demaille <akim@epita.fr>
16249
16250 * src/gram.h, src/gram.c (error_token_number): Remove, use
16251 errtoken->number.
16252 * src/reader.c (reader): Don't specify the user token number (2)
16253 for $undefined, as it uselessly prevents using it.
16254 * src/gram.h (token_number_t): Move to...
16255 * src/symtab.h: here.
16256 (state_t.number): Is a token_number_t.
16257 * src/print.c, src/reader.c: Use undeftoken->number instead of
16258 hard coded 2.
16259 (Even though this 2 is not the same as above: the number of the
16260 undeftoken remains being 2, it is its user token number which
16261 might not be 2).
16262 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
16263 `user_token_number_max'.
16264 Output `undef_token_number'.
16265 * data/bison.simple, data/bison.c++: Use them.
16266 Be sure to map invalid yylex return values to
16267 `undef_token_number'. This saves us from gratuitous SEGV.
16268
16269 * tests/conflicts.at (Solved SR Conflicts)
16270 (Unresolved SR Conflicts): Adjust.
16271 * tests/regression.at (Web2c Actions): Adjust.
16272
06446ccf
AD
162732002-04-08 Akim Demaille <akim@epita.fr>
16274
16275 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
16276 Adding #line.
16277 Remove the duplicate `typedefs'.
16278 (RhsNumberType): Fix the declaration and various other typos.
16279 Use __ofile__.
16280 * data/bison.simple: Use __ofile__.
16281 * src/scan-skel.l: Handle __ofile__.
16282
62a3e4f0
AD
162832002-04-08 Akim Demaille <akim@epita.fr>
16284
16285 * src/gram.h (item_number_t): New, the type of item numbers in
16286 RITEM. Note that it must be able to code symbol numbers as
16287 positive number, and the negation of rule numbers as negative
16288 numbers.
16289 Adjust all dependencies (pretty many).
16290 * src/reduce.c (rule): Remove this `short *' pointer: use
16291 item_number_t.
16292 * src/system.h (MINSHORT, MAXSHORT): Remove.
16293 Include `limits.h'.
16294 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
16295 (shortcpy): Remove.
16296 (MAXTABLE): Move to...
16297 * src/output.c (MAXTABLE): here.
16298 (prepare_rules): Use output_int_table to output rhs.
16299 * data/bison.simple, data/bison.c++: Adjust.
16300 * tests/torture.at (Big triangle): Move the limit from 254 to
16301 500.
16302 * tests/regression.at (Web2c Actions): Ajust.
16303
16304 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
16305 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
16306 passes, but produces negative #line number, once fixed, GCC is
16307 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
16308 C), it passes.
16309 * src/state.h (state_h): Code input lines on ints, not shorts.
16310
bb88b0fc
AD
163112002-04-08 Akim Demaille <akim@epita.fr>
16312
16313 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
16314 and then the grammar.
16315
9a636f47
AD
163162002-04-08 Akim Demaille <akim@epita.fr>
16317
16318 * src/system.h: No longer using strndup.
16319
680e8701
AD
163202002-04-07 Akim Demaille <akim@epita.fr>
16321
16322 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
16323 * src/output.c (output_table_data): Return the longest number.
16324 (prepare_tokens): Output `token_number_max').
16325 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
16326 New.
16327 Use them to define yy_token_number_type/TokenNumberType.
16328 Use this type for yytranslate.
16329 * tests/torture.at (Big triangle): Push the limit from 124 to
16330 253.
16331 * tests/regression.at (Web2c Actions): Adjust.
16332
817e9f41
AD
163332002-04-07 Akim Demaille <akim@epita.fr>
16334
16335 * tests/torture.at (Big triangle): New.
16336 (GNU AWK Grammar, GNU Cim Grammar): Move to...
16337 * tests/existing.at: here.
16338
5123689b
AD
163392002-04-07 Akim Demaille <akim@epita.fr>
16340
16341 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
16342 nritems.
16343 Adjust dependencies.
16344
f3849179
AD
163452002-04-07 Akim Demaille <akim@epita.fr>
16346
16347 * src/reader.c: Normalize increments to prefix form.
16348
bd02036a
AD
163492002-04-07 Akim Demaille <akim@epita.fr>
16350
16351 * src/reader.c, symtab.c: Remove debugging code.
16352
db8837cb
AD
163532002-04-07 Akim Demaille <akim@epita.fr>
16354
16355 Rename all the `bucket's as `symbol_t'.
16356
16357 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
16358 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
16359 * src/symtab.c, src/symtab.h (bucket): Rename as...
16360 (symbol_t): this.
16361 (symbol_list_new, bucket_check_defined, bucket_make_alias)
16362 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
16363 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16364 (buckets_new, buckets_free, buckets_do): Rename as...
16365 (symbol_list_new, symbol_check_defined, symbol_make_alias)
16366 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16367 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
16368 (symbols_new, symbols_free, symbols_do): these.
16369
72a23c97
AD
163702002-04-07 Akim Demaille <akim@epita.fr>
16371
16372 Use lib/hash for the symbol table.
16373
16374 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
16375 EOF.
16376 * src/lex.c (lex): Set the `number' member of new terminals.
16377 * src/reader.c (bucket_check_defined, bucket_make_alias)
16378 (bucket_check_alias_consistence, bucket_translation): New.
16379 (reader, grammar_free, readgram, token_translations_init)
16380 (packsymbols): Adjust.
16381 (reader): Number the predefined tokens.
16382 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
16383 for predefined tokens.
16384 * src/symtab.h (bucket): Remove all the hash table related
16385 members.
16386 * src/symtab.c (symtab): Replace by...
16387 (bucket_table): this.
16388 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16389 (buckets_new, buckets_do): New.
16390
280a38c3
AD
163912002-04-07 Akim Demaille <akim@epita.fr>
16392
16393 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
16394 (start_symbol, max_user_token_number, semantic_parser)
16395 (error_token_number): Initialize.
16396 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
16397 Initialize.
16398 (reader): Don't.
16399 (errtoken, eoftoken, undeftoken, axiom): Extern.
16400
03b31c0c
AD
164012002-04-07 Akim Demaille <akim@epita.fr>
16402
16403 * src/gram.h (rule_s): prec and precsym are now pointers
16404 to the bucket giving the priority/associativity.
16405 Member `associativity' removed: useless.
16406 * src/reduce.c, src/conflicts.c: Adjust.
16407
8b3df748
AD
164082002-04-07 Akim Demaille <akim@epita.fr>
16409
16410 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
16411 Properly escape the symbols' TAG when outputting them.
16412
e601aa1d
AD
164132002-04-07 Akim Demaille <akim@epita.fr>
16414
16415 * src/lalr.h (LA): Is a bitsetv, not bitset*.
16416
b0299a2e
AD
164172002-04-07 Akim Demaille <akim@epita.fr>
16418
16419 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
16420 (LArule): this, which is an array to rule_t*.
16421 * src/print.c, src/conflicts.c: Adjust.
16422
d7e1f00c
AD
164232002-04-07 Akim Demaille <akim@epita.fr>
16424
16425 * src/gram.h (rule_t): Rename `number' as `user_number'.
16426 `number' is a new member.
16427 Adjust dependencies.
16428 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
16429
cc9305dd
AD
164302002-04-07 Akim Demaille <akim@epita.fr>
16431
16432 As a result of the previous patch, it is no longer needed
16433 to reorder ritem itself.
16434
16435 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
16436
b0940840
AD
164372002-04-07 Akim Demaille <akim@epita.fr>
16438
16439 Be sure never to walk through RITEMS, but use only data related to
16440 the rules themselves. RITEMS should be banished.
16441
16442 * src/output.c (output_token_translations): Rename as...
16443 (prepare_tokens): this.
16444 In addition to `translate', prepare the muscles `tname' and
16445 `toknum', which were handled by...
16446 (output_rule_data): this.
16447 Remove, and move the remainder of its outputs into...
16448 (prepare_rules): this new routines, which also merges content from
16449 (output_gram): this.
16450 (prepare_rules): Be sure never to walk through RITEMS.
16451 (output_stos): Rename as...
16452 (prepare_stos): this.
16453 (output): Always invoke prepare_states, after all, just don't use it
16454 in the output if you don't need it.
16455
643a5994
AD
164562002-04-07 Akim Demaille <akim@epita.fr>
16457
16458 * src/LR0.c (new_state): Display `nstates' as the name of the
16459 newly created state.
16460 Adjust to initialize first_state and last_state if needed.
16461 Be sure to distinguish the initial from the final state.
16462 (new_states): Create the itemset of the initial state, and use
16463 new_state.
16464 * src/closure.c (closure): Now that the initial state has its
16465 items properly set, there is no need for a special case when
16466 creating `ruleset'.
16467
16468 As a result, now the rule 0, reducing to $axiom, is visible in the
16469 outputs. Adjust the test suite.
16470
16471 * tests/conflicts.at (Solved SR Conflicts)
16472 (Unresolved SR Conflicts): Adjust.
16473 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
16474 * tests/conflicts.at (S/R in initial): New.
16475
b4c4ccc2
AD
164762002-04-07 Akim Demaille <akim@epita.fr>
16477
16478 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
16479 the RHS of the rules.
16480 * src/output.c (output_gram): Likewise.
16481
bba97eb2
AD
164822002-04-07 Akim Demaille <akim@epita.fr>
16483
16484 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
16485 bucket.
16486 Adjust all dependencies.
16487 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
16488 `number' of the buckets too.
16489 * src/gram.h: Include `symtab.h'.
16490 (associativity): Move to...
16491 * src/symtab.h: here.
16492 No longer include `gram.h'.
16493
c3b407f4
AD
164942002-04-07 Akim Demaille <akim@epita.fr>
16495
16496 * src/gram.h, src/gram.c (rules_rhs_length): New.
16497 (ritem_longest_rhs): Use it.
16498 * src/gram.h (rule_t): `number' is a new member.
16499 * src/reader.c (packgram): Set it.
16500 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
16501 the end of `rules', and count them out of `nrules'.
16502 (reduce_output, dump_grammar): Adjust.
16503 * src/print.c (print_grammar): It is no longer needed to check for
16504 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
16505 * tests/reduce.at (Reduced Automaton): New test.
16506
11652ab3
AD
165072002-04-07 Akim Demaille <akim@epita.fr>
16508
16509 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
16510 lacking `+ 1' to nrules, Bison reported as useless a token if it
16511 was used solely to set the precedence of the last rule...
16512
26b23c1a
AD
165132002-04-07 Akim Demaille <akim@epita.fr>
16514
16515 * data/bison.c++, data/bison.simple: Don't output the current file
16516 name in #line, to avoid useless diffs between two identical
16517 outputs under different names.
16518
18bcecb0
AD
165192002-04-07 Akim Demaille <akim@epita.fr>
16520
16521 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
16522 Normalize loops to using `< nrules + 1', not `<= nrules'.
16523
fa770c86
AD
165242002-04-07 Akim Demaille <akim@epita.fr>
16525
16526 * TODO: Update.
16527
d9b739c3
AD
165282002-04-07 Akim Demaille <akim@epita.fr>
16529
16530 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
16531 bucket.value as bucket.number.
16532
99013900
AD
165332002-04-07 Akim Demaille <akim@epita.fr>
16534
16535 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
16536 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16537 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
16538 RHS, instead of being an index in RITEMS.
16539
e966383b
PE
165402002-04-04 Paul Eggert <eggert@twinsun.com>
16541
16542 * doc/bison.texinfo: Update copyright date.
16543 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
16544 (Symbols): Warn about running Bison in one character set,
16545 but compiling and/or running in an incompatible one.
16546 Warn about character code 256, too.
16547
165482002-04-03 Paul Eggert <eggert@twinsun.com>
16549
16550 * src/bison.data (YYSTACK_ALLOC): Depend on whether
16551 YYERROR_VERBOSE is nonzero, not whether it is defined.
16552
16553 Merge changes from bison-1_29-branch.
c307773e 16554
8d6c48b9
PE
165552002-03-20 Paul Eggert <eggert@twinsun.com>
16556
16557 Merge fixes from Debian bison_1.34-1.diff.
16558
16559 * configure.in (AC_PREREQ): 2.53.
16560
e53c6322
AD
165612002-03-20 Akim Demaille <akim@epita.fr>
16562
16563 * src/conflicts.c (log_resolution): Argument `resolution' is const.
16564
9ffbeca7
PE
165652002-03-19 Paul Eggert <eggert@twinsun.com>
16566
21db0b2a
PE
16567 * src/bison.simple (YYCOPY): New macro.
16568 (YYSTACK_RELOCATE): Use it.
16569 Remove Type arg; no longer needed. All callers changed.
16570 (yymemcpy): Remove; no longer needed.
16571
9ffbeca7
PE
16572 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
16573 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16574
642cb8f8
AD
165752002-03-19 Akim Demaille <akim@epita.fr>
16576
16577 Test and fix the #line outputs.
16578
16579 * tests/atlocal.at (GCC): New.
16580 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 16581 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
16582 (Action synch line, Epilogue synch line): New tests.
16583 * src/reader.c (parse_union_decl): Define the muscle stype_line.
16584 * data/bison.simple, data/bison.c++: Use it.
16585
3c31a486
AD
165862002-03-19 Akim Demaille <akim@epita.fr>
16587
16588 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
16589 (Solved SR Conflicts, %expect not enough, %expect right)
16590 (%expect too much): Move to...
16591 * tests/conflicts.at: this new file.
16592
0d8bed56
AD
165932002-03-19 Akim Demaille <akim@epita.fr>
16594
16595 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16596 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
16597 that we can move to enums for instance.
16598 * src/output.c (token_definitions_output): Output a list of
16599 `token-name, token-number' instead of the #define.
16600 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
16601
9208d17f
AD
166022002-03-14 Akim Demaille <akim@epita.fr>
16603
16604 Use Gettext 0.11.1.
16605
af27eacb
RA
166062002-03-09 Robert Anisko <robert@lrde.epita.fr>
16607
16608 * data/bison.c++: Make the user able to add members to the generated
16609 parser by subclassing.
16610
9101a310
RA
166112002-03-05 Robert Anisko <robert@lrde.epita.fr>
16612
16613 * src/reader.c (read_additionnal_code): `c' should be an integer, not
16614 a character.
16615 Reported by Nicolas Tisserand and Nicolas Burrus.
16616
fff9bf0b
RA
166172002-03-04 Robert Anisko <robert@lrde.epita.fr>
16618
16619 * src/reader.c: Warn about lacking semi-colons, do not complain.
16620
64dba31e
RA
166212002-03-04 Robert Anisko <robert@lrde.epita.fr>
16622
16623 * data/bison.c++: Remove a debug line.
16624
374f5a14
RA
166252002-03-04 Robert Anisko <robert@lrde.epita.fr>
16626
16627 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
16628 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
16629 provide a default implementation.
16630
bfcf1f3a
AD
166312002-03-04 Akim Demaille <akim@epita.fr>
16632
16633 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
16634 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
16635 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
16636 * tests/semantic.at (Parsing Guards): Similarly.
16637 * src/reader.at (readgram): Complain if the last rule is not ended
16638 with a semi-colon.
16639
65ccf9fc
AD
166402002-03-04 Akim Demaille <akim@epita.fr>
16641
16642 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
16643 * src/closure.c: here.
16644 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
16645 RTC.
16646 * src/warshall.h, src/warshall.c: Remove.
16647 * tests/sets.at (Broken Closure): Adjust.
16648
d0039cbc
AD
166492002-03-04 Akim Demaille <akim@epita.fr>
16650
16651 * src/output.c (output_skeleton): tempdir is const.
16652 bytes_read is unused.
16653
345cea78
AD
166542002-03-04 Akim Demaille <akim@epita.fr>
16655
16656 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16657 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
16658 Update.
16659 From Michael Hayes.
16660
564801f7
AD
166612002-03-04 Akim Demaille <akim@epita.fr>
16662
16663 * src/closure.c (closure): `r' is unused.
16664
e5352bc7
AD
166652002-03-04 Akim Demaille <akim@epita.fr>
16666
16667 * tests/sets.at (Broken Closure): Add the ending `;'.
16668 * src/reader.at (readgram): Complain if a rule is not ended with a
16669 semi-colon.
16670
914feea9
AD
166712002-03-04 Akim Demaille <akim@epita.fr>
16672
16673 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
16674 (count_sr_conflicts): Use bitset_count.
16675 * src/reduce.c (inaccessable_symbols): Ditto.
16676 (bits_size): Remove.
16677 * src/warshall.h, src/warshall.c: Convert to bitsetv.
16678
f0250de6
AD
166792002-03-04 Akim Demaille <akim@epita.fr>
16680
16681 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
16682 * src/reduce.c: Remove the `bitset_zero's following the
16683 `bitset_create's, as now it is performed by the latter.
16684
ef017502
AD
166852002-03-04 Akim Demaille <akim@epita.fr>
16686
16687 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
16688 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
16689 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
16690 latest sources from Michael.
16691
76514394
AD
166922002-03-04 Akim Demaille <akim@epita.fr>
16693
16694 * src/output.c (output): Don't free the grammar.
16695 * src/reader.c (grammar_free): New.
16696 * src/main.c (main): Call it and don't free symtab here.
16697
55024580
AD
166982002-03-04 Akim Demaille <akim@epita.fr>
16699
16700 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
16701 before returning.
16702 Reported by Benoit Perrot.
16703
f9abaa2c
AD
167042002-03-04 Akim Demaille <akim@epita.fr>
16705
16706 Use bitset operations when possible, not loops over bits.
16707
16708 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
16709 bitset_or.
16710 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
16711 * src/reduce.c (useless_nonterminals): Formatting changes.
16712 * src/warshall.c (TC): Use bitset_or.
16713
0e721e75
AD
167142002-03-04 Akim Demaille <akim@epita.fr>
16715
16716 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
16717 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
16718 Ditto.
16719
0fb1ffb1
AD
167202002-03-04 Akim Demaille <akim@epita.fr>
16721
16722 * src/lalr.c (F): Now a bitset*.
16723 Adjust all dependencies.
16724
b86796bf
AD
167252002-03-04 Akim Demaille <akim@epita.fr>
16726
16727 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
16728 Adjust all dependencies.
16729
602bbf31
AD
167302002-03-04 Akim Demaille <akim@epita.fr>
16731
16732 * src/L0.c, src/LR0.h (nstates): Be size_t.
16733 Adjust comparisons (signed vs unsigned).
16734 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
16735 bitset*.
16736 Adjust all dependencies.
16737
d8a0245c
AD
167382002-03-04 Akim Demaille <akim@epita.fr>
16739
16740 * src/closure.c (firsts): Now, also a bitset.
16741 Adjust all dependencies.
16742 (varsetsize): Remove, now unused.
16743 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
16744
34ba9743
AD
167452002-03-04 Akim Demaille <akim@epita.fr>
16746
16747 * src/print.c: Convert to use bitset.h, not hand coded iterations
16748 over ints.
16749
ed86e78c
AD
167502002-03-04 Akim Demaille <akim@epita.fr>
16751
16752 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
16753
dfdb1797
AD
167542002-03-04 Akim Demaille <akim@epita.fr>
16755
16756 * src/closure.c (ruleset): Be a bitset.
16757 (rulesetsize): Remove.
16758
7086e707
AD
167592002-03-04 Akim Demaille <akim@epita.fr>
16760
16761 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16762 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
16763 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
16764 * src/closure.c (fderives): Be an array of bitsets.
16765
98254360
RA
167662002-02-28 Robert Anisko <robert@lrde.epita.fr>
16767
16768 * data/bison.c++: Merge the two generated headers. Insert a copyright
16769 notice in each output file.
16770
a75c057f
AD
167712002-02-28 Akim Demaille <akim@epita.fr>
16772
16773 * data/bison.c++: Copy the prologue of bison.simple to fetch
16774 useful M4 definitions, such as b4_header_guard.
16775
06b00abc
AD
167762002-02-25 Akim Demaille <akim@epita.fr>
16777
16778 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
16779 translator friendly scheme for the bgr
16780 copyright notice.
06b00abc 16781
70e7d534
AD
167822002-02-25 Akim Demaille <akim@epita.fr>
16783
16784 * src/output.c (header_output): Remove, now handled completely via
16785 M4.
16786
abe017f6
AD
167872002-02-25 Akim Demaille <akim@epita.fr>
16788
16789 * m4/m4.m4: New, from CVS Autoconf.
16790 * configure.in: Invoke it.
16791 * src/output.c (output_skeleton): Use its result instead of the
16792 hard coded name.
16793
381fb12e
AD
167942002-02-25 Akim Demaille <akim@epita.fr>
16795
16796 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
16797 Fileutils 4.1.5.
16798 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
16799 * src/output.c (output_skeleton): Use mkstemp to create a real
16800 temporary file.
16801 Move the filling of `skeleton' and its muscle to...
16802 (prepare): here.
16803 (output): Move the definition of the prologue muscle to...
16804 (prepare): here.
16805 * src/system.h (DEFAULT_TMPDIR): New.
16806
6f38107f
PE
168072002-02-14 Paul Eggert <eggert@twinsun.com>
16808
16809 Remove the support for C++ namespace cleanliness; it was
16810 causing more problems than it was curing, since it didn't work
16811 properly on some nonstandard C++ compilers. This can wait
16812 for a proper C++ parser.
16813
16814 * NEWS: Document this.
16815 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
16816 of C++, as it's treated like C now.
16817 * src/bison.simple (YYSTD): Remove.
16818 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
16819 Treat C++ just like Standard C instead of trying to support
16820 namespace cleanliness.
16821
80cce3da
AD
168222002-02-14 Akim Demaille <akim@epita.fr>
16823
16824 * tests/regression.at (else): Adjust to Andreas' change.
16825
842e8679
AD
168262002-02-14 Akim Demaille <akim@epita.fr>
16827
16828 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
16829
4bda3f10
AD
168302002-02-13 Andreas Schwab <schwab@suse.de>
16831
16832 * src/output.c (output_rule_data): Don't output NULL, it might
16833 not be defined yet.
16834
4162fa07 168352002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 16836
4162fa07
RA
16837 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
16838 (Copyright notice): Update.
b418ecd8 16839
bd16a5dc
AD
168402002-02-11 Akim Demaille <akim@epita.fr>
16841
16842 * tests/regression.at (%nonassoc and eof): Don't include
16843 nonportable headers.
16844
8d69a1a3
RA
168452002-02-08 Robert Anisko <robert@lrde.epita.fr>
16846
16847 * data/bison.c++: Correct error recovery. Make the user able to
16848 initialize the starting location.
16849
9b2d0677
AD
168502002-02-07 Akim Demaille <akim@epita.fr>
16851
16852 * tests/input.at: New.
16853
69e2658b
RA
168542002-02-07 Robert Anisko <robert@lrde.epita.fr>
16855
16856 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 16857 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
16858 directives around tables only needed for debugging.
16859
4aacc3a7
RA
168602002-02-07 Robert Anisko <robert@lrde.epita.fr>
16861
16862 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
16863 C++ parsers.
16864 (yy::b4_name::parse): Use print_.
16865
762a801e
RA
168662002-02-07 Robert Anisko <robert@lrde.epita.fr>
16867
16868 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
16869
4bb2bc3f
RA
168702002-02-07 Robert Anisko <robert@lrde.epita.fr>
16871
16872 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
16873 C++ parsers.
16874 (yy::b4_name::parse): Build verbose error messages, and use error_.
16875
6b45a3ca
RA
168762002-02-06 Robert Anisko <robert@lrde.epita.fr>
16877
16878 * data/bison.c++: Fix m4 quoting in comments.
16879
50997c6e
RA
168802002-02-06 Robert Anisko <robert@lrde.epita.fr>
16881
16882 * data/bison.c++: Adjust the parser code. Fix some muscles that were
16883 not expanded by m4.
16884
3f3eed27
AD
168852002-02-05 Akim Demaille <akim@epita.fr>
16886
16887 * data/bison.c++: Adjust to the M4 back end.
16888 More is certainly needed.
16889
be2a1a68
AD
168902002-02-05 Akim Demaille <akim@epita.fr>
16891
16892 Give a try to M4 as a back end.
16893
16894 * lib/readpipe.c: New, from wdiff.
16895 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
16896 BISON_HAIRY.
16897 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
16898 specific values. Now it is m4 that performs the lookup.
16899 * src/parse-skel.y: Remove.
16900 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
16901 * src/output.c (actions_output, guards_output)
16902 (token_definitions_output): No longer keeps track of the output
16903 line number, hence remove the second argument.
16904 (guards_output): Check against the guard member of a rule, not the
16905 action member.
16906 Adjust callers.
16907 (output_skeleton): Don't look for the skeleton location, let m4 do
16908 that.
16909 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
16910 file will be used.
16911 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
16912 (prepare): Given that for the time being changesyntax is not
16913 usable in M4, rename the muscles using `-' to `_'.
16914 Define `defines_flag', `output_parser_name' and `output_header_name'.
16915 * src/output.h (actions_output, guards_output)
16916 (token_definitions_output): Adjust prototypes.
16917 * src/scan-skel.l: Instead of scanning the skeletons, it now
16918 processes the output of m4: `__oline__' and `#output'.
16919 * data/bison.simple: Adjust to be used by M4(sugar).
16920 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
16921 to date.
16922 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
16923 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
16924 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
16925 shamelessly stolen from CVS Autoconf.
16926
beda758b
AD
169272002-02-05 Akim Demaille <akim@epita.fr>
16928
16929 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
16930 * configure.in: Check for the declarations of free and malloc.
16931 * src/muscle_tab.c: Adjust.
16932
5ece6d43
AD
169332002-02-05 Akim Demaille <akim@epita.fr>
16934
16935 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
16936 which have no values.
16937
5bb18f9a
AD
169382002-02-05 Akim Demaille <akim@epita.fr>
16939
16940 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
16941 * data/: here.
16942
894dd62e
PE
169432002-01-29 Paul Eggert <eggert@twinsun.com>
16944
16945 * src/bison.simple (YYSIZE_T): Do not define merely because
16946 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
16947 On some platforms, <alloca.h> does not declare YYSTD (size_t).
16948
82841af7
AD
169492002-01-27 Akim Demaille <akim@epita.fr>
16950
16951 Fix `%nonassoc and eof'.
16952
16953 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
16954 which were not properly copied! Replace
16955 memcpy (res->errs, src->errs, src->nerrs);
16956 with
16957 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
16958 !!!
16959 * tests/regression.at (%nonassoc and eof): Adjust to newest
16960 Autotest: `.' is not in the PATH.
16961
318b76e9
AD
169622002-01-27 Akim Demaille <akim@epita.fr>
16963
16964 * tests/sets.at (AT_EXTRACT_SETS): New.
16965 (Nullable): Use it.
16966 (Firsts): New.
16967
30d2f3d5
AD
169682002-01-26 Akim Demaille <akim@epita.fr>
16969
16970 * tests/actions.at, tests/calc.at, tests/headers.at,
16971 * tests/torture.at: Adjust to the newest Autotest which no longer
16972 forces `.' in the PATH.
16973
30f8c395
AD
169742002-01-25 Akim Demaille <akim@epita.fr>
16975
16976 * tests/regression.at (%nonassoc and eof): New.
16977 Suggested by Robert Anisko.
16978
29ae55f1
AD
169792002-01-24 Akim Demaille <akim@epita.fr>
16980
16981 Bison dumps core when trying to complain about broken input files.
16982 Reported by Cris van Pelt.
16983
16984 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
16985 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
16986 into...
16987 (Invalid inputs): Strengthen: exercise parse_percent_token.
16988
2b548aa6
RA
169892002-01-24 Robert Anisko <robert.anisko@epita.fr>
16990
16991 * src/Makefile.am: Add bison.c++.
16992 * src/bison.c++: New skeleton.
16993
bb0146c2
AD
169942002-01-21 Paolo Bonzini <bonzini@gnu.org>
16995
16996 * po/it.po: New.
16997
bec30531
AD
169982002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
16999
17000 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
17001
fc6edc45
MA
170022002-01-20 Marc Autret <marc@gnu.org>
17003
17004 * src/files.c (compute_output_file_names): Fix
17005
5e5d5415
MA
170062002-01-20 Marc Autret <marc@gnu.org>
17007
17008 * tests/output.at: New test.
17009 * src/files.c (compute_base_names): Don't map extensions when
17010 the YACC flag is set, use defaults.
17011 Reported by Evgeny Stambulchik.
17012
44ea3fbd
MA
170132002-01-20 Marc Autret <marc@gnu.org>
17014
ba0fe3c7
PE
17015 * src/system.h: Need to define __attribute__ away for non-GCC
17016 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
17017 Suggested by Albert Chin-A-Young.
17018
338963d1
TVH
170192002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
17020
17021 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
17022 canonical definition.
17023 * src/system.h: Use the canonical definition for PARAMS (avoids
17024 a conflict with the macro from lib/hash.h).
17025
c57b2479
AD
170262002-01-11 Akim Demaille <akim@epita.fr>
17027
17028 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 17029 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 17030
b85810ae
AD
170312002-01-09 Akim Demaille <akim@epita.fr>
17032
17033 * src/files.c, src/files.h (output_infix): New.
17034 (tab_extension): Remove.
17035 (compute_base_names): Compute the former, drop the latter.
17036 * src/output.c (prepare): Insert the muscles `output-infix', and
17037 `output-suffix'.
17038 * src/parse-skel.y (string, string.1): New.
17039 (section.header): Use it.
17040 (section.yacc): Remove.
17041 (prefix): Remove too.
17042 * src/scan-skel.l: Adjust.
17043 * src/bison.simple, src/bison.hairy: Adjust.
17044
cae60122
AD
170452002-01-09 Akim Demaille <akim@epita.fr>
17046
17047 * configure.in (WERROR_CFLAGS): Compute it.
17048 * src/Makefile.am (CFLAGS): Pass it.
17049 * tests/atlocal.in (CFLAGS): Idem.
17050 * src/files.c: Fix a few warnings.
17051 (get_extension_index): Remove, unused.
17052
ae404801
AD
170532002-01-08 Akim Demaille <akim@epita.fr>
17054
17055 * src/getargs.c (AS_FILE_NAME): New.
17056 (getargs): Use it to convert DOSish file names.
17057 * src/files.c (base_name): Rename as full_base_name to avoid
17058 clashes with `base_name ()'.
17059 (filename_split): New.
17060 (compute_base_names): N-th rewrite, using filename_split.
17061
22312b71
AD
170622002-01-08 Akim Demaille <akim@epita.fr>
17063
17064 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
17065 New, stolen from the Fileutils 4.1.
17066 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
17067 * configure.in: Check for the presence of memrchr, and of its
17068 prototype.
17069
a67cef01
TVH
170702002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
17071
17072 * lib/hash.h (__P): Added definition for this macro.
17073 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
17074 BUILT_SOURCES, to ensure they are generated first.
17075 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
17076 %error-verbose to allow bootstrapping with bison 1.30x.
17077
2b25d624
AD
170782002-01-06 Akim Demaille <akim@epita.fr>
17079
17080 * src/reader.c (parse_braces): Don't fetch the next char, the
17081 convention is to fetch on entry.
17082 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
17083 'switch' without a following semicolon.
17084 * tests/regression.at (braces parsing): New.
17085
3460813b
AD
170862002-01-06 Akim Demaille <akim@epita.fr>
17087
17088 Bison is dead wrong in its RR conflict reports.
17089
17090 * tests/torture.at (GNU Cim Grammar): New.
17091 * src/conflicts.c (count_rr_conflicts): Fix.
17092
73784c64
AD
170932002-01-06 Akim Demaille <akim@epita.fr>
17094
17095 Creating package.m4 from configure.ac causes too many problems.
17096
17097 * tests/Makefile.am (package.m4): Create it by hand,
17098 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
17099
25d81090
AD
171002002-01-06 Akim Demaille <akim@epita.fr>
17101
17102 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
17103 skeleton.h.
17104
a9b8959e
PE
171052002-01-04 Paul Eggert <eggert@twinsun.com>
17106
17107 * doc/bison.texinfo (Debugging):
17108 Remove YYSTDERR; it's no longer defined or used.
17109 Also, s/cstdio.h/cstdio/.
17110
25d81090
AD
171112002-01-03 Akim Demaille <akim@epita.fr>
17112
17113 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
17114
1109455c
AD
171152002-01-03 Akim Demaille <akim@epita.fr>
17116
17117 * src/parse-skel.y (process_skeleton): Don't bind the parser's
17118 tracing code to --trace, wait for a better --trace option, with
17119 args.
17120
7ea5e977
AD
171212002-01-03 Akim Demaille <akim@epita.fr>
17122
17123 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
17124 The ISO C++ standard is extremely clear about it: stderr is
17125 considered a macro, not a regular symbol (see table 94 `Header
17126 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
17127 Therefore std:: does not apply to it. It still does with fprintf.
17128 Also, s/cstdio.h/cstdio/.
17129
fab5b110
AD
171302002-01-03 Akim Demaille <akim@epita.fr>
17131
17132 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
17133 for non system headers.
17134
aed7fd9b
AD
171352002-01-02 Akim Demaille <akim@epita.fr>
17136
17137 Equip the skeleton chain with location tracking, runtime trace,
17138 pure parser and scanner.
17139
17140 * src/parse-skel.y: Request a pure parser, locations, and prefix
17141 renaming.
17142 (%union): Having several members with the same type does not help
17143 type mismatches, simplify.
17144 (YYPRINT, yyprint): New.
17145 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
17146 (skel_error): this.
17147 Handle locations.
17148 * src/scan-skel.l: Adjust to these changes.
17149 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
17150 (LOCATION_PRINT, skel_control_t): New.
17151
24fad99e
AD
171522001-12-30 Akim Demaille <akim@epita.fr>
17153
17154 * src/parse-skel.y: Get rid of the shift/reduce conflict:
17155 replace `gb' with BLANKS.
17156 * src/scan-skel.l: Adjust.
17157
a4b36db4
AD
171582001-12-30 Akim Demaille <akim@epita.fr>
17159
17160 * src/system.h: We don't need nor want bcopy.
17161 Throw away MS-DOS crap: we don't need getpid.
17162 * configure.in: We don't need strndup. It was even causing
17163 problems: because Flex includes the headers *before* us,
17164 _GNU_SOURCE is not defined by config.h, and therefore strndup was
17165 not visible.
17166 * lib/xstrndup.c: New.
17167 * src/scan-skel.l: Use it.
17168 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
17169 * src/parse-skel.y: Use %directives instead of #defines.
17170
1239777d
AD
171712001-12-30 Akim Demaille <akim@epita.fr>
17172
17173 * src/skeleton.h: New.
17174 * src/output.c (output_parser, output_master_parser): Remove, dead
17175 code.
17176 * src/output.h (get_lines_number, actions_output, guards_output)
17177 (token_definitions_output): Prototype them.
17178 * src/parse-skel.y: Add the license notice.
17179 Include output.h and skeleton.h.
17180 (process_skeleton): Returns void, and takes a single parameter.
17181 * src/scan-skel.l: Add the license notice.
17182 Include skeleton.h.
17183 Don't use %option yylineno: it seems that then Flex imagines
17184 REJECT has been used, and therefore it won't reallocate its
17185 buffers (which makes no other sense to me than a bug). It results
17186 in warnings for `unused: yy_flex_realloc'.
17187
9b3add5b
RA
171882001-12-30 Robert Anisko <robert.anisko@epita.fr>
17189
17190 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17191 (MUSCLE_INSERT_PREFIX): ...to there.
17192 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17193 (MUSCLE_INSERT_PREFIX): Move from here...
17194
17195 * src/bison.hairy: Add a section directive. Put braces around muscle
17196 names. This parser skeleton is still broken, but Bison should not
17197 choke on a bad muscle 'syntax'.
17198 * src/bison.simple: Add a section directive. Put braces around muscle
17199 names.
17200
17201 * src/files.h (strsuffix, stringappend): Add declarations.
17202 (tab_extension): Add declaration.
17203 (short_base_name): Add declaration.
17204
17205 * src/files.c (strsuffix, stringappend): No longer static. These
17206 functions are used in the skeleton parser.
17207 (tab_extension): New.
17208 (compute_base_names): Use the computations done in this function
fab5b110 17209 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
17210 names.
17211 (short_base_name): No longer static.
17212
17213 * src/output.c (output_skeleton): New.
17214 (output): Disable call to output_master_parser, and give a try to
17215 a new skeleton handling system.
17216 (guards_output, actions_output): No longer static.
17217 (token_definitions_output, get_lines_number): No longer static.
17218
17219 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
17220
fab5b110 17221 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
17222 parse-skel.y.
17223
17224 * src/parse-skel.y: New file.
17225 * src/scan-skel.l: New file.
17226
b5b61c61
AD
172272001-12-29 Akim Demaille <akim@epita.fr>
17228
17229 %name-prefix is broken.
17230
17231 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
17232 Adjust all dependencies.
17233 * tests/headers.at (export YYLTYPE): Strengthen this test: use
17234 %name-prefix.
17235
17236 Renaming yylval but not yylloc is not consistent. Now we do.
17237
17238 * src/bison.simple: Prefix yylloc if used.
17239 * doc/bison.texinfo (Decl Summary): Document that.
17240
8c9a50be
AD
172412001-12-29 Akim Demaille <akim@epita.fr>
17242
17243 * doc/bison.texinfo: Promote `%long-directive' over
17244 `%long_directive'.
17245 Remove all references to fixed-output-files, yacc is enough.
17246
d99361e6
AD
172472001-12-29 Akim Demaille <akim@epita.fr>
17248
17249 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
17250 user prologue. These are defaults.
17251 * tests/actions.at (Mid-rule actions): Make sure the user can
17252 define YYDEBUG and YYERROR_VERBOSE.
17253
b9cecb91
AD
172542001-12-29 Akim Demaille <akim@epita.fr>
17255
17256 * src/output.c (header_output): Don't forget to export YYLTYPE and
17257 yylloc.
17258 * tests/headers.at (export YYLTYPE): New, make sure it does.
17259 * tests/regression.at (%union and --defines, Invalid CPP headers):
17260 Move to...
17261 * tests/headers.at: here.
17262
aea13e97
AD
172632001-12-29 Akim Demaille <akim@epita.fr>
17264
17265 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
17266
931394cb
AD
172672001-12-29 Akim Demaille <akim@epita.fr>
17268
17269 * tests/actions.at (Mid-rule actions): Output on a single line
17270 instead of several.
17271
704a47c4
AD
172722001-12-29 Akim Demaille <akim@epita.fr>
17273
17274 * doc/bison.texinfo: Formatting changes.
17275
091e20bb
AD
172762001-12-29 Akim Demaille <akim@epita.fr>
17277
17278 Don't store the token defs in a muscle, just be ready to output it
17279 on command. Now possible via `symbols'. Fixes a memory leak.
17280
17281 * src/output.c (token_definitions_output): New.
17282 (output_parser, header_output): Use it.
17283 * src/reader.c (symbols_save): Remove.
17284
cce71710
AD
172852001-12-29 Akim Demaille <akim@epita.fr>
17286
17287 * src/bison.simple: Do not provide a default for YYSTYPE and
17288 YYLTYPE before the user's prologue. Otherwise it's hardly... a
17289 default.
17290
82c035a8
AD
172912001-12-29 Akim Demaille <akim@epita.fr>
17292
17293 Mid-rule actions are simply... ignored!
17294
17295 * src/reader.c (readgram): Be sure to attach mid-rule actions to
17296 the empty-rule associated to the dummy symbol, not to the host
17297 rule.
17298 * tests/actions.at (Mid-rule actions): New.
17299
8419d367
AD
173002001-12-29 Akim Demaille <akim@epita.fr>
17301
17302 Memory leak.
17303
17304 * src/reader.c (reader): Free grammar.
17305
375d5806
AD
173062001-12-29 Akim Demaille <akim@epita.fr>
17307
17308 Memory leak.
17309
17310 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
17311 since it allocates it for each state, although only one is needed.
17312 (allocate_storage): Do it here.
17313
f51cb8ff
AD
173142001-12-29 Akim Demaille <akim@epita.fr>
17315
17316 * src/options.h, src/options.c (create_long_option_table): Rename
17317 as...
17318 (long_option_table_new): this, with a clearer prototype.
17319 (percent_table): Remove, unused,
17320 * src/getargs.c (getargs): Adjust.
17321
29e88316
AD
173222001-12-29 Akim Demaille <akim@epita.fr>
17323
17324 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
17325 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
17326 as states.
17327
b9f71f19
AD
173282001-12-29 Akim Demaille <akim@epita.fr>
17329
17330 * src/lalr.c (build_relations): Rename `states' as `states1'.
17331 Sorry, I don't understand exactly what it is, no better name...
17332
1a2b5d37
AD
173332001-12-29 Akim Demaille <akim@epita.fr>
17334
17335 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
17336 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
17337 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
17338 as rules.
17339
1cca533e
AD
173402001-12-29 Akim Demaille <akim@epita.fr>
17341
17342 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
17343 ago.
17344
c03ae966
AD
173452001-12-29 Akim Demaille <akim@epita.fr>
17346
17347 * src/reader.c, src/reader.h (user_toknums): Remove.
17348 Adjust all users to use symbols[i]->user_token_number.
17349
5a670b1e
AD
173502001-12-29 Akim Demaille <akim@epita.fr>
17351
17352 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
17353 Adjust all users to use symbols[i]->prec or ->assoc.
17354
ad949da9
AD
173552001-12-29 Akim Demaille <akim@epita.fr>
17356
17357 * src/reader.c, src/reader.h (tags): Remove.
17358 Adjust all users to use symbols[i]->tag.
17359
0e78e603
AD
173602001-12-29 Akim Demaille <akim@epita.fr>
17361
17362 * src/gram.h, src/gram.c (symbols): New, similar to state_table
17363 and rule_table.
17364 * src/reader.c (packsymbols): Fill this table.
17365 Drop sprec.
17366 * src/conflicts.c (resolve_sr_conflict): Adjust.
17367 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
17368 single table.
17369 Use symbols[i]->tag instead of tags[i].
17370
213e640e
AD
173712001-12-29 Akim Demaille <akim@epita.fr>
17372
17373 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
17374 In addition, put a comment in there, to replace...
17375 * tests/regression.at (%union and C comments): Remove.
17376
e7b8bef1
AD
173772001-12-29 Akim Demaille <akim@epita.fr>
17378
17379 * tests/regression.at (Web2c Actions): Blindly move the actual
17380 output as expected output. The contents *seem* right to me, but I
17381 can't pretend reading perfectly parser tables... Nonetheless, all
17382 the other tests pass correctly, the table look OK, even though the
17383 presence of `$axiom' is to be noted: AFAICS it is useless (but
17384 harmless).
17385
b68e7744
AD
173862001-12-29 Akim Demaille <akim@epita.fr>
17387
17388 * src/reader.c (readgram): Don't add the rule 0 if there were no
17389 rules read. In other words, add it _after_ having performed
17390 grammar sanity checks.
17391 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
17392
78d5bae9
AD
173932001-12-29 Akim Demaille <akim@epita.fr>
17394
17395 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
17396 visible, and some states have now a different number.
17397
ff442794
AD
173982001-12-29 Akim Demaille <akim@epita.fr>
17399
17400 * src/reader.c (readgram): Bind the initial rule's lineno to that
17401 of the first rule.
17402 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
17403 (Solved SR Conflicts): Adjust rule 0's line number.
17404
610ab194
AD
174052001-12-29 Akim Demaille <akim@epita.fr>
17406
17407 Fix the `GAWK Grammar' failure.
17408
17409 * src/LR0.c (final_state): Initialize to -1 so that we do compute
17410 the reductions of the first state which was mistakenly confused
17411 with the final state because precisely final_state was initialized
17412 to 0.
17413 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
17414 now noticed by Bison.
17415 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
17416 have a reduction on $default.
17417
29d29c8f
AD
174182001-12-29 Akim Demaille <akim@epita.fr>
17419
17420 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
17421 rule line numbers.
17422 * src/closure.c (print_closure): Likewise.
17423 * src/derives.c (print_derives): Likewise.
17424 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
17425 now.
17426
7c6b64d0
AD
174272001-12-29 Akim Demaille <akim@epita.fr>
17428
17429 * src/lalr.c (lookaheads_print): New.
17430 (lalr): Call it when --trace-flag.
17431 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
17432 are dumped.
17433
3d4daee3
AD
174342001-12-29 Akim Demaille <akim@epita.fr>
17435
17436 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
17437 when walking through ritem, even via rule->rhs.
17438 * src/reduce.c (dump_grammar, useful_production, reduce_output)
17439 (useful_production, useless_nonterminals): Likewise.
17440 (reduce_grammar_tables): Likewise, plus update nritems.
17441 * src/nullable.c (set_nullable): Likewise.
17442 * src/lalr.c (build_relations): Likewise.
17443 * tests/sets.at (Nullable): Adjust.
17444 Fortunately, now, the $axiom is no longer nullable.
17445
9e7f6bbd
AD
174462001-12-29 Akim Demaille <akim@epita.fr>
17447
17448 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
17449 the 0-sentinel.
17450 * src/gram.c (ritem_longest_rhs): Likewise.
17451 * src/reduce.c (nonterminals_reduce): Likewise.
17452 * src/print_graph.c (print_graph): Likewise.
17453 * src/output.c (output_rule_data): Likewise.
17454 * src/nullable.c (set_nullable): Likewise.
17455
255ef638
AD
174562001-12-29 Akim Demaille <akim@epita.fr>
17457
17458 * src/output.c: Comment changes.
17459
0d8a7363
AD
174602001-12-27 Paul Eggert <eggert@twinsun.com>
17461
17462 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
17463 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
17464 Sparc, as they were causing more porting problems than the
17465 (minor) performance improvement was worth.
17466
17467 Also, catch up with 1.31's YYSTD.
17468
3db472b9
AD
174692001-12-27 Akim Demaille <akim@epita.fr>
17470
17471 * src/output.c (output_gram): Rely on nritems, not the
17472 0-sentinel. See below.
17473 Use -1 as separator, not 0.
17474 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
17475 Rely on -1 as separator in yyrhs, instead of 0.
17476 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
17477 twice `Now at end of input', therefore there are two lines less to
17478 expect.
17479
b365aa05
AD
174802001-12-27 Akim Demaille <akim@epita.fr>
17481
17482 * tests/regression.at (Unresolved SR Conflicts):
17483 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
17484 below.
17485
30171f79
AD
174862001-12-27 Akim Demaille <akim@epita.fr>
17487
17488 * src/LR0.c (new_state): Recognize the final state by the fact it
17489 is reached by eoftoken.
17490 (insert_start_shifting_state, insert_eof_shifting_state)
17491 (insert_accepting_state, augment_automaton): Remove, since now
17492 these states are automatically computed from the initial state.
17493 (generate_states): Adjust.
17494 * src/print.c: When reporting a rule number to the user, substract
17495 1, so that the axiom rule is rule 0, and the first user rule is 1.
17496 * src/reduce.c: Likewise.
17497 * src/print_graph.c (print_core): For the time being, just as for
17498 the report, depend upon --trace-flags to dump the full set of
17499 items.
17500 * src/reader.c (readgram): Once the grammar read, insert the rule
17501 0: `$axiom: START-SYMBOL $'.
17502 * tests/set.at: Adjust: rule 0 is now displayed, and since the
17503 number of the states has changed (the final state is no longer
17504 necessarily the last), catch up.
17505
75142d45
AD
175062001-12-27 Akim Demaille <akim@epita.fr>
17507
17508 Try to make the use of the eoftoken valid. Given that its value
17509 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
17510 is used instead of > 0 where appropriate, (ii), depend upon nritems
17511 instead of the 0-sentinel.
17512
17513 * src/gram.h, src/gram.c (nritems): New.
17514 Expected to be duplication of nitems, but for the time being...
17515 * src/reader.c (packgram): Assert nritems and nitems are equal.
17516 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
17517 * src/closure.c (print_closure, print_fderives): Likewise.
17518 * src/gram.c (ritem_print): Likewise.
17519 * src/print.c (print_core, print_grammar): Likewise.
17520 * src/print_graph.c: Likewise.
17521
b7c49edf
AD
175222001-12-27 Akim Demaille <akim@epita.fr>
17523
17524 * src/main.c (main): If there are complains after grammar
17525 reductions, then output the report anyway if requested, then die.
17526 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
17527 * src/reader.c (eoftoken): New.
17528 (parse_token_decl): If the token being defined has value `0', it
17529 is the eoftoken.
17530 (packsymbols): No longer hack `tags' to insert `$' by hand.
17531 Be sure to preserve the value of the eoftoken.
17532 (reader): Make sure eoftoken is defined.
17533 Initialize nsyms to 0: now eoftoken is created just like the others.
17534 * src/print.c (print_grammar): Don't special case the eof token.
17535 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
17536 lie anyway, albeit pleasant.
17537 * tests/calc.at: Exercise error messages with eoftoken.
17538 Change the grammar so that empty input is invalid.
17539 Adjust expectations.
17540 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
17541
ec2da99f
AD
175422001-12-27 Akim Demaille <akim@epita.fr>
17543
17544 * configure.in: Check the protos of strchr ans strspn.
17545 Replace strchr if needed.
17546 * src/system.h: Provide the protos of strchr, strspn and memchr if
17547 missing.
17548 * lib/strchr.c: New.
17549 * src/reader.c (symbols_save): Use strchr.
17550
8adfa272
AD
175512001-12-27 Akim Demaille <akim@epita.fr>
17552
17553 * src/print.c, src/print_graph.c (escape): New.
17554 Use it to quote the TAGS outputs.
17555 * src/print_graph.c (print_state): Now errors are in red, and
17556 reductions in green.
17557 Prefer high to wide: output the state number on a line of its own.
17558
80dac38c
AD
175592001-12-27 Akim Demaille <akim@epita.fr>
17560
17561 * src/state.h, src/state.c (reductions_new): New.
17562 * src/LR0.c (set_state_table): Let all the states have a
17563 `reductions', even if reduced to 0.
17564 (save_reductions): Adjust.
17565 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
17566 * src/print.c (print_reductions, print_actions): Adjust.
17567 * src/output.c (action_row): Adjust.
17568
2cec70b9
AD
175692001-12-27 Akim Demaille <akim@epita.fr>
17570
17571 * src/state.h, src/state.c (errs_new, errs_dup): New.
17572 * src/LR0.c (set_state_table): Let all the states have an errs,
17573 even if reduced to 0.
17574 * src/print.c (print_errs, print_reductions): Adjust.
17575 * src/output.c (output_actions, action_row): Adjust.
17576 * src/conflicts.c (resolve_sr_conflict): Adjust.
17577
13ca549a
AD
175782001-12-27 Akim Demaille <akim@epita.fr>
17579
17580 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
17581
5092aba5
AD
175822001-12-27 Akim Demaille <akim@epita.fr>
17583
17584 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
17585 * src/print.c: here.
17586 (lookaheadset, shiftset): New, used as additional storage by
17587 print_reductions.
17588 (print_results): Adjust.
17589 (print_shifts, print_gotos, print_errs): New, extracted from...
17590 (print_actions): here.
17591 * src/print_graph.c (print_actions): Remove dead code.
17592
11e2beca
AD
175932001-12-27 Akim Demaille <akim@epita.fr>
17594
17595 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
17596 `$n' and `@n'.
17597
dac3c910
AD
175982001-12-27 Akim Demaille <akim@epita.fr>
17599
17600 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
17601 (build_relations): Adjust.
17602
d0b0fefa
AD
176032001-12-27 Akim Demaille <akim@epita.fr>
17604
17605 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
17606 duplication.
17607
adc8c848
AD
176082001-12-27 Akim Demaille <akim@epita.fr>
17609
17610 * src/reader.c (packgram): Catch nitems overflows.
17611
14d293ac
AD
176122001-12-27 Akim Demaille <akim@epita.fr>
17613
17614 * src/files.c, src/files.h (guard_obstack): Remove.
17615 * src/output.c (output): Adjust.
17616 * src/reader.c (parse_braces): New, factoring...
17617 (copy_action, copy_guard): these two which are renamed as...
17618 (parse_action, parse_guard): these.
17619 As a voluntary consequence, using braces around guards is now
17620 mandatory.
17621
f499b062
AD
176222001-12-27 Akim Demaille <akim@epita.fr>
17623
17624 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
17625 * src/reader.c (symbol_list): `guard' and `guard_line' are new
17626 members.
17627 (symbol_list_new): Adjust.
17628 (copy_action): action_line is the first line, not the last.
17629 (copy_guard): Just as for actions, store the `action' only, not
17630 the switch/case/break flesh.
17631 Don't parse the user action that might follow the guard, let...
17632 (readgram): do it, i.e., now, there can be an action after a
17633 guard.
17634 In other words the guard is just explicitly optional.
17635 (packgram): Adjust.
17636 * src/output.c (guards_output): New.
17637 (output_parser): Call it when needed.
17638 (output): Also free the guard and attrs obstacks.
17639 * src/files.c, src/files.h (obstack_save): Remove.
17640 (output_files): Remove.
17641 As a result, if one needs the former `.act' file, using an
17642 appropriate skeleton which requires actions and guards is now
17643 required.
17644 * src/main.c (main): Adjust.
17645 * tests/semantic.at: New.
17646 * tests/regression.at: Use `input.y' as input file name.
17647 Avoid 8+3 problems by requiring input.c when the test needs the
17648 parser.
17649
d945f5cd
AD
176502001-12-27 Akim Demaille <akim@epita.fr>
17651
17652 * src/reader.c (symbol_list_new): Be sure to initialize all the
17653 fields.
17654
d200e455
AD
176552001-12-27 Akim Demaille <akim@epita.fr>
17656
17657 All the hacks using a final pseudo state are now useless.
17658
17659 * src/LR0.c (set_state_table): state_table holds exactly nstates.
17660 * src/lalr.c (nLA): New.
17661 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
17662 instead of lookaheadsp from the pseudo state (nstate + 1).
17663
f9507c28
AD
176642001-12-27 Akim Demaille <akim@epita.fr>
17665
17666 * src/output.c (action_row, token_actions): Use a state_t instead
17667 of a integer, and nlookaheads instead of the following state's
17668 lookaheadsp.
17669
065fbd27
AD
176702001-12-27 Akim Demaille <akim@epita.fr>
17671
17672 * src/conflicts.c (log_resolution, flush_shift)
17673 (resolve_sr_conflict, set_conflicts, solve_conflicts)
17674 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
17675 (conflicts_print, print_reductions): Use a state_t instead of an
17676 integer when referring to a state.
17677 As much as possible, depend upon nlookaheads, instead of the
17678 `lookaheadsp' member of the following state (since lookaheads of
17679 successive states are successive, the difference between state n + 1
17680 and n served as the number of lookaheads for state n).
17681 * src/lalr.c (add_lookback_edge): Likewise.
17682 * src/print.c (print_core, print_actions, print_state)
17683 (print_results): Likewise.
17684 * src/print_graph.c (print_core, print_actions, print_state)
17685 (print_graph): Likewise.
17686 * src/conflicts.h: Adjust.
17687
1b177bd7
AD
176882001-12-27 Akim Demaille <akim@epita.fr>
17689
17690 * src/bison.hairy: Formatting/comment changes.
17691 ANSIfy.
17692 Remove `register' indications.
17693 Add plenty of `static'.
17694
7742ddeb
AD
176952001-12-27 Akim Demaille <akim@epita.fr>
17696
17697 * src/output.c (prepare): Drop the muscle `ntbase' which
17698 duplicates ntokens.
17699 * src/bison.simple: Formatting/comment changes.
17700 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
17701 is an undocumented synonym.
17702
1fa14068
AD
177032001-12-22 Akim Demaille <akim@epita.fr>
17704
17705 * src/output.c (output_table_data): Change the prototype to use
17706 `int' for array ranges: some invocations do pass an int, not a
17707 short.
17708 Reported by Wayne Green.
17709
b9752825
AD
177102001-12-22 Akim Demaille <akim@epita.fr>
17711
17712 Some actions of web2c.y are improperly triggered.
17713 Reported by Mike Castle.
17714
17715 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
17716 * tests/regression.at (Web2c): Rename as...
17717 (Web2c Report): this.
17718 (Web2c Actions): New.
17719
776209d6
AD
177202001-12-22 Akim Demaille <akim@epita.fr>
17721
17722 Reductions in web2c.y are improperly reported.
17723 Reported by Mike Castle.
17724
17725 * src/conflicts.c (print_reductions): Fix.
17726 * tests/regression.at (Web2c): New.
17727
275fc3ad
AD
177282001-12-18 Akim Demaille <akim@epita.fr>
17729
17730 Some host fail on `assert (!"foo")', which expands to
17731 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
17732 Reported by Nelson Beebee.
17733
17734 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
17735 `#define it_succeeded 0' and `assert (it_succeeded)'.
17736
897668ee
MA
177372001-12-17 Marc Autret <autret_m@epita.fr>
17738
17739 * src/bison.simple: Don't hard code the skeleton line and filename.
17740 * src/output.c (output_parser): Rename 'line' as 'output_line'.
17741 New line counter 'skeleton_line' (skeleton-line muscle).
17742
ab3399e0
PE
177432001-12-17 Paul Eggert <eggert@twinsun.com>
17744
17745 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
17746 YYDEBUG must be defined to a nonzero value.
17747
17748 * src/bison.simple (yytname): Do not assume that the user defines
17749 YYDEBUG to a properly parenthesized expression.
17750
3877f72b
AD
177512001-12-17 Akim Demaille <akim@epita.fr>
17752
17753 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
17754 nlookaheads is a new member.
17755 Adjust all users.
17756 * src/lalr.h (nlookaheads): Remove this orphan declaration.
17757 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
17758 state.
776209d6 17759
331dbc1b
AD
177602001-12-17 Akim Demaille <akim@epita.fr>
17761
17762 * src/files.h, src/files.c (open_files, close_files): Remove.
17763 * src/main.c (main): Don't open/close files, nor invoke lex_free,
17764 let...
17765 * src/reader.c (reader): Do it.
776209d6 17766
be750e4c
AD
177672001-12-17 Akim Demaille <akim@epita.fr>
17768
17769 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 17770
709ae8c6
AD
177712001-12-17 Akim Demaille <akim@epita.fr>
17772
17773 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
17774 (flush_reduce): New.
17775 (resolve_sr_conflict): Adjust.
776209d6 17776
f87685c3
AD
177772001-12-17 Akim Demaille <akim@epita.fr>
17778
17779 * src/output.c (output_obstack): Be static and rename as...
17780 (format_obstack): this, to avoid any confusion with files.c's
17781 output_obstack.
17782 * src/reader.h (muscle_obstack): Move to...
17783 * src/output.h: here, since it's defined in output.c.
17784
837491d8
AD
177852001-12-17 Akim Demaille <akim@epita.fr>
17786
17787 * src/output.c (action_row, save_column, default_goto)
17788 (sort_actions, matching_state, pack_vector): Better variable
17789 locality.
17790
796d61fb
AD
177912001-12-17 Akim Demaille <akim@epita.fr>
17792
17793 * src/output.c: Various formatting changes.
776209d6 17794
64d15509
AD
177952001-12-17 Akim Demaille <akim@epita.fr>
17796
17797 * src/files.c (output_files): Free the output_obstack.
17798 * src/main.c (main): Call print and print_graph conditionally.
17799 * src/print.c (print): Work unconditionally.
17800 * src/print_graph.c (print_graph): Work unconditionally.
17801 * src/conflicts.c (log_resolution): Output only if verbose_flag.
17802
fbc8ecb7
MA
178032001-12-16 Marc Autret <autret_m@epita.fr>
17804
17805 * src/output.c (actions_output): Fix. When we use %no-lines,
17806 there is one less line per action.
17807
f0440388
MA
178082001-12-16 Marc Autret <autret_m@epita.fr>
17809
17810 * src/bison.simple: Remove a useless #line directive.
17811 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
17812 * src/output.c (get_lines_number): New.
776209d6 17813 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
17814 output muscles.
17815 Fix line numbering.
17816 (actions_output): Computes the number of lines taken by actions.
17817 (output_master_parser): Insert new skeleton which is the name of
17818 the output parser file name.
17819
a79986b8
MA
178202001-12-15 Marc Autret <autret_m@epita.fr>
17821
17822 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
17823
4ec8e00f
MA
178242001-12-15 Marc Autret <autret_m@epita.fr>
17825
17826 * src/output.c (output_gram): Keep track of the hairy one.
17827
1a4648ff
AD
178282001-12-15 Akim Demaille <akim@epita.fr>
17829
17830 Make `make distcheck' work.
17831
17832 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
17833 system.h which uses libgettext.h.
17834
9c2c67e6
AD
178352001-12-15 Akim Demaille <akim@epita.fr>
17836
17837 * src/nullable.c (set_nullable): Useless rules must be skipped,
17838 otherwise, since we range over their symbols, we might look at a
17839 nonterminal which no longer ``exists'', i.e., it is not counted in
17840 `nvars', hence we overflow our arrays.
17841
93ede233
AD
178422001-12-15 Akim Demaille <akim@epita.fr>
17843
17844 The header can also be produced directly, without any obstack!
17845 Yahoo!
17846
17847 * src/files.c, src/files.h (defines_obstack): Remove.
17848 (compute_header_macro): Global.
17849 (defines_obstack_save): Remove.
17850 * src/reader.c (parse_union_decl): No longer output to
17851 defines_obstack: its content can be found in the `stype' muscle
17852 anyway.
17853 (output_token_translations): Merge into...
17854 (symbols_output): this.
17855 Rename as...
17856 (symbols_save): this.
17857 (reader): Adjust.
17858 * src/output.c (header_output): New.
17859 (output): Call it.
17860
2666f928
AD
178612001-12-15 Akim Demaille <akim@epita.fr>
17862
17863 * src/reader.c (parse_union_decl): Instead of handling two obstack
17864 simultaneously, use one to define the `stype' muscle, and use the
17865 value of the latter to fill defines_obstack.
17866 (copy_comment): Remove.
17867 (copy_comment2): Work for a single obstack.
17868 Rename as...
17869 (copy_comment): this.
17870
428046f8
AD
178712001-12-15 Akim Demaille <akim@epita.fr>
17872
17873 * src/lex.c, src/lex.h (xgetc): No longer static.
17874 * src/reader.c (parse_union_decl): Revamp.
17875
ea52d706
AD
178762001-12-15 Akim Demaille <akim@epita.fr>
17877
17878 Still making progress in separating Bison into (i) input, (ii)
17879 process, (iii) output: now we can directly output the parser file
17880 without using table_obstack at all.
17881
17882 * src/files.c, src/files.h (table_obstack): Bye bye.
17883 (parser_file_name): New.
17884 * src/files.c (compute_output_file_names): Compute it.
17885 * src/output.c (actions_output, output_parser)
17886 (output_master_parser): To a file instead of an obstack.
17887
3f96f4dc
AD
178882001-12-15 Akim Demaille <akim@epita.fr>
17889
17890 Attach actions to rules, instead of pre-outputting them to
17891 actions_obstack.
17892
17893 * src/gram.h (rule_t): action and action_line are new members.
17894 * src/reader.c (symbol_list): Likewise.
17895 (copy_action): Save the actions within the rule.
17896 (packgram): Save them in rule_table.
17897 * src/output.c (actions_output): New.
17898 (output_parser): Use it on `%%actions'.
17899 (output_rule_data): Don't free rule_table.
17900 (output): Do it.
17901 (prepare): Don't save the `action' muscle.
17902 * src/bison.simple: s/%%action/%%actions/.
17903
51576fb3
AD
179042001-12-15 Akim Demaille <akim@epita.fr>
17905
17906 * src/reader.c (copy_action): When --yacc, don't append a `;'
17907 to the user action: let it fail if lacking.
dee049eb 17908 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 17909
2648a72d
AD
179102001-12-14 Akim Demaille <akim@epita.fr>
17911
17912 * src/lex.c (literalchar): Simply return the char you decoded, non
17913 longer mess around with obstacks and int pointers.
17914 Adjust all callers.
17915
92790e5b
AD
179162001-12-14 Akim Demaille <akim@epita.fr>
17917
17918 * src/lex.c (literalchar): Don't escape the special characters,
17919 just decode them, and keep them as char (before, eol was output as
17920 the 2 char string `\n' etc.).
17921 * src/output.c (output_rule_data): Use quotearg to output the
17922 token strings.
17923
927c1557
PE
179242001-12-13 Paul Eggert <eggert@twinsun.com>
17925
17926 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
17927 Do not infringe on the global user namespace when using C++.
17928 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
17929 All uses of `fprintf' and `stderr' changed.
17930
17931 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
17932
ed8e1f68
AD
179332001-12-13 Akim Demaille <akim@epita.fr>
17934
17935 The computation of nullable is broken: it doesn't handle empty
17936 RHS's properly.
17937
17938 * tests/torture.at (GNU AWK Grammar): New.
17939 * tests/sets.at (Nullable): New.
17940 * src/nullable.c (set_nullable): Instead of blindly looping over
17941 `ritems', loop over the rules, and then over their rhs's.
17942
17943 Work around Autotest bugs.
17944
17945 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
17946 frame, because Autotest understand lines starting with a `+' as
17947 traces from the shell. Then, they are not processed properly.
17948 Admittedly an Autotest bug, but we don't have time to wait for
17949 Autotest to catch up.
17950 * tests/regression.at (Broken Closure): Adjust to the new table
17951 frames.
17952 Move to...
17953 * tests/sets.at: here.
17954
cb581495
AD
179552001-12-13 Akim Demaille <akim@epita.fr>
17956
17957 * src/closure.c (closure): Use nrules instead of playing tricks
17958 with BITS_PER_WORD.
17959
2e729273
AD
179602001-12-13 Akim Demaille <akim@epita.fr>
17961
17962 * src/print.c (print_actions): Output the handling of `$' as the
17963 traces do: shifting the token EOF. Before EOF was treated as a
17964 nonterminal.
17965 * tests/regression.at: Adjust some tests.
17966 * src/print_graph.c (print_core): Complete the set of items via
17967 closure. The next-to-final and final states are still unsatisfying,
17968 but that's to be addressed elsewhere.
17969 No longer output the rule numbers, but do output the state number.
17970 A single loop for the shifts + gotos is enough, but picked a
17971 distinct color for each.
17972 (print_graph): Initialize and finalize closure.
17973
107f7dfb
AD
179742001-12-13 Akim Demaille <akim@epita.fr>
17975
17976 * src/reader.c (readgram): Remove dead code, an strip useless
17977 braces.
17978 (get_type): Remove, unused.
17979
9b53a24f
AD
179802001-12-12 Akim Demaille <akim@epita.fr>
17981
17982 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
17983 on that of lib/error.c.
17984
dbfb6dcd
AD
179852001-12-12 Akim Demaille <akim@epita.fr>
17986
17987 Some hosts don't like `/' in includes.
17988
17989 * src/system.h: Include libgettext.h without qualifying the path.
17990 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
17991 $(top_srcdir).
17992
c25fb648
MA
179932001-12-11 Marc Autret <autret_m@epita.fr>
17994
17995 * src/output.c (output_parser): Remove useless muscle.
17996
710ddc4f
MA
179972001-12-11 Marc Autret <autret_m@epita.fr>
17998
17999 * src/bison.simple: Remove #line just before %%epilogue. It
18000 is now handled in ...
18001 * src/reader.c (read_additionnal_code): Add the output of a
18002 #line for the epilogue.
18003
e83d80b8
MA
180042001-12-10 Marc Autret <autret_m@epita.fr>
18005
927c1557 18006 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
18007 replace precedent remove.
18008 * src/bison.simple: Remove #line before %%prologue because
18009 %%input-line is wrong at this time.
18010
971d5158
MA
180112001-12-10 Marc Autret <autret_m@epita.fr>
18012
18013 * src/reader.c (symbols_output): Clean up.
927c1557 18014 * src/output.c (output_gram, output): Clean up.
971d5158 18015
5edafffd
AD
180162001-12-10 Akim Demaille <akim@epita.fr>
18017
18018 * src/lalr.c (initialize_lookaheads): New. Extracted from...
18019 * src/LR0.c (set_state_table): here.
18020 * src/lalr.c (lalr): Call it.
18021
0279f8e9
AD
180222001-12-10 Akim Demaille <akim@epita.fr>
18023
18024 * src/state.h (shifts): Remove the `number' member: shifts are
18025 attached to state, hence no longer need to be labelled with a
18026 state number.
18027
190c4f5f
AD
180282001-12-10 Akim Demaille <akim@epita.fr>
18029
18030 Now that states have a complete set of members, the linked list of
18031 shifts is useless: just fill directly the state's shifts member.
18032
18033 * src/state.h (shifts): Remove the `next' member.
18034 * src/LR0.c (first_state, last_state): Remove.
18035 Adjust the callers.
18036 (augment_automaton): Don't look for the shifts that must be added
18037 a shift on EOF: it is those of the state we looked for! But now,
18038 since shifts are attached, it is no longer needed to looking
18039 merely by its id: its number.
18040
2a73b93d
AD
180412001-12-10 Akim Demaille <akim@epita.fr>
18042
18043 * src/LR0.c (augment_automaton): Better variable locality.
18044 Remove an impossible branch: if there is a state corresponding to
18045 the start symbol being shifted, then there is shift for the start
18046 symbol from the initial state.
18047
74392f6a
AD
180482001-12-10 Akim Demaille <akim@epita.fr>
18049
18050 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
18051 only when appropriate: when insert_start_shifting_state' is not
18052 invoked.
18053 * tests/regression.at (Rule Line Numbers): Adjust.
18054
37c82725
AD
180552001-12-10 Akim Demaille <akim@epita.fr>
18056
18057 * src/LR0.c (augment_automaton): Now that all states have shifts,
18058 merge the two cases addition shifts to the initial state.
18059
6a164e0c
AD
180602001-12-10 Akim Demaille <akim@epita.fr>
18061
18062 * src/lalr.c (set_state_table): Move to...
18063 * src/LR0.c: here.
18064 * src/lalr.c (lalr): Don't call it...
18065 * src/LR0.c (generate_states): do it.
18066 * src/LR0.h (first_state): Remove, only the table is used.
18067
7215de24
AD
180682001-12-10 Akim Demaille <akim@epita.fr>
18069
18070 * src/LR0.h (first_shift, first_reduction): Remove.
18071 * src/lalr.c: Don't use first_shift: find shifts through the
18072 states.
18073
80e25d4d
AD
180742001-12-10 Akim Demaille <akim@epita.fr>
18075
18076 * src/LR0.c: Attach shifts to states as soon as they are
18077 computed.
18078 * src/lalr.c (set_state_table): Instead of assigning shifts to
18079 state, just assert that the mapping was properly done.
18080
0ab3728b
AD
180812001-12-10 Akim Demaille <akim@epita.fr>
18082
18083 * src/LR0.c (insert_start_shift): Rename as...
18084 (insert_start_shifting_state): this.
18085 (insert_eof_shifting_state, insert_accepting_state): New.
18086 (augment_automaton): Adjust.
18087 Better locality of the variables.
18088 When looking if the start_symbol is shifted from the initial
18089 state, using `while (... symbol != start_symbol ...)' sounds
18090 better than `while (... symbol < start_symbol ...)': If fail
18091 to see how the order between symbols could be relevant!
18092
78af9bbc
AD
180932001-12-10 Akim Demaille <akim@epita.fr>
18094
18095 * src/getargs.h: Don't declare `spec_name_prefix' and
18096 `spec_file_prefix', declared by src/files.h.
18097 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
18098 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
18099 * src/output.c (prepare): Adjust.
18100 * src/reader.c (symbols_output): Likewise.
18101 * src/vmsgetargs.c: Vaguely adjust, but who cares?
18102
bdef2a41
AD
181032001-12-10 Akim Demaille <akim@epita.fr>
18104
18105 * src/muscle_tab.c (muscle_init): NULL is a better default than
18106 `"0"'.
18107
3735969c
AD
181082001-12-10 Akim Demaille <akim@epita.fr>
18109
18110 * src/reader.c (reader): Calling symbols_output once is enough.
18111
49701457
AD
181122001-12-10 Akim Demaille <akim@epita.fr>
18113
18114 Now that states have a complete set of members, the linked list of
18115 reductions is useless: just fill directly the state's reductions
18116 member.
18117
18118 * src/state.h (struct reductions): Remove member `number' and
18119 `next'.
18120 * src/LR0.c (first_reduction, last_reduction): Remove.
18121 (save_reductions): Don't link the new reductions, store them in
18122 this_state.
18123 * src/lalr.c (set_state_table): No need to attach reductions to
18124 states, it's already done.
18125 * src/output.c (output_actions): No longer free the shifts, then
18126 the reductions, then the states: free all the states and their
18127 members.
18128
0edad749
AD
181292001-12-10 Akim Demaille <akim@epita.fr>
18130
18131 * src/options.c (OPTN, DRTV, BOTH): New.
18132 (option_table): Use them.
18133
0edad749
AD
18134 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
18135 the job of system.h.
18136 * src/options.c: Don't include stdio.h and xalloc.h for the same
18137 reasons.
18138
5449dd0f
AD
181392001-12-10 Akim Demaille <akim@epita.fr>
18140
18141 * src/output.c (output, prepare): Make sure the values of the
18142 muscles `action' and `prologue' are 0-terminated.
18143
a870c567
AD
181442001-12-10 Akim Demaille <akim@epita.fr>
18145
18146 Clean up GCC warnings.
18147
18148 * src/reader.c (copy_action): `buf' is not used.
18149 (parse_skel_decl): Be static.
18150 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
18151 * src/options.h (create_long_option_table): Have a real prototype.
18152 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
18153 (hash_delete_at): Return const void *.
18154 Adjust casts to preserve the const.
18155
80df8768
AD
181562001-12-10 Akim Demaille <akim@epita.fr>
18157
18158 * configure.in: Require 2.52g.
18159 M4 is not needed, but AUTOM4TE is.
18160 * m4/m4.m4: Remove.
18161 * tests/Makefile.am: Adjust.
18162
f693ad14
AD
181632001-12-10 Akim Demaille <akim@epita.fr>
18164
18165 One structure for states is enough, even though theoretically
18166 there are LR(0) states and LALR(1) states.
18167
18168 * src/lalr.h (state_t): Remove.
18169 (state_table): Be state_t **, not state_t *.
18170 * src/state.h (core, CORE_ALLOC): Rename as...
18171 (state_t, STATE_ALLOC): this.
18172 Add the LALR(1) members: shifts, reductions, errs.
18173 * src/LR0.c (state_table): Rename as...
18174 (state_hash): this, to avoid name clashes with the global
18175 `state_table'.
18176 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
18177 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
18178
74ffbcb6
AD
181792001-12-10 Akim Demaille <akim@epita.fr>
18180
18181 Bison dumps core on bash.y.
18182 Reported by Pascal Bart.
18183
18184 * src/warshall.c (bitmatrix_print): New.
18185 (TC): Use it.
ba0fe3c7 18186 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
18187 j must be the outer loop.
18188 * tests/regression.at (Broken Closure): New.
18189
07708e19
AD
181902001-12-05 Akim Demaille <akim@epita.fr>
18191
18192 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
18193 its argument.
ba1ecc07 18194 Reported by Peter Hamorsky.
07708e19 18195
92b16366
AD
181962001-12-05 Akim Demaille <akim@epita.fr>
18197
18198 * src/conflicts.c (err_table): Remove.
18199 (resolve_sr_conflict): Adjust.
18200 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
18201 Rename as...
18202 (state_t.reductions, state_t.shifts): this.
18203
076ab033
AD
182042001-12-05 Akim Demaille <akim@epita.fr>
18205
18206 * src/reduce.c (reduce_grammar_tables): No longer disable the
18207 removal of useless rules via CPP but via `if (0)', so that the
18208 compiler still check the code is valid.
18209 For instance, it should have noticed `rline' no longer exists: use
18210 the `line' member of rule_t.
18211 * src/gram.c (dummy, rline): Remove, unused.
18212
3843c413
AD
182132001-12-05 Akim Demaille <akim@epita.fr>
18214
18215 * src/output.c (pack_vector): Use assert, not berror.
18216 * src/main.c (berror): Remove, unused.
18217
43168960
AD
182182001-12-05 Akim Demaille <akim@epita.fr>
18219
18220 New experimental feature: if --verbose --trace output all the
18221 items of a state, not only its kernel.
18222
18223 * src/print.c (print_core): If `trace_flag', then invoke closure
18224 before outputting the items of the state (print_core is no longer
18225 a correct name them).
18226 (print_results): Invoke new_closure/free_closure if needed.
18227
b2872512
AD
182282001-12-05 Akim Demaille <akim@epita.fr>
18229
18230 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
18231 * src/closure.c, src/closure.h (itemsetsize): Rename as...
18232 (nitemset): for consistency with the rest of the project.
18233
23cbcc6c
AD
182342001-12-05 Akim Demaille <akim@epita.fr>
18235
18236 * src/closure.c (print_closure): Improve.
18237 (closure): Use it for printing input and output.
18238
03ec521c
AD
182392001-12-05 Akim Demaille <akim@epita.fr>
18240
18241 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
18242 indexed by nonterminals.
18243
3a7456dd
AD
182442001-12-05 Akim Demaille <akim@epita.fr>
18245
18246 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
18247 what it was!).
18248 * src/warshall.h: Remove accidental duplication of the content.
18249
1cbcf2e7
AD
182502001-12-05 Akim Demaille <akim@epita.fr>
18251
18252 * src/closure.c (set_fderives): De-obfuscate.
18253
84182270
AD
182542001-12-05 Akim Demaille <akim@epita.fr>
18255
18256 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
18257
3f6f053c
AD
182582001-12-05 Akim Demaille <akim@epita.fr>
18259
18260 * src/closure.c (set_firsts): De-obfuscate.
18261
7a5350ba
AD
182622001-12-05 Akim Demaille <akim@epita.fr>
18263
18264 * src/output.c (action_row): De-obfuscate
18265 using the good o' techniques: arrays not pointers, variable
18266 locality, BITISSET, RESETBIT etc.
18267
d954473d
AD
182682001-12-05 Akim Demaille <akim@epita.fr>
18269
18270 Pessimize the code to simplify it: from now on, all the states
18271 have a valid SHIFTS, which NSHIFTS is possibly 0.
18272
18273 * src/LR0.c (shifts_new): Be global and move to..
18274 * src/state.c, src/state.h: here.
18275 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
18276 * src/print_graph: Adjust.
18277
9839bbe5
AD
182782001-12-05 Akim Demaille <akim@epita.fr>
18279
18280 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
18281 * src/conflicts.c: Use it.
18282 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
18283 incorrectly ``simplified''.
18284
9f136c07
AD
182852001-12-05 Akim Demaille <akim@epita.fr>
18286
18287 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
18288 using the good o' techniques: arrays not pointers, variable
18289 locality, BITISSET, RESETBIT etc.
18290
b608206e
AD
182912001-12-05 Akim Demaille <akim@epita.fr>
18292
18293 * src/state.h (SHIFT_SYMBOL): New.
18294 * src/conflicts.c: Use it to deobfuscate.
18295
52afa962
AD
182962001-12-05 Akim Demaille <akim@epita.fr>
18297
18298 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
18299 (print_reductions): De-obfuscate using the good o' techniques:
18300 arrays not pointers, variable locality, BITISSET.
18301
e74dc321
AD
183022001-12-05 Akim Demaille <akim@epita.fr>
18303
18304 * src/conflicts.c (print_reductions): Arrays, not pointers.
18305 Use BITISSET.
18306
768fca83
AD
183072001-12-05 Akim Demaille <akim@epita.fr>
18308
18309 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18310
a17e599f
AD
183112001-12-05 Akim Demaille <akim@epita.fr>
18312
18313 * src/conflicts.c (print_reductions): Improve variable locality.
18314
a04bc341
AD
183152001-12-05 Akim Demaille <akim@epita.fr>
18316
18317 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18318
c8ea038e
AD
183192001-12-05 Akim Demaille <akim@epita.fr>
18320
18321 * src/conflicts.c (print_reductions): Improve variable locality.
18322
aa2aab3c
AD
183232001-12-05 Akim Demaille <akim@epita.fr>
18324
18325 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
18326 * src/lalr.c: Use them.
18327
b178c8cc
AD
183282001-12-05 Akim Demaille <akim@epita.fr>
18329
18330 * src/LR0.c (augment_automaton): Formatting changes.
18331 Better variable locality.
18332
f67d13aa
AD
183332001-12-05 Akim Demaille <akim@epita.fr>
18334
18335 * src/lalr.c (matrix_print): New.
18336 (transpose): Use it.
18337 Use arrays instead of pointers.
18338
c2713865
AD
183392001-12-05 Akim Demaille <akim@epita.fr>
18340
18341 * src/lalr.c (maxrhs): Move to...
18342 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
18343 * src/lalr.c (build_relations): Adjust.
18344
9887c18a
AD
183452001-12-05 Akim Demaille <akim@epita.fr>
18346
18347 * src/lalr.c (transpose): Free the memory allocated to the
18348 argument, as it is replaced by the results by the unique caller.
18349 (build_relations): Merely invoke transpose: it handles the memory
18350 deallocation.
18351 Improve variable locality.
18352 Avoid variables used as mere abbreviations.
18353 (compute_lookaheads): Use arrays instead of pointers.
18354
4d4f699c
AD
183552001-12-05 Akim Demaille <akim@epita.fr>
18356
18357 * src/lalr.c (initialize_F): Improve variable locality.
18358 Avoid variables used as mere abbreviations.
18359
80a69750
AD
183602001-12-05 Akim Demaille <akim@epita.fr>
18361
18362 * src/derives.c (print_derives): Display the ruleno.
18363 * src/lalr.c (initialize_F, transpose): Better variable locality
18364 to improve readability.
18365 Avoid variables used as mere abbreviations.
18366
fe961097
AD
183672001-12-05 Akim Demaille <akim@epita.fr>
18368
18369 * src/lalr.c (traverse): Use arrays instead of pointers.
18370
e3e4e814
AD
183712001-12-05 Akim Demaille <akim@epita.fr>
18372
18373 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
18374 the handling of squeue.
18375 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18376
630e182b
AD
183772001-12-05 Akim Demaille <akim@epita.fr>
18378
18379 Because useless nonterminals are now kept alive (instead of being
18380 `destroyed'), we now sometimes examine them, and store information
18381 related to them. Hence we need to know their number, and adjust
18382 memory allocations.
18383
18384 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
18385 static.
18386 * src/LR0.c (allocate_itemsets): The memory allocated to
18387 `symbol_count' was used for two different purpose: once to count
18388 the number of occurrences of each symbol, and later reassigned to
18389 `shift_symbol', containing the symbol that can be shifted from a
18390 given state.
18391 Deobfuscate, i.e., allocate, use and free `symbol_count' here
18392 only, and...
18393 (new_itemsets): Allocate `shift_symbol' here.
18394 (allocate_itemsets): symbol_count includes useless nonterminals.
18395 Make room for them.
18396 (free_storage): Use `free', not `XFREE', for pointers that cannot
18397 be null.
18398
81b51460
AD
183992001-12-05 Akim Demaille <akim@epita.fr>
18400
18401 * src/nullable.c (set_nullable): Deobfuscate the handling of
18402 ritem.
18403 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18404
3067fbef
AD
184052001-12-05 Akim Demaille <akim@epita.fr>
18406
18407 * src/gram.c, src/gram.h (ritem_print): New.
18408 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
18409 (This useless function was defined only to work around VMS linkers
18410 that can't handle compilation units with variables only).
18411 * src/reduce.c (dump_grammar): Use it to trace the construction of
18412 ritem.
18413
c2bea5f9
PE
184142001-12-04 Paul Eggert <eggert@twinsun.com>
18415
7d27c823
PE
18416 * src/bison.simple (union yyalloc): Change member names
18417 to be the same as the stack names.
18418 (yyparse): yyptr is now union yyalloc *, not char *.
18419 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
18420 and may generate better code on some machines.
c2bea5f9
PE
18421 (yystpcpy): Use prototype if __STDC__ is defined, not just
18422 if __cplusplus is defined.
35687a9d 18423
2c8a9dfa
AD
184242001-11-30 Akim Demaille <akim@epita.fr>
18425
18426 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
18427 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
18428 Gettext doesn't compile cleanly, and dies with -Werror.
18429 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
18430 Include WARNING_CFLAGS here.
18431 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
18432 before being defined.
18433
f4e421e6
AD
184342001-11-27 Paul Eggert <eggert@twinsun.com>
18435
18436 * lib/quotearg.h (quotearg_n, quotearg_n_style):
18437 First arg is int, not unsigned.
18438 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
18439 (SIZE_MAX, UINT_MAX): New macros.
18440 (quotearg_n_options): Abort if N is negative.
18441 Avoid overflow check on hosts where size_t is 64 bits and int
18442 is 32 bits, as overflow is impossible there.
18443 Fix off-by-one typo that caused unnecessary reallocation.
18444
7093d0f5
AD
184452001-11-29 Paul Eggert <eggert@twinsun.com>
18446
18447 Name space cleanup in generated parser.
18448
18449 * doc/bison.texinfo (Bison Parser): Discuss system headers
18450 and their effect on the user name space.
18451
18452 * src/bison.simple:
18453 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
18454 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
18455 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
18456
18457 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
18458 on user names when possible.
18459
18460 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
18461 Simplify test for whather <alloca.h> exists.
18462
18463 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
18464
18465 (<stdio.h>): Include if YYDEBUG.
18466
18467 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
18468 ! defined (yyoverflow) && ! defined (yymemcpy).
18469
18470 (yymemcpy, yyparse): Rename local variables as needed so that
18471 they all begin with 'yy'.
18472
18473 (yystrlen, yystpcpy): New functions.
18474
18475 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
18476 All uses changed.
18477
18478 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
18479 instead of relying on string.h functions. Use YYSTACK_ALLOC
18480 and YYSTACK_FREE instead of malloc and free.
18481
fd51e5ff
AD
184822001-11-30 Akim Demaille <akim@epita.fr>
18483
18484 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
18485 before their first uses.
18486 (YYBISON, YYPURE): Move to the top of the output.
18487
7d13ff5f
AD
184882001-11-30 Akim Demaille <akim@epita.fr>
18489
18490 * tests/reduce.at (Useless Nonterminals): Fix.
18491
892a3995
AD
184922001-11-30 Akim Demaille <akim@epita.fr>
18493
18494 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
18495 if body instead of `;' to pacify GCC's warnings.
18496
68f1e3ed
AD
184972001-11-30 Akim Demaille <akim@epita.fr>
18498
18499 Instead of mapping the LHS of unused rules to -1, keep the LHS
18500 valid, but flag the rules as invalid.
18501
18502 * src/gram.h (rule_t): `useful' is a new member.
18503 * src/print.c (print_grammar): Adjust.
18504 * src/derives.c (set_derives): Likewise.
18505 * src/reader.c (packgram, reduce_output): Likewise.
18506 * src/reduce.c (reduce_grammar_tables): Likewise.
18507 * tests/reduce.at (Underivable Rules, Useless Rules): New.
18508
d2d1b42b
AD
185092001-11-30 Akim Demaille <akim@epita.fr>
18510
18511 * src/reduce.c (reduce_output): Formatting changes.
18512 * src/print.c (print_results, print_grammar): Likewise.
18513 * tests/regression.at (Rule Line Numbers)
18514 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
18515
760b53a8
AD
185162001-11-30 Akim Demaille <akim@epita.fr>
18517
18518 * src/reduce.c (nonterminals_reduce): Instead of throwing away
18519 useless nonterminals, move them at the end of the symbol arrays.
18520 (reduce_output): Adjust.
18521 * tests/reduce.at (Useless Nonterminals): Adjust.
18522
00238958
AD
185232001-11-30 Akim Demaille <akim@epita.fr>
18524
18525 * src/reduce.c: Various comment/formatting changes.
18526 (nonterminals_reduce): New, extracted from...
18527 (reduce_grammar_tables): here.
18528 (reduce_grammar): Call nonterminals_reduce.
18529
396452de
PE
185302001-11-29 Paul Eggert <eggert@twinsun.com>
18531
18532 * src/bison.simple (YYSTACK_REALLOC): Remove.
18533 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
18534 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
18535 New macros.
18536 (union yyalloc): New type.
18537 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
18538 an arbitrary restriction on hosts where size_t is wider than int.
18539
18540 (yyparse): Don't dump core if alloca or malloc fails; instead, report
18541 a parser stack overflow. Allocate just one block of memory for all
18542 three stacks, instead of allocating three blocks; this typically is
18543 faster and reduces fragmentation.
18544
18545 Do not limit the number of items in the stack to a value that fits
18546 in 'int', as this is an arbitrary limit on hosts with 64-bit
18547 size_t and 32-bit int.
18548
147e184c
MA
185492001-11-29 Marc Autret <autret_m@epita.fr>
18550
18551 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
18552 of defining YYERROR_VERBOSE.
18553 [AT_DATA]: $4 is now out of C declarations in the prologue.
18554
426cf563
MA
185552001-11-28 Marc Autret <autret_m@epita.fr>
18556
18557 * src/reader.c (parse_dquoted_param): New.
18558 (parse_skel_decl): Use it.
18559 * src/lex.h: Add its prototype.
18560 * src/lex.c (literalchar): Become not static.
18561
c7925b99
MA
185622001-11-28 Marc Autret <autret_m@epita.fr>
18563
18564 * src/output.h: And put its extern declaration here.
18565 * src/output.c (error_verbose): Define here.
18566 (prepare): Echo name modification.
18567 * src/getargs.h: Clean its extern declaration.
18568 * src/getargs.c (error_verbose_flag): Remove.
18569 (getargs): Remove case 'e'.
18570 * src/options.c (option_table): 'error-verbose' is now seen as simple
18571 percent option.
18572 Include output.h.
18573
18574 * src/reader.c (read_declarations): Remove case tok_include.
18575 (parse_include_decl): Remove.
18576 * src/lex.h (token_t): Remove tok_include.
18577 * src/options.c (option_table): 'include' is now a simple command line
18578 option.
18579
5b5d1929
MA
185802001-11-28 Marc Autret <autret_m@epita.fr>
18581
18582 * src/bison.simple: Adjust muscle names.
18583 * src/muscle_tab.c (muscle_init): Also rename the muscles.
18584 * src/output.c (prepare): s/_/-/ for the muscles names.
18585 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
18586
8850be4b
MA
185872001-11-28 Marc Autret <autret_m@epita.fr>
18588
18589 * src/bison.simple: Fix debug.
18590 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
18591
4a38e613
AD
185922001-11-28 Akim Demaille <akim@epita.fr>
18593
18594 * src/LR0.c (shifts_new): New.
18595 (save_shifts, insert_start_shift, augment_automaton): Use it.
18596
4b35e1c1
AD
185972001-11-28 Akim Demaille <akim@epita.fr>
18598
18599 * src/closure.c (closure): `b' and `ruleno' denote the same value:
18600 keep ruleno only.
18601
d2b04478
AD
186022001-11-28 Akim Demaille <akim@epita.fr>
18603
18604 * src/closure.c (closure): Instead of looping over word in array
18605 then bits in words, loop over bits in array.
18606
2c4c30aa
AD
186072001-11-28 Akim Demaille <akim@epita.fr>
18608
18609 * src/closure.c (closure): No longer optimize the special case
18610 where all the bits of `ruleset[r]' are set to 0, to make the code
18611 clearer.
18612
576890b7
AD
186132001-11-28 Akim Demaille <akim@epita.fr>
18614
18615 * src/closure.c (closure): `r' and `c' are new variables, used to
18616 de-obfuscate accesses to RULESET and CORE.
18617
cb487d7d
AD
186182001-11-28 Akim Demaille <akim@epita.fr>
18619
18620 * src/reduce.c (reduce_print): Use ngettext.
18621 (dump_grammar): Improve the trace accuracy.
18622
6013d43f
AD
186232001-11-28 Akim Demaille <akim@epita.fr>
18624
18625 * src/reduce.c (dump_grammar): Don't translate trace messages.
18626
cb4956ee
AD
186272001-11-28 Akim Demaille <akim@epita.fr>
18628
18629 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
18630 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
18631 as all tags are free'ed afterwards.
18632 From Enrico Scholz.
18633
648185ab
PE
186342001-11-27 Paul Eggert <eggert@twinsun.com>
18635
18636 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
18637 use alloca when we didn't want to, and vice versa.
18638
68254a03
MA
186392001-11-27 Marc Autret <autret_m@epita.fr>
18640
9113b58f
AD
18641 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
18642 initialization.
68254a03
MA
18643 * src/output.c (prepare): Remove its update.
18644
04d843a2
MA
186452001-11-27 Marc Autret <autret_m@epita.fr>
18646
18647 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
18648 Use %error-verbose.
18649
d2079671 186502001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
18651
18652 * src/bison.simple: Remove YYERROR_VERBOSE using.
18653 Use %%error_verbose.
18654 (yyparse): Likewise.
18655 * src/output.c (prepare): Give its final value.
18656 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
18657 * src/getargs.h: Add its extern declaration.
18658 * src/getargs.c (error_verbose_flag): New int.
18659 (getargs): Update to catch new case.
18660 * src/options.c (option_table): 'error-verbose' is a new option.
18661 (shortopts): Update.
18662
e0327bc8
AD
186632001-11-27 Akim Demaille <akim@epita.fr>
18664
18665 * src/system.h: Use intl/libgettext.h.
18666 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
18667
000f1a3c
AD
186682001-11-27 Akim Demaille <akim@epita.fr>
18669
18670 * tests/torture.at (Exploding the Stack Size with Malloc):
18671 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
18672
26cfe0be
AD
186732001-11-27 Akim Demaille <akim@epita.fr>
18674
18675 * src/files.c: Include error.h.
18676 Reported by Hans Aberg.
18677
f6bd5427
MA
186782001-11-26 Marc Autret <autret_m@epita.fr>
18679
d2079671 18680 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
18681 (read_declarations): Add case tok_include.
18682 * src/getargs.h (include): Add its extern definition.
18683 * src/getargs.c (include): New const char *.
18684 (getargs): Add case '-I'.
18685 * src/options.c (option_table): Add include as command line and
18686 percent option.
18687 * src/lex.h (token_t): Add tok_include.
18688
2ca209c1
AD
186892001-11-26 Akim Demaille <akim@epita.fr>
18690
18691 * src/reader.c (readgram): Make sure rules for mid-rule actions
18692 have a lineno equal to that of their host rule.
18693 Reported by Hans Aberg.
18694 * tests/regression.at (Rule Line Numbers): New.
18695
0e41b407
AD
186962001-11-26 Akim Demaille <akim@epita.fr>
18697
18698 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
18699 size_ts.
18700
187012001-11-26 Akim Demaille <akim@epita.fr>
18702
18703 * src/complain.c, src/complain.h (error): Remove, provided by
18704 lib/error.[ch].
18705
e0c40012
AD
187062001-11-26 Akim Demaille <akim@epita.fr>
18707
18708 * src/reader.c (read_declarations): Don't abort on tok_illegal,
18709 issue an error message.
18710 * tests/regression.at (Invalid %directive): New.
18711 Reported by Hans Aberg.
18712
5e147124
AD
187132001-11-26 Akim Demaille <akim@epita.fr>
18714
18715 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
18716 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18717
a034c8b8
AD
187182001-11-26 Akim Demaille <akim@epita.fr>
18719
18720 * src/conflicts.c (conflicts_print): Don't complain at all when
18721 there are no reduce/reduce conflicts, and as many shift/reduce
18722 conflicts as expected.
18723 * tests/regression.at (%expect right): Adjust.
18724
c64a20f3
AD
187252001-11-23 Akim Demaille <akim@epita.fr>
18726
18727 * lib/alloca.c: Update, from fileutils.
18728
5b0d29bb
AD
187292001-11-23 Akim Demaille <akim@epita.fr>
18730
18731 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
18732
722c4bfe
AD
187332001-11-23 Akim Demaille <akim@epita.fr>
18734
18735 * src/system.h: Include alloca.h.
18736 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
18737
6255b435
AD
187382001-11-23 Akim Demaille <akim@epita.fr>
18739
18740 * src/print_graph.c (print_actions): Remove `rule', unused.
18741 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
18742 pacify GCC's signed < unsigned warnings.
18743 * src/closure.c (itemsetsize): Likewise.
18744 * src/reader.c (symbol_list_new): Static.
18745
b29b2ed5
AD
187462001-11-23 Akim Demaille <akim@epita.fr>
18747
18748 Attaching lineno to buckets is stupid, since only one copy of each
18749 symbol is kept, only the line of the first occurrence is kept too.
18750
18751 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
18752 * src/reader.c (rline_allocated): Remove, unused.
18753 (symbol_list): Have a `line' member.
18754 (symbol_list_new): New.
18755 (readgram): Use it.
18756 * src/print.c (print_grammar): Output the rule line numbers.
18757 * tests/regression.at (Solved SR Conflicts)
18758 (Unresolved SR Conflicts): Adjust.
18759 Reported by Hans Aberg.
18760
a81b1d4a
MA
187612001-11-22 Marc Autret <autret_m@epita.fr>
18762
18763 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
18764
c1ecb3c1
MA
187652001-11-22 Marc Autret <autret_m@epita.fr>
18766
18767 * src/muscle_tab.c (muscle_init): Remove initialization of
18768 skeleton muscle.
18769 * src/output.c (output_master_parser): Do it here.
18770
fbe01355
AD
187712001-11-20 Akim Demaille <akim@epita.fr>
18772
18773 * po/sv.po: New.
18774 * configure.in (ALL_LINGUAS): Adjust.
18775 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
18776 longer contains strings to translate.
18777
81e895c0
AD
187782001-11-19 Akim Demaille <akim@epita.fr>
18779
18780 * src/conflicts.c (conflicts_print): Add a missing \n.
18781
6bb1878b
AD
187822001-11-19 Akim Demaille <akim@epita.fr>
18783
18784 * src/nullable.c (nullable_print): New.
18785 (set_nullable): Call it when tracing.
18786 Better locality of variables.
18787
d9ec2d07
AD
187882001-11-19 Akim Demaille <akim@epita.fr>
18789
18790 * src/print.c (print_actions): Better locality of variables.
18791
720e5c1b
AD
187922001-11-19 Akim Demaille <akim@epita.fr>
18793
18794 * src/derives.c (print_derives): Fix and enrich.
18795 * src/closure.c (print_fderives): Likewise.
18796
fb908786
AD
187972001-11-19 Akim Demaille <akim@epita.fr>
18798
18799 * src/closure.c (itemsetend): Remove, replaced with...
18800 (itemsetsize): new.
18801
125ecb56
AD
188022001-11-19 Akim Demaille <akim@epita.fr>
18803
18804 * src/LR0.c (kernel_end): Remove, replaced with...
18805 (kernel_size): new.
18806
d8cf039f
AD
188072001-11-19 Akim Demaille <akim@epita.fr>
18808
18809 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
18810 to clarify.
18811
7bec0760
AD
188122001-11-19 Akim Demaille <akim@epita.fr>
18813
18814 * src/closure.c (closure): Use arrays instead of pointers to clarify.
18815
c87d4863
AD
188162001-11-19 Akim Demaille <akim@epita.fr>
18817
18818 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
18819 trace messages.
18820 * src/LR0.c: Likewise.
18821 (allocate_itemsets): Use arrays instead of pointers to clarify.
18822
9bfe901c
AD
188232001-11-19 Akim Demaille <akim@epita.fr>
18824
18825 * src/getargs.c (statistics_flag): Replace with...
18826 (trace_flag): New.
18827 (longopts): Accept --trace instead of --statistics.
18828 * src/getargs.h, src/options.c: Adjust.
18829 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
18830 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
18831
97db7bd4
AD
188322001-11-19 Akim Demaille <akim@epita.fr>
18833
cc72668c 18834 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
18835 pointers to clarify the code.
18836 (save_reductions, save_shifts): Factor common parts of alternatives.
18837
2c5f66ed
AD
188382001-11-19 Akim Demaille <akim@epita.fr>
18839
18840 * src/LR0.c (new_state, get_state): Complete TRACE code.
18841 * src/closure.c: Include `reader.h' to get `tags', needed by the
18842 trace code.
18843 Rename the conditional DEBUG as TRACE.
18844 Output consistently TRACEs to stderr, not stdout.
18845 * src/derives.c: Likewise.
18846 * src/reduce.c: (inaccessable_symbols): Using if is better style
18847 than goto.
18848 Use `#if TRACE' instead of `#if 0' for tracing code.
18849
300f275f
AD
188502001-11-19 Akim Demaille <akim@epita.fr>
18851
18852 * src/system.h (LIST_FREE, shortcpy): New.
18853 * src/LR0.c: Use them.
18854 * src/output.c (free_itemsets, free_reductions, free_shifts):
18855 Remove, replaced by LIST_FREE.
18856
f59c437a
AD
188572001-11-19 Akim Demaille <akim@epita.fr>
18858
18859 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
18860 (REDUCTIONS_ALLOC): New.
18861 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
18862 allocation.
18863
6986fd9e
AD
188642001-11-19 Akim Demaille <akim@epita.fr>
18865
18866 * src/LR0.c (new_state): Complete trace code.
18867 * src/nullable.c (set_nullable): Don't translate traces.
18868
4bc30f78
AD
188692001-11-19 Akim Demaille <akim@epita.fr>
18870
18871 * src/print_graph.c (print_core): Better locality of variables.
18872 * src/print.c (print_core): Likewise.
18873
08a946e0
AD
188742001-11-19 Akim Demaille <akim@epita.fr>
18875
18876 * src/vcg.c: You do the output, so you are responsible of the
18877 handling of VCG syntax, in particular: use quotearg.
18878 * src/print_graph.c: Don't.
18879 (print_actions): Don't output the actions as part of the nodes,
18880 since that's the job of the edges.
18881 (print_state): Don't output by hand: fill the node description,
9bfe901c 18882 and ask for its output.
08a946e0 18883
f0473484
AD
188842001-11-19 Akim Demaille <akim@epita.fr>
18885
cc72668c
AD
18886 * src/bison.simple (yyparse): When verbosely reporting an error,
18887 no longer put additional quotes around token names.
f0473484
AD
18888 * tests/calc.at: Adjust.
18889
e41dc700
AD
188902001-11-19 Akim Demaille <akim@epita.fr>
18891
18892 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
18893 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
18894 * src/output.c: Adjust.
18895
652a871c
AD
188962001-11-19 Akim Demaille <akim@epita.fr>
18897
18898 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
18899 (rule_t): this.
18900 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
18901
b2ed6e58
AD
189022001-11-19 Akim Demaille <akim@epita.fr>
18903
18904 * src/gram.h (rule_t): New.
18905 (rule_table): New.
18906 (rrhs, rlhs): Remove, part of state_t.
18907 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
18908 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18909 * src/reader.c, src/reduce.c: Adjust.
18910
edad7067
AD
189112001-11-19 Akim Demaille <akim@epita.fr>
18912
18913 * src/reader.c (symbols_output): New, extracted from...
18914 (packsymbols): Here.
18915 (reader): Call it.
18916
3feec034
AD
189172001-11-19 Akim Demaille <akim@epita.fr>
18918
18919 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
18920 (maxrhs): this new function.
18921
ddcd5fdf
AD
189222001-11-19 Akim Demaille <akim@epita.fr>
18923
cc72668c 18924 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
18925 Adjust.
18926
bb527fc2
AD
189272001-11-19 Akim Demaille <akim@epita.fr>
18928
cc72668c 18929 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
18930 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18931 * src/lalr.c: Adjust.
18932
a845a697
AD
189332001-11-19 Akim Demaille <akim@epita.fr>
18934
18935 * src/lalr.c (initialize_LA): Only initialize LA. Let...
18936 (set_state_table): handle the `lookaheads' members.
18937
f004bf6a
AD
189382001-11-19 Akim Demaille <akim@epita.fr>
18939
cc72668c
AD
18940 * src/lalr.h (lookaheads): Removed array, whose contents is now
18941 a member of...
f004bf6a
AD
18942 (state_t): this structure.
18943 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18944 Adjust.
18945
de326cc0
AD
189462001-11-19 Akim Demaille <akim@epita.fr>
18947
cc72668c
AD
18948 * src/lalr.h (consistent): Removed array, whose contents is now
18949 a member of...
de326cc0
AD
18950 (state_t): this structure.
18951 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18952 Adjust.
18953
90b4416b
AD
189542001-11-19 Akim Demaille <akim@epita.fr>
18955
cc72668c
AD
18956 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
18957 contents are now members of...
90b4416b
AD
18958 (state_t): this structure.
18959 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18960 Adjust.
18961
9703cc49
AD
189622001-11-19 Akim Demaille <akim@epita.fr>
18963
18964 * src/lalr.h (state_t): New.
18965 (state_table): Be a state_t * instead of a core **.
18966 (accessing_symbol): Remove, part of state_t.
18967 * src/lalr.c: Adjust.
18968 (set_accessing_symbol): Merge into...
18969 (set_state_table): this.
18970 * src/print_graph.c, src/conflicts.c: Adjust.
18971
d803322e
AD
189722001-11-14 Akim Demaille <akim@epita.fr>
18973
18974 * tests/calc.at, tests/output.at, tests/regression.at,
18975 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
18976 now the tests are run in private dirs, therefore AC_CLEANUP and
18977 family can be simplified to 0-ary.
18978 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
18979 use abs. path to find config.h.
18980 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
18981 stderr, there can be way too much random noise.
18982 Instead pass -Werror to GCC and rely on the exit status.
18983 Reported by Wolfram Wagner.
18984
3d76b07d
AD
189852001-11-14 Akim Demaille <akim@epita.fr>
18986
18987 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
18988 defined only if yyoverflow is defined, to avoid `warning: unused
18989 variable `yyvs1''.
18990 Reported by The Test Suite.
18991
09b503c8
AD
189922001-11-14 Akim Demaille <akim@epita.fr>
18993
18994 * src/print.c: Include reduce.h.
18995 Reported by Hans Aberg.
18996
189972001-11-14 Akim Demaille <akim@epita.fr>
18998
18999 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
19000 Revert a previous patch: these are really const.
19001 * src/conflicts.c (conflict_report): Additional useless pair of
19002 braces to pacify GCC's warnings for `if () if () {} else {}'.
19003 * src/lex.c (parse_percent_token): Replace equal_offset with
19004 arg_offset.
19005 arg is const.
19006 Be sure to strdup `arg' when used, since there is no reason for
19007 token_buffer not to change.
19008
0f37a994
AD
190092001-11-14 Akim Demaille <akim@epita.fr>
19010
19011 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
19012 definition.
19013 * src/main.c (main): Use them.
19014 Suggested by Hans Aberg.
19015
d39d93b8
AD
190162001-11-12 Akim Demaille <akim@epita.fr>
19017
19018 * src/system.h (ngettext): Now that we use ngettext, be sure to
19019 provide a default definition when NLS are not used.
19020
9edcd895
AD
190212001-11-12 Akim Demaille <akim@epita.fr>
19022
19023 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
19024 Use @kbd to denote user input.
19025 (Language and Grammar): ANSIfy the example.
19026 Adjust its layout for info/notinfo.
19027 (Location Tracking Calc): Output error messages to stderr.
19028 Output locations in a more GNUtically correct way.
19029 Fix a couple of Englishos.
19030 Adjust @group/@end group pairs.
19031
7da99ede
AD
190322001-11-12 Akim Demaille <akim@epita.fr>
19033
e3aa65c5 19034 %expect was not functioning at all.
7da99ede
AD
19035
19036 * src/conflicts.c (expected_conflicts): Set to -1.
19037 (conflict_report): Use ngettext.
19038 (conflicts_print): Check %expect and make its violation an error.
19039 * doc/bison.texinfo (Expect Decl): Adjust.
19040 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
19041 * tests/regression.at (%expect not enough, %expect right)
19042 (%expect too much): New.
19043
ba9dda1a
AD
190442001-11-12 Akim Demaille <akim@epita.fr>
19045
19046 * tests/regression.at (Conflicts): Rename as...
19047 (Unresolved SR Conflicts): this.
19048 (Solved SR Conflicts): New.
19049
337c5bd1
AD
190502001-11-12 Akim Demaille <akim@epita.fr>
19051
19052 * src/reduce.c (print_results): Rename as...
19053 (reduce_output): This.
19054 Output to OUT, passed as argument, instead of output_obstack.
19055 (dump_grammar): Likewise.
19056 (reduce_free): New.
19057 Also free V1.
19058 (reduce_grammar): No longer call reduce_output, since...
19059 * src/print.c (print_results): do it.
19060 * src/main.c (main): Call reduce_free;
19061
c73a41af
AD
190622001-11-12 Akim Demaille <akim@epita.fr>
19063
19064 * src/conflicts.c (print_reductions): Accept OUT as argument.
19065 Output to it, not to output_obstack.
19066 * src/print.c (print_actions): Adjust.
19067
0df87bb6
AD
190682001-11-12 Akim Demaille <akim@epita.fr>
19069
19070 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
19071 the result instead of using...
19072 (src_total, rrc_total, src_count, rrc_count): Remove.
19073 (any_conflicts): Remove.
19074 (print_conflicts): Split into...
19075 (conflicts_print, conflicts_output): New.
19076 * src/conflicts.h: Adjust.
19077 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 19078 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
19079 * tests/regression.at (Conflicts): New.
19080 Reported by Tom Lane.
19081
e4d3d4de
AD
190822001-11-12 Akim Demaille <akim@epita.fr>
19083
19084 * tests/regression.at (Invalid input): Remove, duplicate with
19085 ``Invalid input: 1''.
19086
6d7d248e
AD
190872001-11-12 Akim Demaille <akim@epita.fr>
19088
19089 * tests/torture.at (AT_DATA_STACK_TORTURE)
19090 (Exploding the Stack Size with Alloca)
19091 (Exploding the Stack Size with Malloc): New.
19092
e9e4c321
AD
190932001-11-12 Akim Demaille <akim@epita.fr>
19094
19095 * src/bison.simple (YYSTACK_REALLOC): New.
19096 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 19097 Reported by Per Allansson.
e9e4c321 19098
5f7e0832
AD
190992001-11-12 Pascal Bart <pascal.bart@epita.fr>
19100
19101 * src/bison.simple: Define type yystype instead of YYSTYPE, and
19102 define CPP macro, which substitute YYSTYPE by yystype.
19103 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
19104 with yyltype/YYLTYPE. This allows inclusion of the generated
19105 header within the parser if the compiler, such as GGC, accepts
19106 multiple equivalent #defines.
19107 From Akim.
19108
e3f1699f
AD
191092001-11-05 Akim Demaille <akim@epita.fr>
19110
19111 * src/reader.c (symbols_output): New, extracted from...
19112 (packsymbols): here.
19113 (reader): Adjust.
19114
65be0866
AD
191152001-11-05 Akim Demaille <akim@epita.fr>
19116
19117 * src/lex.c (parse_percent_token): s/quotearg/quote/.
19118
e4d910bf
AD
191192001-11-05 Akim Demaille <akim@epita.fr>
19120
19121 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
19122 pattern.
19123
951366c1
AD
191242001-11-05 Akim Demaille <akim@epita.fr>
19125
19126 * src/options.h (struct option_table_struct): set_flags is void*.
19127 * src/options.c (longopts): Support `--output' and `%output'.
19128 (usage): Adjust.
19129 * src/lex.h (tok_setopt): Remove, replaced with...
19130 (tok_intopt, tok_stropt): these new guys.
19131 * src/lex.c (getopt.h): Not needed.
19132 (token_buffer, unlexed_token_buffer): Not const.
19133 (percent_table): Promote `-' over `_' in directive names.
19134 Active `%name-prefix', `file-prefix', and `output'.
19135 (parse_percent_token): Accept possible arguments to directives.
19136 Promote `-' over `_' in directive names.
19137
d8988b2f
AD
191382001-11-04 Akim Demaille <akim@epita.fr>
19139
19140 * doc/bison.texinfo (Decl Summary): Split the list into
19141 `directives for grammars' and `directives for bison'.
19142 Sort'em.
19143 Add description of `%name-prefix', `file-prefix', and `output'.
19144 Promote `-' over `_' in directive names.
19145 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
19146 Simplify the description of `--name-prefix'.
19147 Promote `-' over `_' in directive names.
19148 Promote `--output' over `--output-file'.
19149 Fix the description of `--defines'.
19150 * tests/output.at: Exercise %file-prefix and %output.
19151
6468d18e
AD
191522001-11-02 Akim Demaille <akim@epita.fr>
19153
19154 * doc/refcard.tex: Update.
19155
6b7e85b9
AD
191562001-11-02 Akim Demaille <akim@epita.fr>
19157
19158 * src/symtab.h (SUNDEF): New.
19159 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
19160 stand for `uninitialized', instead of 0.
19161 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
19162 * src/lex.c (lex): Adjust.
19163
19164 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
19165 Number it 0.
19166 Let yylex return it instead of a plain 0.
19167 Reported by Dick Streefland.
19168
cd5aafcf
AD
191692001-11-02 Akim Demaille <akim@epita.fr>
19170
19171 * tests/regression.at (Mixing %token styles): New test.
19172
037ca2f1
AD
191732001-11-02 Akim Demaille <akim@epita.fr>
19174
19175 * src/reader.c (parse_thong_decl): Formatting changes.
19176 (token_translations_init): New, extracted from...
19177 (packsymbols): Here.
19178 Adjust.
19179
270a173c
AD
191802001-11-01 Akim Demaille <akim@epita.fr>
19181
19182 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
19183 Check that `9foo.y' produces correct cpp guards.
19184 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
19185 guards.
19186 Reported by Wwp.
19187
561f9a30
AD
191882001-11-01 Akim Demaille <akim@epita.fr>
19189
19190 * tests/regression.at (Invalid input: 2): New.
19191 * src/lex.c (unlexed_token_buffer): New.
19192 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
19193 too.
19194 Reported by Wwp.
19195
f987e9d2
AD
191962001-11-01 Akim Demaille <akim@epita.fr>
19197
19198 * tests/calc.at: Catch up with 1.30.
19199 * configure.in: Bump to 1.49a.
19200 Adjust to newer Autotest.
19201
0846f581
PB
192022001-10-19 Pascal Bart <pascal.bart@epita.fr>
19203
19204 * src/conflicts.c: Move global variables rrc_total and src_total ...
19205 (print_conflicts): here.
19206 * src/output.c (output): Free global variable user_toknums.
19207 * src/lex.c (token_obstack): Become static.
19208
3c1a79b3
AD
192092001-10-18 Akim Demaille <akim@epita.fr>
19210
19211 * tests/atlocal.in (GCC): Add.
19212 * tests/calc.at: s/m4_match/m4_bmatch/.
19213 s/m4_patsubst/m4_bpatsubst/.
19214 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
19215 * configure.in: AC_SUBST(GCC).
19216
5d52e7d0
MA
192172001-10-14 Marc Autret <autret_m@epita.fr>
19218
19219 * src/options.c (create_long_option_table): Fix.
19220
631aa1d3
AD
192212001-10-10 Akim Demaille <akim@epita.fr>
19222
19223 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
19224
f6ec6d13
AD
192252001-10-04 Akim Demaille <akim@epita.fr>
19226
19227 * src/reader.c (parse_union_decl): Push the caracters in
19228 union_obstack, not attrs_obstack.
19229
342b8b6e
AD
192302001-10-04 Akim Demaille <akim@epita.fr>
19231
19232 Merge in the branch 1.29.
19233
19234 * src/reader.c (packsymbols): Use a temporary obstack for
19235 `%%tokendef', since output_stack is already used elsewhere.
19236
19237 2001-10-02 Akim Demaille <akim@epita.fr>
19238
19239 Bump 1.29d.
19240
19241 2001-10-02 Akim Demaille <akim@epita.fr>
19242
19243 Version 1.29c.
19244
19245 2001-10-02 Akim Demaille <akim@epita.fr>
19246
19247 * tests/regression.at (Invalid CPP headers): New.
19248 From Alexander Belopolsky.
19249 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
19250
19251 2001-10-02 Akim Demaille <akim@epita.fr>
19252
19253 * tests/regression.at (Invalid input): New.
19254 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
19255 Reported by Shura.
19256
19257 2001-10-02 Akim Demaille <akim@epita.fr>
19258
19259 * tests/calc.at: Now that --debug works, the tests must be adjusted.
19260
19261 2001-10-02 Akim Demaille <akim@epita.fr>
19262
19263 * src/output.c (output_parser): Assert `skeleton'.
19264 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
19265 systems.
19266 From Shura.
19267
19268 2001-10-01 Marc Autret <autret_m@epita.fr>
19269
19270 * src/lex.h: Echo modifications.
19271 * src/lex.c (unlex): Parameter is now token_t.
19272 From Hans Aberg.
19273
19274 2001-10-01 Marc Autret <autret_m@epita.fr>
19275
19276 * src/main.c: Include lex.h.
19277 From Hans Aberg.
19278
19279 2001-09-29 Akim Demaille <akim@epita.fr>
19280
19281 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
19282
19283 2001-09-28 Akim Demaille <akim@epita.fr>
19284
19285 * tests/testsuite.at: Update to newer Autotest.
19286 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
19287
19288 2001-09-27 Akim Demaille <akim@epita.fr>
19289
19290 Position independent wrapper.
19291
19292 * tests/bison: Remove.
19293 * tests/bison.in: New.
19294 * configure.in: Adjust.
19295
19296 2001-09-27 Paul Eggert <eggert@twinsun.com>
19297
19298 Port quotearg fixes from tar 1.13.24.
19299
19300 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
19301 tm to be declared.
19302 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
19303 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
19304
19305 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
19306 * m4/mbrtowc.m4: New file.
19307 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
19308 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
19309
19310 2001-09-27 Akim Demaille <akim@epita.fr>
19311
19312 Bump to 1.29c.
19313
19314 2001-09-27 Akim Demaille <akim@epita.fr>
19315
19316 Version 1.29b.
19317
19318 2001-09-25 Akim Demaille <akim@epita.fr>
19319
19320 * src/system.h: Include `xalloc.h'.
19321 Remove it from the C files.
19322 * src/files.c (output_files): Free the obstacks.
19323 * src/lex.c (init_lex): Rename as...
19324 (lex_init): this.
19325 (lex_free): New.
19326 * src/main.c (main): Use it.
19327
19328 2001-09-24 Marc Autret <autret_m@epita.fr>
19329
19330 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
19331 to output informations in fout (FILE*).
19332 (open_graph, close_graph): Likewise.
19333 (output_graph, output_edge, output_node): Likewise.
19334 * src/vcg.h: Update function prototypes.
19335 * src/print_graph.c (print_graph): Open output graph file.
19336 (print_actions): Adjust.
19337 * src/files.h: Remove extern declaration.
19338 * src/files.c: Remove graph_obstack declaration.
19339 (open_files): Remove graph_obstack initialization.
19340 (output_files): Remove graph_obstack saving.
19341
19342 2001-09-24 Marc Autret <autret_m@epita.fr>
19343
19344 * src/files.c (compute_output_file_names): Fix.
19345
19346 2001-09-24 Marc Autret <autret_m@epita.fr>,
19347 Akim Demaille <akim@epita.fr>
19348
19349 * src/reader.c (reader): Remove call to free_symtab ().
19350 * src/main.c (main): Call it here.
19351 Include symtab.h.
19352 * src/conflicts.c (initialize_conflicts): Rename as...
19353 (solve_conflicts): this.
19354 * src/print.c (print_core, print_actions, print_state)
19355 (print_grammar): Dump to a file instead a `output_obstack'.
19356 (print_results): Dump `output_obstack', and then proceed with the
19357 FILE *.
19358 * src/files.c (compute_output_file_names, close_files): New.
19359 (output_files): Adjust.
19360 * src/main.c (main): Adjust.
19361
19362 2001-09-23 Marc Autret <autret_m@epita.fr>
19363
19364 * src/files.c (compute_header_macro): Computes header macro name
19365 from spec_defines_file when given.
19366
19367 2001-09-23 Marc Autret <autret_m@epita.fr>
19368
19369 * src/files.c (output_files): Add default extensions.
19370
19371 2001-09-22 Akim Demaille <akim@epita.fr>
19372
19373 * src/conflicts.c (finalize_conflicts): Rename as...
19374 (free_conflicts): this.
19375
19376 2001-09-22 Akim Demaille <akim@epita.fr>
19377
19378 * src/gram.c (gram_free): Rename back as...
19379 (dummy): this.
19380 (output_token_translations): Free `token_translations'.
19381 * src/symtab.c (free_symtab): Free the tag field.
19382
19383 2001-09-22 Akim Demaille <akim@epita.fr>
19384
19385 Remove `translations' as it is always set to true.
19386
19387 * src/gram.h: Adjust.
19388 * src/reader.c (packsymbols, parse_token_decl): Adjust
19389 * src/print.c (print_grammar): Adjust.
19390 * src/output.c (output_token_translations): Adjust.
19391 * src/lex.c (lex): Adjust.
19392 * src/gram.c: Be sure the set pointers to NULL.
19393 (dummy): Rename as...
19394 (gram_free): this.
19395
19396 2001-09-22 Akim Demaille <akim@epita.fr>
19397
19398 * configure.in: Invoke AM_LIB_DMALLOC.
19399 * src/system.h: Use dmalloc.
19400 * src/LR0.c: Be sure to have pointers initialized to NULL.
19401 (allocate_itemsets): Allocate kernel_items only if needed.
19402
19403 2001-09-22 Akim Demaille <akim@epita.fr>
19404
19405 * configure.in: Bump to 1.29b.
19406 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
19407 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
19408 need xmalloc.c in calc.y.
19409 From Pascal Bart.
19410
19411 2001-09-21 Akim Demaille <akim@epita.fr>
19412
19413 Version 1.29a.
19414 * Makefile.maint, config/config.guess, config/config.sub,
19415 * config/missing: Update from masters.
19416 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
19417 upon package.m4.
19418 * configure.in (ALL_LINGUAS): Add `tr'.
19419
19420 2001-09-21 Akim Demaille <akim@epita.fr>
19421
19422 * tests/Makefile.am (package.m4): Move to...
19423 ($(srcdir)/$(TESTSUITE)): here.
19424
19425 2001-09-20 Akim Demaille <akim@epita.fr>
19426
19427 * src/complain.c: No longer try to be standalone: use system.h.
19428 Don't assume __STDC__ is defined to 1. Just test if it is defined.
19429 * src/complain.h: Likewise.
19430 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
19431 Remove the unused variable `n'.
19432 From Albert Chin-A-Young.
19433
19434 2001-09-18 Marc Autret <autret_m@epita.fr>
19435
19436 * doc/bison.1: Update.
19437 * doc/bison.texinfo (Bison Options): Update --defines and --graph
19438 descriptions.
19439 (Option Cross Key): Update.
19440 Add --graph.
19441
19442 2001-09-18 Marc Autret <autret_m@epita.fr>
19443
19444 * tests/regression.at: New test (comment in %union).
19445
19446 2001-09-18 Marc Autret <autret_m@epita.fr>
19447
19448 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
19449 do that.
19450 Reported by Keith Browne.
19451
19452 2001-09-18 Marc Autret <autret_m@epita.fr>
19453
19454 * tests/output.at: Add tests for --defines and --graph.
19455
19456 2001-09-18 Marc Autret <autret_m@epita.fr>
19457
19458 * tests/output.at: Removes tests of %{header,src}_extension features.
19459
19460 2001-09-18 Akim Demaille <akim@epita.fr>
19461
19462 * tests/Makefile.am (package.m4): New.
19463 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
19464 (_AT_CHECK_CALC_ERROR): Likewise.
19465 Factor the `, ' part of verbose error messages.
19466
19467 2001-09-18 Marc Autret <autret_m@epita.fr>
19468
19469 * src/getargs.c (longopts): Declare --defines and --graph as options
19470 with optional arguments.
19471 * src/files.h: Add extern declarations.
19472 * src/files.c (spec_graph_file, spec_defines_file): New.
19473 (output_files): Update.
19474 Remove CPP-outed code.
19475
19476 2001-09-18 Marc Autret <autret_m@epita.fr>
19477
19478 Turn off %{source,header}_extension feature.
19479
19480 * src/files.c (compute_exts_from_gf): Update.
19481 (compute_exts_from_src): Update.
19482 (output_files): CPP-out useless code.
19483 * src/files.h: Remove {header,source}_extension extern declarations.
19484 * src/reader.c (parse_dquoted_param): CPP-out.
19485 (parse_header_extension_decl): Remove.
19486 (parse_source_extension_decl): Remove.
19487 (read_declarations): Remove cases tok_{hdrext,srcext}.
19488 * src/lex.c (percent_table): Remove {header,source}_extension entries.
19489 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
19490
19491 2001-09-10 Akim Demaille <akim@epita.fr>
19492
19493 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
19494 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
19495 (AT_CHECK_OUTPUT): this.
19496 Merely check ls' exit status, its output is useless.
19497
19498 2001-09-10 Akim Demaille <akim@epita.fr>
19499
19500 * tests/calc.at: Use m4_match.
19501 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
19502
19503 2001-09-10 Marc Autret <autret_m@epita.fr>,
19504 Akim Demaille <akim@epita.fr>
19505
19506 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
19507 enum color_e.
19508 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
19509 to `normal'.
19510 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
19511 * src/lex.h: Adjust prototype.
19512 (token_t): Add `tok_undef'.
19513 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
19514 (parse_percent_token): Now returns token_t.
19515 Add default statement in switch.
19516 (lex): Separate `c' as an input variable, from the token_t result
19517 part.
19518 (unlexed): Is a token_t.
19519
19520 2001-09-10 Akim Demaille <akim@epita.fr>
19521
19522 * configure.in: Bump to 1.29a.
19523
19524 2001-09-07 Akim Demaille <akim@epita.fr>
19525
19526 Version 1.29.
19527
19528 2001-08-30 Akim Demaille <akim@epita.fr>
19529
19530 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
19531 * m4/atconfig.m4: Remove.
19532 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
19533 * tests/bison: New.
19534 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
19535 m4_if, m4_patsubst, and m4_regexp.
19536 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
19537 `input' file instead of echo.
19538
19539 2001-08-29 Akim Demaille <akim@epita.fr>
19540
19541 Bump to 1.28e.
19542
19543 2001-08-29 Akim Demaille <akim@epita.fr>
19544
19545 Version 1.28d.
19546
19547 2001-08-29 Paul Eggert <eggert@twinsun.com>
19548
19549 * src/bison.simple (yyparse): Don't take the address of an
19550 item before the start of an array, as that doesn't conform to
19551 the C Standard.
19552
19553 2001-08-29 Robert Anisko <anisko_r@epita.fr>
19554
19555 * doc/bison.texinfo (Location Tracking Calc): New node.
19556
19557 2001-08-29 Paul Eggert <eggert@twinsun.com>
19558
19559 * src/output.c (output): Do not define const, as this now
19560 causes more problems than it cures.
19561
19562 2001-08-29 Akim Demaille <akim@epita.fr>
19563
19564 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
19565 the nodes.
19566 Be sure to tag the `detailmenu'.
19567
19568 2001-08-29 Akim Demaille <akim@epita.fr>
19569
19570 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
19571 download in a tmp dir.
19572
19573 2001-08-28 Marc Autret <autret_m@epita.fr>
19574
19575 * config/depcomp: New file.
19576
19577 2001-08-28 Marc Autret <autret_m@epita.fr>
19578
19579 * doc/bison.1 (mandoc): Adjust.
19580 From Juan Manuel Guerrero.
19581
19582 2001-08-28 Marc Autret <autret_m@epita.fr>
19583
19584 * src/print_graph.c (print_state): Fix.
19585
19586 2001-08-27 Marc Autret <autret_m@epita.fr>
19587
19588 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
19589 char * members.
19590 Echo modifications to the functions prototypes.
19591 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
19592
19593 2001-08-27 Marc Autret <autret_m@epita.fr>
19594
19595 * src/vcg.c: Include `xalloc.h'.
19596 (add_colorentry): New.
19597 (add_classname): New.
19598 (add_infoname): New.
19599 * src/vcg.h: Add new prototypes.
19600
19601 2001-08-27 Akim Demaille <akim@epita.fr>
19602
19603 * Makefile.maint: Sync. again with CVS Autoconf.
19604
19605 2001-08-27 Akim Demaille <akim@epita.fr>
19606
19607 * Makefile.maint: Formatting changes.
19608 (po-update, cvs-update, update): New targets.
19609 (AMTAR): Remove.
19610
19611 2001-08-27 Akim Demaille <akim@epita.fr>
19612
19613 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19614 * Makefile.maint: Sync. with CVS Autoconf.
19615
19616 2001-08-27 Marc Autret <autret_m@epita.fr>
19617
19618 * src/vcg.h (struct infoname_s): New.
19619 (struct colorentry_s): New.
19620 (graph_s): New fields {vertical,horizontal}_order in structure.
19621 Add `infoname' field.
19622 Add `colorentry' field;
19623 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
19624 (G_HORIZONTAL_ORDER): New.
19625 (G_INFONAME): New.
19626 (G_COLORENTRY): New.
19627 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
19628 Add output of `infoname'.
19629 Add output of `colorentry'.
19630
19631 2001-08-27 Marc Autret <autret_m@epita.fr>
19632
19633 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
19634 This one shadowed a global parameter.
19635
19636 2001-08-24 Marc Autret <autret_m@epita.fr>
19637
19638 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
19639 instead of `unsigned'.
19640 (print_state): Do not call obstack_object_size () in obstack_grow ()
19641 to avoid macro variables shadowing.
19642
19643 2001-08-23 Marc Autret <autret_m@epita.fr>
19644
19645 * src/lex.c (percent_table): Typo: s/naem/name/.
19646 Add graph option.
19647 Normalize new options declarations.
19648
19649 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
19650
19651 * tests/suite.at: Exercise %header_extension and %source_extension.
19652
19653 2001-08-16 Marc Autret <autret_m@epita.fr>
19654
19655 * src/reader.c (parse_dquoted_param): New.
19656 (parse_header_extension_decl): Use it.
19657 (parse_source_extension_decl): Likewise.
19658
19659 2001-08-16 Marc Autret <autret_m@epita.fr>
19660
19661 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
19662 (get_xxxx_str): Use assert () instead of complain ().
19663 Remove return invokations in default cases.
19664 (get_decision_str): Modify default behaviour. Remove second argument.
19665 Echo modifications on calls.
19666 (output_graph): Fix.
19667
19668 2001-08-16 Marc Autret <autret_m@epita.fr>
19669
19670 * src/getargs.c (usage): Update with ``-g, --graph''.
19671
19672 2001-08-16 Marc Autret <autret_m@epita.fr>
19673
19674 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
19675 (Option Cross Key): Likewise.
19676 * doc/bison.1: Update.
19677
1c8c2190
PB
196782001-09-25 Pascal Bart <pascal.bart@epita.fr>
19679
19680 * src/output.c (output_master_parser): Don't finish action_obstack.
19681 (output_parser): Don't care about the muscle action, here.
19682 (prepare): Copy the action_obstack in the action muscle.
19683 (output): Free action_obstack.
19684
180d45ba
PB
196852001-09-23 Pascal Bart <pascal.bart@epita.fr>
19686
19687 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
19688 will contain `%union' declaration.
19689 (parse_union_decl): Delete #line directive output.
19690 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
19691 informations about %union.
19692 (parse_union_decl): Copy the union_obstack in the muscle stype.
19693 * src/bison.simple: Add new #line directive.
19694 Add typdef %%stype YYSTYPE.
19695
c51d1a19
PB
196962001-09-23 Pascal Bart <pascal.bart@epita.fr>
19697
19698 * src/bison.simple: Add new `#line' directive.
19699
6f9344da
PB
197002001-09-22 Pascal Bart <pascal.bart@epita.fr>
19701
19702 * src/bison.simple: New `#line' directive.
19703 * src/output.c (output_parser): Support new dynamic muscle input_line.
19704
652def80
MA
197052001-09-22 Marc Autret <autret_m@epita.fr>
19706
19707 * src/output.c (output_master_parser): New.
19708 (output_parser): Be more re-entrant.
19709
25b222fa
MA
197102001-09-21 Marc Autret <autret_m@epita.fr>
19711
19712 * src/reader.c (copy_definition, parse_union_decl): Update and use
19713 `linef' muscle.
19714 (copy_action): Likewise.
19715 Use obstack_1grow ().
19716 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
19717
6bc35ae5
MA
197182001-09-21 Marc Autret <autret_m@epita.fr>
19719
19720 * src/options.c (option_table): Adjust.
19721 * src/lex.c (parse_percent_token): Fix.
19722
c0629aa1
PB
197232001-09-20 Pascal Bart <pascal.bart@epita.fr>
19724
19725 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 19726
82b6d266
PB
197272001-09-20 Pascal Bart <pascal.bart@epita.fr>
19728
19729 * src/lex.c (parse_percent_token): Change type of variable `tx', which
19730 is now an option_table_struct*.
19731 (option_strcmp): New function option_strcmp.
19732 (parse_percent_token): Call option_strcmp.
19733 * src/getargs.c (xalloc.h, options.h): Include it.
19734 (getargs): Call create_long_option_table.
19735 (getargs): Free longopts at the end of the function.
19736 (shortopts): Move in options.c.
19737 * src/options.c (create_long_option_table): New function. Convert
19738 information from option_table to option structure.
19739 * src/reader.c (options.h): Include it.
19740
19741 * src/Makefile.am: Adjust.
19742 * src/options.c (option_table): Create from longopts and percent_table.
19743 * src/getargs.c (longopts): Delete.
19744 * src/lex.c (struct percent_table_struct): Delete.
19745 (percent_table): Delete.
19746 (options.h): Include it.
19747 * src/options.c: Create.
19748 * src/options.h: Create.
19749 Declare enum opt_access_e.
19750 Define struct option_table_struct.
19751
75f5aaea
MA
197522001-09-20 Marc Autret <autret_m@epita.fr>
19753
19754 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
19755 sections of Bison.
19756
f508cb0a
PB
197572001-09-19 Pascal Bart <pascal.bart@epita.fr>
19758
19759 * src/bison.simple: s/%%filename/%%skeleton.
19760 * src/muscle_tab.c (getargs.h): Include it.
19761 (muscle_init): Insert new muscle skeleton.
19762
13105fc1
PB
197632001-09-18 Pascal Bart <pascal.bart@epita.fr>
19764
19765 * src/output.c (output_parser): Delete unused variable actions_dumped.
19766
b0c4483e
PB
197672001-09-07 Pascal Bart <pascal.bart@epita.fr>
19768
19769 * src/output.c (output): Delete call to reader_output_yylsp.
19770 * src/reader.c (reader): Likewise.
ba0fe3c7 19771 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 19772
11d82f03
MA
197732001-09-02 Marc Autret <autret_m@epita.fr>
19774
19775 * src/reader.c: Include muscle_tab.h.
19776 (parse_union_decl): Update.
19777 (parse_macro_decl): Rename parse_muscle_decl.
19778 Update to use renamed functions and variable.
19779 (read_declarations, copy_action, read_additionnal_code, : Updated
19780 with correct variables and functions names.
19781 (packsymbols, reader): Likewise.
342b8b6e 19782
11d82f03 19783 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 19784
11d82f03
MA
19785 * src/output.c: Include muscle_tab.h
19786 In all functions using macro_insert, change by using muscle_insert ().
19787 (macro_obstack): Rename muscle_obstack.
19788 Echo modifications in the whole file.
19789 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
19790 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
19791 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
19792
19793 * src/muscle_tab.h: Update double inclusion macros.
19794 (macro_entry_s): Rename muscle_entry_s.
19795 Update prototypes.
342b8b6e 19796
11d82f03
MA
19797 * src/muscle_tab.c: Include muscle_tab.h.
19798 Rename macro_tabble to muscle_table.
19799 (mhash1, mhash2, mcmp): Use muscle_entry.
19800 (macro_init): Rename muscle_init. Update.
19801 (macro_insert): Rename muscle_insert. Update.
19802 (macro_find): Rename muscle_find. Update.
19803
19804 * src/main.c: Include muscle_tab.h.
19805 (main): Call muscle_init ().
19806 * src/Makefile.am (bison_SOURCES): Echo modifications.
19807
93a37297
MA
198082001-09-02 Marc Autret <autret_m@epita.fr>
19809
f753cd62 19810 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 19811
f753cd62
MA
19812 * src/muscle_tab.c, src/muscle_tab.h: Add files.
19813
198142001-09-02 Marc Autret <autret_m@epita.fr>
19815
19816 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 19817
682d48cd
PB
198182001-09-01 Pascal Bart <pascal.bart@epita.fr>
19819
342b8b6e 19820 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
19821 filename.
19822
087c8fda
MA
198232001-09-01 Marc Autret <autret_m@epita.fr>
19824
19825 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
19826 to an explicit value to activate the feature. We do it here.
19827
dda680cb
PB
198282001-08-31 Pascal Bart <pascal.bart@epita.fr>
19829
19830 * src/output.c (prepare): Delete the `filename' muscule insertion.
19831 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
19832 (parse_union_decl): Likewise.
19833 * src/macrotab.c (macro_init): Initialize filename by infile.
19834
9e644e64
MA
198352001-08-31 Marc Autret <autret_m@epita.fr>
19836
19837 * src/bison.simple (YYLSP_NEEDED): New definition.
19838 * src/output.c (prepare): Add macro insertion of `locations_flag'
19839
17da6427
PB
198402001-08-31 Pascal Bart <pascal.bart@epita.fr>
19841
19842 * src/output.c (prepare): Delete insertion of previous muscles,
19843 and insert the `prefix' muscles.
19844 * src/macrotab.c (macro_init): Likewise.
19845 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 19846 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
19847 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
19848 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 19849 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
19850 name_prefix.
19851
e8cb70b9
PB
198522001-08-31 Pascal Bart <pascal.bart@epita.fr>
19853
19854 * src/main.c (main): Standardize.
19855 * src/output.c (output_table_data, output_parser): Likewise.
19856 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
19857
63c2d5de
MA
198582001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
19859
342b8b6e 19860 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
19861 %%epilogue.
19862 * src/output.c (output): Rename %%declarations to %%prologue.
19863 * src/bison.simple: Echo modifications.
342b8b6e 19864
d8cb5183
MA
198652001-08-31 Marc Autret <autret_m@epita.fr>
19866
19867 * src/reader.c (readgram): CleanUp.
19868 (output_token_defines): Likewise.
19869 (packsymbols): Likewise.
19870 (reader): Likewise.
19871 * src/output.c (output): CPP-out useless code.
19872
6c686258
PB
198732001-08-31 Pascal Bart <pascal.bart@epita.fr>
19874
342b8b6e 19875 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
19876 output_trailers and output_headers.
19877 * src/output.h: Remove obsolete functions prototypes of output_headers
19878 and output_trailers.
19879
8f451ef7
PB
198802001-08-30 Pascal Bart <pascal.bart@epita.fr>
19881
19882 * src/main.c: Include macrotab.h.
342b8b6e 19883 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
19884 Adjust functions prototypes.
19885 * src/macrotab.c (macro_insert): Constify key and value.
19886 (macro_find): Constify key.
19887 (macro_insert): Include 'xalloc.h'
19888 (macro_insert): Use XMALLOC.
19889 (macro_find): Constify return value.
19890 * src/output.c (output_table_data): Rename table to table_data.
19891 (output_parser): Constify macro_key, macro_value.
19892
997b6fd0 198932001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
19894
19895 * src/reader.c (parse_skel_decl): New.
342b8b6e 19896 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
19897 * src/lex.h (token_t): New token `tok_skel'.
19898 * src/lex.c (percent_table): Add skeleton option entry.
19899 Standardize.
19900
ff48177d
MA
199012001-08-29 Marc Autret <autret_m@epita.fr>
19902
19903 * src/bison.simple: Add %%user_code directive at the end.
19904 * src/reader.c (read_additionnal_code): New.
19905 (reader): Use it.
19906 * src/output.c (output_program): Remove.
19907 (output): Update.
19908
b33160bf
MA
199092001-08-28 Marc Autret <autret_m@epita.fr>
19910
19911 * src/output.c (output_actions): Clean up.
4e5caae2 19912 (output_gram): CPP-out useless code.
b33160bf
MA
19913 * src/reader.c (reader): Clean up, CPP-out useless code.
19914
d1a2daf7
PB
199152001-08-28 Pascal Bart <pascal.bart@epita.fr>
19916
342b8b6e 19917 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 19918 directive.
d1a2daf7
PB
19919 * src/bison.simple: Add `%%definitions'.
19920
2b763dfe
MA
199212001-08-28 Marc Autret <autret_m@epita.fr>
19922
19923 * config/depcomp: New file.
19924
f1a87ef6
PE
199252001-08-27 Paul Eggert <eggert@twinsun.com>
19926
19927 * src/bison.simple (yyparse): Don't take the address of an
19928 item before the start of an array, as that doesn't conform to
19929 the C Standard.
19930
82e236e2
RA
199312001-08-27 Robert Anisko <robert.anisko@epita.fr>
19932
f1a87ef6 19933 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
19934 obstack. It was done too late here.
19935
19936 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
19937 completely wrong.
19938 (reader): Initialize the macro obstack here, since we need it to grow
19939 '%define' directives.
19940
19941 * src/reader.h: Declare the macro obstack as extern.
19942
b0cfa28a
RA
199432001-08-27 Robert Anisko <robert.anisko@epita.fr>
19944
19945 * src/output.c (output_parser): Fix. Store single '%' characters in
19946 the output obstack instead of throwing them away.
19947
6fc74234
AD
199482001-08-27 Akim Demaille <akim@epita.fr>
19949
19950 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19951
9c76d118
RA
199522001-08-25 Robert Anisko <robert.anisko@epita.fr>
19953
19954 * lib/Makefile.am: Adjust.
19955
a8289c62
RA
199562001-08-25 Robert Anisko <robert.anisko@epita.fr>
19957
19958 * src/bison.simple: Update and add '%%' directives.
19959
b6610515
RA
199602001-08-25 Robert Anisko <robert.anisko@epita.fr>
19961
19962 * src/reader.c (reader): Remove calls to 'output_headers' and
19963 'output_trailers'. Remove some C output.
19964 (readgram): Disable a piece of code that was writing a default
19965 definition for 'YYSTYPE'.
19966 (reader_output_yylsp): Remove.
19967 (packsymbols): Output token defintions to a macro.
19968 (copy_definition): Disable C output.
6fc74234 19969
b6610515
RA
19970 * src/reader.c (parse_macro_decl): New function used to parse macro
19971 declarations.
19972 (copy_string2): Put the body of copy_string into this new function.
19973 Add a parameter to let the caller choose whether he wants to copy the
19974 string delimiters or not.
19975 (copy_string): Be a simple call to copy_string2 with the last argument
19976 bound to true.
19977 (read_declarations): Add case for macro definition.
19978 (copy_identifier): New.
6fc74234 19979 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
19980 rather than lex.
19981
26f609ff
RA
199822001-08-25 Robert Anisko <robert.anisko@epita.fr>
19983
19984 * src/output.c (prepare): Add prefixed names.
19985 (output_parser): Output semantic actions.
19986 (output_parser): Fix bug on '%%line' directives.
6fc74234 19987
26f609ff
RA
19988 * src/output.c (output_headers): Remove. The C code printed by this
19989 function should now be in the skeletons.
19990 (output_trailers): Remove.
19991 (output): Disable call to 'reader_output_yylsp'.
19992 (output_rule_data): Do not output tables to the table obstack.
19993
19994 * src/output.c: Remove some C dedicated output.
19995 Improve the use of macro and output obstacks.
19996 (output_defines): Remove.
6fc74234 19997
26f609ff
RA
19998 * src/output.c (output_token_translations): Associate 'translate'
19999 table with a macro. No output to the table obstack.
20000 (output_gram): Same for 'rhs' and 'prhs'.
20001 (output_stos): Same for 'stos'.
20002 (output_rule_data): Same for 'r1' and 'r2'.
20003 (token_actions): Same for 'defact'.
20004 (goto_actions): Same for 'defgoto'.
20005 (output_base): Same for 'pact' and 'pgoto'.
20006 (output_table): Same for 'table'.
20007 (output_check): Same for 'check'.
6fc74234 20008
26f609ff
RA
20009 * src/output.c (output_table_data): New function.
20010 (output_short_table): Remove.
20011 (output_short_or_char_table): Remove.
6fc74234 20012
26f609ff
RA
20013 * src/output.c (output_parser): Replace most of the skeleton copy code
20014 with something new. Skeletons are now processed character by character
20015 rather than line by line, and Bison looks for '%%' macros. This is the
20016 first step in making Bison's output process (a lot) more flexible.
20017 (output_parser): Use the macro table.
20018
6f43b113
RA
200192001-08-25 Robert Anisko <robert.anisko@epita.fr>
20020
20021 * src/main.c (main): Initialize the macro table.
20022
dd3127cf
RA
200232001-08-25 Robert Anisko <robert.anisko@epita.fr>
20024
20025 * src/lex.c (percent_table): Add tok_define.
20026 * src/lex.h: Add tok_define.
20027
aa321494
RA
200282001-08-25 Robert Anisko <robert.anisko@epita.fr>
20029
20030 * src/macrotab.c: New file.
20031 * src/macrotab.h: New file.
20032 * src/Makefile.am: Update.
20033
68bd3b6b
RA
200342001-08-25 Robert Anisko <robert.anisko@epita.fr>
20035
20036 * lib/hash.c: New file.
20037 * lib/hash.h: New file.
20038 * lib/Makefile.am: Update.
20039
45f8dd1e
AD
200402001-08-15 Akim Demaille <akim@epita.fr>
20041
20042 Version 1.28c.
20043
40a64a7a 200442001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
20045
20046 * src/reader.c (readgram): Indent output macro YYSTYPE.
20047 (packsymbols): Likewise.
20048 (output_token_defines): Likewise.
20049 * src/files.c: Standardize.
20050 (compute_header_macro): New.
20051 (defines_obstack_save): New. Use compute_header_macro.
20052 (output_files): Update. Use defines_obstack_save.
20053
f9a8293a
AD
200542001-08-15 Akim Demaille <akim@epita.fr>
20055
20056 * doc/bison.texinfo (Table of Symbols): Document
20057 YYSTACK_USE_ALLOCA.
20058
150ca7a7
AD
200592001-08-15 Akim Demaille <akim@epita.fr>
20060
20061 * missing: Update from CVS Automake.
20062 * config/config.guess, config/config.sub, config/texinfo.tex:
20063 Update from gnu.org.
20064
69b5cec4
AD
200652001-08-15 Akim Demaille <akim@epita.fr>
20066
20067 * Makefile.maint: Sync with CVS Autoconf.
20068
f2b5126e
PB
200692001-08-14 Pascal Bart <pascal.bart@epita.fr>
20070
69b5cec4 20071 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
20072 `fdl.texi'.
20073 * doc/fdl.texi: Add to package.
20074
4ecbf796
MA
200752001-08-14 Marc Autret <autret_m@epita.fr>
20076
20077 Turn on %{source,header}_extension features.
20078
69b5cec4 20079 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
20080 source_extension.
20081 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 20082 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
20083 between options.
20084
95fb5662
MA
200852001-08-14 Marc Autret <autret_m@epita.fr>
20086
20087 * src/files.c (compute_base_names): Add extensions computing when
20088 `--file-prefix' used.
20089 Standardize function calls.
20090
78d09da9
MA
200912001-08-13 Marc Autret <autret_m@epita.fr>
20092
69b5cec4 20093 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
20094 defining it (defined but null disables alloca).
20095
5a009f2c
MA
200962001-08-13 Marc Autret <autret_m@epita.fr>
20097
20098 * src/bison.simple (_yy_memcpy): CPP reformat.
20099
1e41465a
PB
201002001-08-13 Pascal Bart <pascal.bart@epita.fr>
20101
20102 * tests/atconfig.in (CPPFLAGS): Fix.
20103
c67a198d
PB
201042001-08-10 Pascal Bart <pascal.bart@epita.fr>
20105
79282c6c 20106 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
20107 `gpl.texi'.
20108 * doc/gpl.texi: Add to package.
20109
09a6de7e
MA
201102001-08-10 Marc Autret <autret_m@epita.fr>
20111
20112 * src/print_graph.h: Fix.
20113 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
20114
b77b9ee0
AD
201152001-08-10 Akim Demaille <akim@epita.fr>
20116
20117 * src/system.h: Provide default declarations for stpcpy, strndup,
20118 and strnlen.
20119
3e259915
MA
201202001-08-10 Robert Anisko <anisko_r@epita.fr>
20121
20122 * doc/bison.texinfo (Locations): Update @$ stuff.
20123
ca96bc2d
MA
201242001-08-09 Robert Anisko <anisko_r@epita.fr>
20125
20126 * src/bison.simple (YYLLOC_DEFAULT): Update.
20127 (yyparse): Adjust.
20128
fdc6758b
MA
201292001-08-08 Marc Autret <autret_m@epita.fr>
20130
b77b9ee0 20131 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
20132 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
20133 Reported by Fabrice Bauzac.
957d4dbf 20134
600cad3b
MA
201352001-08-08 Marc Autret <autret_m@epita.fr>
20136
20137 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
20138 * src/vcg.c (output_node): Fix.
20139 * src/vcg.h: Cleanup.
20140 * src/print_graph.c: Add comments.
b77b9ee0 20141 (node_output_size): New global variable. Simplify the formatting of
600cad3b 20142 the VCG graph output.
b77b9ee0 20143 (print_actions): Unused code is now used. It notifies the final state
600cad3b 20144 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 20145 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
20146 blue.
20147 Get the current node name and node_obstack by argument.
20148 (node_obstack): New variable.
20149 (print_state): Manage node_obstack.
20150 (print_core): Use node_obstack given by argument.
20151 A node is not only computed here but in print_actions also.
20152 (print_graph): CPP out useless code instead of commenting it.
20153
976e528f
AD
201542001-08-07 Pascal Bart <pascal.bart@epita.fr>
20155
20156 * tests/atconfig.in (CPPFLAGS): Fix.
20157
20e8e5ca
AD
201582001-08-07 Akim Demaille <akim@epita.fr>
20159
20160 * src/print_graph.c (quote): New.
20161 (print_core): Use it.
20162
957d4dbf 201632001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 20164
3e3da797
AD
20165 * src/vcg.c (complain.h): Include it.
20166 Unepitaize `return' invocations.
c4b66126 20167 [NDEBUG] (main): Remove.
79282c6c 20168 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
20169 * src/files.c (open_files): Initialize graph_obstack.
20170 * src/print_graph.c (print_actions): CPP out useless code.
20171 (print_core): Don't output the last `\n' in labels.
20172 Use `quote'.
20173 * src/files.c (output_files): Output the VCG file.
20174 * src/main.c (main): Invoke print_graph ();
3e3da797 20175
957d4dbf 201762001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
20177
20178 Automaton VCG graph output.
20179 Using option ``-g'' or long option ``--graph'', you can generate
20180 a gram_filename.vcg file containing a VCG description of the LALR (1)
20181 automaton of your grammar.
20182
20183 * src/main.c: Call to print_graph() function.
20184 * src/getargs.h: Update.
20185 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
20186 (graph_flag): New flag.
20187 (longopts): Update.
20188 (getargs): Add case `g'.
20189 * src/files.c (graph_obstack): New obstack struct.
20190 (open_files): Initialize new obstack.
20191 (output_files): Saves graph_obstack if required.
20192 * src/files.h (graph_obstack): New extern declaration.
20193 * src/Makefile.am: Add new source files.
20194
927c1557 201952001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
20196
20197 * src/print_graph.c, src/print_graph.h (graph): New.
20198 * src/vcg.h: New file.
20199 * src/vcg.c: New file, VCG graph handling.
20200
7333d403
AD
202012001-08-06 Marc Autret <autret_m@epita.fr>
20202
20203 Add of %source_extension and %header_extension which specify
20204 the source or/and the header output file extension.
20205
20206 * src/files.c (compute_base_names): Remove initialisation of
20207 src_extension and header_extension.
20208 (compute_exts_from_gf): Update.
20209 (compute_exts_from_src): Update.
20210 (output_files): Update.
20211 * src/reader.c (parse_header_extension_decl): New.
20212 (parse_source_extension_decl): New.
20213 (read_declarations): New case statements for the new tokens.
20214 * src/lex.c (percent_table): Add entries for %source_extension
20215 and %header_extension.
20216 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
20217
84163231
AD
202182001-08-06 Marc Autret <autret_m@epita.fr>
20219
20220 * configure.in: Bump to 1.28c.
20221 * doc/bison.texinfo: Texinfo thingies.
20222
8303fc42
AD
202232001-08-04 Pascal Bart <pascal.bart@epita.fr>
20224
20225 * tests/atconfig.in (CPPFLAGS): Add.
20226 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
20227
70a84437
AD
202282001-08-03 Akim Demaille <akim@epita.fr>
20229
20230 Version 1.28b.
20231
2ce10144
AD
202322001-08-03 Akim Demaille <akim@epita.fr>
20233
20234 * tests/Makefile.am (check-local): Ship testsuite.
20235 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
20236 Include `string.h'.
20237
1e3e4bc1
AD
202382001-08-03 Akim Demaille <akim@epita.fr>
20239
20240 * configure.in: Try using -Wformat when compiling.
20241
42b45b7f
AD
202422001-08-03 Akim Demaille <akim@epita.fr>
20243
20244 * configure.in: Bump to 1.28b.
20245
8f13fe33
AD
202462001-08-03 Akim Demaille <akim@epita.fr>
20247
20248 * src/complain.c: Adjust strerror_r portability issues.
20249
b37ba92c
AD
202502001-08-03 Akim Demaille <akim@epita.fr>
20251
20252 Version 1.28a.
20253
b0ce6046
AD
202542001-08-03 Akim Demaille <akim@epita.fr>
20255
20256 * src/getargs.c, src/getarg.h (skeleton)): Constify.
20257 * src/lex.c (literalchar): Avoid name clashes on `buf'.
20258 * src/getargs.c: Include complain.h.
20259 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
20260 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
20261
d01c415b
AD
202622001-08-03 Akim Demaille <akim@epita.fr>
20263
20264 * src/reader.c (readgram): Display hidden chars in error messages.
20265
459dd1a6
AD
202662001-08-03 Akim Demaille <akim@epita.fr>
20267
20268 Update to gettext 0.10.39.
20269
53b74c0c
AD
202702001-08-03 Akim Demaille <akim@epita.fr>
20271
20272 * lib/strspn.c: New.
20273
234a3be3
AD
202742001-08-01 Marc Autret <autret_m@epita.fr>
20275
20276 * doc/bison.texinfo: Update.
20277 * doc/bison.1 (mandoc): Update.
20278 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
20279 * src/files.c: Support output files extensions computing.
20280 (src_extension): New static variable.
20281 (header_extension): New static variable.
20282 (tr): New function.
20283 (get_extension_index): New function, gets the index of an extension
20284 filename in a string.
20285 (compute_exts_from_gf): New function, computes extensions from the
20286 grammar file extension.
20287 (compute_exts_from_src): New functions, computes extensions from the
20288 C source file extension, file given by ``-o'' option.
20289 (compute_base_names): Update.
20290 (output_files): Update.
20291
847bf1f5
AD
202922001-08-01 Robert Anisko <anisko_r@epita.fr>
20293
d995fee7 20294 * doc/bison.texi: Document @$.
847bf1f5
AD
20295 (Locations): New section.
20296
d074a105
AD
202972001-07-18 Akim Demaille <akim@epita.fr>
20298
20299 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
20300 * config/prev-version.txt, config/move-if-change: New.
20301 * Makefile.am: Adjust.
20302
3419715d
AD
203032001-07-08 Pascal Bart <pascal.bart@epita.fr>
20304
20305 * src/bison.simple (yyparse): Suppress warning `comparaison
20306 between signed and unsigned'.
20307
62ab6972
AD
203082001-07-05 Pascal Bart <pascal.bart@epita.fr>
20309
20310 * src/getargs.h (raw_flag): Remove.
20311 * src/getargs.c: Die on `-r'/`--raw'.
20312 * src/lex.c (parse_percent_token): Die on `%raw'.
20313 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
20314 * tests/calc.at: Suppress test with option `--raw'.
20315
1e24cc5b
AD
203162001-07-14 Akim Demaille <akim@epita.fr>
20317
20318 * config/: New.
20319 * configure.in: Require Autoconf 2.50.
20320 Update to gettext 0.10.38.
20321
32dfccf8
AD
203222001-03-16 Akim Demaille <akim@epita.fr>
20323
20324 * doc/bison.texinfo: ANSIfy the examples.
20325
cd5bd6ac
AD
203262001-03-16 Akim Demaille <akim@epita.fr>
20327
20328 * getargs.c (skeleton): New variable.
20329 (longopts): --skeleton is a new option.
20330 (shortopts, getargs): -S is a new option.
20331 * getargs.h: Declare skeleton.
20332 * output.c (output_parser): Use it.
20333
5141b016
AD
203342001-03-16 Akim Demaille <akim@epita.fr>
20335
20336 * m4/strerror_r.m4: New.
20337 * m4/error.m4: Run AC_FUNC_STRERROR_R.
20338 * lib/error.h, lib/error.c: Update.
20339
447992b9
AD
203402001-03-16 Akim Demaille <akim@epita.fr>
20341
20342 * src/getargs.c (longopts): Clean up.
20343
274d42ce
AD
203442001-02-21 Akim Demaille <akim@epita.fr>
20345
20346 * src/reader.c (gensym): `gensym_count' is your own.
20347 Use a static buf to create the symbol name, as token_buffer is no
20348 longer a buffer.
20349
22c821f3
AD
203502001-02-08 Akim Demaille <akim@epita.fr>
20351
20352 * src/conflicts.c (conflict_report): Be sure not to append to res
20353 between two calls, which could happen if both first sprintf were
20354 skipped, but not the first cp += strlen.
20355
18569462
AD
203562001-02-08 Akim Demaille <akim@epita.fr>
20357
20358 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
20359 New, from fileutils 4.0.37.
20360 * configure.in: Require Autoconf 2.49c. I took some time before
20361 making this decision. This is the only way out for portability
20362 issues in Bison, it would mean way too much duplicate effort to
20363 import in Bison features implemented in 2.49c since 2.13.
20364 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
20365
0d8f3c8a
AD
203662001-02-02 Akim Demaille <akim@epita.fr>
20367
20368 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 20369 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 20370
f17bcd1f
AD
203712001-01-19 Akim Demaille <akim@epita.fr>
20372
20373 Get rid of the ad hoc handling of token_buffer in the scanner: use
20374 the obstacks.
20375
20376 * src/lex.c (token_obstack): New.
20377 (init_lex): Initialize it. No longer call...
20378 (grow_token_buffer): this. Remove it.
20379 Adjust all the places which used it to use the obstack.
20380
511e79b3
AD
203812001-01-19 Akim Demaille <akim@epita.fr>
20382
20383 * src/lex.h: Rename all the tokens:
20384 s/\bENDFILE\b/tok_eof/g;
20385 s/\bIDENTIFIER\b/tok_identifier/g;
20386 etc.
20387 Let them be enums, not #define, to ease debugging.
20388 Adjust all the code.
20389
0d6508ef
AD
203902001-01-18 Akim Demaille <akim@epita.fr>
20391
20392 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
20393 * src/lex.c (maxtoken, grow_token_buffer): Static.
20394
6deb4447
AD
203952001-01-18 Akim Demaille <akim@epita.fr>
20396
20397 Since we now use obstacks, more % directives can be enabled.
20398
20399 * src/lex.c (percent_table): Also accept `%yacc',
20400 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
20401 `%debug'.
20402 Handle the actions for `%semantic_parser' and `%pure_parser' here,
20403 instead of returning a token.
20404 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
20405 * src/reader.c (read_declarations): Adjust.
20406 * src/files.c (open_files): Don't call `compute_base_names', don't
20407 compute `attrsfile' since they depend upon data which might be
20408 *in* the input file now.
20409 (output_files): Do it here.
20410 * src/output.c (output_headers): Document the fact that this patch
20411 introduces a guaranteed SEGV for semantic parsers.
20412 * doc/bison.texinfo: Document them.
20413 * tests/suite.at: Exercise these %options.
20414
ff4423cc
AD
204152000-12-20 Akim Demaille <akim@epita.fr>
20416
20417 Also handle the output file (--verbose) with obstacks.
20418
20419 * files.c (foutput): Remove.
20420 (output_obstack): New.
20421 Adjust all dependencies.
20422 * src/conflicts.c: Return a string.
20423 * src/system.h (obstack_grow_string): Rename as...
20424 (obstack_sgrow): this. Be ready to work with non literals.
20425 (obstack_fgrow4): New.
20426
956dba3a
AD
204272000-12-20 Akim Demaille <akim@epita.fr>
20428
20429 * src/files.c (open_files): Fix the computation of short_base_name
20430 in the case of `-o foo.tab.c'.
20431
337bab46
AD
204322000-12-20 Akim Demaille <akim@epita.fr>
20433
20434 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
20435 (copy_dollar): Now that everything uses obstacks, get rid of the
20436 FILE * parameters.
20437
5d3214b8
AD
204382000-12-20 Akim Demaille <akim@epita.fr>
20439
20440 * src/files.c (open_files): Actually the `.output' file is based
20441 on the short_base_name, not base_name.
20442 * tests/suite.at (Checking output file names): Adjust.
20443
29092a57
AD
204442000-12-20 Akim Demaille <akim@epita.fr>
20445
20446 * src/bison.s1: Remove, we now use directly...
20447 * src/bison.simple: this.
20448 * src/Makefile.am: Use pkgdata instead of data.
20449
ea5607fd
AD
204502000-12-20 Akim Demaille <akim@epita.fr>
20451
20452 * src/files.c (guard_obstack): New.
20453 (open_files): Initialize it.
20454 (output_files): Dump it...
20455 * src/files.h: Export it.
20456 * src/reader.c (copy_guard): Use it.
20457
27110317
AD
204582000-12-19 Akim Demaille <akim@epita.fr>
20459
20460 * src/files.c (outfile, defsfile, actfile): Removed as global
20461 vars.
20462 (open_files): Don't compute them.
20463 (output_files): Adjust.
20464 (base_name, short_base_name): Be global.
20465 Adjust dependencies.
20466
19c50364
AD
204672000-12-19 Akim Demaille <akim@epita.fr>
20468
20469 * src/files.c (strsuffix): New.
20470 (stringappend): Be just like strcat but allocate.
20471 (base_names): Eve out from open_files.
20472 Try to simplify the rather hairy computation of base_name and
20473 short_base_name.
20474 (open_files): Use it.
20475 * tests/suite.at (Checking output file names): New test.
20476
573c1d9f
AD
204772000-12-19 Akim Demaille <akim@epita.fr>
20478
20479 * src/system.h (obstack_grow_literal_string): Rename as...
20480 (obstack_grow_string): this.
20481 * src/output.c (output_parser): Recognize `%% actions' instead of
20482 `$'.
20483 * src/bison.s1: s/$/%% actions/.
20484 * src/bison.hairy: Likewise.
20485
ef7ddedd
AD
204862000-12-19 Akim Demaille <akim@epita.fr>
20487
20488 * src/output.c (output_parser): Compute the `#line' lines when
20489 there are.
20490 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
20491 Suggested by Hans Aberg.
20492
ff61dabd
AD
204932000-12-19 Akim Demaille <akim@epita.fr>
20494
20495 Let the handling of the skeleton files be local to the procedures
20496 that use it.
20497
20498 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
20499 longer static.
20500 (fparser, open_extra_files): Remove.
20501 (open_files, output_files): Don't take care of fparser.
20502 * src/files.h: Adjust.
20503 * src/output.c (output_parser): Open and close the file to the
20504 skeleton.
20505 * src/reader.c (read_declarations): When %semantic_parser, open
20506 fguard.
20507
55b96341
AD
205082000-12-19 Akim Demaille <akim@epita.fr>
20509
20510 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
20511 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
20512
358c15b7
AD
205132000-12-19 Akim Demaille <akim@epita.fr>
20514
20515 * src/files.c (open_files): Yipee! We no longer need all the code
20516 looking for `/tmp' since we have no tmp file.
20517
7de3329e
AD
205182000-12-19 Akim Demaille <akim@epita.fr>
20519
20520 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
20521 New macros.
20522 * src/files.c (open_files): Less dependency on MSDOS etc.
20523
3abcd459
AD
205242000-12-14 Akim Demaille <akim@epita.fr>
20525
20526 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
20527 Provide a default definition.
20528 Use it when executing the default @ action.
20529 * src/reader.c (reader_output_yylsp): No longer include
20530 `timestamp' and `text' in the default YYLTYPE.
20531
2a91a95e
AD
205322000-12-12 Akim Demaille <akim@epita.fr>
20533
20534 * src/reader.c (copy_definition, parse_union_decl, copy_action)
20535 (copy_guard): Quote the file names.
20536 Reported by Laurent Mascherpa.
20537
14d3eb9b
AD
205382000-12-12 Akim Demaille <akim@epita.fr>
20539
20540 * src/output.c (output_headers, output_program, output): Be sure
20541 to escape special characters when outputting filenames.
20542 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
20543 (output_headers): Don't depend on them, Use ACTSTR.
20544
d7045ec6
AD
205452000-11-17 Akim Demaille <akim@epita.fr>
20546
20547 * lib/obstack.h: Formatting changes.
20548 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
20549 prevents type checking.
20550 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
20551 cast the value to (void *): assigning a `foo *' to a `void *'
20552 variable is valid.
20553 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
20554 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
20555 append characters.
20556
6fd54b73
AD
205572000-11-17 Akim Demaille <akim@epita.fr>
20558
20559 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
20560 as...
20561 (suite.m4, regression.m4, calc.m4): these.
20562 * tests/atgeneral.m4: Update from CVS Autoconf.
20563
4c50eae6
AD
205642000-11-17 Akim Demaille <akim@epita.fr>
20565
20566 * tests/regression.m4 (%union and --defines): New test,
20567 demonstrating a current bug in the obstack implementation.
20568
a35f64ea
AD
205692000-11-17 Akim Demaille <akim@epita.fr>
20570
20571 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
20572 macros.
20573 Use them to declare the variables which are global or local to
20574 `yyparse'.
20575
7de23534
AD
205762000-11-17 Akim Demaille <akim@epita.fr>
20577
20578 * acconfig.h: Remove, no longer used.
20579
aa7815f5
AD
205802000-11-07 Akim Demaille <akim@epita.fr>
20581
20582 * src: s/Copyright (C)/Copyright/g.
20583
5af1f549
AD
205842000-11-07 Akim Demaille <akim@epita.fr>
20585
20586 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
20587 defining.
20588 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
20589
553e2b22
AD
205902000-11-07 Akim Demaille <akim@epita.fr>
20591
20592 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
20593 Merge in a single CPP if/else.
20594
8a4f41d6
AD
205952000-11-07 Akim Demaille <akim@epita.fr>
20596
20597 * src/output.c (output): Remove useless variables.
20598 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
20599 argument `data' for consistency with the prototypes.
20600 Qualify it `const'.
20601 (obstack_copy, obstack_copy0): Rename the second argument as
20602 `address' for consistency. Qualify it `const'.
20603 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
20604 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
20605 `const' their input argument (`data' or `address').
20606 Adjust the corresponding macros to include `const' in casts.
20607
095a3fb5
AD
206082000-11-03 Akim Demaille <akim@epita.fr>
20609
20610 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
20611 s/PFILE1/BISON_HAIRY/.
20612 Adjust dependencies.
20613
d1cdce7c
AD
206142000-11-03 Akim Demaille <akim@epita.fr>
20615
090c5ebf 20616 For some reason, this was not applied.
d1cdce7c
AD
20617
20618 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20619 `unlink': it's no longer used.
20620
9311529b
AD
206212000-11-03 Akim Demaille <akim@epita.fr>
20622
20623 * src/files.c (skeleton_find): New function, eved out of...
20624 (open_files, open_extra_files): here.
20625
d8880f69
AD
206262000-11-03 Akim Demaille <akim@epita.fr>
20627
20628 Don't use `atexit'.
20629
20630 * src/files.c (obstack_save): New function.
20631 (done): Rename as...
20632 (output_files): this.
20633 Use `obstack_save'.
20634 * src/main.c (main): Don't use `atexit' to register `done', since
20635 it no longer has to remove tmp files, just call `output_files'
20636 when there are no errors.
20637
0dbb648e
AD
206382000-11-02 Akim Demaille <akim@epita.fr>
20639
20640 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20641 `unlink': it's no longer used.
20642 * src/files.h: Formatting changes.
20643
896fe5c1
AD
206442000-11-02 Akim Demaille <akim@epita.fr>
20645
20646 Remove the last uses of mktemp and unlink/delete.
20647
20648 * src/files.c (fdefines, ftable): Removed.
20649 (defines_ostack, table_obstack): New.
20650 Adjust dependencies of the former into uses of the latter.
20651 * src/output.c (output_short_or_char_table, output_short_table):
20652 Convert to using obstacks.
20653 * src/reader.c (copy_comment2): Accept one FILE * and two
20654 obstacks.
20655 (output_token_defines, reader_output_yylsp): Use obstacks.
20656 * src/system.h (obstack_fgrow3): New.
1f65350a 20657 * po/POTFILES.in: Adjust.
896fe5c1 20658
dd60faec
AD
206592000-11-01 Akim Demaille <akim@epita.fr>
20660
20661 Change each use of `fattrs' into a use of `attrs_obstack'.
20662
20663 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
20664 * src/files.c (fattrs): Remove.
20665 (attrs_obstack): New.
20666 Adjust all dependencies.
20667 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
20668
8c7ebe49
AD
206692000-11-01 Akim Demaille <akim@epita.fr>
20670
20671 Introduce obstacks.
20672 Change each use of `faction' into a use of `action_obstack'.
20673
20674 * lib/obstack.h, lib/obstack.c: New files.
20675 * src/files.c (faction): Remove.
20676 (action_obstack): New.
20677 Adjust all dependencies.
20678
77aee789
AD
206792000-10-20 Akim Demaille <akim@epita.fr>
20680
20681 * lib/quote.h (PARAMS): New macro. Use it.
20682
43591cec
AD
206832000-10-16 Akim Demaille <akim@epita.fr>
20684
20685 * src/output.c (output_short_or_char_table): New function.
20686 (output_short_table, output_token_translations): Use it.
20687 (goto_actions): Use output_short_table.
20688
1e9798d5
AD
206892000-10-16 Akim Demaille <akim@epita.fr>
20690
20691 * src/symtab.c (bucket_new): New function.
20692 (getsym): Use it.
20693
20694 * src/output.c (output_short_table): New argument to display the
20695 comment associated with the table.
20696 Adjust dependencies.
20697 (output_gram): Use it.
20698 (output_rule_data): Nicer output layout for YYTNAME.
20699
f282676b
AD
207002000-10-16 Akim Demaille <akim@epita.fr>
20701
20702 * src/lex.c (read_typename): New function.
20703 (lex): Use it.
20704 * src/reader.c (copy_dollar): Likewise.
20705
550a72a3
AD
207062000-10-16 Akim Demaille <akim@epita.fr>
20707
20708 * src/reader.c (copy_comment2): Expect the input stream to be on
20709 the `/' which is suspected to open a comment, instead of being
20710 called after `//' or `/*' was read.
20711 (copy_comment, copy_definition, parse_union_decl, copy_action)
20712 (copy_guard): Adjust.
20713
131e2fef
AD
207142000-10-16 Akim Demaille <akim@epita.fr>
20715
20716 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
20717 `read_signed_integer'.
20718
79282c5a
AD
207192000-10-16 Akim Demaille <akim@epita.fr>
20720
20721 * src/reader.c (copy_dollar): New function.
20722 (copy_guard, copy_action): Use it.
20723
ff4a34be
AD
207242000-10-16 Akim Demaille <akim@epita.fr>
20725
20726 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
20727 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
20728 New files, from Fileutils 4.0.27.
20729 * src/main.c (printable_version): Remove.
20730 * src/lex.c, src/reader.c: Use `quote'.
20731
207322000-10-04 Akim Demaille <akim@epita.fr>
20733
20734 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
20735
14ded682
AD
207362000-10-04 Akim Demaille <akim@epita.fr>
20737
20738 * doc/bison.texinfo: Various typos spotted by Neil Booth.
20739
8e03724b
AD
207402000-10-04 Akim Demaille <akim@epita.fr>
20741
20742 When a literal string is used to define two different tokens,
20743 `bison -v' segfaults.
20744 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
20745
20746 * tests/regression.m4: New file.
20747 Include the core of the sample provided by Piotr Gackiewicz.
20748 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
20749 properly.
20750
a9e64249
AD
207512000-10-04 Akim Demaille <akim@epita.fr>
20752
20753 * src/reader.c (parse_expect_decl): Keep `count' within the size
20754 of `buffer'.
20755 From Neil Booth.
20756
da9abf43
AD
207572000-10-02 Paul Eggert <eggert@twinsun.com>
20758
20759 * bison.s1 (yyparse): Assign the default value
20760 unconditionally, to avoid a GCC warning and make the parser a
20761 tad smaller.
20762
c33638bb
AD
207632000-10-02 Akim Demaille <akim@epita.fr>
20764
20765 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
20766 options.
20767
444c570a
AD
207682000-10-02 Akim Demaille <akim@epita.fr>
20769
20770 * src/derives.c, src/print.c, src/reduce.c: To ease the
20771 translation, move some `\n' out of the translated strings.
20772
89cab50d
AD
207732000-10-02 Akim Demaille <akim@epita.fr>
20774
20775 The location tracking mechanism is precious for parse error
20776 messages. Nevertheless, it is enabled only when `@n' is used in
20777 the grammar, which is a different issue (you can use it in error
20778 message, but not in the grammar per se). Therefore, there should
20779 be another means to enable it.
20780
20781 * src/getargs.c (getargs): Support `--locations'.
20782 (usage): Report it.
20783 * src/getargs.h (locationsflag): Export it.
20784 * src/lex.c (percent_table): Support `%locations'.
20785 * src/reader.c (yylsp_needed): Remove this variable, now replaced
20786 with `locationsflag'.
20787 * doc/bison.texinfo: Document `--locations' and `%locations'.
20788 Sort the options.
20789 * tests/calc.m4: Test it.
20790
20791 For regularity of the names, replace each
20792 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
20793 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
20794 In addition replace each `flag' with `_flag'.
20795
d6c2cba0
AD
207962000-10-02 Akim Demaille <akim@epita.fr>
20797
20798 Also test parse error messages, including with YYERROR_VERBOSE.
20799
20800 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
20801 associative).
20802 Use it to check the computations.
20803 Use it to check `nonassoc' is honored.
20804 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
20805 `--yyerror-verbose'.
20806 (_AT_CHECK_CALC): Adjust to this option.
20807 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
20808
5a35a6cb
AD
208092000-10-02 Akim Demaille <akim@epita.fr>
20810
20811 Test also `--verbose', `--defines' and `--name-prefix'. Testing
20812 the latter demonstrates a flaw in the handling of non debugging
20813 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
20814 was used in order to simplify:
20815
20816 #if YYDEBUG
20817 if (yydebug)
20818 {
20819 ...
20820 }
20821 #endif
20822
20823 into
20824
20825 if (yydebug)
20826 {
20827 ...
20828 }
20829
20830 unfortunately this leads to a CPP conflict when
20831 `--name-prefix=foo' is used since it produces `#define yydebug
20832 foodebug'.
20833
20834 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
20835 (YYDPRINTF): New macro.
20836 Spread its use.
20837 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
20838 the bison options.
20839 Also test `--verbose', `--defines' and `--name-prefix'.
20840
71da9eea
AD
208412000-10-02 Akim Demaille <akim@epita.fr>
20842
20843 Improve the readability of the produced parsers.
20844
20845 * src/bison.s1: Formatting changes.
20846 Improve the comment related to the `$' mark.
20847 (yydefault): Don't fall through to `yyresume': `goto' there.
20848 * src/output.c (output_parser): When the `$' is met, skip the end
20849 of its line.
20850 New variable, `number_of_dollar_signs', to check there's exactly
20851 one `$' in the parser skeleton.
20852
95e36146
AD
208532000-10-02 Akim Demaille <akim@epita.fr>
20854
20855 * lib/xstrdup.c: New file, from the fileutils.
20856 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
20857 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
20858 instead of strlen + xmalloc + strcpy.
20859 * src/symtab.c (copys): Remove, use xstrdup instead.
20860
d7020c20
AD
208612000-10-02 Akim Demaille <akim@epita.fr>
20862
20863 * src/gram.h (associativity): New enum type which replaces the
20864 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
20865 `right_assoc', `left_assoc' and `non_assoc'.
20866 Adjust all dependencies.
20867 * src/reader.c: Formatting changes.
20868 (LTYPESTR): Don't define it, use it as a literal in
20869 `reader_output_yylsp'.
20870 * src/symtab.h (symbol_class): New enum type which replaces the
20871 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
20872 `sunknown', `stoken and `snterm'.
20873
1916f98e
AD
208742000-10-02 Akim Demaille <akim@epita.fr>
20875
20876 * src/getargs.c (fixed_outfiles): Rename as...
20877 (yaccflag): for consistency and accuracy.
20878 Adjust dependencies.
20879
d7913476
AD
208802000-10-02 Akim Demaille <akim@epita.fr>
20881
20882 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
20883 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
20884 difficult and introduced a lot of core dump. It turns out that
20885 Bison used an implementation of `xmalloc' based on `calloc', and
20886 at various places it does depend upon the initialization to 0. I
20887 have not tried to isolate the pertinent places, and all the former
20888 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
20889 someone should address this issue.
20890
20891 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
20892 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
20893 files.
20894 Adjust dependencies.
20895 * src/warshall.h: New file.
20896 Propagate.
20897
340ef489
AD
208982000-10-02 Akim Demaille <akim@epita.fr>
20899
20900 Various anti-`extern in *.c' changes.
20901
20902 * src/system.h: Include `assert.h'.
20903
b2ca4022
AD
209042000-10-02 Akim Demaille <akim@epita.fr>
20905
20906 * src/state.h (nstates, final_state, first_state, first_shift)
20907 (first_reduction): Move their exportation from here...
20908 * src/LR0.h: to here.
20909 Adjust dependencies.
20910 * src/getargs.c (statisticsflag): New variable.
20911 Add support for `--statistics'.
20912 Adjust dependencies.
20913
20914 Remove a lot of now useless `extern' statements in most files.
20915
403b315b
AD
209162000-10-02 Akim Demaille <akim@epita.fr>
20917
20918 * src/LR0.h: New file.
20919 Propagate its use.
20920
07a58c13
AD
209212000-10-02 Akim Demaille <akim@epita.fr>
20922
20923 * src/print.h: New file.
20924 Propagate its use.
20925 * src/print.c: Formatting and ordering changes.
20926 (verbose, terse): Replace with...
20927 (print_results): this new function.
20928 Adjust dependencies.
20929
0619caf0
AD
209302000-10-02 Akim Demaille <akim@epita.fr>
20931
20932 * src/conflicts.c (conflict_report): New function.
20933 (conflict_log, verbose_conflict_log): Replace with...
20934 (print_conflicts): this function.
20935 Adjust dependencies.
20936 * src/conflicts.h: New file.
20937 Propagate its inclusion.
20938
3519ec76
AD
209392000-10-02 Akim Demaille <akim@epita.fr>
20940
20941 * src/nullable.h: New file.
20942 Propagate its inclusion.
20943 * src/nullable.c: Formatting changes.
20944
015acc48
AD
209452000-10-02 Akim Demaille <akim@epita.fr>
20946
20947 * src/reduce.h: New file.
20948 Propagate its inclusion.
20949 * src/reduce.c: Topological sort and other formatting changes.
20950 (bool, TRUE, FALSE): Move their definition to...
20951 * src/system.h: here.
20952
8963a27b
AD
209532000-10-02 Akim Demaille <akim@epita.fr>
20954
20955 * src/files.c: Formatting changes.
20956 (tryopen, tryclose, openfiles): Rename as...
20957 (xfopen, xfclose, open_files): this.
20958 (stringappend): static.
20959 * src/files.h: Complete the list of exported symbols.
20960 Propagate its use.
20961
a70083a3
AD
209622000-10-02 Akim Demaille <akim@epita.fr>
20963
20964 * src/reader.h: New file.
20965 Propagate its use instead of tedious list of `extern' and
20966 prototypes.
20967 * src/reader.c: Formatting changes, topological sort,
20968 s/register//.
20969
abadc117
AD
209702000-10-02 Akim Demaille <akim@epita.fr>
20971
20972 * src/lex.h: Prototype `lex.c' exported functions.
20973 * src/reader.c: Adjust.
20974 * src/lex.c: Formatting changes.
20975 (safegetc): Rename as...
20976 (xgetc): this.
20977
720d742f
AD
209782000-10-02 Akim Demaille <akim@epita.fr>
20979
20980 * src/lalr.h: New file.
20981 Propagate its inclusion instead of prototypes and `extern'.
20982 * src/lalr.c: Formatting changes, topological sorting etc.
20983
f2acea59
AD
209842000-10-02 Akim Demaille <akim@epita.fr>
20985
20986 * src/output.c (token_actions): Introduce a temporary array,
20987 YYDEFACT, that makes it possible for this function to use
20988 output_short_table.
20989
d019d655
AD
209902000-10-02 Akim Demaille <akim@epita.fr>
20991
20992 `user_toknums' is output as a `short[]' in `output.c', while it is
20993 defined as a `int[]' in `reader.c'. For consistency with the
20994 other output tables, `user_toknums' is now defined as a table of
20995 shorts.
20996
20997 * src/reader.c (user_toknums): Be a short table instead of an int
20998 table.
20999 Adjust dependencies.
21000
21001 Factor the short table outputs.
21002
21003 * src/output.c (output_short_table): New function.
21004 * src/output.c (output_gram, output_stos, output_rule_data)
21005 (output_base, output_table, output_check): Use it.
21006
6c89f1c1
AD
210072000-10-02 Akim Demaille <akim@epita.fr>
21008
21009 * src/output.c (output): Topological sort of the functions, in
21010 order to get rid of the `static' prototypes.
21011 No longer use `register'.
21012 * src/output.h: New file.
21013 Propagate its inclusion in files explicitly prototyping functions
21014 from output.c.
21015
d9efd181
AD
210162000-09-21 Akim Demaille <akim@epita.fr>
21017
21018 * src/atgeneral.m4: Update from Autoconf.
21019
c29240e7 210202000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
21021
21022 * src/closure.h: New file.
21023 * src/closure.c: Formatting changes, topological sort over the
21024 functions, use of closure.h.
21025 (initialize_closure, finalize_closure): Rename as...
21026 (new_closure, free_closure): these. Adjust dependencies.
21027 * src/LR0.c: Formatting changes, topological sort, use of
21028 cloture.h.
21029 (initialize_states): Rename as...
21030 (new_states): this.
21031 * src/Makefile.am (noinst_HEADERS): Adjust.
21032
499daa50
AD
210332000-09-20 Akim Demaille <akim@epita.fr>
21034
21035 * src/acconfig.h: Don't protect config.h against multiple
21036 inclusion.
21037 Don't define PARAMS.
21038 * src/system.h: Define PARAMS.
21039 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
21040 purpose of config.h. system.h must not try to fix wrong
21041 definitions in config.h.
21042
cc84fd5d
AD
210432000-09-20 Akim Demaille <akim@epita.fr>
21044
21045 * src/derives.h: New file.
21046 * src/main.c, src/derives.h: Use it.
21047 Formatting changes.
21048 * src/Makefile.am (noinst_HEADERS): Adjust.
21049
db5b3a89
AD
210502000-09-20 Akim Demaille <akim@epita.fr>
21051
21052 * tests/atgeneral.m4: Update from Autoconf.
21053 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
21054 (AT_CHECK_CALC): New macros.
21055 Use these macros to test bison with options `', `--raw',
21056 `--debug', `--yacc', `--yacc --debug'.
21057
ceed8467
AD
210582000-09-19 Akim Demaille <akim@epita.fr>
21059
21060 * src/output.c: Formatting changes.
21061 * src/machine.h: Remove, leaving its contents in...
21062 * src/system.h: here.
21063 Include stdio.h.
21064 Adjust all dependencies on stdio.h and machine.h.
21065 * src/getargs.h: New file.
21066 Let all `extern' declarations about getargs.c be replaced with
21067 inclusion of `getargs.h'.
21068 * src/Makefile.am (noinst_HEADERS): Adjust.
21069
21070 * tests/calc.m4 (yyin): Be initialized in main, not on the global
21071 scope.
21072 (yyerror): Returns void, not int.
21073 * doc/bison.texinfo: Formatting changes.
21074
05a1d24b
AD
210752000-09-19 Akim Demaille <akim@epita.fr>
21076
21077 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
21078 portable.
21079
cbd25751
AD
210802000-09-18 Akim Demaille <akim@epita.fr>
21081
21082 * configure.in: Append WARNING_CFLAGS to CFLAGS.
21083 * src/Makefile.am (INCLUDES): Don't.
21084 Be ready to fetch headers in lib/.
21085
13863333
AD
210862000-09-18 Akim Demaille <akim@epita.fr>
21087
21088 * doc/bison.texinfo: Update the copyright.
21089 ANSIfy and GNUify the examples.
21090 Remove the old menu.
21091
0d533154
AD
210922000-09-18 Akim Demaille <akim@epita.fr>
21093
21094 First set of tests: use the `calc' example from the documentation.
21095
21096 * src/bison.s1 (yyparse): Condition the code using `yytname' which
21097 is defined only when YYDEBUG is.
21098 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
21099 * src/files.c (tryopen, tryclose): Formatting changes.
21100 Move to the top and be static.
21101 * src/reader.c (read_signed_integer): Likewise.
21102 * tests/calc.m4: New file.
21103 * Makefile.am, suite.m4: Adjust.
21104 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
21105
e79137ac
AD
211062000-09-18 Akim Demaille <akim@epita.fr>
21107
21108 Add support for an Autotest test suite for Bison.
21109
21110 * m4/m4.m4, m4/atconfig.m4: New files.
21111 * m4/Makefile.am (EXTRA_DIST): Adjust.
21112 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
21113 files.
21114 * src/getargs.c: Display a more standard --version message.
21115 * src/reader.c (reader): Formatting changes.
21116 No longer depend upon VERSION_STRING.
21117 * configure.in: No longer use `dnl'.
21118 Set up the test suite and the new directory `tests/.
21119 (VERSION_STRING): Remove.
21120
27821bff
AD
211212000-04-14 Akim Demaille <akim@epita.fr>
21122
21123 * src/reader.c (copy_comment2): New function, same as former
21124 `copy_comment', but outputs into two FILE *.
21125 (copy_comment): Use it.
21126 (parse_union_decl): Use it.
21127 (get_type, parse_start_decl): Use the same `invalid' message.
21128 (parse_start_decl, parse_union_decl): Use the same `multiple'
21129 message.
21130 (parse_union_decl, copy_guard, copy_action): Use the same
21131 `unmatched' message.
21132 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
21133
cfe5fbc0
AD
211342000-03-31 Akim Demaille <akim@epita.fr>
21135
21136 * src/files.c (tryopen, tryclose): Move to the top.
21137 Be static.
21138
cb7db13e
AD
211392000-03-31 Akim Demaille <akim@epita.fr>
21140
21141 * src/main.c (main): Don't call `done', exit does it.
21142
a0f6b076
AD
211432000-03-31 Akim Demaille <akim@epita.fr>
21144
36281465
AD
21145 * allocate.c: s/return (foo)/return foo/.
21146 * lalr.c: Likewise.
21147 * LR0.c: Likewise.
21148 * output.c: Likewise.
21149 * reader.c: Likewise.
21150 * symtab.c: Likewise.
21151 * vmsgetargs.c: Likewise.
21152
211532000-03-31 Akim Demaille <akim@epita.fr>
21154
21155 Clean up the error reporting functions.
a0f6b076
AD
21156
21157 * src/report.c: New file.
21158 * src/report.h: Likewise.
21159 * src/Makefile.am: Adjust.
21160 * m4/error.m4: New file.
21161 * m4/Makefile.am: Adjust.
21162 * configure.in (jm_PREREQ_ERROR): Call it.
21163 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
21164 Remove.
21165 (fatal, fatals): Remove. All callers use complain.c::fatal.
21166 (warn, warni, warns, warnss, warnss): Remove. All callers use
21167 complain.c::complain.
21168 (toomany): Remove, use fatal instead.
21169 * src/files.c (done): No argument, use complain_message_count.
21170 * src/main.c (main): Register `done' to `atexit'.
21171
21172 * src/getargs.c (usage): More `fputs', less `fprintf'.
21173
18539825
AD
211742000-03-28 Akim Demaille <akim@epita.fr>
21175
21176 * lib/: New directory.
21177 * Makefile.am (SUBDIRS): Adjust.
21178 * configure.in: Adjust.
21179 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
21180 useless.
21181 * src/alloca.c: Moved to lib/.
21182 * src/getopt.c: Likewise.
21183 * src/getopt1.c: Likewise.
21184 * src/getopt.h: Likewise.
21185 * src/ansi2knr.c: Likewise.
21186 * src/ansi2knr.1: Likewise.
21187 * src/Makefile.am: Adjust.
21188 * lib/Makefile.am: New file.
21189
9f306f2a
AD
211902000-03-28 Akim Demaille <akim@epita.fr>
21191
21192 * src/getargs.c (usage): Refresh the help message.
21193
0ba347b6
AD
211942000-03-17 Akim Demaille <akim@epita.fr>
21195
21196 * src/getopt1.c: Updated from textutils 2.0e
21197 * src/getopt.c: Likewise.
21198 * src/getopt.h: Likewise.
21199
dbe7f271
AD
212002000-03-17 Akim Demaille <akim@epita.fr>
21201
21202 * src/Makefile.am (bison.simple): Fix the awk program: quote only
21203 the file name, not the whole `#line LINE FILE'.
21204
75bbe78d
AD
212052000-03-17 Akim Demaille <akim@epita.fr>
21206
21207 On syntax errors, report the token on which we choked.
21208
aa5fd0ee
AD
21209 * src/bison.s1 (yyparse): In the label yyerrlab, when
21210 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 21211
7b306f52
AD
212122000-03-17 Akim Demaille <akim@epita.fr>
21213
aa5fd0ee 21214 * src/reader.c (copy_at): New function.
7b306f52
AD
21215 (copy_guard): Use it.
21216 (copy_action): Use it.
21217
e87b5700
AD
212182000-03-17 Akim Demaille <akim@epita.fr>
21219
21220 Be kind to translators, save some useless translations.
21221
aa5fd0ee 21222 * src/main.c (banner): New function.
e87b5700
AD
21223 (fatal_banner): Use it.
21224 (warn_banner): Use it.
21225
ae3c3164
AD
212262000-03-17 Akim Demaille <akim@epita.fr>
21227
aa5fd0ee
AD
21228 * src/reader.c (copy_definition): Use copy_string and
21229 copy_comment. Removed now unused `match', `ended',
21230 `cplus_comment'.
ae3c3164
AD
21231 (copy_comment, copy_string): Moved, to be visible from
21232 copy_definition.
21233
4dc58e7c
AD
212342000-03-17 Akim Demaille <akim@epita.fr>
21235
aa5fd0ee
AD
21236 * src/reader.c (copy_string): Declare `static inline'. No
21237 problems with inline, since it is checked by configure.
4dc58e7c
AD
21238 (copy_comment): Likewise.
21239
0a6384c4
AD
212402000-03-17 Akim Demaille <akim@epita.fr>
21241
aa5fd0ee 21242 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 21243
3cef001a
AD
212442000-03-17 Akim Demaille <akim@epita.fr>
21245
aa5fd0ee 21246 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
21247 (copy_action): Use it. Removed now unused `match', `ended',
21248 `cplus_comment'.
21249 (copy_guard): Likewise.
21250
ca36d2ef
AD
212512000-03-17 Akim Demaille <akim@epita.fr>
21252
aa5fd0ee 21253 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
21254 (copy_action): Use it.
21255 (copy_guard): Likewise.
21256
6666f98f
AD
212572000-03-17 Akim Demaille <akim@epita.fr>
21258
21259 Change the handling of @s so that they behave exactly like $s.
21260 There is now a pseudo variable @$ (readble and writable), location
21261 of the lhs of the rule (by default ranging from the location of
21262 the first symbol of the rhs, to the location of the last symbol,
21263 or, if the rhs is empty, YYLLOC).
21264
21265 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
21266 yyval.
21267 (yyparse): When providing a default semantic action, provide a
21268 default location action.
21269 (after the $): No longer change `*YYLSP', just stack YYLOC the
21270 same way you stack YYVAL.
21271 * src/reader.c (read_declarations): Use warns.
21272 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
21273 (copy_action, case '@'): Likewise.
21274 Use a standard error message, to save useless work from
21275 translators.
21276
41aca2e0
AD
212772000-03-17 Akim Demaille <akim@epita.fr>
21278
aa5fd0ee
AD
21279 * src/bison.s1: Formatting and cosmetics changes.
21280 * src/reader.c: Likewise.
41aca2e0
AD
21281 Update the Copyright notice.
21282
dc08c1d5
AD
212832000-03-17 Akim Demaille <akim@epita.fr>
21284
aa5fd0ee
AD
21285 * src/bison.s1 (#line): All set to `#line' only, since the
21286 Makefile now handles them.
dc08c1d5 21287
9ee3c97b
AD
212882000-03-16 Akim Demaille <akim@epita.fr>
21289
21290 * src/output.c (output_rule_data): Output the documentation of
21291 some of the tables.
21292 (Copyright notice): Update.
21293 Formatting changes.
21294
0de741ca
AD
212952000-03-16 Akim Demaille <akim@epita.fr>
21296
21297 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
21298 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
21299 One `#if YYDEBUG' remains, since it uses variables which are
21300 defined only if `YYDEBUG != 0'.
21301
bb10be54
AD
213022000-03-16 Akim Demaille <akim@epita.fr>
21303
21304 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
21305 and related variables so that the similarities are highlighted.
21306
b07b484a
AD
213072000-03-16 Akim Demaille <akim@epita.fr>
21308
21309 * src/bison.s1: Properly indent CPP directives.
21310
361f60b3
AD
213112000-03-16 Akim Demaille <akim@epita.fr>
21312
21313 * src/bison.s1: Properly indent the `alloca' CPP section.
21314
8c44d3ec
AD
213152000-03-16 Akim Demaille <akim@epita.fr>
21316
21317 Do not hard code values of directories in `configure.in'.
21318 Update the `configure' tool chain.
21319
21320 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
21321 src/makefile.am.
21322 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
21323 (AC_OUTPUT): Add m4/Makefile.
21324 Bump to bison 1.28a, 1.29 has never been released.
21325 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
21326 handled via src/Makefile.am.
21327 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
21328 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
21329 autoheader.
21330 * Makefile.am (SUBDIRS): Add m4.
21331 (ACLOCAL_AM_FLAGS): New variable.
21332 (AUTOMAKE_OPTIONS): Add check-news.
21333 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
21334 the proper line number and file name.
21335 (DEFS): Propagate the location of bison library files and of the
21336 locale files.
21337 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
21338 builddir.
21339 * acinclude.m4: Remove, replaced by the directory m4.
21340 * m4/Makefile.am (EXTRA_DIST): New variable.
21341 * m4/gettext.m4: New file, from the fileutils.
21342 * m4/lcmessage.m4: Likewise
21343 * m4/progtest.m4: Likewise.
21344 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
21345
f95997e7
AD
213462000-03-10 Akim Demaille <akim@epita.fr>
21347
21348 * src/closure.c:
21349 Formatting changes of various comments.
21350 Respect the GNU coding standards at various places.
21351 Don't use `_()' when no translation is needed.
21352
213531999-12-13 Jesse Thilo <jthilo@gnu.org>
21354
21355 * src/files.c:
21356 OS/2 honors TMPDIR environment variable.
21357
213581999-12-13 Jesse Thilo <jthilo@gnu.org>
21359
21360 * doc/bison.texinfo: Tweaked spelling and grammar.
21361 Updated ISBN.
21362 Removed reference to price of printed copy.
21363 Mention BISON_SIMPLE and BISON_HAIRY.
21364
213651999-12-13 Jesse Thilo <jthilo@gnu.org>
21366
21367 * configure.in, NEWS:
21368 Bison 1.29 released.
21369
213701999-10-27 Jesse Thilo <jthilo@gnu.org>
21371
21372 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
21373 Added reference card.
21374
213751999-07-26 Jesse Thilo <jthilo@gnu.org>
21376
21377 * po/ru.po: Added Russian translation.
21378
213791999-07-26 Jesse Thilo <jthilo@gnu.org>
21380
21381 * configure.in: Added Russian translation.
21382
213831999-07-06 Jesse Thilo <jthilo@gnu.org>
21384
21385 * configure.in, NEWS, README:
21386 Released version 1.28.
21387
213881999-06-14 Jesse Thilo <jthilo@gnu.org>
21389
21390 * src/system.h:
21391 Squashed redefinition warning on some systems.
21392
21393 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
21394 Have configure build version string instead of relying on ANSI string
21395 concatentation.
21396
213971999-06-14 Jesse Thilo <jthilo@gnu.org>
21398
21399 * po/POTFILES.in: Got rid of version.c.
21400
214011999-06-14 Jesse Thilo <jthilo@gnu.org>
21402
21403 * acconfig.h, configure.in:
21404 Have configure build version string instead of relying on ANSI string
21405 concatentation.
21406
214071999-06-08 Jesse Thilo <jthilo@gnu.org>
21408
21409 * doc/bison.1:
21410 Dropped mention of `+' for long-named options.
21411
214121999-05-30 Jesse Thilo <jthilo@gnu.org>
21413
21414 * src/files.c: Added <unistd.h> for unlink().
21415
21416 * src/Makefile.am, src/system.h:
21417 I18n fixes.
21418
214191999-05-30 Jesse Thilo <jthilo@gnu.org>
21420
21421 * README: Added a FAQ list.
21422
21423 * configure.in, acconfig.h:
21424 I18n fixes.
21425
214261999-05-30 Jesse Thilo <jthilo@gnu.org>
21427
21428 * doc/FAQ, doc/Makefile.am:
21429 Added a FAQ list.
21430
214311999-05-19 Jesse Thilo <jthilo@gnu.org>
21432
21433 * src/alloc.h, src/symtab.h, src/version.c:
21434 Protected inclusion of "config.h" with HAVE_CONFIG_H.
21435
214361999-04-18 Jesse Thilo <jthilo@gnu.org>
21437
21438 * src/.cvsignore, src/Makefile.am:
21439 Reorganized: sources in `src', documentation in `doc'.
21440
21441 * src/lex.c (literalchar):
21442 fixed the code for escaping double quotes (thanks
21443 Jonathan Czisny.)
21444
214451999-04-18 Jesse Thilo <jthilo@gnu.org>
21446
21447 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
21448 Adjusted paths to reflect directory reorganization.
21449
214501999-04-18 Jesse Thilo <jthilo@gnu.org>
21451
21452 * doc/.cvsignore, doc/Makefile.am:
21453 Reorganized: sources in `src', documentation in `doc'.
21454
214551999-04-18 Jesse Thilo <jthilo@gnu.org>
21456
21457 * configure.in:
21458 Updated AC_INIT file to reflect directory reorganization.
21459
21460 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
21461 Reorganized: sources in `src', documentation in `doc'.
21462
214631999-04-13 Jesse Thilo <jthilo@gnu.org>
21464
21465 * src/allocate.c:
21466 Don't declare calloc() and realloc() if not necessary.
21467
214681999-04-13 Jesse Thilo <jthilo@gnu.org>
21469
21470 * configure.in, acconfig.h, acinclude.m4:
21471 Don't declare calloc() and realloc() if not necessary.
21472
214731999-03-23 Jesse Thilo <jthilo@gnu.org>
21474
21475 * po/.cvsignore: Added i18n support.
21476
214771999-03-23 Jesse Thilo <jthilo@gnu.org>
21478
21479 * acconfig.h, configure.in, Makefile.am:
21480 Added i18n support.
21481
214821999-03-22 Jesse Thilo <jthilo@gnu.org>
21483
21484 * src/bison.s1: Fixed #line numbers.
21485
214861999-03-15 Jesse Thilo <jthilo@gnu.org>
21487
21488 * po/es.po, po/fr.po, po/nl.po, po/de.po:
21489 Added PO files from Translation Project.
21490
214911999-03-03 Jesse Thilo <jthilo@gnu.org>
21492
21493 * Makefile.am:
21494 Added support for non-ANSI compilers (ansi2knr).
21495
214961999-02-16 Jesse Thilo <jthilo@gnu.org>
21497
21498 * configure.in: Bumped version number to 1.27.
21499
21500 * Makefile.am:
21501 Added `bison.simple' to list of files removed by `make distclean'.
21502
215031999-02-12 Jesse Thilo <jthilo@gnu.org>
21504
21505 * src/files.c, src/files.h:
21506 Defined locations of parser files in config.h instead of Makefile.
21507
215081999-02-12 Jesse Thilo <jthilo@gnu.org>
21509
21510 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
21511 Defined locations of parser files in config.h instead of Makefile.
21512
215131999-02-09 Jesse Thilo <jthilo@gnu.org>
21514
21515 * Makefile.am:
21516 Removed inappropriate use of $< macro.
21517
215181999-02-05 Jesse Thilo <jthilo@gnu.org>
21519
21520 * po/Makefile.in.in, po/POTFILES.in:
21521 Add `po' directory skeleton.
21522
215231999-01-27 Jesse Thilo <jthilo@gnu.org>
21524
21525 * README: Document help-bison list.
21526
21527 * configure.in: Add check for mkstemp().
21528
215291999-01-20 Jesse Thilo <jthilo@gnu.org>
21530
21531 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
21532 Hush a few compiler warnings.
21533
21534 * src/files.c:
21535 Add tryclose(), which verifies that fclose was successful.
21536 Hush a couple of compiler warnings.
21537
215381999-01-20 Jesse Thilo <jthilo@gnu.org>
21539
21540 * Makefile.am, OChangeLog:
21541 ChangeLog is now automatically generated. Include the old version as
21542 OChangeLog.
21543
215441999-01-14 Jesse Thilo <jthilo@gnu.org>
21545
21546 * 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:
21547 Update FSF address.
21548
215491999-01-14 Jesse Thilo <jthilo@gnu.org>
21550
21551 * doc/bison.texinfo: Fix formatting glitch.
21552
21553 * doc/bison.texinfo: Update FSF address.
21554
215551999-01-14 Jesse Thilo <jthilo@gnu.org>
21556
21557 * acconfig.h: Update FSF address.
21558
215591999-01-08 Jesse Thilo <jthilo@gnu.org>
21560
21561 * src/system.h:
21562 Don't define PACKAGE here, since config.h defines it.
21563
215641998-12-30 Jesse Thilo <jthilo@gnu.org>
21565
21566 * src/reader.c: Update copyright date.
21567
21568 * src/main.c:
21569 Ditch sprintf to statically-sized buffers in fatal/warn functions in
21570 favor of output directly to stderr (avoids buffer overruns).
21571
21572 * src/reader.c: Some checks for premature EOF.
21573
21574 * 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:
21575 Use prototypes if the compiler understands them.
21576
21577 * src/files.c: Honor TMPDIR on Unix hosts.
21578 Use prototypes if the compiler understands them.
21579
21580 * src/reader.c:
21581 Fix a couple of buffer overrun bugs.
21582 Use prototypes if the compiler understands them.
21583
21584 * src/system.h: Include unistd.h and ctype.h.
21585 Use #ifdef instead of #if for NLS symbols.
21586
215871998-12-30 Jesse Thilo <jthilo@gnu.org>
21588
21589 * doc/bison.texinfo:
21590 Delete comment "consider using @set for edition number, etc..." since
21591 we now are doing so.
21592
215931998-12-30 Jesse Thilo <jthilo@gnu.org>
21594
21595 * configure.in:
21596 Use prototypes if the compiler understands them.
21597
21598 * NEWS: Document 1.26 highlights.
21599
21600 * Makefile.am: Require Automake 1.3 or later.
21601
21602 * acconfig.h:
21603 Use prototypes if the compiler understands them.
21604
216051998-12-29 Jesse Thilo <jthilo@gnu.org>
21606
21607 * src/version.c:
21608 Use VERSION symbol from automake for version number.
21609
216101998-12-29 Jesse Thilo <jthilo@gnu.org>
21611
21612 * acconfig.h, configure.in, version.cin:
21613 Use VERSION symbol from automake for version number.
21614
216151998-11-28 Jesse Thilo <jthilo@gnu.org>
21616
21617 * Makefile.am:
21618 Distribute original version of simple parser (bison.s1), not built
21619 version (bison.simple).
21620
216211998-11-28 Jesse Thilo <jthilo@gnu.org>
21622
21623 * doc/bison.texinfo: Add info dir entry.
21624
21625 * doc/bison.texinfo:
21626 Let automake put version number into documentation.
21627
216281998-11-26 Jesse Thilo <jthilo@gnu.org>
21629
21630 * src/bison.cld, src/build.com, src/vmshlp.mar:
21631 Add non-RCS files from /gd/gnu/bison.
21632
216331998-11-26 Jesse Thilo <jthilo@gnu.org>
21634
21635 * doc/bison.1:
21636 Document the BISON_HAIRY and BISON_SIMPLE variables.
21637
216381998-11-25 Jesse Thilo <jthilo@gnu.org>
21639
21640 * src/version.c: Build version.c automatically.
21641
21642 * src/reader.c:
21643 Fix token numbering (used to start at 258, not 257).
21644
21645 * src/system.h: Include config.h.
21646
21647 * src/getargs.c: Update bug report address.
21648
21649 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
21650 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
21651
216521998-11-25 Jesse Thilo <jthilo@gnu.org>
21653
21654 * Makefile.am:
21655 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21656
21657 * configure.in, version.cin:
21658 Build version.c automatically.
21659
21660 * AUTHORS: Add AUTHORS file.
21661
21662 * README: Update bug report address.
21663
21664 * bison.simple:
21665 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21666
21667 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
21668 Add automake stuff.
21669
216701998-11-25 Jesse Thilo <jthilo@gnu.org>
21671
21672 * doc/bison.texinfo: Clean up some formatting.
21673
216741998-05-05 Richard Stallman <rms@gnu.org>
21675
21676 * doc/bison.texinfo:
21677 Explain better why to make a pure parser.
21678
216791998-01-05 Richard Stallman <rms@gnu.org>
21680
21681 * src/files.c (openfiles):
21682 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
21683 find a temporary directory, if possible. Do not unlink files while
21684 they are open.
21685
216861997-08-25 Richard Stallman <rms@gnu.org>
21687
21688 * src/reader.c (stack_offset;):
21689 Change some warni to warns.
21690
21691 * src/lex.c (literalchar): Use warns, not warni.
21692
216931997-06-28 Richard Stallman <rms@gnu.org>
21694
21695 * src/bison.s1: Add a Bison version comment.
21696
21697 * src/main.c (fatal, warn, berror):
21698 Use program_name.
21699
217001997-06-28 Richard Stallman <rms@gnu.org>
21701
21702 * Makefile.in (bison_version): New variable.
21703 (dist): Use that variable.
21704 (bison.s1): Substitute the Bison version into bison.simple.
21705
21706 * bison.simple: Add a Bison version comment.
21707
217081997-06-18 Richard Stallman <rms@gnu.org>
21709
21710 * src/main.c (fatal, warn, berror):
21711 Make error messages standard.
21712 (toomany): Improve error message text.
21713
21714 * 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:
21715 new.h renamed to alloc.h.
21716
217171997-06-18 Richard Stallman <rms@gnu.org>
21718
21719 * Makefile.in: new.h renamed to alloc.h.
21720
217211997-05-24 Richard Stallman <rms@gnu.org>
21722
21723 * src/lex.c (literalchar):
21724 Fix the code for escaping \, " and '.
21725
21726 (lex): Avoid trouble when there are many chars
21727 to discard in a char literal with just several chars in it.
21728
217291997-05-17 Richard Stallman <rms@gnu.org>
21730
21731 * src/bison.s1:
21732 Use malloc, if using alloca is troublesome.
21733 (YYSTACK_USE_ALLOCA): New flag macro.
21734 Define it for some systems and compilers.
21735 (YYSTACK_ALLOC): New macro.
21736 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21737 If it was malloc'd, free it.
21738
217391997-05-17 Richard Stallman <rms@gnu.org>
21740
21741 * bison.simple:
21742 Use malloc, if using alloca is troublesome.
21743 (YYSTACK_USE_ALLOCA): New flag macro.
21744 Define it for some systems and compilers.
21745 (YYSTACK_ALLOC): New macro.
21746 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21747 If it was malloc'd, free it.
21748
217491997-04-23 Richard Stallman <rms@gnu.org>
21750
21751 * src/bison.s1:
21752 (alloca) [__hpux]: Always define as __builtin_alloca.
21753
217541997-04-23 Richard Stallman <rms@gnu.org>
21755
21756 * bison.simple:
21757 (alloca) [__hpux]: Always define as __builtin_alloca.
21758
217591997-04-22 Richard Stallman <rms@gnu.org>
21760
21761 * src/bison.s1:
21762 [__hpux]: Include alloca.h (right for HPUX 10)
21763 instead of declaring alloca (right for HPUX 9).
21764
21765 * src/bison.s1 (__yy_memcpy):
21766 Declare arg `count' as unsigned int.
21767 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21768
217691997-04-22 Richard Stallman <rms@gnu.org>
21770
21771 * bison.simple:
21772 [__hpux]: Include alloca.h (right for HPUX 10)
21773 instead of declaring alloca (right for HPUX 9).
21774
21775 * bison.simple (__yy_memcpy):
21776 Declare arg `count' as unsigned int.
21777 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21778
217791997-01-03 Richard Stallman <rms@gnu.org>
21780
21781 * src/allocate.c: [__STDC__ or _MSC_VER]:
21782 Declare calloc and realloc to return void *.
21783
217841997-01-02 Richard Stallman <rms@gnu.org>
21785
21786 * src/system.h:
21787 [_MSC_VER]: Include stdlib.h and process.h.
21788 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
21789
21790 * src/main.c (main): Return FAILURE as a value.
21791 (printable_version): Declare arg as int, not char.
21792
217931997-01-02 Richard Stallman <rms@gnu.org>
21794
21795 * Makefile.in (dist):
21796 Explicitly check for symlinks, and copy them.
21797
217981996-12-19 Richard Stallman <rms@gnu.org>
21799
21800 * src/files.c:
21801 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
21802
218031996-12-18 Paul Eggert <eggert@gnu.org>
21804
21805 * src/bison.s1 (yyparse):
21806 If __GNUC__ and YYPARSE_PARAM are both defined,
21807 declare yyparse to have a void * argument.
21808
218091996-12-18 Paul Eggert <eggert@gnu.org>
21810
21811 * bison.simple (yyparse):
21812 If __GNUC__ and YYPARSE_PARAM are both defined,
21813 declare yyparse to have a void * argument.
21814
218151996-12-17 Richard Stallman <rms@gnu.org>
21816
21817 * src/reduce.c (nbits): Add some casts.
21818
218191996-08-12 Richard Stallman <rms@gnu.org>
21820
21821 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
21822
218231996-08-12 Richard Stallman <rms@gnu.org>
21824
21825 * bison.simple: Test _MSDOS as well as _MSDOS_.
21826
218271996-07-31 Richard Stallman <rms@gnu.org>
21828
21829 * src/bison.s1:
21830 [__sun && __i386]: Include alloca.h.
21831
218321996-07-31 Richard Stallman <rms@gnu.org>
21833
21834 * bison.simple:
21835 [__sun && __i386]: Include alloca.h.
21836
218371996-07-30 Richard Stallman <rms@gnu.org>
21838
21839 * src/bison.s1: Comment change.
21840
21841 * src/bison.s1: Test _MSDOS_, not MSDOS.
21842
218431996-07-30 Richard Stallman <rms@gnu.org>
21844
21845 * bison.simple: Comment change.
21846
21847 * bison.simple: Test _MSDOS_, not MSDOS.
21848
218491996-06-01 Richard Stallman <rms@gnu.org>
21850
21851 * 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:
21852 Insert `_' macro around many string constants.
21853
21854 * src/main.c:
21855 Insert `_' macro around many string constants.
21856
21857 (main): Call setlocale, bindtextdomain and textdomain.
21858
21859 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
21860 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
21861 [ENABLE_NLS]: Include libintl.h.
21862 [ENABLE_NLS] (gettext): Define.
21863 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
21864 (N_, PACKAGE, LOCALEDIR): New macros.
21865
218661996-06-01 Richard Stallman <rms@gnu.org>
21867
21868 * POTFILES.in: New file.
21869
21870 * Makefile.in (allocate.o):
21871 Define target explicitly.
21872
21873 * Makefile.in (CFLAGS): Set to @CFLAGS@.
21874 (LDFLAGS): Set to @LDFLAGS@.
21875 (configure): Run autoconf only if preceding `cd' succeeds.
21876 (bison.s1): Redirect output to temporary file then move the
21877 temporary to the target, rather than redirecting directly to bison.s1.
21878 (clean): Remove config.status and config.log.
21879 (distclean): Don't remove config.status here.
21880
218811996-05-12 Richard Stallman <rms@gnu.org>
21882
21883 * src/bison.s1:
21884 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21885
218861996-05-12 Richard Stallman <rms@gnu.org>
21887
21888 * bison.simple:
21889 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21890
218911996-05-11 Richard Stallman <rms@gnu.org>
21892
21893 * src/bison.s1 (__yy_memcpy):
21894 Really reorder the args, as was supposedly done on Feb 14 1995.
21895 (yyparse): Calls changed accordingly.
21896
218971996-05-11 Richard Stallman <rms@gnu.org>
21898
21899 * Makefile.in (dist): Don't use $(srcdir).
21900
21901 * bison.simple (__yy_memcpy):
21902 Really reorder the args, as was supposedly done on Feb 14 1995.
21903 (yyparse): Calls changed accordingly.
21904
219051996-01-27 Richard Stallman <rms@gnu.org>
21906
21907 * src/output.c (output_rule_data):
21908 Test YYERROR_VERBOSE in the conditional
21909 around the definition of ttyname.
21910
219111995-12-29 Richard Stallman <rms@gnu.org>
21912
21913 * src/bison.s1:
21914 Fix line numbers in #line commands.
21915
219161995-12-29 Richard Stallman <rms@gnu.org>
21917
21918 * bison.simple:
21919 Fix line numbers in #line commands.
21920
219211995-12-27 Richard Stallman <rms@gnu.org>
21922
21923 * src/bison.s1 (YYPARSE_PARAM_DECL):
21924 In C++, make it always null.
21925 (YYPARSE_PARAM_ARG): New macro.
21926 (yyparse): Use YYPARSE_PARAM_ARG.
21927
219281995-12-27 Richard Stallman <rms@gnu.org>
21929
21930 * bison.simple (YYPARSE_PARAM_DECL):
21931 In C++, make it always null.
21932 (YYPARSE_PARAM_ARG): New macro.
21933 (yyparse): Use YYPARSE_PARAM_ARG.
21934
219351995-11-29 Richard Stallman <rms@gnu.org>
21936
21937 * doc/bison.texinfo:
21938 Describe literal string tokens, %raw, %no_lines, %token_table.
21939
219401995-11-29 Daniel Hagerty <hag@gnu.org>
21941
21942 * doc/bison.texinfo: Fixed update date
21943
219441995-10-16 Richard Stallman <rms@gnu.org>
21945
21946 * src/version.c: Version 1.25.
21947
219481995-10-16 Richard Stallman <rms@gnu.org>
21949
21950 * NEWS: *** empty log message ***
21951
219521995-10-16 Richard Stallman <rms@gnu.org>
21953
21954 * doc/bison.1, doc/bison.rnh:
21955 Add new options.
21956
219571995-10-15 Richard Stallman <rms@gnu.org>
21958
21959 * src/vmsgetargs.c, src/getargs.c:
21960 Added -n, -k, and -raw switches.
21961 (noparserflag, toknumflag, rawtoknumflag): New variables.
21962
21963 * src/symtab.h (SALIAS):
21964 New #define for adding aliases to %token.
21965 (struct bucket): Added `alias' field.
21966
21967 * src/reduce.c (reduce_grammar):
21968 Revise error message.
21969 (print_notices): Remove final `.' from error message.
21970
21971 * src/reader.c (reader_output_yylsp):
21972 New function.
21973 (readgram): Use `#if 0' around code that accepted %command
21974 inside grammar rules: The documentation doesn't allow it,
21975 and it will fail since the %command processors scan for the next %.
21976 (parse_token_decl): Extended the %token
21977 declaration to allow a multi-character symbol as an alias.
21978 (parse_thong_decl): New function.
21979 (read_declarations): Added %thong declarations.
21980 (read_declarations): Handle NOOP to deal with allowing
21981 % declarations as another means to specify the flags.
21982 (readgram): Allow %prec prior to semantics embedded in a rule.
21983 (skip_to_char, read_declarations, copy_definition)
21984 (parse_token_decl, parse_start_decl, parse_type_decl)
21985 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
21986 (get_type_name, copy_guard, copy_action, readgram)
21987 (get_type, packsymbols): Revised most error messages.
21988 Changed `fatal' to `warnxxx' to avoid aborting for error.
21989 Revised and use multiple warnxxx functions to avoid using VARARGS1.
21990 (read_declarations): Improve the error message for
21991 an invalid character. Do not abort.
21992 (read_declarations, copy_guard, copy_action): Use
21993 printable_version to avoid unprintable characters in printed output.
21994 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
21995 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
21996 Allow the type of a non-terminal can be given
21997 more than once, as long as all specifications give the same type.
21998
21999 * src/output.c:
22000 (output_headers, output_trailers, output, output_gram)
22001 (output_rule_data): Implement noparserflag variable.
22002 Implement toknumflag variable.
22003 (output): Call reader_output_yylsp to output LTYPESTR.
22004
22005 * src/main.c (main):
22006 If reader sees an error, don't process the grammar.
22007 (fatals): Updated to not use VARARGS1.
22008 (printable_version, int_to_string, warn, warni, warns, warnss)
22009 (warnsss): New error reporting functions. Avoid abort for error.
22010
22011 * src/lex.h:
22012 Added THONG and NOOP for alias processing.
22013 Added SETOPT for the new code that allows setting options with %flags.
22014
22015 * src/lex.c:
22016 Include getopt.h. Add some extern decls.
22017 (safegetc): New function to deal with EOF gracefully.
22018 (literalchar); new function to deal with reading \ escapes.
22019 (lex): Use literalchar.
22020 (lex): Implemented "..." tokens.
22021 (literalchar, lex, parse_percent_token): Made tokenbuffer
22022 always contain the token. This includes growing the token
22023 buffer while reading an integer.
22024 (parse_percent_token): Replaced if-else statement with percent_table.
22025 (parse_percent_token): Added % declarations as another
22026 way to specify the flags -n, -l, and -r. Also added hooks for
22027 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
22028 major changes to files.c.
22029 (lex) Retain in the incoming stream a character following
22030 an incorrect '/'.
22031 (skip_white_space, lex): Revised most error messages
22032 and changed fatal to warn to avoid aborting.
22033 (percent_table): Added %thong declarations.
22034
22035 * src/gram.h: Comment changes.
22036
22037 * src/files.c (openfiles, open_extra_files, done):
22038 Add faction flag
22039 and actfile file. Handle noparserflag. Both for -n switch.
22040
22041 * src/conflicts.c (resolve_sr_conflict):
22042 Remove use of alloca.
22043
220441995-06-01 Jim Meyering <meyering@gnu.org>
22045
22046 * doc/bison.texinfo: *** empty log message ***
22047
220481995-05-06 Richard Stallman <rms@gnu.org>
22049
22050 * src/bison.s1: Comment change.
22051
220521995-05-06 Richard Stallman <rms@gnu.org>
22053
22054 * bison.simple: Comment change.
22055
220561995-05-03 Richard Stallman <rms@gnu.org>
22057
22058 * src/version.c: Version now 1.24.
22059
22060 * src/bison.s1: Change distribution terms.
22061
22062 * src/version.c: Version now 1.23.
22063
220641995-05-03 Richard Stallman <rms@gnu.org>
22065
22066 * doc/bison.texinfo:
22067 Rewrite "Conditions for Using Bison".
22068 Update version to 1.24.
22069
220701995-05-03 Richard Stallman <rms@gnu.org>
22071
22072 * bison.simple: Change distribution terms.
22073
220741995-02-23 Richard Stallman <rms@gnu.org>
22075
22076 * src/files.c: Test __VMS_POSIX as well as VMS.
22077
220781995-02-14 Jim Meyering <meyering@gnu.org>
22079
22080 * src/bison.s1 (__yy_memcpy):
22081 Renamed from __yy_bcopy to avoid
22082 confusion. Reverse FROM and TO arguments to be consistent with
22083 those of memcpy.
22084
220851995-02-14 Jim Meyering <meyering@gnu.org>
22086
22087 * bison.simple (__yy_memcpy):
22088 Renamed from __yy_bcopy to avoid
22089 confusion. Reverse FROM and TO arguments to be consistent with
22090 those of memcpy.
22091
220921994-11-10 David J. MacKenzie <djm@gnu.org>
22093
22094 * NEWS: reformat
22095
22096 * NEWS: New file.
22097
22098 * Makefile.in (DISTFILES): Include NEWS.
22099
22100 * Makefile.in (DISTFILES):
22101 Include install-sh, not install.sh.
22102
22103 * configure.in: Update to Autoconf v2 macro names.
22104
221051994-10-05 David J. MacKenzie <djm@gnu.org>
22106
22107 * Makefile.in: fix typo
22108
22109 * Makefile.in (prefix, exec_prefix):
22110 Let configure set them.
22111
221121994-09-28 David J. MacKenzie <djm@gnu.org>
22113
22114 * Makefile.in: Set datadir to $(prefix)/share.
22115
221161994-09-15 Richard Stallman <rms@gnu.org>
22117
22118 * src/bison.s1:
22119 Update copyright notice and GPL version.
22120
221211994-09-15 Richard Stallman <rms@gnu.org>
22122
22123 * bison.simple:
22124 Update copyright notice and GPL version.
22125
221261994-07-12 Richard Stallman <rms@gnu.org>
22127
22128 * src/reduce.c, src/reader.c:
22129 entered into RCS
22130
221311994-05-05 David J. MacKenzie <djm@gnu.org>
22132
22133 * Makefile.in: entered into RCS
22134
221351994-03-26 Richard Stallman <rms@gnu.org>
22136
22137 * src/bison.s1: entered into RCS
22138
221391994-03-26 Richard Stallman <rms@gnu.org>
22140
22141 * bison.simple: entered into RCS
22142
221431994-03-25 Richard Stallman <rms@gnu.org>
22144
22145 * src/main.c: entered into RCS
22146
221471994-03-24 Richard Stallman <rms@gnu.org>
22148
22149 * src/conflicts.c: entered into RCS
22150
221511994-01-02 Richard Stallman <rms@gnu.org>
22152
22153 * Makefile.in: *** empty log message ***
22154
221551993-11-21 Richard Stallman <rms@gnu.org>
22156
22157 * src/bison.s1: *** empty log message ***
22158
221591993-11-21 Richard Stallman <rms@gnu.org>
22160
22161 * doc/bison.texinfo: entered into RCS
22162
22163 * doc/bison.texinfo: *** empty log message ***
22164
221651993-11-21 Richard Stallman <rms@gnu.org>
22166
22167 * bison.simple: *** empty log message ***
22168
221691993-10-25 David J. MacKenzie <djm@gnu.org>
22170
22171 * doc/bison.texinfo: *** empty log message ***
22172
221731993-10-19 Richard Stallman <rms@gnu.org>
22174
22175 * src/bison.s1: *** empty log message ***
22176
221771993-10-19 Richard Stallman <rms@gnu.org>
22178
22179 * bison.simple: *** empty log message ***
22180
221811993-10-14 Richard Stallman <rms@gnu.org>
22182
22183 * src/bison.s1: *** empty log message ***
22184
221851993-10-14 Richard Stallman <rms@gnu.org>
22186
22187 * bison.simple: *** empty log message ***
22188
221891993-09-14 David J. MacKenzie <djm@gnu.org>
22190
22191 * doc/bison.texinfo: *** empty log message ***
22192
221931993-09-13 Noah Friedman <friedman@gnu.org>
22194
22195 * Makefile.in: *** empty log message ***
22196
221971993-09-10 Richard Stallman <rms@gnu.org>
22198
22199 * src/conflicts.c: *** empty log message ***
22200
22201 * src/system.h: entered into RCS
22202
222031993-09-10 Richard Stallman <rms@gnu.org>
22204
22205 * doc/bison.1: entered into RCS
22206
222071993-09-06 Noah Friedman <friedman@gnu.org>
22208
22209 * src/version.c: entered into RCS
22210
222111993-09-06 Noah Friedman <friedman@gnu.org>
22212
22213 * Makefile.in: *** empty log message ***
22214
222151993-07-30 David J. MacKenzie <djm@gnu.org>
22216
22217 * Makefile.in: *** empty log message ***
22218
222191993-07-24 Richard Stallman <rms@gnu.org>
22220
22221 * src/bison.s1: *** empty log message ***
22222
222231993-07-24 Richard Stallman <rms@gnu.org>
22224
22225 * bison.simple: *** empty log message ***
22226
222271993-07-08 David J. MacKenzie <djm@gnu.org>
22228
22229 * Makefile.in: *** empty log message ***
22230
222311993-07-04 Richard Stallman <rms@gnu.org>
22232
22233 * src/bison.s1: *** empty log message ***
22234
222351993-07-04 Richard Stallman <rms@gnu.org>
22236
22237 * bison.simple: *** empty log message ***
22238
222391993-06-26 David J. MacKenzie <djm@gnu.org>
22240
22241 * src/getargs.c: entered into RCS
22242
222431993-06-26 David J. MacKenzie <djm@gnu.org>
22244
22245 * doc/bison.texinfo: *** empty log message ***
22246
22247 * doc/bison.1: New file.
22248
222491993-06-25 Richard Stallman <rms@gnu.org>
22250
22251 * src/getargs.c: New file.
22252
222531993-06-16 Richard Stallman <rms@gnu.org>
22254
22255 * src/bison.s1: *** empty log message ***
22256
222571993-06-16 Richard Stallman <rms@gnu.org>
22258
22259 * bison.simple: *** empty log message ***
22260
222611993-06-03 Richard Stallman <rms@gnu.org>
22262
22263 * src/bison.s1: New file.
22264
222651993-06-03 Richard Stallman <rms@gnu.org>
22266
22267 * doc/bison.texinfo: *** empty log message ***
22268
222691993-06-03 Richard Stallman <rms@gnu.org>
22270
22271 * bison.simple: New file.
22272
222731993-05-19 Richard Stallman <rms@gnu.org>
22274
22275 * doc/bison.texinfo: New file.
22276
222771993-05-07 Noah Friedman <friedman@gnu.org>
22278
22279 * Makefile.in: *** empty log message ***
22280
222811993-04-28 Noah Friedman <friedman@gnu.org>
22282
22283 * src/reader.c: *** empty log message ***
22284
222851993-04-23 Noah Friedman <friedman@gnu.org>
22286
22287 * src/alloc.h: entered into RCS
22288
222891993-04-20 David J. MacKenzie <djm@gnu.org>
22290
22291 * src/version.c: *** empty log message ***
22292
22293 * src/files.c, src/allocate.c:
22294 entered into RCS
22295
22296 * src/reader.c: *** empty log message ***
22297
22298 * src/lex.c: entered into RCS
22299
22300 * src/conflicts.c: New file.
22301
22302 * src/symtab.c: entered into RCS
22303
22304 * src/alloc.h: New file.
22305
22306 * src/LR0.c: entered into RCS
22307
223081993-04-18 Noah Friedman <friedman@gnu.org>
22309
22310 * src/reader.c: New file.
22311
22312 * src/version.c: *** empty log message ***
22313
223141993-04-18 Noah Friedman <friedman@gnu.org>
22315
22316 * Makefile.in: *** empty log message ***
22317
223181993-04-17 Noah Friedman <friedman@gnu.org>
22319
22320 * Makefile.in: *** empty log message ***
22321
223221993-04-15 Richard Stallman <rms@gnu.org>
22323
22324 * src/main.c, src/files.c:
22325 New file.
22326
223271993-04-15 Noah Friedman <friedman@gnu.org>
22328
22329 * configure.in: entered into RCS
22330
22331 * configure.in: *** empty log message ***
22332
22333 * configure.in: New file.
22334
223351993-04-14 Richard Stallman <rms@gnu.org>
22336
22337 * Makefile.in: New file.
22338
223391993-04-13 Richard Stallman <rms@gnu.org>
22340
22341 * src/version.c: New file.
22342
223431993-03-25 Richard Stallman <rms@gnu.org>
22344
22345 * src/output.c: entered into RCS
22346
223471992-09-25 Richard Stallman <rms@gnu.org>
22348
22349 * configure.bat: entered into RCS
22350
223511992-06-22 Richard Stallman <rms@gnu.org>
22352
22353 * src/vmsgetargs.c: entered into RCS
22354
223551992-06-22 Richard Stallman <rms@gnu.org>
22356
22357 * doc/bison.rnh: entered into RCS
22358
223591992-04-20 David J. MacKenzie <djm@gnu.org>
22360
22361 * README: entered into RCS
22362
223631992-01-22 Richard Stallman <rms@gnu.org>
22364
22365 * src/machine.h: entered into RCS
22366
223671991-12-21 Richard Stallman <rms@gnu.org>
22368
22369 * src/lalr.c, src/closure.c:
22370 entered into RCS
22371
223721991-12-20 Richard Stallman <rms@gnu.org>
22373
22374 * src/state.h: entered into RCS
22375
223761991-12-18 Richard Stallman <rms@gnu.org>
22377
22378 * src/print.c, src/nullable.c, src/derives.c:
22379 entered into RCS
22380
223811991-11-03 David J. MacKenzie <djm@gnu.org>
22382
22383 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
22384 entered into RCS
22385
223861988-09-09 Richard Stallman <rms@gnu.org>
22387
22388 * src/bison.hairy: entered into RCS
22389
223901987-12-16 Richard Stallman <rms@gnu.org>
22391
22392 * REFERENCES: entered into RCS
dc546b0f 22393
f294a2c2 22394
04098407 22395 -----
f294a2c2 22396
04098407 22397 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
f490771b
JD
22398 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
22399 2007, 2008, 2009 Free Software Foundation, Inc.
f294a2c2 22400
04098407
PE
22401 Copying and distribution of this file, with or without
22402 modification, are permitted provided the copyright notice and this
22403 notice are preserved.