]> git.saurik.com Git - bison.git/blob - ChangeLog
Fix complaints about escape sequences.
[bison.git] / ChangeLog
1 2009-08-19 Joel E. Denny <jdenny@clemson.edu>
2
3 Fix complaints about escape sequences.
4 Discussed starting at
5 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
6 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
7 For a \0 and similar escape sequences meaning the null
8 character, report an invalid escape sequence instead of an
9 invalid null character because the latter does not actually
10 appear in the user's input.
11 In all escape sequence complaints, don't escape the initial
12 backslash, and don't quote when the sequence appears at the end
13 of the complaint line unless there's whitespace that quotearg
14 won't escape.
15 Consistently say "invalid" not "unrecognized".
16 Consistently prefer "empty character literal" over "extra
17 characters in character literal" warning for invalid escape
18 sequences; that is, consistently discard those sequences.
19 * tests/input.at (Bad escapes in literals): New.
20
21 2009-08-19 Akim Demaille <demaille@gostai.com>
22
23 doc: fixes.
24 * doc/bison.texinfo: Fix minor Texinfo errors.
25
26 2009-08-19 Akim Demaille <demaille@gostai.com>
27
28 doc: %initial-action to initialize yylloc.
29 Reported by Bill Allombert.
30 * doc/bison.texinfo: Set fill-column to 76.
31 (Location Type): Document the use of %initial-action to initialize
32 yylloc.
33
34 2009-08-18 Joel E. Denny <jdenny@clemson.edu>
35
36 maint: update for gnulib's recent update-copyright changes
37 * gnulib: Update.
38 * .x-update-copyright (COPYING): Add as it's no longer implied
39 when .x-update-copyright is present.
40 * cfg.mk (update-copyright-local): Remove, now ignored.
41 (update-copyright): Declare update-b4-copyright as a dependency.
42
43 2009-08-17 Akim Demaille <demaille@gostai.com>
44
45 build: require gettext 0.17.
46
47 Suggested by Bruno Haible.
48 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
49 * configure.ac: require gettext 0.17 to ensure compatibility with
50 gnulib.
51
52 2009-08-17 Akim Demaille <demaille@gostai.com>
53
54 build: lower gettext requirements.
55
56 Bison was uselessly requiring the formatstring macros from
57 gettext, which resulted in mo files not being installed on systems
58 that perfectly supported Bison mo files. Lower the requirement.
59 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
60
61 * configure.ac: Require need-ngettext instead of
62 need-formatstring-macros.
63 Reported by Martin Jabocs.
64 Suggested by Bruno Haible.
65 * INSTALL: Restructure.
66 (Internationalization): New.
67
68 2009-08-14 Joel E. Denny <jdenny@clemson.edu>
69
70 maint: fix use of copyright year intervals.
71 * gnulib: Update.
72 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
73 as now recommended in gnulib/NEWS.
74 * build-aux/update-b4-copyright: Fix.
75 * cfg.mk (update-copyright-env): Configure update-copyright.
76
77 2009-08-13 Joel E. Denny <jdenny@clemson.edu>
78
79 Make it easier to write deterministic tests.
80 Continues Akim's work from his 2009-06-10 commits.
81 * src/reader.c (check_and_convert_grammar): Don't add any
82 symbols after the first symbols_do invocation.
83 * src/symtab.c (symbols_sorted): New static global.
84 (user_token_number_redeclaration): Update comments.
85 (symbol_from_uniqstr): If a new symbol is being created, assert
86 that symbols_sorted hasn't been allocated yet.
87 (symbols_free): Free symbols_sorted.
88 (symbols_cmp, symbols_cmp_qsort): New functions.
89 (symbols_do): Sort symbol_table into symbols_sorted on first
90 invocation.
91 * tests/input.at (Numbered tokens): Recombine tests now that the
92 output should be deterministic across multiple numbers.
93
94 2009-08-12 Akim Demaille <demaille@gostai.com>
95
96 distcheck: fix.
97
98 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
99
100 2009-08-10 Joel E. Denny <jdenny@clemson.edu>
101
102 * tests/Makefile.am (TESTSUITE_AT): Add named-refs.at.
103
104 2009-08-10 Joel E. Denny <jdenny@clemson.edu>
105
106 Miscellaneous code readability improvements.
107
108 * src/reader.c (reader): Move %define front-end variable
109 defaults and checking into...
110 (prepare_percent_define_front_end_variables): ... this new
111 function.
112
113 * src/scan-gram.l (INITIAL): For consistency with string
114 literals, don't store open quote on character literal. It's
115 discarded before returning anyway.
116 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
117 Make length test more readable, and make the character stored
118 for an empty literal more obvious while consistent with the
119 previous behavior.
120
121 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
122 USER_NUMBER_HAS_STRING_ALIAS throughout.
123 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
124 that is repeated in symtab.h. Improve argument names to make it
125 clear which side of the symbol-string alias pair is which.
126 (symbol_check_alias_consistency): Improve local variable names
127 for the same purpose.
128 * src/symtab.h (struct symbol): Make comments about aliases
129 clearer.
130 (symbol_make_alias): Improve comments and argument name.
131 * src/output.c (token_definitions_output): Update for rename to
132 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
133
134 2009-08-08 Alex Rozenman <rozenman@gmail.com>
135
136 Convert "misleading reference" messages to warnings.
137 * src/scan-code.l: New function 'show_sub_messages', more
138 factoring.
139 * tests/named-ref.at: Adjust tests.
140
141 2009-08-06 Joel E. Denny <jdenny@clemson.edu>
142
143 maint: run "make update-copyright"
144
145 2009-08-06 Joel E. Denny <jdenny@clemson.edu>
146
147 maint: make update-b4-copyright easier to use
148 * build-aux/update-b4-copyright: In warnings, report line
149 numbers rather than character positions.
150 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
151 that update-copyright runs it.
152 * gnulib: Update.
153
154 2009-08-05 Joel E. Denny <jdenny@clemson.edu>
155
156 maint: clean up update-b4-copyright code
157 * build-aux/update-b4-copyright: Do not accept 2-digit
158 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
159 Don't accept a `[' in a b4_copyright argument.
160 Format code more consistently.
161 Don't assume b4*copyright never occurs.
162
163 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
164
165 maint: automate b4_copyright updates.
166 * Makefile.am (update-b4-copyright): New target rule.
167 * build-aux/Makefile.am (EXTRA_DIST): Add update-b4-copyright.
168 * build-aux/update-b4-copyright: New.
169 * data/yacc.c: Remove stray characters around b4_copyright
170 invocations.
171
172 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
173
174 maint: automate annual package-wide copyright-year update.
175 * .x-update-copyright: New.
176 * Makefile.am (EXTRA_DIST): Remove maint.mk.
177 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
178 update-copyright. Remove gnumakefile, which is implied by
179 maintainer-makefile.
180 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
181 * gnulib: Update.
182 * maint.mk: Remove, now copied from gnulib.
183 * examples/extexi: Add missing "(C)" in copyright statement so
184 update-copyright can recognize it.
185 * src/LR0.h: Likewise.
186 * src/print.h: Likewise.
187 * src/print_graph.h: Likewise.
188 * src/gram.c: Add missing comma in copyright statement.
189 * src/gram.h: Likewise.
190
191 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
192
193 Fix "make distcheck".
194 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
195 of just calc.stamp.
196
197 2009-08-01 Joel E. Denny <jdenny@clemson.edu>
198
199 Pacify "gcc -Wunused" for the input function from Flex.
200 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
201 and later.
202 * src/scan-code.l: Add "%option noinput", which I cannot find in
203 the Flex manual, but which Flex has supported since at least as
204 far back as 2.5.4. However, if any of our developers still use
205 Flex 2.5.4, they'll need to stop configuring with
206 --enable-gcc-warnings because "%option noinput" didn't work
207 correctly until Flex 2.5.6.
208 * src/scan-gram.l: Likewise.
209 * src/scan-skel.l: Likewise.
210
211 2009-07-31 Alex Rozenman <rozenman@gmail.com>
212
213 Fix --enable-gcc-warnings problems.
214 * src/reader.c: Adjust variable names.
215 * src/scan-code.l: Fix prototypes and adjust names.
216 * src/named-ref.c: Remove redundant "if".
217
218 2009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
219
220 Fix a --enable-gcc-warnings problem.
221 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
222 variable.
223
224 2009-07-24 Alex Rozenman <rozenman@gmail.com>
225
226 Fix some memory leaks.
227 * src/named-ref.c: Add a pointer check (named_ref_free).
228 * src/scan-code.l: New function (variant_table_free). Called in
229 code_scanner_free.
230 * src/symlist.c: Call to named_ref_free (symbol_list_free).
231
232 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
233
234 Warn about character literals not of length one.
235 * NEWS (2.5): Document.
236 * src/scan-gram.l (INITIAL): Remove comment that we don't check
237 the length.
238 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
239 * tests/input.at (Bad character literals): New test group.
240
241 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
242
243 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
244
245 2009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
246
247 Some M4 cleanup in the testsuite.
248 Suggested by Eric Blake at
249 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
250 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
251 complicate the code by distinguishing between a missing value
252 and an empty string value for an optional argument. This fix is
253 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
254 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
255 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
256 arguments are not needed because of the following changes.
257 Fix stale comments.
258 Bison developers should use GNU M4 and should not use
259 POSIXLY_CORRECT when building the test suite, so do not
260 complicate the code by avoiding $10 and above.
261 Do not quote an empty string value for an optional argument, and
262 do not distinguish between a missing value and an empty string
263 value.
264
265 2009-07-21 Joel E. Denny <jdenny@ces.clemson.edu>
266
267 * m4/m4.m4: Make it a sym link to submodules/autoconf/m4/m4.m4.
268
269 2009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
270
271 Revert unnecessary column realignment in --help output.
272 Reported by Akim Demaille at
273 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
274 * src/getargs.c (usage): Here.
275
276 2009-07-04 Alex Rozenman <rozenman@gmail.com>
277
278 Alphabetical order in src/Makefile.am.
279 * src/Makefile.am: Adjust.
280
281 2009-07-04 Alex Rozenman <rozenman@gmail.com>
282
283 Style changes and factoring.
284 * src/named-ref.h: Add comments.
285 * src/parse-gram.y: Readability and style changes.
286 * src/reader.c: Factoring: assign_named_ref function.
287 * src/scan-code.l: Factoring and style changes. Rename
288 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
289 Use "unsigned" type for variant index. Improve readablity.
290 * src/scan-gram.l: Change error messages and add comments.
291 * src/symlist.h: symbol_list_null: New function decl.
292 * src/symlist.c: symbol_list_null: Implement here.
293 * tests/named-refs.at: Adjust for new error messages.
294
295 2009-06-29 Eric Blake <ebb9@byu.net>
296
297 scan-code: avoid compiler warnings
298 * src/scan-code.l (parse_named_ref): Use correct specifiers.
299
300 2009-06-29 Akim Demaille <demaille@gostai.com>
301
302 build: avoid concurrent extraction of calc++.
303 * examples/calc++/Makefile.am (calc.stamp): New.
304 Depend on it to create the sources of calc++ so that concurrent
305 builds don't launch several "extexi" in parallel.
306 Not only this is inefficient, this also builds incorrect sources
307 with several extractions mixed together.
308
309 2009-06-27 Alex Rozenman <rozenman@gmail.com>
310
311 Implement support for named symbol references.
312 * src/parse-gram.y: Add new syntax (named_ref.opt).
313 * src/reader.c: Store named refs in symbol lists.
314 * src/reader.h: New argument for symbol_append and
315 action_append functions.
316 * src/scan-code.h: Add new field (named_ref) into
317 code_props data structure. Keeps named ref of midrule
318 actions.
319 * src/scan-code.l: Support for named refs in semantic
320 action code. New function 'parse_named_ref'.
321 * src/scan-gram.l: Support bracketed id.
322 * src/symlist.c: Store named refs in symbol lists.
323 * src/symlist.h: New field in symbol list: named_ref.
324 * src/named-ref.h: New file, a struct for named_ref.
325 * src/named-ref.cp: New file, named_ref_new function.
326 * src/local.mk: Add two new files.
327 * tests/testsuite.at: Include new test group:
328 * tests/named-refs.at: this new file.
329
330 2009-06-25 Akim Demaille <demaille@gostai.com>
331
332 hash: check insertion for memory exhaustion.
333 * src/uniqstr.c (uniqstr_new): New.
334
335 2009-06-11 Akim Demaille <demaille@gostai.com>
336
337 style changes.
338 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
339 * src/print-xml.c: Style changes.
340 * tests/conflicts.at: Comment changes.
341
342 2009-06-11 Akim Demaille <demaille@gostai.com>
343
344 xml: beware of user strings used to give a %prec to rules.
345 * tests/conflicts.at (%prec with user strings): New.
346 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
347 XML output.
348
349 2009-06-11 Akim Demaille <demaille@gostai.com>
350
351 hash: check insertion for memory exhaustion.
352 * src/muscle-tab.c (muscle_insert, muscle_grow)
353 * src/state.c (state_hash_insert): Check the return value of
354 hash_insert.
355
356 2009-06-10 Akim Demaille <demaille@gostai.com>
357
358 deterministic test suite.
359 Some consistency checks on symbols are performed after all the
360 symbols were read, by an iteration over the symbol table. This
361 traversal is nondeterministic, which can be a problem for test
362 cases.
363 Avoid this.
364 Addresses another form of nondeterminism reported by Joel E. Denny.
365 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
366
367 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
368 test in two.
369 Use different file names for the three tests to make the
370 maintenance easier.
371
372 2009-06-10 Akim Demaille <demaille@gostai.com>
373
374 deterministic user-token-number redeclaration errors.
375 Address nondeterminism reported by Joel E. Denny.
376 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
377
378 * src/uniqstr.h: Comment changes.
379 * src/location.h (boundary_cmp, location_cmp): New.
380 * src/symtab.c (user_token_number_redeclaration): New.
381 (symbol_translation): Use it.
382 * tests/input.at (Numbered tokens): Adjust the expected output.
383
384 2009-05-25 Akim Demaille <demaille@gostai.com>
385
386 gnulib: update.
387 * gnulib: Update to latest.
388 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
389 * m4/.gitignore: Regen.
390 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
391 Call xalloc_die on hash_insert failures.
392 Requested by the new __warn_unused_result__ attribute of
393 hash_insert.
394
395 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
396
397 Convert multiple variable definition warnings to complaints.
398 * NEWS (2.5): Add a new entry for that change.
399 * doc/bison.texinfo (Decl Summary): Update %define entry.
400 (Bison Options): Update -D/--define/-F/--force-define entry.
401 * src/muscle_tab.c (muscle_percent_define_insert): Implement.
402 * src/muscle_tab.h (muscle_percent_define_insert): Update
403 comments.
404 * tests/input.at (`%define errors'): Update.
405 (`%define, --define, --force-define'): Update.
406
407 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
408
409 -F/--force-define and relative %define/-D/--define priorities.
410 * NEWS (2.5): Add documentation to -D/--define entry.
411 * build-aux/cross-options.pl: Hard-code association of
412 --force-define with %define.
413 * doc/bison.texinfo (Decl Summary): In %define entry,
414 cross-reference command-line options.
415 (Bison Options): Add documentation to -D/--define entry.
416 (Option Cross Key): Widen column for --force-define row.
417 * src/getargs.c (usage): Document -F/--force-define. Realign
418 options in output.
419 (short_options, long_options, getargs): Parse -F/--force-define,
420 and update muscle_percent_define_insert invocation.
421 * src/muscle_tab.h (muscle_percent_define_how): New enum type.
422 (muscle_percent_define_insert): Add argument with that type.
423 * src/muscle_tab.c (muscle_percent_define_insert): Implement
424 -F/--force-define behavior and priorities.
425 * src/parse-gram.y (prologue_declaration): Update
426 muscle_percent_define_insert invocations.
427 * tests/input.at (`%define, --define'): Rename to...
428 (`%define, --define, --force-define'): ... this and extend.
429
430 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
431
432 Update some comments to make sense for -D.
433 * data/bison.m4 (b4_check_user_names): In header comments, say
434 "user occurrence" instead of "grammar occurrence".
435 * src/muscle_tab.h (muscle_percent_define_insert): Likewise.
436 (muscle_percent_code_grow): Likewise just for consistency.
437
438 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
439
440 * data/c++.m4: Update copyright year.
441
442 2009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
443
444 * data/c++.m4 (b4_namespace_close): Simplify slightly.
445
446 2009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
447
448 Handle a trailing `:' in a user-supplied C++ namespace better.
449 * data/c++.m4 (b4_namespace_close): Don't let it be printed
450 among the closing braces here. This fix might make the
451 generated code easier to debug, but otherwise it should be
452 insignificant because a trailing `:' is a C++ error already.
453
454 2009-05-19 Akim Demaille <demaille@gostai.com>
455
456 remove useless variable.
457 * src/getargs.c (skeleton_arg): Remove now useless variable.
458 Should help the compiler see that this printf-like call is sane.
459
460 2009-05-11 Akim Demaille <demaille@gostai.com>
461
462 doc: use C++ headers.
463 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
464 headers.
465
466 2009-05-05 Akim Demaille <demaille@gostai.com>
467
468 fix hexadecimal token number support.
469 * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers.
470
471 2009-05-05 Akim Demaille <demaille@gostai.com>
472
473 tests: check token numbers.
474 * tests/input.at (Numbered tokens): New.
475
476 2009-05-04 Akim Demaille <demaille@gostai.com>
477
478 bison: catch bad symbol names.
479 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
480 * tests/input.at: Adjust.
481
482 2009-05-04 Akim Demaille <demaille@gostai.com>
483
484 space changes.
485 * src/scan-gram.l: Untabify to be robust to zealous editors.
486
487 2009-05-04 Akim Demaille <demaille@gostai.com>
488
489 identifiers: dashes are letters.
490 Dashes can now start identifiers (symbols and directives).
491
492 * src/scan-gram.l ({letter}): Add dash.
493 ({id}): Remove it.
494 * tests/input.at (Symbols): Adjust.
495 Remove stray comment.
496 * tests/regression.at (Invalid inputs): Adjust error message.
497 * doc/bison.texinfo (Symbols): Update.
498
499 2009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
500
501 Declare %code to be a permanent feature.
502 * NEWS (2.4.2): Here.
503 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
504 experimental.
505 (Decl Summary): Likewise.
506
507 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
508
509 Convert underscores to dashes in some %define variable names.
510 For now, just api.push-pull and lr.keep-unreachable-states.
511 Maintain old names for backward compatibility.
512 * NEWS (2.5): Document.
513 * data/c.m4 (b4_identification): Update comment.
514 * data/yacc.c: Update access.
515 * doc/bison.texinfo: Update.
516 * etc/bench.pl.in (bench_grammar): Update use.
517 * src/files.c (tr): Move to...
518 * src/getargs.c, src/getargs.h (tr): ... here because I can't
519 think of a better place to expose it. My logic is that, for all
520 uses of tr so far, command-line arguments can be involved, and
521 getargs.h is already included.
522 * src/main.c (main): Update access.
523 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
524 variable names to new variable names before assigning value.
525 * src/reader.c (reader): Update setting default.
526 * tests/calc.at: Update uses.
527 * tests/conflicts.at (Unreachable States After Conflict
528 Resolution): Update use.
529 * tests/input.at (%define enum variables): Update use.
530 (%define backward compatibility): New test group.
531 * tests/push.at: Update uses.
532 * tests/reduce.at: Update uses.
533 * tests/torture.at: Update uses.
534
535 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
536
537 Set all front-end %define defaults in one place.
538 * src/main.c (main): Move lr.keep_unreachable_states default...
539 * src/reader.c (reader): ... to here.
540
541 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
542
543 Rename lr.default_reductions to lr.default-reductions.
544 * NEWS (2.5): Here.
545 * doc/bison.texinfo: Here.
546 * src/lalr.c (initialize_LA): Here.
547 * src/print.c (print_reductions): Here.
548 * src/reader.c (reader): Here.
549 * src/tables.c (action_row): Here.
550 * tests/input.at (%define enum variables): Here.
551 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
552
553 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
554
555 Pacify ./configure --enable-gcc-warnings.
556 * tests/input.at (Symbols): Prototype yyerror and yylex.
557
558 2009-04-21 Akim Demaille <demaille@gostai.com>
559
560 tests: check the use of dashes and periods in symbols.
561 * tests/input.at (Symbol): New test group.
562
563 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
564
565 Document how `%define "var" "value"' is not M4-friendly.
566 * src/parse-gram.y (variable): In comments here.
567
568 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
569
570 Add copyright updates missed during previous cherry pick.
571 * src/output.c: Here.
572 * src/parse-gram.y: Here.
573 * src/scan-gram.l: Here.
574
575 2009-04-20 Akim Demaille <demaille@gostai.com>
576
577 variables: accept dashes.
578 * src/scan-gram.l ({id}): Also accept dashes after the initial
579 letter.
580 ({directive}): Use {id}.
581 * src/parse-gram.y: Comment and formatting changes.
582 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
583 symbols.
584 * src/complain.h, src/complain.c (yacc_at): New.
585 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
586 symbol names.
587 * src/output.c (token_definitions_output): Do not #define token
588 names with dashes.
589
590 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
591
592 Clean up recent patches a little.
593 Reported by Akim Demaille.
594 * doc/bison.texinfo (Understanding): Fix typos.
595 * src/print.c (print_reductions): Don't use negated variable.
596
597 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
598
599 List accepted values for a %define enum variable with an invalid value.
600 Suggested by Akim Demaille at
601 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
602 * data/bison.m4 (_b4_percent_define_check_values): Implement.
603 * src/muscle_tab.c (muscle_percent_define_check_values): Implement.
604 * tests/input.at (%define lr.default_reductions invalid values): Merge
605 into...
606 (%define enum variables): ... here, and update output.
607
608 2009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
609
610 Rename "default rule" to "default reduction".
611 This includes changing variable names in code, changing
612 comments, and renaming %define lr.default_rules to %define
613 lr.default_reductions.
614 * NEWS (2.5): Update IELR documentation.
615 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c:
616 Adjust YYDEFACT and yydefact_ documentation.
617 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
618 and lr.type documentation. Make some other wording
619 improvements.
620 (Glossary): Adjust cross-references and Default Reduction
621 definition.
622 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
623 Remove a confusing comment pointed out by Akim Demaille.
624 (initialize_LA): Adjust code.
625 * src/print-xml.c (print_reductions): Adjust code.
626 * src/print.c (print_reductions): Adjust code.
627 * src/reader.c (reader): Adjust code.
628 * src/tables.c (action_row): Adjust code.
629 (token_actions): Adjust code.
630 * src/tables.h: Adjust YYDEFACT documentation.
631 * tests/input.at (%define lr.default_rules invalid values):
632 Rename test group to...
633 (%define lr.default_reductions invalid values): ... this, and
634 update grammar file and expected output.
635 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
636 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
637
638 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
639
640 Document %define lr.type and lr.default_rules.
641 * NEWS (2.5): Add an entry.
642 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
643 besides just LALR(1) and GLR(1).
644 * doc/bison.texinfo (Introduction): Likewise.
645 (Language and Grammar): Bison is no longer limited to LALR(1)
646 restrictions.
647 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
648 when trying to distinguish from GLR. Talk about LR(1) grammars
649 rather than LALR(1) grammars.
650 (Decl Summary): In %define api.push_pull entry, say it applies
651 to deterministic parsers in C rather than LALR(1) parsers in C.
652 Add lr.default_rules entry.
653 Add lr.type entry.
654 (Mystery Conflicts): Bison is no longer limited to LALR(1)
655 restrictions.
656 (Generalized LR Parsing): Same changes as for the previous GLR
657 section.
658 (Memory Management): Say deterministic rather than LALR(1).
659 (Understanding): Correct some bison output.
660 Index discussion of "accepting state".
661 Say deterministic rather than LALR(1).
662 (Bison Options): In --yacc entry, say deterministic rather than
663 LALR(1).
664 In --report, --graph, and --xml entries, just don't mention
665 LALR(1).
666 (C++ Parsers): Say deterministic rather than LALR(1).
667 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
668 (Glossary): Add Accepting State, Consistent State, Default Rule,
669 and IELR(1) definitions.
670 In Generalized LR (GLR) definition, make same changes as in
671 previous GLR sections.
672 In LALR(1) definition, say Bison uses LALR(1) by default rather
673 than implying Bison is limited to LALR(1).
674 (LocalWords): Add IELR.
675
676 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
677
678 Finish implementing %define lr.type.
679 Its value can be "LALR", "IELR", or "canonical LR".
680 * lib/timevar.def (TV_IELR_PHASE1): New var.
681 (TV_IELR_PHASE2): New var.
682 (TV_IELR_PHASE3): New var.
683 (TV_IELR_PHASE4): New var.
684 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
685 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
686 Sbitset.h, ielr.h, and ielr.c.
687 * src/getargs.h, src/getargs.c (enum trace, trace_args,
688 trace_types): Add trace_ielr.
689 * src/lalr.h, src/lalr.c (ngotos): Export it.
690 (F): Rename to...
691 (goto_follows): ... this, update all uses, and export it.
692 (set_goto_map): Export it.
693 (map_goto): Export it.
694 (compute_lookahead_tokens): Don't free goto_follows yet. Now
695 handled in ielr.
696 (initialize_LA): Export it. Move lookback allocation to...
697 (lalr): ... here because, for canonical LR, initialize_LA must
698 be invoked but lookback and much of the rest of LALR isn't
699 needed.
700 * main.c (main): Instead of lalr, invoke ielr, which invokes
701 lalr.
702 * src/reader.c (reader): Default lr.type to "LALR".
703 Default lr.default_rules to "accepting" if lr.type is "canonical
704 LR". Leave the default as "all" otherwise.
705 Check for a valid lr.type value.
706 * src/state.h, src/state.c (struct state_list): Add state_list
707 member.
708 (state_new): Initialize state_list member to NULL.
709 (state_new_isocore): New function, exported.
710 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
711 exercises all values of lr.type.
712 (GNU AWK Grammar): Rename test group to...
713 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
714 AT_TEST_EXISTING_GRAMMAR.
715 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
716 (GNU pic Grammar): Rename test group to...
717 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
718 AT_TEST_EXISTING_GRAMMAR.
719 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
720 all values of lr.type.
721 (Single State Split): New test groups using AT_TEST_LR_TYPE.
722 (Lane Split): Likewise.
723 (Complex Lane Split): Likewise.
724 (Split During Added Lookahead Propagation): Likewise.
725
726 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
727
728 Add new files for IELR and canonical LR implementation.
729 * src/AnnotationList.c: New.
730 * src/AnnotationList.h: New.
731 * src/InadequacyList.c: New.
732 * src/InadequacyList.h: New.
733 * src/Sbitset.c: New.
734 * src/Sbitset.h: New.
735 * src/ielr.c: New.
736 * src/ielr.h: New.
737
738 2009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
739
740 Implement %define lr.default_rules.
741 Its value describes the states that are permitted to contain
742 default rules: "all", "consistent", or "accepting".
743 * src/reader.c (reader): Default lr.default_rules to "all".
744 Check for a valid lr.default_rules value.
745 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
746 is "accepting", then only mark the accepting state as
747 consistent.
748 (initialize_LA): Tell state_lookahead_tokens_count whether
749 lr.default_rules is "accepting".
750 * src/tables.c (action_row): If lr.default_rules is not "all",
751 then disable default rules in inconsistent states.
752 * src/print.c (print_reductions): Use this opportunity to
753 perform some assertions about whether lr.default_rules was
754 obeyed correctly.
755 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
756 helps with checking the parser tables for a grammar.
757 * tests/input.at (%define lr.default_rules invalid values): New
758 test group.
759 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
760 AT_TEST_TABLES_AND_PARSE.
761 (`no %define lr.default_rules'): New test group generated by
762 AT_TEST_LR_DEFAULT_RULES.
763 (`%define lr.default_rules "all"'): Likewise.
764 (`%define lr.default_rules "consistent"'): Likewise.
765 (`%define lr.default_rules "accepting"'): Likewise.
766
767 2009-04-20 Akim Demaille <demaille@gostai.com>
768
769 Consistently refer to Yacc, not YACC.
770 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
771
772 2009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
773
774 Pacify make maintainer-check-posix.
775 * tests/input.at (%define, --define): Move bison command-line
776 options before grammar file name.
777
778 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
779
780 Document semicolon warnings.
781 * NEWS (2.5): Here.
782
783 2008-12-08 Akim Demaille <demaille@gostai.com>
784
785 Fix portability issue in the test suite.
786 * tests/local.at (AT_MATCHES_CHECK): New.
787 Based on Perl instead of Sed. Sed has too many portability
788 pitfalls, not ever Sed is GNU Sed.
789 * tests/actions.at (Fix user actions without a trailing semicolon):
790 Use it.
791
792 2008-12-07 Di-an Jan <dianj@freeshell.org>
793
794 Implement the FIXME that ends an user action with a semicolon
795 if it seems necessary.
796 * src/scan-code.l (flex rules section): Flag cpp directive from
797 any `#' to the first unescaped end-of-line. Semicolon is not
798 needed after `;', `{', '}', or cpp directives and is needed after
799 any other token (whitespaces and comments have no effect).
800 * tests/actions.at (Fix user actions without a trailing semicolon):
801 New test.
802 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
803 to make user actions complete statements.
804 Adjust column numbers in error messages.
805 * tests/regression.at (Fix user actions without a trailing semicolon):
806 Remove. Covered by new test.
807
808 2009-04-14 Akim Demaille <demaille@gostai.com>
809
810 doc: minor fixes.
811 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
812 (Table of Symbols): Remove duplicate entry for %debug.
813
814 2009-04-10 Eric Blake <ebb9@byu.net>
815
816 submodules: update to latest
817 * submodules/autoconf: Use latest upstream Autoconf.
818
819 2009-04-06 Eric Blake <ebb9@byu.net>
820
821 Work around autoconf 2.63b bug in testsuite.
822 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
823 autoconf bug related to # in test.
824
825 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
826
827 * NEWS (2.5): Describe new -D/--define feature.
828
829 2008-11-10 Akim Demaille <demaille@gostai.com>
830
831 --trace=muscles
832 * src/getargs.h, src/getargs.c (trace_muscle): New.
833 (trace_types, trace_args): Support it.
834 * src/output.c (output_skeleton): Use it.
835
836 2008-11-10 Akim Demaille <demaille@gostai.com>
837
838 muscles_output.
839 * src/output.c (muscles_output): New, extracted from...
840 (output_skeleton): here.
841 Adjust.
842
843 2008-11-21 Akim Demaille <demaille@gostai.com>
844
845 Display the changes in cross-options.texi.
846 * build-aux/cross-options.pl ($sep): New, to separate items.
847 * doc/Makefile.am ($(srcdir)/cross-options.texi): Use diff to display
848 the changes.
849
850 2008-11-20 Di-an Jan <dianj@freeshell.org>
851
852 Improves options in the manual.
853 * doc/bison.texinfo (-g, -x): Add space before argument.
854 (Option Cross Key): Implement FIXME: listing directives also.
855 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
856 (Short Option): Special case -d. Put arguments inside @option.
857 (Bison Directive): Add column, automatically extracted from
858 src/scan-gram.l (actual name passed as the first argument)
859 with special case for %define.
860 * doc/Makefile.am (doc/cross-options.texi): Pass src/scan-gram.l
861 to build-aux/cross-options.pl.
862 * src/getargs.c (usage): Document limitations of cross-options.pl.
863 * src/scan-gram.l: Likewise.
864
865 2009-02-25 Akim Demaille <demaille@gostai.com>
866
867 Copyright years.
868 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
869
870 2008-12-08 Akim Demaille <demaille@gostai.com>
871
872 Install autoconf as a submodule to get m4sugar.
873 * .gitmodules: Add submodules/autoconf.
874 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
875 submodules/autoconf.
876
877 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
878
879 Simplify last patch slightly.
880 * src/getargs.c (getargs): Here.
881
882 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
883
884 Fix last warning from --enable-gcc-warnings.
885 * src/getargs.c (getargs): Don't assign const address to non-const
886 pointer.
887
888 2008-11-17 Di-an Jan <dianj@freeshell.org>
889
890 Handle --enable-gcc-warnings.
891 * src/getargs.c (command_line_location): Set parameters to void.
892
893 2008-11-11 Akim Demaille <demaille@gostai.com>
894
895 AT_FULL_COMPILE.
896 * tests/actions.at, tests/regression.at: Use it.
897
898 2008-11-07 Akim Demaille <demaille@gostai.com>
899
900 Pass command line location to skeleton_arg and language_argmatch.
901 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
902 The location argument is now mandatory.
903 Adjust all dependencies.
904 (getargs): Use command_line_location.
905
906 2008-11-07 Akim Demaille <demaille@gostai.com>
907
908 -D, --define.
909 * src/getargs.c (usage): Document -D.
910 Fix help string for --locations.
911 (command_line_location): New.
912 (short_options, long_options, getargs): Support -D, --define.
913 (getargs): Move -d support at the right place.
914 * doc/bison.texinfo (Bison Options): Update.
915 * tests/input.at (%define, --define): New.
916
917 2008-11-07 Akim Demaille <demaille@gostai.com>
918
919 Initialize the muscle table before parsing the command line.
920 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
921 (getargs): Define file_name.
922 * src/main.c (main): Initialize muscle_tab before calling
923 getargs.
924 * src/muscle_tab.c (muscle_init): No longer define file_name, as
925 its value is not available yet.
926
927 2008-11-09 Akim Demaille <demaille@gostai.com>
928
929 Require the generation of parse-gram.output.
930 * src/Makefile.am (YACC): Pass --report=all.
931
932 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
933
934 * NEWS (2.5): New stub.
935
936 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
937
938 Fix options documentation.
939 * build-aux/cross-options.pl: As in --help output, write optional
940 arguments as [=ARG] not =[ARG].
941 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
942
943 2008-11-07 Akim Demaille <demaille@gostai.com>
944
945 Fix --help.
946 * src/getargs.c (usage): Fix help string for -W.
947
948 2008-11-07 Akim Demaille <demaille@gostai.com>
949
950 Handle more general types of option arguments.
951 * build-aux/cross-options.pl: The argument ends at the first
952 space, not the first non-symbol character.
953 Use @var for each word appearing the argument description.
954
955 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
956
957 Remove spurious initial empty lines.
958 * data/location.cc: End the @output lines with an @.
959
960 2008-11-04 Akim Demaille <demaille@gostai.com>
961
962 Remove spurious initial empty lines.
963 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
964 * data/yacc.c: End the @output lines with an @.
965
966 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
967
968 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
969 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
970 requirements for a correct m4 are stricter.
971 * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
972 * configure.ac: Update to use AC_PROG_GNU_M4.
973 Reported by Eric Blake.
974
975 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
976
977 Help with updating web manual.
978 * HACKING: Incorporate instructions from gnulib/doc/README.
979 * bootstrap.conf (gnulib_modules): Add gendocs.
980
981 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
982
983 Fix strange %define locations for default values.
984 Reported by Akim Demaille at
985 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
986 and discussed again starting at
987 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
988 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
989 because location information is bogus.
990 Use angle brackets to delimit fake file name because square brackets
991 look like underexpanded m4. Choose a better fake file name.
992 Use negative line numbers.
993 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
994 * src/location.c (location_print): If line for a boundary is negative,
995 only print that boundary's file name.
996 * src/location.h: Document that.
997 * tests/skeletons.at (%define Boolean variables: invalid skeleton
998 defaults): Update output.
999
1000 2008-11-07 Akim Demaille <demaille@gostai.com>
1001
1002 Locations without columns for command line arguments.
1003 * src/location.c (location_print): Don't display negative columns.
1004 * src/location.h: Document this.
1005
1006 2009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
1007
1008 Add reminder about uploading public key to keys.gnupg.net.
1009 * HACKING (Release Procedure): Here.
1010
1011 2009-03-31 Akim Demaille <demaille@gostai.com>
1012
1013 bootstrap: --help to stdout.
1014 * bootstrap (usage): Don't send --help to stderr.
1015 Use a here doc instead of a long string.
1016
1017 2009-03-31 Akim Demaille <demaille@gostai.com>
1018
1019 bootstrap: README-hacking no longer exists
1020 * bootstrap (checkout_only_file): Set to HACKING.
1021
1022 2009-03-26 Akim Demaille <demaille@gostai.com>
1023
1024 doc: merge HACKING and README-hacking.
1025 Two files is confusing.
1026 Reported by Alexandre Duret-Lutz.
1027
1028 * README-hacking: Merge into...
1029 * HACKING (Working from the repository): here.
1030
1031 2009-03-26 Akim Demaille <demaille@gostai.com>
1032
1033 doc: update README-hacking.
1034 * README-hacking: We now use git and git submodules.
1035 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
1036
1037 2009-03-26 Akim Demaille <demaille@gostai.com>
1038
1039 lalr1.cc: avoid GCC 4.3 warnings.
1040 GCC 4.3 now warns about "a || b && c" and asks for explicit
1041 parentheses.
1042 Reported by Alexandre Duret-Lutz.
1043 * data/location.cc: Update copyright years.
1044 (Position::operator==): Use parens to make precedence explicit.
1045 Compare lines and columns first, as they are more likely to be
1046 different, and they are faster to compare.
1047
1048 2009-03-26 Akim Demaille <demaille@gostai.com>
1049
1050 gnulib: update.
1051 * gnulib: Update to latest.
1052 * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so
1053 use +=.
1054
1055 2009-01-08 Akim Demaille <demaille@gostai.com>
1056
1057 Fix grep portability issues.
1058 Grep on Solaris does not support -q.
1059 Reported by Summum Bonum.
1060
1061 * NEWS: Add a stub for 2.4.2.
1062 * THANKS: Add Summum Bonum.
1063 * tests/atlocal.in (EGREP): New.
1064 (CC, CXX, XSLTPROC): Make it possible to override them via
1065 envvars.
1066 * tests/java.at: Use $EGREP instead of egrep.
1067 Use AT_CHECK's ignore instead of grep's -q.
1068
1069 2008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1070
1071 Version 2.4.1.
1072 * NEWS: Set version and date.
1073 * lib/Makefile.am: Update copyright year.
1074 * tests/atlocal.in: Update copyright year.
1075
1076 2008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1077
1078 Semicolon feature removal is not about future language support.
1079 * NEWS: The semicolon feature is no longer active for newer languages,
1080 so don't claim that it causes trouble for them.
1081
1082 2008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1083
1084 * gnulib: Update submodule to HEAD.
1085
1086 2008-12-09 Akim Demaille <demaille@gostai.com>
1087
1088 Update data/README.
1089 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
1090
1091 2008-12-05 Eric Blake <ebb9@byu.net>
1092
1093 Build testsuite with newer autoconf.
1094 * tests/output.at (m4_expand): Don't override in newer autoconf,
1095 where the underlying implementation changed.
1096 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
1097 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
1098 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
1099 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
1100 since some of them contain unbalanced ')'.
1101
1102 2008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1103
1104 * NEWS: Clarify a little.
1105
1106 2008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1107
1108 * NEWS: Update for recent changes.
1109
1110 2008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1111
1112 Fix unexpanded macros in GLR defines file.
1113 Reported by Csaba Raduly at
1114 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
1115 * THANKS (Csaba Raduly): Add.
1116 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
1117 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
1118 lexer in a separate module that includes the defines file.
1119 (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
1120 source.
1121 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
1122 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
1123 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
1124 (AT_DATA_SOURCE_PROLOGUE): New.
1125 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
1126 (AT_DATA_SOURCE): New.
1127 (AT_FULL_COMPILE): New, copied from master branch and extended to
1128 support an additional source file.
1129
1130 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1131
1132 Don't let maintainer-*-check targets force a version update.
1133 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
1134 handled.
1135
1136 2008-11-17 Di-an Jan <dianj@freeshell.org>
1137
1138 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
1139 Align menus. Adjust word wrapping. Use node names for menu names.
1140 (Examples): Don't abbreviate node names.
1141 (LocalWords): Remove abbreviations.
1142 (Copying): Make description a sentence.
1143 (Java Action Features): Remove period to match the rest of menu.
1144
1145 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
1146
1147 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
1148 * configure.ac: Adjust usage.
1149 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1150 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1151 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
1152
1153 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1154
1155 Don't add a semicolon to actions for %skeleton or %language.
1156 It breaks Java test cases as reported by Akim Demaille.
1157 * src/scan-code.l: Implement.
1158
1159 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1160
1161 Clean up %skeleton and %language priority implementation.
1162 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
1163 remove static qualifier because others will soon need to see it.
1164 (language_prio): Likewise.
1165 (getargs): Use command_line_prio rather than 0.
1166 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
1167 enum fields.
1168 (skeleton_prio): Extern it.
1169 (language_prio): Extern it.
1170 * src/parse-gram.y: Use grammar_prio rather than 1.
1171
1172 2008-11-04 Akim Demaille <demaille@gostai.com>
1173
1174 * NEWS: Mention the trailing semicolon in action.
1175
1176 2008-11-04 Akim Demaille <demaille@gostai.com>
1177
1178 Reformat NEWS.
1179 * NEWS: Use more outline-mode markup.
1180 Suggested by Jim Meyering.
1181
1182 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
1183
1184 Fix user actions without a trailing semicolon.
1185 Reported by Sergei Steshenko at
1186 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
1187 * THANKS (Sergei Steshenko): Add.
1188 * src/scan-code.l (SC_RULE_ACTION): Fix it.
1189 * tests/regression.at (Fix user actions without a trailing semicolon):
1190 New test case.
1191
1192 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1193
1194 Initiate further development.
1195 * NEWS: Create an empty section for new entries.
1196 * gnulib: Update submodule to HEAD.
1197
1198 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1199
1200 * NEWS: Version 2.4.
1201
1202 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1203
1204 Prepare for next release.
1205 * NEWS: Briefly mention changes since 2.3b.
1206 * README: Say GNU m4 1.4.6, which we've been requiring in release
1207 announcements already, not 1.4.3, which breaks the build.
1208
1209 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1210
1211 Say %language is experimental.
1212 We're thinking of extending it's effect on output file naming. See the
1213 thread at
1214 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
1215 * NEWS: Say it's experimental.
1216 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
1217 recommend it over %skeleton for now.
1218 (Bison Options): Likewise.
1219 (C++ Bison Interface): Use %skeleton not %language.
1220 (Calc++ Parser): Use %skeleton not %language.
1221 * src/getargs.c (usage): Say it's experimental.
1222
1223 2008-11-01 Di-an Jan <dianj@freeshell.org>
1224 Paolo Bonzini <bonzini@gnu.org>
1225
1226 Support all Java parser class modifiers.
1227 * data/java.m4 (b4_percent_define_get3): New.
1228 (b4_final_if, b4_strictfp_if): New.
1229 * data/lalr1.java (final, strictfp, extends, implements): Support.
1230 * doc/bison.texinfo (final, strictfp, extends, implements): Add
1231 documentation.
1232 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
1233 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
1234 (AT_CHECK_JAVA_GREP): New.
1235 (Java parser class modifiers): New test.
1236 (Java parser class extends and implements): New test.
1237
1238 Model exception propagation better with throws and lex_throws.
1239 * data/java.m4 (b4_list2): New.
1240 (throws): Change default.
1241 * data/lalr1.java (yyaction): Add throws.
1242 (parse): Add lex_throws in addition to throws.
1243 * doc/bison.texinfo (throws, lex_throws): Add documentation.
1244 * tests/java.at (Java throws specifications): New test.
1245
1246 Improve documentation for Java parsers.
1247 * doc/bison.texinfo (Java Parsers): Add subsections.
1248 Don't quote first argument of %define.
1249 (Java Bison Interface): Document output files. Move documentation
1250 of parser class and merge into Java Parser Interface. Document
1251 features that error out. Document directives with no effect.
1252 Move note about Javadoc higher.
1253 (Java Semantic Values): Explicitly mention stype.
1254 Document that generic types cannot be used.
1255 (Java Location Values): Use @deftypeivar. Document constructors.
1256 Correct return value for toString.
1257 (Java Parser Interface): List undocumented constants/fields.
1258 Move documentation of fields added by %parse-param closer to list
1259 of members. Document that token names are added as fields.
1260 Document constructors accurately. Remove error method.
1261 (Java Scanner Interface): Move note on %pure-parser to Java Bison
1262 Interface. Describe %code lexer and yylex accutately.
1263 Remove documentation that does not match the code.
1264 (Java Action Features): New.
1265 (Java Differences): Add reference. Add item on semantic values.
1266 Add note about @{ ... @}. Clarify %% epilogue placement.
1267 (Java Declarations Summary): New.
1268
1269 Fix Java skeleton.
1270 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
1271 (b4_remove_comma): Quote test argument.
1272 (b4_identification): Remove "bison" field.
1273 * tests/java.at (Java parser class and package names): New test.
1274 (Java %parse-param and %lex-param): New test.
1275 (Java stype, position_class and location_class): New test.
1276
1277 2008-10-31 Di-an Jan <dianj@freeshell.org>
1278
1279 * data/lalr1.jave: Update copyright years.
1280 (YYParser): Correct name of "generated from" file in Javadoc:
1281 use b4_file_name instead of @ofile@.
1282 (Location constructor): Correct Javadoc parameter name.
1283 (yylloc): Add missing opening m4 quote after b4_location_if.
1284 This removes a stray [ in the Javadoc of Lexer.getStartPos.
1285 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
1286 (YYParser constructor): Correct Javadoc parameter name.
1287
1288 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
1289
1290 Always put auxiliary code files in the same dir as other output files.
1291 * src/files.c (compute_file_name_parts): When the user specifies
1292 --output but not --file-prefix, extract the directory prefix from the
1293 file prefix not from the grammar file name. This affects the location
1294 of files like location.hh generated by the C++ skeleton. The includes
1295 in the other output files require this fix.
1296 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
1297 for expected output files.
1298 (Output files): Add a test for the above.
1299
1300 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
1301
1302 * gnulib: Update submodule to HEAD.
1303
1304 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1305
1306 Update copyright year.
1307 * src/files.c: Here.
1308
1309 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
1310
1311 Don't overwrite the input file.
1312 * src/files.c (output_file_name_check): Fatal error if using input file
1313 for output.
1314 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
1315 argument.
1316 (Conflicting output files): Add test.
1317
1318 2008-10-28 Akim Demaille <demaille@gostai.com>
1319
1320 Space changes.
1321 * data/lalr1.cc: Formatting changes.
1322
1323 2008-10-28 Akim Demaille <demaille@gostai.com>
1324
1325 Don't define debugging functions when !YYDEBUG.
1326 * data/lalr1.cc (debug_stream, set_debug_stream)
1327 (debug_level_type, debug_level, set_debug_level): Don't
1328 declare them when YYDEBUG is not defined.
1329 The implementation are already YYDEBUG-aware.
1330
1331 2008-10-28 Akim Demaille <demaille@gostai.com>
1332
1333 Prefer "continue" for empty loop bodies.
1334 * etc/bench.pl.in: Use "continue" instead of {}.
1335
1336 2008-10-28 Akim Demaille <demaille@gostai.com>
1337
1338 Space and comments changes.
1339 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
1340 * data/c.m4, data/lalr1.cc: Space changes.
1341
1342 2008-10-28 Akim Demaille <demaille@gostai.com>
1343
1344 Make gnulib a submodule.
1345 * gnulib: New.
1346 * .gitmodules (gnulib): New.
1347
1348 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1349
1350 Fix yyerror_range for user-defined location type in C++. Reported by
1351 Georg Sauthoff at
1352 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
1353 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
1354 * THANKS (Georg Sauthoff): Add.
1355
1356 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1357
1358 Update several administrative files mainly to facilitate releasing.
1359 * HACKING (Administrivia): Make the git-merge-changelog notes more
1360 helpful.
1361 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
1362 (Release Procedure): Update for git and add numerous details that were
1363 previously missing.
1364 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
1365 * maint.mk (announcement): Don't list bison as a bootstrap tool so
1366 that announcements don't claim we bootstrapped with whatever bison
1367 happened to be in PATH. Add flex as a bootstrap tool.
1368 * Makefile.maint: Remove, previously replaced by maint.mk.
1369 * Makefile.cfg: Remove, and migrate settings to...
1370 * cfg.mk: ... here for the sake of `make announcement'.
1371 * bootstrap.conf (gnulib_modules): Add announce-gen.
1372 * README: Say GNU Bison instead of just Bison. Suggested by Karl
1373 Berry.
1374
1375 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
1376
1377 Small but important bugfixes for the Java skeleton.
1378 * data/lalr1.java (yyerror): Change Location to b4_location_type.
1379 (yy_symbol_print): Call toString on yyvaluep.
1380
1381 2008-08-29 Akim Demaille <demaille@gostai.com>
1382
1383 Clarify UPDATED use.
1384 * doc/bison.texinfo: It refers to the last edition of this file,
1385 not to the release date of Bison.
1386 Reported by Joel E. Denny.
1387
1388 2008-08-29 Akim Demaille <demaille@gostai.com>
1389
1390 * README: Update FAQ pointer.
1391 Reported by Joel E. Denny.
1392
1393 2008-08-27 Eric Blake <ebb9@byu.net>
1394
1395 Resync m4sugar from autoconf.
1396 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
1397 (m4_init): Adjust to latest m4.git changes.
1398 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
1399 effects.
1400 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
1401 (_m4_list_cmp): Reduce side effects.
1402
1403 2008-08-27 Akim Demaille <demaille@gostai.com>
1404
1405 Check yyerrok in calc.at.
1406 * tests/calc.at (calc.y): Use yyerrok on "( error )".
1407 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
1408 expected.
1409
1410 2008-08-27 Akim Demaille <demaille@gostai.com>
1411
1412 Support yyerrok in lalr1.cc.
1413 YYBACKUP is still to import back into lalr1.cc.
1414 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
1415
1416 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1417
1418 For maintainer-check*, don't recompile for a $(VERSION) update.
1419 * cfg.mk: New file.
1420 (_is-dist-target): Override the one in GNUmakefile.
1421 * Makefile.am (EXTRA_DIST): Add cfg.mk.
1422
1423 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1424
1425 Update for recent change to gnulib.
1426 * src/parse-gram.y: Don't include strverscmp.h. It comes from
1427 string.h now.
1428
1429 2008-08-15 Eric Blake <ebb9@byu.net>
1430
1431 Remaining m4sugar merge from autoconf.
1432 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
1433 * data/m4sugar/foreach.m4: New file, copied from autoconf.
1434 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
1435 * src/output.c (output_skeleton): Tell m4 how to find it.
1436
1437 Partial m4sugar merge from autoconf: m4_map.
1438 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
1439 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
1440 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
1441 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
1442 for empty list.
1443 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
1444 Likewise.
1445 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
1446 declares it.
1447
1448 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
1449
1450 Keep .version and PACKAGE_VERSION in sync.
1451 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
1452 dependency, and add comments justifying this in more detail. Discussed
1453 starting at
1454 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
1455
1456 2008-08-06 Eric Blake <ebb9@byu.net>
1457
1458 Partial m4sugar merge from autoconf: m4_shiftn.
1459 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
1460 (m4_shift2, m4_shift3): New macros.
1461 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
1462 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
1463 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
1464 * data/java.m4 (b4_remove_comma): Likewise.
1465
1466 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
1467 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
1468 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
1469 (m4_init): Consolidate wrapped text into single m4_wrap.
1470 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
1471 in wrapped text.
1472
1473 2008-08-05 Eric Blake <ebb9@byu.net>
1474
1475 Partial m4sugar merge from autoconf: builtins, version.m4.
1476 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
1477 (m4_prepend): Remove, as it is unused and inherently quadratic,
1478 whereas m4_append is linear in newer m4.
1479 (m4_mkstemp): New builtin.
1480 (m4_symbols): Make rename conditional.
1481 (m4_version_prereq): Ensure fatal error if used in bison, which
1482 intentionally lacks version.m4.
1483
1484 Fix comments in m4sugar.
1485 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
1486
1487 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1488
1489 Update for recent .gitignore fix in Gnulib.
1490 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
1491 anchored .gitignore entries.
1492
1493 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1494
1495 Set gnu or gnits strictness.
1496 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
1497 development and gnits strictness for releases. Based on Eric Blake's
1498 suggestion at
1499 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
1500
1501 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
1502
1503 * NEWS: Clarify documentation of %language.
1504
1505 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
1506
1507 Support usage of git-merge-changelog.
1508 * .gitattributes: New.
1509 * HACKING: Document usage of git-merge-changelog.
1510 * bootstrap: Install git-merge-changelog entries in .git/config
1511 if appropriate.
1512
1513 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1514
1515 Remove remaining dependence on CVS Id keyword.
1516 * ChangeLog: For the sake of people still using CVS, don't use dollars
1517 when mentioning Id.
1518 * data/xslt/bison.xsl: Remove Id from header comments, where it was
1519 unusual anyway.
1520 * data/xslt/xml2dot.xsl: Likewise.
1521 * data/xslt/xml2text.xsl: Likewise.
1522 * data/xslt/xml2xhtml.xsl: Likewise.
1523 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
1524 * doc/Makefile.am (neutralize): Remove, no longer needed.
1525 (.x.1): Don't use neutralize.
1526 (edit): Don't substitute for ID.
1527 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
1528
1529 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1530
1531 Fix dependence on computed configure variables.
1532 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
1533 $(top_srcdir)/configure.ac so that changes to computed variables, such
1534 as PACKAGE_VERSION, are seen.
1535 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
1536
1537 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
1538
1539 Update copyright dates for recent changes.
1540 * Makefile.am: Here.
1541 * src/Makefile.am: Here.
1542 * src/reduce.c: Here.
1543 * tests/reduce.at: Here.
1544
1545 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
1546
1547 Use git-version-gen for version names between releases.
1548 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
1549 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
1550 * .prev-version: New.
1551 * .version.in: Remove.
1552 * ChangeLog: Remove the Id previously used for capturing the CVS
1553 revision.
1554 * GNUmakefile: Remove, now copied from Gnulib.
1555 * Makefile.am: Add code suggested by comments in
1556 build-aux/git-version-gen.
1557 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
1558 .prev-version, and .version.
1559 * NEWS (2.3b+): Rename to...
1560 (?.?): ... this because we're dropping the "+" version naming scheme,
1561 but, in general, we still can't be sure of our next release name.
1562 * bootstrap: Add a quick hack to remove from .gitignore the
1563 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
1564 entry. This should really be fixed in gnulib instead.
1565 * bootstrap.conf (gnulib_modules): Add gnumakefile.
1566 * configure.ac (AC_INIT): Set version name by invoking
1567 build-aux/git-version-gen.
1568 (AC_CONFIG_FILES): Remove .version, now generated by
1569 build-aux/git-version-gen.
1570 * maint.mk: New, copied from coreutils.
1571 * doc/.cvsignore (bison.1): Add.
1572 * doc/.gitignore (/bison.1): Add.
1573 * doc/bison.1: Remove, generated.
1574 * src/.cvsignore (revision.c): Remove.
1575 * src/.gitignore (/revision.c): Remove.
1576 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
1577 (BUILT_SOURCES): Remove revision.c.
1578 (revision.c): Remove.
1579 * src/getargs.c (version): Don't print revision after the VERSION.
1580 * src/revision.h: Remove.
1581
1582 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1583
1584 Fix untranslatable composition of sentences. Reported by Goran
1585 Uddeborg at
1586 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
1587 * THANKS (Goran Uddeborg): Add.
1588 * src/reduce.c (reduce_print): Report the number of nonterminals and
1589 rules useless in the grammar in separate sentences.
1590 * tests/reduce.at (Useless Rules): Update output.
1591 (Reduced Automaton): Likewise.
1592 (Underivable Rules): Likewise.
1593 (Empty Language): Likewise.
1594
1595 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1596
1597 Fix some .gitignore and .cvsignore problems.
1598 * bootstrap (insert_sorted_if_absent): Replace all uses with...
1599 (insert_vc_ignore): ... this new function, which prepends `/' to all
1600 .gitignore entries before passing them to insert_sorted_if_absent.
1601 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
1602 .cvsignore files are maintained even though Bison developers run
1603 bootstrap while using Git.
1604 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
1605 unneeded by Bison.
1606 (gnulib): Add.
1607 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
1608 unneeded. Reported by Eric Blake.
1609 * lib/.gitignore (/*~): Add.
1610 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
1611 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
1612 Blake.
1613 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
1614
1615 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1616
1617 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
1618 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
1619 * bootstrap.conf (gnulib_modules): Add unsetenv.
1620 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
1621 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
1622 (/setenv.m4): Add.
1623 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
1624 the first argument because it may become position-dependent, and unset
1625 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
1626 Add comments explaining these issues in more detail.
1627
1628 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
1629
1630 Add .gitignore everywhere based on .cvsignore.
1631 * .gitignore: New.
1632 * build-aux/.gitignore: New.
1633 * data/.gitignore: New.
1634 * doc/.gitignore: New.
1635 * etc/.gitignore: New.
1636 * examples/.gitignore: New.
1637 * examples/calc++/.gitignore: New.
1638 * lib/.gitignore: New.
1639 * m4/.gitignore: New.
1640 * po/.gitignore: New.
1641 * runtime-po/.gitignore: New.
1642 * src/.gitignore: New.
1643 * tests/.gitignore: New.
1644
1645 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1646
1647 * NEWS (2.3b+): New section, empty for now.
1648 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
1649
1650 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1651
1652 * NEWS (2.3b): Update release date since there has been a delay in
1653 getting the announcements and tarballs out.
1654
1655 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1656
1657 * NEWS: Version 2.3b.
1658 * configure.ac (AC_INIT): Likewise.
1659 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
1660
1661 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1662
1663 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
1664 been doing it for years.
1665 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
1666 (Release Procedure): Add FIXME about make alpha being unmaintained.
1667
1668 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
1669
1670 * data/yacc.c: Reformat m4 a little for readability.
1671 * src/lalr.c (build_relations): Correct comment.
1672
1673 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1674
1675 DJGPP specific issue.
1676 * djgpp/config.sed: Fixes required to run configure scripts generated
1677 by autoconf 2.62.
1678
1679 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1680
1681 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
1682 coordinator@translationproject.org.
1683
1684 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1685
1686 * THANKS: Add Eric Blake.
1687
1688 2008-04-23 Eric Blake <ebb9@byu.net>
1689
1690 Revert prior patch, by working around autoconf regression.
1691 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
1692 ("Output file name: ("): Uncomment test.
1693 ("Output file name: )"): Likewise.
1694 Based on an idea from Noah Misch.
1695
1696 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1697
1698 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
1699 2.61. Reported by Juan Manuel Guerrero at
1700 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
1701 * tests/output.at ("Output file name: ("): Comment out test case for
1702 now.
1703 ("Output file name: )"): Likewise.
1704
1705 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1706
1707 * GNUmakefile: Update git-version-gen invocation so make dist
1708 succeeds.
1709
1710 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1711
1712 Update to the current gnulib CVS repository, and fix trigraph handling
1713 in Bison.
1714 * bootstrap: Update gnulib CVS repository URL.
1715 (symlink_to_dir): Encapsulate the code that guarantees the destination
1716 directory exists into...
1717 (check_dst_dir): ... this new function, and...
1718 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
1719 fail when copying files into lib/uniwidth/.
1720 * src/output.c (prepare_symbols): When writing yytname muscles, where
1721 symbol names will be encoded in C-string literals, tell quotearg to
1722 escape trigraphs. This used to be the default in gnulib.
1723 * tests/regression.at (Token definitions): Because of the change in
1724 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
1725 escapes trigraphs in symbol names. Thus, yytname no longer has
1726 trigraphs unnecessarily doubly escaped. Update test case output.
1727 Extend test case to be sure Bison's own error messages will no longer
1728 have trigraphs in symbol names unnecessarily escaped once.
1729
1730 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1731
1732 Fix make dist infinite loop reported by Juan Manuel Guerrero at
1733 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
1734 * .cvsignore: Add .version.
1735 * .version.in: New.
1736 * bootstrap.conf (gnulib_modules): Add git-version-gen.
1737 * configure.ac (AC_CONFIG_FILES): Add .version.
1738 * build-aux/.cvsignore: Add git-version-gen.
1739
1740 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
1741
1742 * NEWS (2.3a+): Mention that -g now takes an argument.
1743 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
1744 consistency. Update the -g and -x entries now that they take
1745 arguments. Use brackets to indicate optional arguments.
1746 * src/getargs.c (usage): Explain the relationship between arguments of
1747 long and short options more completely. Document --defines and -d
1748 separately since the former takes an argument but, for POSIX Yacc, the
1749 latter does not.
1750 (short_options): Let -W take an optional argument like --warnings.
1751 (getargs): Sort cases.
1752
1753 2008-02-28 Akim Demaille <demaille@gostai.com>
1754
1755 * doc/bison.texinfo: Fix a few typos.
1756
1757 2008-02-28 Akim Demaille <akim@epita.fr>
1758
1759 * doc/bison.texinfo (Bison Options): Document -W.
1760 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
1761
1762 2008-02-28 Akim Demaille <akim@epita.fr>
1763
1764 * src/getargs.c (short_options): Split and sort for readability.
1765 -g and -x take optional arguments, just like their long options.
1766 * build-aux/cross-options.pl: Use /x to make the regexp easier to
1767 understand.
1768 Fix the handling of $opt which resulted in all the argument to be
1769 considered as optional.
1770
1771 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1772
1773 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
1774 say its interface is experimental.
1775 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1776 Java.
1777 (Bison Options): In the -L and --language entry, mention Java.
1778 (Java Bison Interface): Say the interface is experimental.
1779 * src/getargs.c (usage): Mention -L and --language.
1780
1781 * NEWS (2.3a+): Say the push parsing interface is experimental.
1782 * doc/bison.texinfo (Push Decl): Likewise.
1783 (Decl Summary): Likewise in the "%define api.push_pull" entry.
1784 (Push Parser Function): Likewise.
1785 (Pull Parser Function): Likewise.
1786 (Parser Create Function): Likewise.
1787 (Parser Delete Function): Likewise.
1788 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
1789 yypull_parse, and yypush_parse entries.
1790
1791 * NEWS (2.3a+): Mention XML support, and say the schema is
1792 experimental.
1793 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
1794 * src/getargs.c (usage): Say the XML schema is experimental.
1795
1796 * NEWS (2.3a+): Say option instead of flag.
1797
1798 2008-02-21 Wojciech Polak <polak@gnu.org>
1799
1800 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
1801 text.
1802
1803 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
1804
1805 Fix impure push parser compile error reported by Bob Rossi at
1806 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
1807 * data/yacc.c: Clean up whitespace in the output a little.
1808 (yypstate_allocated): Define for impure push parsers regardless of
1809 whether the pull interface is also requested.
1810 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
1811 check impure push parsers without the pull interface.
1812
1813 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
1814 yyerror takes arguments specified by %parse-param while yypstate_new
1815 does not.
1816 * doc/bison.texinfo (Parser Create Function): Document that
1817 yypstate_new returns 0 for multiple impure parser instances.
1818 * tests/push.at (Push Parsing: Multiple impure instances): Update
1819 expected stderr output.
1820
1821 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1822
1823 * runtime-po/POTFILES.in (push.c): Remove.
1824
1825 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1826
1827 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
1828 * data/push.c: Rename to...
1829 * data/yacc.c: ... this, overwriting it.
1830 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
1831 `%push-pull-parser' -> `%define api.push_pull "both"'.
1832 Remove old yacc.c tests, and update push.c tests to yacc.c.
1833
1834 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1835
1836 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
1837 `"%code top" blocks' instead of `%code "top" blocks'.
1838 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
1839 Clean up whitespace in the output a little.
1840
1841 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1842
1843 Fix documentation problems reported by Tim Josling at
1844 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
1845 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
1846 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
1847 integers. Explain the effect of literal string aliases on error
1848 messages. Copy token 0 documentation from the C++ skeleton
1849 documentation.
1850
1851 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1852
1853 Accept a token number in a %left, %right, or %nonassoc for POSIX
1854 conformance. Reported by Tim Josling at
1855 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
1856 * NEWS (2.3a+): Mention.
1857 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
1858 and code numbers are treated by precedence declarations.
1859 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
1860 of symbols.1.
1861 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
1862 of symbol.
1863 (symbol.prec): New, just like symbol but allows INT.
1864 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
1865 longer holds.
1866 * tests/regression.at (Token number in precedence declaration): New
1867 test case.
1868
1869 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1870
1871 DJGPP specific issues.
1872 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
1873 be changed. Copyright timestamp adjusted.
1874 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
1875 be changed. Copyright timestamp adjusted.
1876 * djgpp/config.site: Copyright timestamp adjusted.
1877 * djgpp/config_h.sed: Copyright timestamp adjusted.
1878 * djgpp/djunpack.bat: Copyright timestamp adjusted.
1879 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
1880 filename translation list.
1881 * djgpp/subpipe.c (init_subpipe): Check the environment variables
1882 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
1883 files shall be created. Before trying to use the temp dir where the
1884 environment variable points to check that the dir really exists. If
1885 not default to the cwd as temp dir. Copyright timestamp adjusted.
1886 * djgpp/subpipe.h: Copyright timestamp adjusted.
1887 * djgpp/testsuite.sed: Copyright timestamp adjusted.
1888
1889 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
1890
1891 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
1892
1893 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
1894
1895 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
1896 Problem reported by Claudio Saavedra in
1897 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
1898
1899 2008-01-05 Wojciech Polak <polak@gnu.org>
1900
1901 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
1902 document's title with the input grammar file name.
1903
1904 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
1905
1906 Automate regression testing of the XML/XSLT implementation. Discussed
1907 starting at
1908 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
1909 * configure.ac (XSLTPROC): New substitution.
1910 * Makefile.am (maintainer-xml-check): New phony target invoking...
1911 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
1912 invoking make maintainer-check with BISON_TEST_XML=1.
1913 * tests/atlocal.in (XSLTPROC): New.
1914 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
1915 not to report reachable memory when Bison is expected to have a
1916 non-zero exit status and (2) to compare XML/XSLT output with --graph
1917 and --report=all output for every working grammar when
1918 BISON_TEST_XML=1.
1919 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
1920 (AT_BISON_CHECK_XML): New.
1921 (AT_QUELL_VALGRIND): New.
1922 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
1923 (AT_CHECK): ... don't redefine this since this was the old way to
1924 quell Valgrind.
1925 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
1926 AT_BISON_CHECK invocations.
1927 * tests/c++.at: Likewise.
1928 * tests/calc.at: Likewise.
1929 * tests/conflicts.at: Likewise.
1930 * tests/cxx-type.at: Likewise.
1931 * tests/existing.at: Likewise.
1932 * tests/glr-regression.at: Likewise.
1933 * tests/headers.at: Likewise.
1934 * tests/input.at: Likewise.
1935 * tests/java.at: Likewise.
1936 * tests/output.at: Likewise.
1937 * tests/push.at: Likewise.
1938 * tests/reduce.at: Likewise.
1939 * tests/regression.at: Likewise.
1940 * tests/sets.at: Likewise.
1941 * tests/skeletons.at: Likewise.
1942 * tests/synclines.at: Likewise.
1943 * tests/torture.at: Likewise.
1944 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
1945 tends to hang xsltproc.
1946 (Big horizontal): Likewise.
1947
1948 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1949
1950 In XML output, remove redundant class attribute on symbol element.
1951 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
1952 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
1953 look up a symbol to determine whether it's a nonterminal or terminal.
1954 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
1955 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
1956
1957 Add prec/assoc information to XML output.
1958 * src/gram.c (grammar_rules_print_xml): For each rule that has a
1959 %prec, add a percent_prec attribute.
1960 * src/print-xml.c (print_grammar): For each terminal that has a
1961 precedence or associativity, add a prec or assoc attribute.
1962 (xml_indent): New.
1963 (xml_puts): Use xml_indent.
1964 (xml_printf): Use xml_indent.
1965 * src/print-xml.h (xml_indent): Prototype.
1966
1967 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
1968 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
1969
1970 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1971
1972 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
1973 (bison:ruleByNumber): ... this for clarity.
1974 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
1975 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
1976 (xsl:template match="reduction"): Update.
1977 (xsl:template match="item"): Update.
1978 (xsl:template match="reduction"): Update.
1979
1980 In the XML output, don't print the list of rules where symbols appear.
1981 Compute it in XSLT instead. Discussed at
1982 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
1983 * data/xslt/bison.xsl (bison:ruleByLhs): New.
1984 (bison:ruleByRhs): New.
1985 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
1986 bison:ruleByRhs.
1987 (xsl:template match="terminal/rule"): Remove.
1988 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
1989 bison:ruleByRhs.
1990 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
1991 Remove.
1992 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
1993 bison:ruleByRhs and mode="number-link" for rule template.
1994 (xsl:template match="terminal/rule"): Remove.
1995 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
1996 bison:ruleByRhs and mode="number-link" for rule template.
1997 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
1998 Rewrite as...
1999 (xsl:template match="rule" mode="number-link"): ... this.
2000 * src/print-xml.c (print_grammar): Don't print the list of rules.
2001
2002 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2003
2004 Don't let --report affect XML output; always print all information.
2005 Discussed at
2006 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
2007 * src/conflicts.c (log_resolution): Implement.
2008 * src/print-xml.c (print_core): Implement.
2009 (print_state): Implement.
2010 (print_xml): Implement.
2011
2012 * NEWS (2.3a+): Fix quotes.
2013 * src/parse-gram.y (prologue_declaration): For consistency with -v,
2014 don't let %verbose clear the list specified by --report.
2015
2016 2007-11-26 Akim Demaille <akim@epita.fr>
2017
2018 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
2019
2020 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
2021
2022 In the XML output, list useless and unused symbols and rules with the
2023 useful ones and add a "usefulness" attribute. Discussed starting at
2024 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
2025 * src/gram.c (grammar_rules_partial_print_xml): Remove.
2026 (grammar_rules_print_xml): Print all rules instead of just those
2027 useful in the grammar, and add a "usefulness" attribute.
2028 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
2029 * src/print-xml.c (print_rules_useless_in_parser): Remove.
2030 (print_grammar): Print all nonterminals instead of just useful ones,
2031 and add a "usefulness" attribute to nonterminals and terminals.
2032 (print_xml): Don't print a separate "reductions" or
2033 "rules-useless-in-parser" element.
2034 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
2035 (reduce_xml): Remove.
2036 (reduce_token_unused_in_grammar): New.
2037 (reduce_nonterminal_useless_in_grammar): New.
2038 * src/reduce.h (reduce_xml): Remove prototype.
2039 (reduce_token_unused_in_grammar): Add prototype.
2040 (reduce_nonterminal_useless_in_grammar): Add prototype.
2041 * data/xslt/xml2text.xsl: Update for XML changes.
2042 * data/xslt/xml2xhtml.xsl: Update for XML changes.
2043 * tests/reduce.at (Useless Terminals): Update output.
2044 (Useless Rules): Update output.
2045 (Reduced Automaton): Update output.
2046
2047 Say "Terminals unused in grammar" instead of "Unused terminals".
2048 * NEWS (2.3a+): Update.
2049 * doc/bison.texinfo (Understanding): Update example output.
2050 * src/reduce.c (reduce_output): Implement.
2051 * data/xslt/xml2text.xsl: Implement.
2052 * data/xslt/xml2xhtml.xsl: Implement.
2053
2054 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2055
2056 Accept --report-file=FILE to override the default `.output' filename.
2057 * NEWS (2.3a+): Mention.
2058 * doc/bison.texinfo (Bison Options): Add an entry.
2059 * src/files.c (compute_output_file_names): Don't override
2060 spec_verbose_file if already set.
2061 * src/getargs.c (usage): Document --report-file.
2062 (REPORT_FILE_OPTION): New anonymous enum member.
2063 (long_options): Add entry for it.
2064 (getargs): Add case for it setting spec_verbose_file.
2065
2066 * build-aux/cross-options.pl: Don't record a short option just because
2067 there's an arg.
2068 * doc/.cvsignore: Add yacc.1.
2069
2070 2007-11-14 Akim Demaille <akim@epita.fr>
2071
2072 * doc/yacc.1.in: New.
2073 * configure.ac, doc/Makefile.am: Adjust.
2074 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
2075 config.h symbol.
2076 Use AC_SUBST for assignments too.
2077 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
2078
2079 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2080
2081 * src/gram.c: Remove comments that duplicate comments in gram.h.
2082
2083 When reporting useless rules and nonterminals, say "useless in grammar"
2084 instead of "useless", and say "useless in parser" instead of "never
2085 reduced". Discussed starting at
2086 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
2087 * NEWS (2.3a+): Mention this change.
2088 * data/xslt/xml2text.xsl: Update output text and expected input XML
2089 element names to match changes below.
2090 * data/xslt/xml2xhtml.xsl: Likewise.
2091 (xsl:template match="bison-xml-report"): Add missing entry in Table of
2092 Contents: "Rules useless in parser due to conflicts".
2093 * doc/bison.texinfo (Decl Summary): Reword a little.
2094 (Understanding): Update example output for changes below.
2095 * src/gram.c: (rule_useful_p): Rename to...
2096 (rule_useful_in_grammar_p): ... this.
2097 (rule_useless_p): Rename to...
2098 (rule_useless_in_grammar_p): ... this.
2099 (rule_never_reduced_p): Rename to...
2100 (rule_useless_in_parser_p): ... this.
2101 (grammar_rules_print): Update for renames.
2102 (grammar_rules_print_xml): Update for renames.
2103 (grammar_rules_never_reduced_report): Rename to...
2104 (grammar_rules_useless_report): ... this since it is used for either
2105 kind of useless rule.
2106 * src/gram.h: Reword comments and update function names in prototypes.
2107 * src/main.c (main): Say "rule useless in parser due to conflicts".
2108 * src/print-xml.c (print_rules_never_reduced): Rename to...
2109 (print_rules_useless_in_parser): ... this, and rename output XML
2110 element "rules-never-reduced" to "rules-useless-in-parser".
2111 (print_xml): Update for rename.
2112 * src/print.c (print_results): Say "Rules useless in parser due to
2113 conflicts".
2114 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
2115 (nonterminals_reduce): Say "nonterminal useless in grammar".
2116 (reduce_output): Say "Nonterminals useless in grammar".
2117 Say "Rules useless in grammar".
2118 (reduce_xml): Rename output XML element "useless" to
2119 "useless-in-grammar".
2120 (reduce_print): Don't report the count of grammatically useless rules
2121 as "rules never reduced" just because %yacc is specified.
2122 In the correct report of this count, say nonterminal(s) and rule(s)
2123 "useless in grammar".
2124 * tests/conflicts.at (S/R in initial): Update expected output.
2125 (Defaulted Conflicted Reduction): Likewise.
2126 (Unreachable States After Conflict Resolution): Likewise.
2127 * tests/existing.at (GNU pic Grammar): Likewise.
2128 * tests/reduce.at (Useless Nonterminals): Likewise.
2129 (Useless Rules): Likewise.
2130 (Reduced Automaton): Likewise.
2131 (Underivable Rules): Likewise.
2132 (Empty Language): Likewise.
2133
2134 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2135
2136 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
2137 here document and before the EOF so that BSD's implementation of Bourne
2138 shell doesn't parse the delimiter as part of the here document.
2139 * doc/.cvsignore: Add cross-options.texi.
2140 * src/getargs.c (usage): Add a blank line after the warning categories.
2141
2142 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
2143
2144 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
2145
2146 2007-11-05 Akim Demaille <akim@epita.fr>
2147
2148 Remove Id: from bison.1.
2149 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
2150 (perl -0777 -pi -e 's/\.PP\nId): New.
2151 (.x.1): Use it to ignore the version control revision.
2152
2153 2007-11-05 Akim Demaille <demaille@gostai.com>
2154
2155 * build-aux/Makefile.am: Ship cross-options.pl.
2156 * doc/Makefile.am: Always refer to cross-options.texi with
2157 $(srcdir).
2158 (MAINTAINERCLEANFILES): Add it.
2159
2160 2007-11-04 Akim Demaille <demaille@gostai.com>
2161
2162 Generate the long/short option cross-table.
2163 * build-aux/cross-options.pl: New.
2164 * doc/Makefile.am (cross-options.texi): New.
2165 * doc/bison.texinfo: Use it.
2166
2167 2007-11-04 Akim Demaille <demaille@gostai.com>
2168
2169 Generate bison.1 using help2man.
2170 * doc/common.x, doc/bison.x: New.
2171 * doc/Makefile.am (bison.1, .x.1): New.
2172 The code is taken from autoconf-2.61/man/Makefile.am.
2173 * configure.ac: Look for help2man.
2174
2175 2007-11-04 Akim Demaille <demaille@gostai.com>
2176
2177 Complete --help.
2178 * src/getargs.c (usage): Document -W, make it clear that -d,
2179 -g and -x have optional arguments.
2180
2181 2007-11-04 Akim Demaille <demaille@gostai.com>
2182
2183 Find sha1sum when named gsha1sum.
2184 * bootstrap (find_tool): New.
2185 ($SHA1SUM): New.
2186
2187 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2188
2189 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
2190 at
2191 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
2192 * NEWS (2.3a+): Mention.
2193 * data/bison.m4 (b4_pure_if): Don't define it here.
2194 * data/c.m4 (b4_identification): Depend on individual skeletons to
2195 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
2196 values of the %define variables api.pure or api.push_pull. Define
2197 YYPURE, YYPUSH, and YYPULL accordingly.
2198 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
2199 glr.cc has already defined b4_pure_flag.
2200 * data/push.c: Define b4_pure_if based on `%define api.pure'.
2201 Remove YYPUSH and YYPULL since they're back in b4_identification again.
2202 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
2203 * doc/bison.texinfo (Pure Decl): Update.
2204 (Push Decl): Update.
2205 (Decl Summary): Add api.pure to %define entry.
2206 In %pure-parser entry, say it's deprecated and reference %define.
2207 (Pure Calling): Update.
2208 (Error Reporting): Update.
2209 (C++ Scanner Interface): Update.
2210 (How Can I Reset the Parser): Update.
2211 (Table of Symbols): In %pure-parser entry, say it's deprecated and
2212 reference %define.
2213 * src/getargs.c (pure_parser): Remove global variable.
2214 * src/getargs.h (pure_parser): Remove extern.
2215 * src/output.c (prepare): Don't define pure_flag muscle.
2216 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
2217 wrapper around `%define api.pure'.
2218 * tests/calc.at (Simple LALR Calculator): Update.
2219 (Simple GLR Calculator): Update.
2220 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
2221 Update.
2222 (GLR: Resolve ambiguity, pure, locations): Update.
2223 (GLR: Merge conflicting parses, pure, no locations): Update.
2224 (GLR: Merge conflicting parses, pure, locations): Update.
2225 * tests/glr-regression.at (Uninitialized location when reporting
2226 ambiguity): Update
2227 * tests/input.at (Unused %define api.pure): New test case.
2228 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
2229 AT_PURE_IF and AT_PURE_AND_LOC_IF.
2230 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2231
2232 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2233
2234 %define push_pull -> %define api.push_pull. Discussed starting at
2235 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
2236 * data/push.c: Expect the new name.
2237 * data/yacc.c: Likewise.
2238 * doc/bison.texinfo (Push Decl): Update.
2239 (Decl Summary): Update %define entry.
2240 (Push Parser Function): Update.
2241 (Pull Parser Function): Update.
2242 (Parser Create Function): Update.
2243 (Parser Delete Function): Update.
2244 * tests/calc.at (Simple LALR Calculator): Update.
2245 * tests/input.at (%define enum variables): Update.
2246 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2247 (Push Parsing: Multiple impure instances): Update.
2248 (Push Parsing: Unsupported Skeletons): Update.
2249 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
2250 (Exploding the Stack Size with Malloc): Update.
2251
2252 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
2253 other entries some.
2254
2255 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
2256
2257 For the XML output's terminal element, rename @number to @token-number,
2258 and add @symbol-number. In the nonterminal element, rename @number to
2259 @symbol-number. Discussed starting at
2260 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
2261 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
2262 renames.
2263 (xsl:template match="nonterminal"): Likewise.
2264 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
2265 (xsl:template match="nonterminal"): Likewise.
2266 * src/print-xml.c (print_grammar): Implement.
2267
2268 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2269
2270 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
2271 2007-10-11 change, the child elements here are items not rules.
2272 (xsl:template match="item"): New.
2273 (xsl:template match="rule"): Update for new reduced itemset.
2274 (xsl:template match="point"): Remove.
2275 (xsl:template match="empty"): For consistency with --graph, don't
2276 output "/* empty */".
2277 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
2278 line-wrap, don't pass a negative value as first-line-length since this
2279 won't work with the following changes.
2280 (xsl:template name="line-wrap"): Simplify slightly.
2281 (xsl:template name="ws-search"): Eliminate recursion.
2282 * src/print_graph.c (print_core): Don't print a reduction's lookahead
2283 set next to an item whose dot is not at the end of the RHS even if it
2284 happens to be associated with the same rule.
2285
2286 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2287
2288 Add %define lr.keep_unreachable_states.
2289 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
2290 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
2291 * src/main.c (main): Implement it.
2292 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2293 Extend to test it, and fix a typo.
2294
2295 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2296
2297 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
2298 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
2299 the example .output text.
2300 * tests/regression.at (Extra lookahead sets in report): Improve wording
2301 of comments.
2302
2303 2007-10-17 Wojciech Polak <polak@gnu.org>
2304
2305 * src/print-xml.c (print_grammar): Renamed
2306 <terminal> and <nonterminal> attributes:
2307 "type" to "number" and "symbol" to "name".
2308 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
2309 Use new attribute names.
2310 (xsl:template match="nonterminal"): Likewise.
2311 * data/xslt/xml2xhtml.xsl: Likewise.
2312
2313 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
2314
2315 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
2316 (Option Cross Key): Likewise.
2317
2318 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
2319 next to an item whose dot is not at the end of the RHS even if it
2320 happens to be associated with the same rule.
2321 * src/print.c (print_core): Likewise.
2322 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
2323 (Resolved SR Conflicts): Update output.
2324 * tests/regression.at (Extra lookahead sets in report): New test case.
2325
2326 2007-10-11 Wojciech Polak <polak@gnu.org>
2327
2328 * src/print-xml.c (print_core): Remove item set
2329 redundancy.
2330 * data/xslt/bison.xsl (bison:ruleNumber): New key.
2331 Improve processing time. Suggested by Joel E. Denny.
2332 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
2333 Write xsl:param "required" attribute as comment.
2334 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
2335 (xsl:template match="rule"): Support new reduced itemset.
2336 (xsl:template match="point"): Remove.
2337 * data/xslt/xml2xhtml.xsl: Likewise.
2338
2339 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2340
2341 * src/getargs.c (version): Update copyright year.
2342
2343 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2344
2345 Make xml2dot.xsl and --graph produce the same output.
2346 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
2347 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
2348 escaped later.
2349 (xsl:template name="output-node"): Use the new escape template instead
2350 of the string-replace template directly.
2351 (xsl:template name="output-edge"): Likewise.
2352 (xsl:template name="escape"): New, escapes backslashes and newlines in
2353 addition to quotation marks.
2354 * src/graphviz.c (start_graph, output_node, output_edge): Add
2355 whitespace to output for legibility.
2356
2357 Make xml2text.xsl and --report produce the same output, and remove the
2358 XML "conflicts" element since a conflict summary is easily extracted
2359 from the automaton.
2360 * data/xslt/bison.xsl: New.
2361 (xsl:template match="state" mode="bison:count-conflicts): New.
2362 * data/xslt/xml2text.xsl: Import bison.xsl.
2363 (xsl:template match="bison-xml-report"): Instead of styling the
2364 "conflicts" element, style the "automaton" element with mode
2365 "conflicts". Unlike the former, the latter lists S/R and R/R
2366 conflicts for a state on the same line.
2367 (xsl:template match="conflicts"): Remove.
2368 (xsl:template match="conflict"): Remove.
2369 (xsl:template match="terminal"): Line-wrap the list of rules in which
2370 the terminal is used.
2371 (xsl:template match="nonterminal"): Likewise for nonterminals.
2372 (xsl:template match="automaton" mode="conflicts"): New.
2373 (xsl:template match="state" mode="conflicts"): New.
2374 (xsl:template name="line-wrap"): New.
2375 (xsl:template name="ws-search"): New.
2376 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
2377 (xsl:template match="bison-xml-report"): Instead of styling the
2378 "conflicts" element, style the "automaton" element with mode
2379 "conflicts."
2380 (xsl:template match="conflicts"): Remove.
2381 (xsl:template match="conflict"): Remove.
2382 (xsl:template match="automaton" mode="conflicts"): New.
2383 (xsl:template match="state" mode="conflicts): New.
2384 * src/conflicts.c (conflicts_output_xml): Remove.
2385 * src/conflicts.h (conflicts_output_xml): Remove prototype.
2386 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
2387 * src/print.c (print_grammar): Consistently wrap at the 66th column so
2388 the corresponding XSLT is easier. Also, never wrap between a word and
2389 the comma that follows it.
2390
2391 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2392
2393 Improve C++ namespace support. Discussed starting at
2394 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
2395 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
2396 b4_namespace_close): New macros that interpret the %define variable
2397 "namespace" so its value can contain "::" to indicate nested
2398 namespaces.
2399 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
2400 the above macros.
2401 * data/lalr1.cc (b4_namespace): Likewise.
2402 * data/location.cc (b4_namespace): Likewise.
2403 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
2404 inside a new table in the general %define entry. Document `%define
2405 namespace' there as well. Point the %name-prefix entry to it since it
2406 explains it more completely in the case of C++.
2407 (C++ Bison Interface): Mention `%define namespace' instead of
2408 %name-prefix.
2409 (Table of Symbols): Remove the `%define push_pull' entry. The %define
2410 entry suffices.
2411 * tests/c++.at (Relative namespace references): New test case.
2412 (Absolute namespace references): New test case.
2413 (Syntactically invalid namespace references): New test case.
2414 * tests/input.at (C++ namespace reference errors): New test case.
2415
2416 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2417
2418 Add syncline support and location accessor to internal %define
2419 interfaces.
2420 * data/bison.m4 (b4_percent_define_get_loc): New.
2421 (b4_percent_define_get_syncline): New.
2422 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
2423 (b4_percent_define_default): Record defining location as line 1 rather
2424 than 0 for the sake of synchronizing #line's, and define
2425 b4_percent_define_syncline(VARIABLE).
2426 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
2427 * src/muscle_tab.c (muscle_syncline_grow): New.
2428 (muscle_code_grow): Use muscle_syncline_grow.
2429 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
2430 define b4_percent_define_syncline(VARIABLE).
2431 (muscle_percent_define_get_loc): New.
2432 (muscle_percent_define_get_syncline): New.
2433 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
2434 remove some unused variables.
2435 (muscle_percent_define_default): Record defining location as line 1
2436 rather than 0 for the sake of synchronizing #line's, and define
2437 b4_percent_define_syncline(VARIABLE).
2438 (muscle_percent_define_check_values): Use
2439 muscle_percent_define_get_loc.
2440 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
2441 (muscle_percent_define_get_syncline): Prototype.
2442 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2443 defaults): Update output for location change.
2444 (Complaining during macro argument expansion): Extend to test
2445 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
2446
2447 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
2448
2449 Fix some error-reporting macro bugs.
2450 * data/bison.m4 (b4_cat): New.
2451 (b4_error, b4_error_at): Use b4_cat to send error directives directly
2452 to stdout so they don't become arguments to other macros. Update
2453 comments and add examples.
2454 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
2455 add examples.
2456 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
2457 after printing the error directive so that M4 doesn't report subsequent
2458 problems that are induced by this problem.
2459 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
2460 instead of just in them. Recognize @\n in both places. Both expand to
2461 the empty string. Needed by b4_cat.
2462 * tests/skeletons.at (Complaining during macro argument expansion):
2463 New test case.
2464 (Fatal errors make M4 exit immediately): New test case.
2465
2466 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
2467
2468 Implement --print-datadir.
2469 * src/getargs.c (usage): Mention.
2470 (PRINT_DATADIR_OPTION): New anonymous enum member.
2471 (long_options): Add entry for it.
2472 (getargs): Add case for it calling compute_pkgdatadir.
2473 * src/output.c (output_skeleton): Encapsulate data directory
2474 computation from here...
2475 (prepare): ... and from here...
2476 (compute_pkgdatadir): ... into this new function.
2477 * src/output.h (compute_pkgdatadir): Prototype.
2478
2479 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
2480
2481 * src/print-xml.c (escape_bufs): New static global variable
2482 replacing...
2483 (xml_escape_n): ... the static local variable buf here.
2484 (print_xml): Free memory for escape_bufs.
2485 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
2486
2487 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
2488
2489 Replace `%push-parser' and `%push-pull-parser' with
2490 `%define push_pull "push"' and `%define push_pull "both"'.
2491 `%define push_pull "pull"' is the default.
2492 * doc/bison.texinfo (Push Decl, Push Parser Function,
2493 Pull Parser Function, Parser Create Function, Parser Delete Function):
2494 Update declarations.
2495 (Decl Summary, Table of Symbols): Replace %push-parser and
2496 %push-pull-parser entries with a %define push_pull entry.
2497 * data/bison.m4 (b4_percent_define_check_values): New macro.
2498 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
2499 definitions...
2500 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
2501 definitions...
2502 * data/push.c: ... to here and compute them from the value of the
2503 %define variable push_pull.
2504 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
2505 parsing requests here...
2506 * data/yacc.c: ... hack this to switch to push.c any time
2507 b4_use_push_pull_flag or the %define variable push_pull is set. This
2508 will go away when we mv push.c yacc.c.
2509 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
2510 push parsing is not supported since unused %define variables are
2511 reported anyway.
2512 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
2513 * src/muscle_tab.h (muscle_percent_define_check_values): Update
2514 comments for consistency with b4_percent_define_check_values.
2515 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
2516 muscles.
2517 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
2518 Remove.
2519 (prologue_declaration): Remove %push-parser and %push-pull-parser
2520 rules.
2521 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
2522 * tests/calc.at: Update declarations.
2523 * tests/input.at (%define enum variables): New test case.
2524 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
2525 declaration.
2526 (Push Parsing: Multiple impure instances): Update declaration.
2527 (Push Parsing: Unsupported Skeletons): New test case.
2528 * tests/torture.at (Exploding the Stack Size with Alloca): Update
2529 declaration.
2530 (Exploding the Stack Size with Malloc): Update declaration.
2531
2532 2007-09-24 Wojciech Polak <polak@gnu.org>
2533
2534 Add XSLT transformations.
2535
2536 * data/xslt/xml2dot.xsl: Transform XML into DOT.
2537 * data/xslt/xml2text.xsl: Transform XML into plain text.
2538 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
2539 * data/Makefile.am (xsltdir): New variable.
2540 (dist_xslt_DATA): Add xslt/*.xsl files.
2541
2542 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
2543
2544 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
2545 Problem reported by Wojciech Polak.
2546 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
2547 (xml_printf): Undo change I made on 21 September; that is,
2548 indent 2 spaces, not 1.
2549
2550 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
2551
2552 Pacify ./configure --enable-gcc-warnings.
2553 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
2554 `char const *' instead of `char *'.
2555 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
2556 local variable `sep'.
2557
2558 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2559
2560 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
2561 elsewhere.
2562 * src/print-xml.c: Prefer "const" after types; that's more consistent.
2563 (xml_printf): Indent just 1 space for level.
2564 (e_char, xlate_char): Remove.
2565 (xml_escape_string): Rewrite to avoid undefined behavior (used
2566 storage that was freed from the stack).
2567 (xml_escape_n): Don't bother checking for subscript error.
2568
2569 2007-09-21 Wojciech Polak <polak@gnu.org>
2570
2571 Add Bison XML Automaton Report.
2572
2573 Add support for an -x option to generate an XML report.
2574 It is not documented yet.
2575 * src/print-xml.c: New file.
2576 * src/print-xml.h: Likewise.
2577 * lib/timevar.def (TV_XML): New var.
2578 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
2579 * src/conflicts.c: Include print-xml.h.
2580 (solved_conflicts_xml_obstack): New var.
2581 (log_resolution, conflicts_solve, conflicts_free):
2582 Add support for XML report.
2583 (conflicts_output_val): New function.
2584 * src/conflicts.h (conflicts_output_val): New decl.
2585 * src/files.c (spec_xml_file): New var.
2586 (compute_output_file_names, output_file_names_free): Add XML support.
2587 * src/files.h (spec_xml_file): New decl.
2588 * src/getargs.c (xml_flag): New var.
2589 (usage, short_options, long_options, getargs): Add XML support.
2590 * src/getargs.h (xml_flag): New decl.
2591 * src/gram.c: Include print-xml.h.
2592 (rule_lhs_print_xml, rule_rhs_print_xml):
2593 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
2594 New functions.
2595 * src/gram.h: Declare external ones.
2596 * src/main.c: Include print-xml.h.
2597 (main): Add XML support.
2598 * src/reduce.c: Include print-xml.h.
2599 (reduce_xml): New function.
2600 * src/reduce.h: Declare it.
2601 * src/state.c: Include print-xml.h.
2602 (state_new): Add XML support.
2603 (state_rule_lookahead_tokens_print_xml): New function.
2604 * src/state.h: Declare it.
2605 (struct state): New member solved_conflicts_xml.
2606 * src/symtab.c (symbol_class_get_string): New function.
2607 * src/symtab.h: Declare it.
2608
2609 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2610
2611 * GNUmakefile: Switch to coreutils's version.
2612 * bootstrap: Likewise.
2613 * Makefile.cfg: Adjust to new GNUmakefile.
2614 * README-hacking: Likewise.
2615
2616 Import from gnulib:
2617
2618 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
2619 Bruno Haible <bruno@clisp.org>
2620
2621 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
2622 and is a script that invokes bison. Tighten the code. Add comments.
2623
2624 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
2625
2626 Spell "boolean" as "Boolean". Reported by Akim Demaille.
2627 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
2628 * doc/bison.texinfo (Decl Summary): Fix.
2629 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
2630 * tests/input.at (Boolean %define variables): Update output.
2631 * tests/skeletons.at (%define boolean variables: invalid skeleton
2632 defaults): Rename to...
2633 (%define Boolean variables: invalid skeleton defaults): ... this and
2634 update output.
2635
2636 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
2637
2638 In impure push mode, don't allow more than one yypstate to be allocated
2639 since multiple impure parsers would corrupt yynerrs.
2640 * data/push.c (yypstate_allocated): New static global variable
2641 initialized to 0.
2642 (yypull_parse): If yypstate_new returns 0, don't report it as memory
2643 exhaustion if yypstate_allocated is 1, but still return 2.
2644 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
2645 already 1. Otherwise, set it to 1.
2646 (yypstate_delete): Set it to 0.
2647 * tests/push.at (Push Parsing: Multiple impure instances): New test
2648 case.
2649
2650 2007-08-17 Bob Rossi <bob@brasko.net>
2651
2652 * doc/bison.texinfo (Push Decl): Document the push parser.
2653 (Table of Symbols): Ditto.
2654 (Pure Decl): Ditto.
2655 (Decl Summary): Ditto.
2656 (Multiple Parsers, Push Parser Function, Pull Parser Function,
2657 Parser Create Function, Parser Delete Function):
2658 Add new push parser symbols.
2659 (Table of Symbols): Document push-parser, push-pull-parser,
2660 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
2661
2662 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
2663
2664 Update to GPLv3.
2665 * doc/gpl-3.0.texi: New file.
2666 * doc/gpl.texi: Remove.
2667 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
2668 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
2669 * README-hacking, TODO, bootstrap, bootstrap.conf:
2670 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
2671 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
2672 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
2673 * data/lalr1.cc, data/lalr1.java, data/location.cc:
2674 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
2675 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
2676 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
2677 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
2678 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
2679 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
2680 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
2681 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
2682 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
2683 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
2684 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
2685 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
2686 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
2687 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
2688 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
2689 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
2690 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
2691 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
2692 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
2693 * src/complain.c, src/complain.h, src/conflicts.c:
2694 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
2695 * src/files.h, src/flex-scanner.h, src/getargs.c:
2696 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
2697 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
2698 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
2699 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
2700 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
2701 * src/print.c, src/print.h, src/print_graph.c:
2702 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
2703 * src/reduce.h, src/relation.c, src/relation.h:
2704 * src/revision.h, src/scan-code.h, src/scan-code.l:
2705 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
2706 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
2707 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
2708 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
2709 * tests/Makefile.am, tests/actions.at, tests/c++.at:
2710 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
2711 * tests/existing.at, tests/glr-regression.at:
2712 * tests/headers.at, tests/input.at, tests/java.at:
2713 * tests/local.at, tests/output.at, tests/push.at:
2714 * tests/reduce.at, tests/regression.at, tests/sets.at:
2715 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
2716 * tests/torture.at:
2717 Update to GPLv3.
2718
2719 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2720
2721 Get rid of broken %no-parser, -n, and --no-parser implementation and
2722 documentation.
2723 * TODO: Don't mention them.
2724 * doc/bison.1: Likewise.
2725 * doc/bison.texinfo (Decl Summary): Likewise.
2726 (Bison Options): Likewise.
2727 (Option Cross Key): Likewise.
2728 * src/getargs.c (no_parser_flag): Remove global variable.
2729 (usage): Don't print description of -n and --no-parser.
2730 (long_options): Remove --no-parser entry here.
2731 (getargs): Remove -n case in the switch here.
2732 * src/getargs.h (no_parser_flag): Remove extern.
2733 * tests/regression.at (Web2c Actions): Remove comment that mentions
2734 --no-parser.
2735
2736 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2737
2738 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
2739 name user variables starting with `yy'. Just pass NULL instead of a
2740 dummy local &yylval to yypush_parse.
2741 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
2742 starting with `yy'.
2743
2744 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
2745
2746 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
2747 true since it's then always used regardless of whether yyoverflow is
2748 defined. Reported by Christian Burger at
2749 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
2750 * THANKS: Add Christian Burger.
2751
2752 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
2753 node names: say "Decl Summary" not "Bison Declaration Summary".
2754
2755 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
2756
2757 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
2758 determine whether this function has already complained about an invalid
2759 value for a %define boolean variable, don't check whether Bison has
2760 ever examined the value. As written, the check was a tautology.
2761 Instead, record and check for this complaint using a separate muscle.
2762
2763 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2764
2765 Fix push parsing memory leak reported by Brandon Lucia at
2766 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
2767 * THANKS: Add Brandon Lucia.
2768 * data/push.c (yypstate_delete): Free the stack if it was reallocated
2769 but the parse never completed and thus freed it.
2770 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
2771 * tests/testsuite.at: Include push.at.
2772 * test/push.at: New.
2773 (Push Parsing: Memory Leak for Early Deletion): New test case.
2774
2775 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
2776
2777 Improve handling of multiple S/R conflicts in the same state and of S/R
2778 conflicts involving multiple reductions.
2779 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
2780 set for a state here or Bison will abort if it is reassigned on a
2781 later conflicted reduction in the same state.
2782 Similarly, don't finalize and assign the solved conflicts report here
2783 or it will be lost if it is reassigned on a later conflicted reduction
2784 in the same state.
2785 (set_conflicts): Instead, assign them both here after all S/R conflicts
2786 in the state have been fully examined.
2787 * src/print.c (shift_set): Rename to...
2788 (no_reduce_set): ... this.
2789 (print_reductions): Update for rename, and add %nonassoc error action
2790 tokens to no_reduce_set so that, when printing the first remaining
2791 reduction on an error action token, the reduction is enclosed in
2792 brackets.
2793 (print_results): Update for rename.
2794 * tests/conflicts.at (Solved conflicts report for multiple reductions
2795 in a state): New test case.
2796 (%nonassoc error actions for multiple reductions in a state): New test
2797 case.
2798
2799 * src/main.c (main): Don't depend on C99 features.
2800
2801 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2802
2803 * build-aux/.cvsignore: Add compile.
2804 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
2805 uniwidth.
2806
2807 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
2808
2809 * bootstrap (slurp): Create target directories that don't exist.
2810 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
2811
2812 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
2813
2814 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
2815 than item number.
2816 * closure.c (closure): Likewise.
2817 * state.h (reductions): Comment sorting of rules.
2818 (state): Comment sorting of items.
2819
2820 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
2821
2822 Fix C++ test cases after recent Gnulib changes. Discussed starting at
2823 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
2824 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
2825 definition in order to avoid Gnulib headers since we don't use config.h
2826 here.
2827 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
2828 rather than AT_DATA so that config.h is included.
2829
2830 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
2831
2832 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
2833 instead of fprintf. Guard these functions with #if YYDEBUG instead of
2834 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
2835 and so that YYFPRINTF is guaranteed to be defined here.
2836
2837 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2838
2839 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
2840 with...
2841 (muscle_percent_define_check_values): ... this more helpful function.
2842 Again, it's not used yet, but it will be.
2843 * src/muscle_tab.h: Likewise.
2844
2845 Improve some comments in parser table construction.
2846 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
2847 (generate_states): Don't mention ruleset, which is internal to closure.
2848 * src/closure.c (closure): Explain sorting of core and itemset, which
2849 is required for this function to behave correctly.
2850 * src/closure.h (closure): Mention sorting.
2851
2852 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
2853
2854 * src/lalr.c (state_lookahead_tokens_count): For code readability,
2855 move the check for disabled transitions to an aver since conflict
2856 resolution hasn't happened yet.
2857
2858 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
2859 labels a state as inconsistent just because it has error transitions.
2860 The original form of this check appeared in revision 1.1 of lalr.c,
2861 which was committed on 1991-12-21. Now (at least), changing the
2862 consistency label on such a state appears to have no useful effect in
2863 any of the places it is examined, which I enumerate below. The key
2864 point to understanding each item in this enumeration is that a state
2865 with an error transition is labelled consistent in the first place only
2866 if it has no rules, so the check cannot matter for states that have
2867 rules. (1) Labelling a state as inconsistent will cause set_conflicts
2868 to try to identify its conflicts, and a state must have *rules* to have
2869 conflicts. (2) Labelling a state as inconsistent will affect how
2870 action_row sets the default *rule* for the state. (3) Labelling a
2871 state as inconsistent will cause build_relations to add lookback edges
2872 to *rules* in that state.
2873 * src/state.h (struct state): Word the comment for member consistent
2874 more carefully.
2875
2876 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2877
2878 Don't depend on C99 features.
2879 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
2880 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
2881 * src/reader.c (check_and_convert_grammar): Fix for-loop.
2882 * src/state.c (state_mark_reachable_states): Fix for-loop.
2883 (state_remove_unreachable_states): Fix for-loop.
2884
2885 Don't widen struct state with member reachable just to temporarily
2886 record reachability. Instead, use a local bitset.
2887 * src/state.h (struct state): Remove member.
2888 * src/state.c (state_new): Don't initialize it.
2889 (state_mark_reachable_states): Rename to...
2890 (state_record_reachable_states): ... this, and use bitset.
2891 (state_remove_unreachable_states): Use bitset.
2892
2893 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
2894
2895 * src/Makefile.am (yacc): Quote target action commands properly so
2896 that the yacc script isn't corrupt. Reported by Hans Aberg at
2897 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
2898
2899 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
2900 the case of pure parsers. Reported by Frans Englich at
2901 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
2902 * THANKS: Add Frans Englich.
2903
2904 * NEWS (2.3a+): In the %code entry, reference section `Bison
2905 Declaration Summary' from the manual now since the %code summary has
2906 moved there.
2907 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
2908 in the rules section must be terminated by semicolons.
2909
2910 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
2911
2912 Extend the front-end API for %define variables to more completely
2913 mirror the back-end. This will be useful in the future.
2914 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
2915 Update comments to mention the new front-end counterparts of these
2916 macros.
2917 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
2918 for muscle_string_decode and muscle_location_decode.
2919 (muscle_string_decode): New static function.
2920 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
2921 (muscle_percent_define_get, muscle_percent_define_ifdef): New
2922 functions.
2923 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
2924 muscle_percent_define_get to mimic the b4_percent_define_flag_if
2925 implementation more closely.
2926 (muscle_percent_define_invalid_value): New function.
2927 * src/muscle_tab.h (muscle_percent_define_get,
2928 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
2929 Prototype.
2930
2931 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2932
2933 * NEWS (2.3a+): Mention yesterday's state-removal change.
2934 (2.3a): Remove the %language entry, which was added after 2.3a.
2935 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
2936 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
2937 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
2938 tests/existing.at: Update copyright date.
2939
2940 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2941
2942 If conflict resolution makes states unreachable, remove those states,
2943 report rules that are then unused, and don't report conflicts in those
2944 states.
2945 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
2946 New global function.
2947 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
2948 function.
2949 * src/main.c (main): After conflict resolution, remove the unreachable
2950 states and update all data structures that reference states by number.
2951 * src/state.c (state_new): Initialize each state's reachable member to
2952 false.
2953 (state_mark_reachable_states): New static function.
2954 (state_remove_unreachable_states): New global function.
2955 * src/state.h (struct state): Add member bool reachable.
2956 (state_remove_unreachable_states): Prototype.
2957 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2958 New test case.
2959 * tests/existing.at (GNU pic Grammar): Update test case output now that
2960 an unused rule is discovered.
2961
2962 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2963
2964 Minor code cleanup in parser table construction.
2965 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
2966 (new_itemsets, save_reductions): Update for rename to nitemset.
2967 * src/closure.c (nritemset): Rename to...
2968 (nitemset): ... this since the "r" appears to meaningless and isn't
2969 used in the comments.
2970 (closure): Update for rename.
2971 * src/closure.h (nritemset): Update extern to...
2972 (nitemset): ... this.
2973 * src/lalr.c (LA): Fix a typo in comments.
2974 * src/print.c (print_core): Update for rename to nitemset.
2975 * src/print_graph.c (print_graph): Likewise.
2976 * src/state.h: Fix some typos in header comments.
2977
2978 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
2979
2980 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
2981 still sticks to ASCII. Sorry!
2982
2983 * README-hacking: New file, taken mostly from coreutils, with changes
2984 for Bison. Contains much of the contents of:
2985 * README-cvs: Remove.
2986 * bootstrap: Sync from gnulib.
2987 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
2988 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
2989
2990 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
2991
2992 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
2993 Setzer.
2994 (Java Differences): Fix some typos.
2995 * THANKS: Add Sebastian Setzer.
2996
2997 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
2998
2999 * data/java.m4 (b4_single_class_if): Remove.
3000 (b4_abstract_if): Look at "%define abstract".
3001 (b4_lexer_if): New.
3002 (b4_union_name): Rename...
3003 (b4_yystype): ... to this. Map to "%define stype".
3004 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
3005 b4_maybe_throws): Fix quoting.
3006 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
3007 * data/lalr1.java (Lexer interface): Always define.
3008 (Lexer interface within parser class): Remove.
3009 (YYLexer class): New, used when "%code lexer" is present.
3010 (constructor): When "%code lexer" is used, pass %lex-param
3011 to the lexer constructor.
3012 (yylex, yyparse): Remove %lex-param from method invocations
3013 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
3014
3015 * doc/bison.texinfo (Java Bison Interface): Mention "%define
3016 abstract". Rename "%define union_name" to "%define stype".
3017 Rename method names according to previous patch.
3018 (Java Scanner Interface): Describe "%code lexer" instead of
3019 "%pure-parser" and "%define single_class".
3020 (Java Differences): Mention "%code lexer".
3021
3022 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
3023 Include scanner here, using macros from tests/local.at.
3024 (AT_DATA_CALC_Y): Remove final argument.
3025 (_AT_CHECK_JAVA_CALC): Likewise.
3026 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
3027 of %locations and %error-verbose.
3028 (main): Test with and without %lex-param.
3029 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
3030 (AT_BISON_OPTION_POPDEFS): Pop it.
3031
3032 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3033
3034 DJGPP spefic issue. Inhibit the use of disallowed characters for
3035 file name genertion on Win98, WinXP, etc. These are |<>":?*\
3036 and concern testsuite case 46.
3037 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
3038 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
3039 * djgpp/config.bat: Inhibit the use of disallowed characters.
3040
3041 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3042
3043 Miscellaneous %define and %code cleanup.
3044 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
3045 values are interpreted.
3046 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
3047 documentation a little more.
3048 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
3049 muscle_percent_define_insert, muscle_percent_code_grow): New
3050 functions/macros.
3051 * src/muscle_tab.h (muscle_percent_define_insert,
3052 muscle_percent_code_grow): Prototype.
3053 * src/parse-gram.y (prologue_declaration): Use
3054 muscle_percent_define_insert and muscle_percent_code_grow when parsing
3055 %define and %code directives.
3056
3057 Make it easy to share %define boolean variables between the front-end
3058 and back-end. Though not used yet, this will be useful in the future.
3059 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
3060 Bison uses of names rather than just skeleton uses of names.
3061 (b4_percent_define_get, b4_percent_define_ifdef): Rename
3062 b4_percent_define_skeleton_variables(VARIABLE) to
3063 b4_percent_define_bison_variables(VARIABLE).
3064 (b4_percent_code_get, b4_percent_code_ifdef): Rename
3065 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
3066 b4_percent_code_bison_qualifiers(QUALIFIER).
3067 (b4_check_user_names_wrap): Update for renames.
3068 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
3069 muscle_percent_define_default): New functions mimicking
3070 b4_percent_define_flag_if and b4_percent_define_default.
3071
3072 For %define variables, report locations for invalid values and
3073 redefinitions.
3074 * data/bison.m4 (b4_percent_define_flag_if): Read
3075 b4_percent_define_loc(VARIABLE) to report the location of an invalid
3076 value for VARIABLE.
3077 (b4_percent_define_default): Save a special location in
3078 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
3079 must later be reported as invalid.
3080 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
3081 functions.
3082 (muscle_percent_define_insert): Record the location of VARIABLE in
3083 muscle percent_define_loc(VARIABLE), and use it to report the previous
3084 location for a redefinition.
3085 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
3086 (muscle_percent_define_default): Update like b4_percent_define_default.
3087 (muscle_grow_user_name_list): Rename to...
3088 (muscle_user_name_list_grow): ... this for consistency and use
3089 muscle_location_grow.
3090 * src/muscle_tab.h (muscle_location_grow): Prototype.
3091 * tests/input.at (%define errors): Update expected output.
3092 * tests/skeletons.at (%define boolean variables: invalid skeleton
3093 defaults): New test case.
3094
3095 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
3096
3097 * src/print.c (lookahead_set, state_default_rule): Remove.
3098 (print_reductions): Replace state_default_rule invocation with
3099 equivalent use of yydefact, which was computed in token_actions in
3100 tables.c.
3101 (print_results): Don't allocate lookahead_set.
3102
3103 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
3104
3105 * data/lalr1.java: Prefix all private members with yy.
3106
3107 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
3108
3109 Use YYFPRINTF instead of fprintf where appropriate. Reported by
3110 Sebastien Fricker at
3111 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
3112 * THANKS: Add Sebastien Fricker.
3113 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
3114 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
3115 accept a variable number of arguments.
3116
3117 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3118
3119 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
3120
3121 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3122
3123 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
3124 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
3125 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
3126
3127 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
3128
3129 Undo my 2007-02-07 change, switching back to the c-strcase module
3130 introduced in the 2007-02-03 change. Bruno Haible reported that
3131 the 2007-02-07 change would be dangerous in Turkish if we add a
3132 language whose name contains "i", since "i" is not lowercase "I"
3133 in Turkish.
3134 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
3135 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
3136 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
3137 * m4/.cvsignore: Remove strcase.m4.
3138 * src/getargs.c: Revert 2007-02-07 change, as follows.
3139 Include c-strcase.h.
3140 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
3141
3142 2007-02-11 Bruno Haible <bruno@clisp.org>
3143
3144 Enable the Java related testsuite tests when the only Java compiler
3145 found is a gcj < 4.3. Discussed at
3146 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
3147 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
3148
3149 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
3150
3151 * data/Makefile.am: Update copyright date.
3152 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
3153 yypstate_new returns NULL.
3154 (yypstate_new): Return NULL if malloc does.
3155 * src/reader.c (packgram): Move translation of rule actions from the
3156 beginning of packgram to...
3157 (check_and_convert_grammar): ... here right before packgram is invoked
3158 so it's easier to write more complete comments, and remove redundant
3159 code.
3160
3161 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
3162
3163 As in semantic actions, make @$ in %initial-action, %destructor, and
3164 %printer imply %locations.
3165 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
3166 scanning @$.
3167 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
3168 (@$ in %initial-action implies %locations,
3169 @$ in %destructor implies %locations,
3170 @$ in %printer implies %locations): ... these new test cases.
3171
3172 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
3173
3174 Undo most of the 2007-02-03 change, switching to the strcase module
3175 now that gnulib strcase has been fixed.
3176 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
3177 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
3178 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
3179 * m4/.cvsignore: Add strcase.m4.
3180 * src/getargs.c: Revert 2007-02-03 change, as follows.
3181 Don't include c-strcase.h.
3182 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
3183 strcasecmp has "unspecified behavior" outside the POSIX locale,
3184 but it works fine in practice if at least one argument is ASCII,
3185 as is the case in Bison.
3186
3187 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
3188
3189 * tests/java.at: Skip tests if only one of javac/java is present.
3190 Reported by Joel E. Denny.
3191 * tests/atlocal.in: Adjust copyright years.
3192
3193 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
3194
3195 * data/lalr1.java (Stack): Work around old verifiers that disallow
3196 access to the private fields of an inner class, from the outer class.
3197 We can make Stack's fields public because user code doesn't have access
3198 to the instance of Stack used by parse(). Reported by Paul Eggert.
3199
3200 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
3201
3202 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
3203 the right spot for these files?
3204 * bootstrap.conf (gnulib_modules): Add c-strcase.
3205 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
3206 c-strncasecmp.c.
3207 * src/getargs.c: Include c-strcase.h.
3208 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
3209 to avoid unspecified behavior.
3210
3211 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
3212
3213 * doc/bison.texinfo (Decl Summary): Correct typo.
3214
3215 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
3216
3217 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
3218 Complain if the value does not match empty, "true" or "false".
3219 * data/c++.m4: Adjust default definitions of %define variables.
3220 * data/java.m4: Adjust default definitions of %define variables.
3221 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
3222 to above behavior.
3223 * tests/input.at (Boolean %define variables): Test new behavior.
3224
3225 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
3226
3227 * NEWS: Mention java.
3228 * TODO: Remove things that are done.
3229 * bootstrap.conf: Add javacomp-script and javaexec-script.
3230 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
3231
3232 * data/Makefile.am: Add new files.
3233 * data/java-skel.m4: New.
3234 * data/java.m4: New.
3235 * data/lalr1.java: New.
3236
3237 * doc/bison.texinfo: Put "A Complete C++ Example" under
3238 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
3239 under Other Languages.
3240
3241 * src/getargs.c (valid_languages): Add Java.
3242 * src/getargs.h (struct bison_language): Update size of string fields.
3243
3244 * tests/Makefile.am: Add java.at.
3245 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
3246 * tests/java.at: New.
3247 * tests/testsuite.at: Include it.
3248
3249 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
3250
3251 Clean up.
3252 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
3253 at_directive_argv arguments so these no longer have to be global
3254 variables. Also, update the implementation for the following changes.
3255 (fail_for_at_directive_too_many_args,
3256 fail_for_at_directive_too_few_args): Add at_directive_name argument.
3257 (at_directive_name): Remove as at_directive_argv[0] will be used for
3258 this now.
3259 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
3260 for the directive name.
3261 (at_directive_argc, at_directive_argv): Make these local within
3262 skel_lex instead of global.
3263 (INITIAL): Update directive start action for above changes.
3264 (SC_AT_DIRECTIVE_ARG): Rename to...
3265 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
3266 (SC_AT_DIRECTIVE_SKIP_WS): Update.
3267 (scan_skel): Move yylex_destroy to...
3268 (skel_scanner_free): ... here.
3269 * tests/skeletons.at (installed skeleton file name): Rename to...
3270 (installed skeleton file names): ... this.
3271
3272 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
3273
3274 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3275 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
3276 Summary" not "Directives".
3277 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
3278 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
3279 since the former is now the more complete one.
3280 (Prologue Alternatives): Likewise and do the same for %defines.
3281 (Table of Symbols): Add summary of %code, add summary of %define, and
3282 move full %code documentation to...
3283 (Decl Summary): ... here for consistency with other entries in these
3284 sections.
3285 Move %define entry in order to keep this list alphabetized.
3286 Reword %define entry a little to put less emphasis on the skeleton
3287 concept, which most users shouldn't have to think about.
3288
3289 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
3290
3291 Adjust to recent gnulib changes.
3292 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
3293 Add string.h, string_.h, unistd_.h, wchar_.h.
3294 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
3295 * src/system.h: Don't include <stpcpy.h>; this is now done by
3296 <string.h>.
3297
3298 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
3299
3300 Simplify implementation of unqualified %code, implement macros for
3301 uniform treatment of boolean %define flags. Document %define.
3302 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
3303 b4_percent_code_ifdef): New.
3304 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
3305 * data/c++.m4: Define default value for global_tokens_and_yystype.
3306 * data/glr.cc: Likewise.
3307 * data/location.cc: Use b4_percent_define_flag_if.
3308
3309 * doc/bison.texinfo (Decl Summary): Document %define.
3310
3311 * src/parse-gram.y (Unqualified %code): Change muscle name to
3312 b4_percent_code().
3313 (content.opt): Default to empty.
3314
3315 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3316
3317 Implement support for relative and absolute skeleton file names.
3318 Discussed starting at
3319 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
3320 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
3321 (Bison Options): Document in --skeleton entry.
3322 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
3323 full_skeleton can't necessarily hold all of pkgdatadir.
3324 If the specified skeleton file name contains a `/', don't prepend
3325 pkgdatadir.
3326 * src/parse-gram.y (prologue_declaration): If the specified skeleton
3327 file name contains a `/', prepend the grammar file directory.
3328 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
3329 * skeletons.at: New file.
3330 (relative skeleton file names): New test case.
3331 (installed skeleton file names): New test case.
3332 * tests/testsuite.at: Include skeletons.at.
3333
3334 * bootstrap: Update copyright to 2007.
3335
3336 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
3337
3338 * bootstrap: Remove occurrences of .#bootmp from the files.
3339
3340 2007-01-17 Akim Demaille <akim@epita.fr>
3341
3342 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
3343 nonterminals.
3344 Use per-type %printer.
3345
3346 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3347
3348 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
3349 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3350 djgpp/config.site, src/files.c, src/files.h, src/main.c,
3351 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
3352 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
3353 tests/glr-regression.at, tests/input.at, tests/local.at,
3354 tests/output.at, tests/torture.at: Update copyright to 2007.
3355
3356 2007-01-16 Akim Demaille <akim@epita.fr>
3357
3358 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
3359 error code.
3360 (Calc++ Scanner): Exit with failure if we can't open the input
3361 file.
3362 Accept "-" standing for stdin.
3363 (Calc++ Top Level): Print the result only if the parsing was
3364 successful.
3365
3366 2007-01-16 Akim Demaille <akim@epita.fr>
3367
3368 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
3369
3370 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
3371 and Joel E. Denny <jdenny@ces.clemson.edu>
3372
3373 Clean up %define and %code implementation in M4 some. Most
3374 importantly, rename all related macros to be in the b4_percent_define
3375 and b4_percent_code namespaces. Also, complete support for `.' in
3376 %define variable names and %code qualifiers.
3377 * data/bison.m4 (b4_check_user_names): Check for special
3378 "SKELETON-NAMESPACE(name)" macros instead of using two nested
3379 m4_foreach loops.
3380 (b4_get_percent_define, b4_get_percent_code): Rename to...
3381 (b4_percent_define_get, b4_percent_code_get): ... these.
3382 Extend documentation with examples.
3383 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
3384 b4_percent_define_skeleton_variables and
3385 b4_percent_code_skeleton_qualifiers.
3386 Expect any value for the %define variable `foo' to be stored in the
3387 macro named `b4_percent_define(foo)'; expect any %code blocks for the
3388 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
3389 expect any unqualified %code blocks to be stored in a macro named
3390 `b4_percent_code_unqualified'.
3391 Use m4_indir so that %define variable names and %code qualifiers can
3392 contain `.', which is allowed by the grammar parser.
3393 (b4_percent_define_default): New macro to set a default value for a
3394 %define variable.
3395 (m4_wrap): Update wrapped code, and fix some underquoting.
3396 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
3397 Expect grammar uses of %define variables and %code qualifiers to be
3398 defined in b4_percent_define_user_variables and
3399 b4_percent_code_user_qualifiers.
3400 * data/c++.m4: Use b4_percent_define_default rather than
3401 m4_define_default. Fix some underquoting. Skeleton usage of %define
3402 variable define_location_comparison now implies skeleton usage of
3403 %define variable filename_type.
3404 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3405 data/push.c, data/yacc.c: Update macro names.
3406 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
3407 muscle names.
3408
3409 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3410
3411 DJGPP specific issues.
3412
3413 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
3414 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
3415
3416 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3417
3418 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
3419 run parsers in all tests so that Valgrind is invoked during
3420 maintainer-check-valgrind.
3421 (Duplicate representation of merged trees): Free all semantic values.
3422 (Duplicated user destructor for lookahead): Likewise.
3423
3424 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3425
3426 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
3427 command-line prefix.
3428 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
3429 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
3430 miss Valgrind messages.
3431 (Exploding the Stack Size with Malloc): Likewise.
3432
3433 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3434
3435 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
3436 locals. Reported by Juan Manuel Guerrero at
3437 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
3438 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
3439 Fix some indentation also.
3440 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
3441 explaining this issue.
3442
3443 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
3444 and Joel E. Denny <jdenny@ces.clemson.edu>
3445
3446 Simplify union and prologue handling, and escape union and lex/parse
3447 params with digraphs.
3448 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
3449 values to the empty string since these are no longer guaranteed
3450 initialized by the front-end.
3451 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
3452 braces around b4_user_stype since this is no longer done by the
3453 front-end.
3454 * src/files.c, src/files.h (pre_prologue_obstack,
3455 post_prologue_obstack): Remove.
3456 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
3457 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
3458 with digraphs. This fixes lex params and parse params.
3459 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
3460 * src/output.c (prepare): Remove muscle insertion of the prologues.
3461 (output): Remove freeing of pre_prologue_obstack and
3462 post_prologue_obstack.
3463 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
3464 than prologue_augment for prologue parsing so you don't need prologue
3465 obstacks.
3466 (grammar_declaration): For %union RHS, use `braceless' instead of
3467 "{...}" so that braces are already stripped and code is escaped with
3468 digraphs.
3469 * src/reader.c (prologue_augment): Remove.
3470 (reader): Remove initialization of pre_prologue_obstack and
3471 post_prologue_obstack.
3472 * src/reader.h (prologue_augment): Remove.
3473
3474 * data/c.m4: Remove stray parenthesis.
3475
3476 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3477
3478 Remove quotes from variables names in %define directives and from
3479 qualifiers in %code directives, and restrict the characters that are
3480 allowed in them to M4-friendly ones. For %define, continue to support
3481 the quoted form as a deprecated feature. Discussed starting at
3482 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
3483 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
3484 %code.
3485 * doc/bison.texinfo (Prologue Alternatives): Update.
3486 (Decl Summary): In %defines entry, update mention of `%code requires'
3487 and `%code provides'.
3488 (C++ Location Values): Update %define uses.
3489 (Calc++ Parser Interface): Likewise.
3490 (Calc++ Parser): Likewise, and update `%code requires' uses.
3491 (Table of Symbols): Update %code documentation.
3492 * src/parse-gram.y (prologue_declaration): For %define variables, use
3493 `variable' instead of `STRING'.
3494 (grammar_declaration): For %code qualifiers, use `ID' instead of
3495 `STRING'.
3496 (variable): New nonterminal that takes an `ID' or a `STRING'.
3497 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
3498 and %define uses.
3499 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
3500 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
3501 (%define errors): Update %define uses.
3502
3503 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3504
3505 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
3506 instead of muscle_insert for %define values so that M4-special
3507 characters are replaced with digraphs.
3508 * tests/input.at (%define errors): Extend to check weird values.
3509
3510 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3511
3512 Instead of having skeletons declare all valid %define variables and
3513 %code qualifiers, provide macros that retrieve the associated values
3514 and build these lists automatically. Thus Bison will now warn when a
3515 variable or qualifier is not used by the skeleton in the current
3516 invocation regardless of whether it might sometimes be used by that
3517 skeleton in other invocations. Also, move all %define value macros to
3518 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
3519 form, which is replaced by %code.
3520 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
3521 (b4_check_user_names): ... this, and change the series of valid name
3522 arguments to a single list argument for names used in the skeleton
3523 similar to the existing list argument for names used in the grammar.
3524 Warn instead of complaining.
3525 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
3526 values and %code code, to format %code code properly, and to build
3527 lists of all %define variables and %code qualifiers used in the
3528 skeleton: b4_skeleton_percent_define_variables and
3529 b4_skeleton_percent_code_qualifiers.
3530 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
3531 Remove, and...
3532 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
3533 the skeleton names lists can finish building first. In place of
3534 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
3535 expect the lists b4_user_percent_define_variables and
3536 b4_user_percent_code_qualifiers.
3537 * data/c++.m4: Where setting default values for b4_parser_class_name,
3538 b4_location_type, b4_filename_type, b4_namespace, and
3539 b4_define_location_comparison, update their names to the
3540 b4_percent_define_ namespace.
3541 * data/glr.c: Don't use b4_check_percent_define_variables and
3542 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3543 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
3544 (b4_parser_class_name, b4_namespace): Define these using
3545 b4_get_percent_define for parser_class_name and namespace.
3546 * data/location.cc: Use b4_get_percent_define.
3547 * data/push.c: Don't use b4_check_percent_define_variables and
3548 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3549 * data/yacc.c: Likewise, and don't call m4_exit in
3550 b4_use_push_for_pull_if or m4_wrap code will never execute.
3551 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
3552 Rename to...
3553 (muscle_grow_user_name_list): ... this for consistency with the
3554 terminology used in bison.m4.
3555 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
3556 %define variable names, and rename muscle used_percent_define_variables
3557 to user_percent_define_variables.
3558 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
3559 user_percent_code_qualifiers.
3560 (content): Remove.
3561 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
3562 {CODE} form is no longer accepted.
3563 * tests/input.at (Reject bad %code qualifiers): Rename to...
3564 (Reject unused %code qualifiers): ... this, and update test output.
3565 (%define error): Update test output.
3566
3567 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
3568
3569 Check for unrecognized %define variables similar to checking for
3570 unrecognized %code qualifiers. Check for redefined %define variables.
3571 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
3572 generalizes...
3573 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
3574 (b4_check_percent_define_variables): New, also wraps it.
3575 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
3576 variables using b4_check_percent_define_variables.
3577 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
3578 all those exercised in the test suite and all those listed in the
3579 `Default values' section of c++.m4. Are there others?
3580 * data/push.c, data/yacc.c: Declare no valid %define variables.
3581 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
3582 similar to muscle_find, but it works even when the muscle stores a
3583 const value.
3584 (muscle_grow_used_name_list): New function for constructing the used
3585 name list muscles that b4_check_for_unrecognized_names requires.
3586 * src/parse-gram.y (prologue_declaration): Warn if a variable is
3587 %define'd more than once. Define the b4_used_percent_define_variables
3588 muscle with muscle_grow_used_name_list.
3589 (grammar_declaration): Abbreviate %code code with
3590 muscle_grow_used_name_list.
3591 * tests/input.at (%define errors): New.
3592
3593 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3594
3595 Provide warn_at, complain_at, and fatal_at function callbacks to the
3596 skeletons, and use this for %code qualifier complaints.
3597 * data/bison.m4 (b4_error_at): New, invoked by...
3598 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
3599 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
3600 @fatal_at(...@) directives.
3601 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
3602 qualifiers in b4_used_percent_code_qualifiers and to use
3603 b4_complain_at.
3604 * src/location.c, src/location.h (boundary_set_from_string): New global
3605 function.
3606 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
3607 function.
3608 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
3609 to b4_used_percent_code_qualifiers.
3610 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
3611 function.
3612 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
3613 (lineno): Rename to...
3614 (out_lineno): ... this so I don't misunderstand it again.
3615 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
3616 here; these newlines are in the input but not the output file.
3617 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
3618 (at_directive_perform): ... this new static function, and add handling
3619 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
3620 directives.
3621 * tests/input.at (Reject bad %code qualifiers): Update test output with
3622 locations and extend.
3623
3624 * tests/output.at (Output file name: [, Output file name: ]): Remove
3625 bogus comment about these tests failing.
3626
3627 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3628
3629 Clean up b4_check_percent_code_qualifiers a little.
3630 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
3631 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
3632 documentation and add examples.
3633 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
3634 qualifiers here.
3635
3636 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3637
3638 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
3639 unreliable -- especially when they're hidden inside another macro.
3640 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
3641 data/c.m4: Remove m4_divert(-1).
3642 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3643 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
3644 m4_divert_push(0) and m4_divert_pop(0).
3645 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
3646 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
3647 pushed and popped by m4sugar, should be first on the stack.
3648
3649 Provide warn, complain, and fatal function callbacks to the skeletons.
3650 This provides more flexibility than m4_fatal, improves the error
3651 message format, and captures messages for translation. Discussed
3652 starting at
3653 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
3654 * data/bison.m4 (b4_error): New, invoked by...
3655 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
3656 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
3657 directives. Because these M4 macros might be called when the current
3658 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
3659 the previous removal of uses of m4_divert, which caused trouble.
3660 (b4_check_percent_code_qualifiers): Use b4_complain instead of
3661 m4_fatal to report unrecognized %code qualifiers.
3662 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
3663 push parser requests.
3664 * data/glr.c: Use b4_complain instead of m4_fatal to report
3665 non-deterministic push parser requests.
3666 Update @output usage to @output(...@) form.
3667 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
3668 report missing %defines. Update @output usage to @output(...@) form.
3669 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
3670 @output(...@) form.
3671 * src/main.c (main): Invoke skel_scanner_free.
3672 * src/scan-skel.h (skel_scanner_free): Prototype new function.
3673 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
3674 obstack_for_string from flex-scanner.h.
3675 (YY_DECL): Use to declare skel_lex static.
3676 (decode_at_digraphs): Remove; now handled in the new
3677 SC_AT_DIRECTIVE_ARG start condition.
3678 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
3679 functions.
3680 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
3681 at_directive_argv): New static globals.
3682 (INITIAL): Use fail_for_invalid_at.
3683 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
3684 recognize the start of a generalized `@directive(...@)' form and
3685 start...
3686 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
3687 directive args (using the new obstack_for_string), to decode the
3688 contained @ diagraphs, and to perform the directive. It recognizes
3689 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
3690 @output(...@).
3691 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
3692 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
3693 `@,'.
3694 (scan_skel): Initialize obstack_for_string on the first call.
3695 (skel_scanner_free): New function to free obstack_for_string.
3696 * tests/input.at (Reject bad %code qualifiers): Update test output.
3697
3698 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
3699
3700 Consolidate the 4 prologue alternative directives (%code, %requires,
3701 %provides, and %code-top) into a single %code directive with an
3702 optional qualifier field. Discussed at
3703 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
3704 * NEWS (2.3a+): Rewrite the existing entry for the prologue
3705 alternatives.
3706 * doc/bison.texinfo (Prologue Alternatives): Update.
3707 (Decl Summary): Update to %code "requires" and %code "provides".
3708 (Calc++ Parser): Update to %code "requires".
3709 (Table of Symbols): Remove entries for %requires, %provides, and
3710 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
3711 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
3712 are replaced by b4_percent_code_provides and b4_percent_code_requires,
3713 which are skeleton-specific.
3714 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
3715 declare what %code qualifiers it supports and to complain if any other
3716 qualifiers were used in the grammar.
3717 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
3718 and b4_user_code([b4_percent_code_provides]) in place of
3719 b4_user_requires and b4_user_provides.
3720 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
3721 Add b4_user_code([b4_percent_code_top]) and
3722 b4_user_code([b4_percent_code]).
3723 Invoke b4_check_percent_code_qualifiers.
3724 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3725 PERCENT_REQUIRES): Remove.
3726 (grammar_declaration): Remove RHS's for %code-top, %provides, and
3727 %requires. Rewrite the %code RHS as the unqualified form defining the
3728 muscle b4_percent_code. Add another RHS for the qualified %code form,
3729 which defines muscles of the form b4_percent_code_QUALIFIER and the
3730 b4_used_percent_code_qualifiers muscle.
3731 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3732 PERCENT_REQUIRES): Remove.
3733 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
3734 %code "requires" and %code "provides".
3735 * tests/input.at (Reject bad %code qualifiers): New.
3736
3737 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3738
3739 Use the new code_props interface for destructors and printers.
3740 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
3741 printer_location members, and change the type of the destructor and
3742 printer members to code_props.
3743 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
3744 symbol_printer_get, semantic_type_destructor_set,
3745 semantic_type_printer_set, default_tagged_destructor_set,
3746 default_tagless_destructor_set, default_tagged_printer_set,
3747 default_tagless_printer_set): Use code_props in arguments and return
3748 types in place of char const * and location.
3749 (symbol_destructor_location_get, symbol_printer_location_get): Remove
3750 since the locations are now contained in the return of
3751 symbol_destructor_get and symbol_printer_get.
3752 * src/output.c (symbol_destructors_output, symbol_printers_output):
3753 Replace with...
3754 (symbol_code_props_output): ... this to eliminate duplicate code.
3755 (output_skeleton): Update to use symbol_code_props_output.
3756 * src/reader.c (symbol_should_be_used): Update use of
3757 symbol_destructor_get.
3758 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3759 Update uses of the various _destructor_set and _printer_set functions.
3760 * src/symtab.c: (default_tagged_destructor_location,
3761 default_tagless_destructor_location, default_tagged_printer_location,
3762 default_tagless_printer_location): Remove since we...
3763 (default_tagged_destructor, default_tagless_destructor,
3764 default_tagged_printer, default_tagless_printer): ... change the type
3765 of these to code_props.
3766 (symbol_new, semantic_type_new, symbol_destructor_set,
3767 semantic_type_destructor_set, symbol_destructor_get,
3768 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
3769 symbol_check_alias_consistency, default_tagged_destructor_set,
3770 default_tagless_destructor_set, default_tagged_printer_set,
3771 default_tagless_printer_set): Update.
3772 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
3773 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
3774 code_props members.
3775 (symbol_print): Use SYMBOL_CODE_PRINT.
3776
3777 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3778
3779 Use the new code_props interface for rule actions.
3780 * src/symlist.h (symbol_list): Replace action, action_location, and
3781 used members with a code_props action_props member.
3782 * src/reader.c (symbol_should_be_used, grammar_rule_check,
3783 grammar_midrule_action, grammar_current_rule_merge_set,
3784 grammar_current_rule_symbol_append, packgram): Update.
3785 * src/scan-code.h (translate_rule_action): Remove, no longer used.
3786 * src/scan-code.l (handle_action_dollar): Update.
3787 (translate_rule_action): Remove, no longer used.
3788 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
3789
3790 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3791
3792 Use the new code_props interface in parse-gram.y.
3793 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
3794 Update all uses of translate_* functions to use the new code_props
3795 interface and to use gram_scanner_last_string_free and
3796 code_scanner_last_string_free where possible.
3797 (grammar_declaration): symbol_list_destructor_set and
3798 symbol_list_printer_set now perform the translation, so don't do it
3799 here. Use gram_scanner_last_string_free where possible.
3800 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
3801 translate_code): Remove, no longer used.
3802 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
3803 symbol_list_printer_set): Perform code translation here rather than
3804 depending on the caller to do so.
3805
3806 * src/symlist.h (struct symbol_list): Correct some documentation typos.
3807 * src/scan-gram.h (gram_last_string): Remove declaration.
3808 * src/scan-gram.l (last_string): Declare it static.
3809
3810 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3811
3812 Encapsulate code properties and related functionality for the various
3813 destructors, printers, and actions into a code_props structure and
3814 interface. This patch merely implements code_props in scan-code.h and
3815 scan-code.l. Future patches will rewrite other modules to use it.
3816 Discussed starting at
3817 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
3818 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
3819 consistently initialize const structs that have an empty location
3820 field.
3821 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
3822 to ensure consistency.
3823 * src/scan-code.h (code_props): New structure.
3824 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
3825 function, macro, and const global variable for initializing a
3826 code_props with no code.
3827 (code_props_plain_init, code_props_symbol_action_init,
3828 code_props_rule_action_init, code_props_translate_code): The rest of
3829 the new code_props functional interface. Among other things, the init
3830 functions set the code_props kind field so that
3831 code_props_translate_code will know whether to behave like
3832 translate_symbol_action, translate_rule_action, or translate_code.
3833 These old translate functions must remain until all other modules are
3834 updated to use the new code_props interface.
3835 (code_scanner_last_string_free): New function similar to
3836 gram_scanner_last_string_free.
3837 (code_scanner_free): Add documentation.
3838 * src/scan-code.l: Implement the new interface.
3839 (code_lex): Make it static, add a code_props* argument, and remove the
3840 rule argument.
3841 (last_string): New static global similar to the one in scan-gram.l.
3842 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
3843 instead of rule.
3844 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
3845 code_props since Bison may one day use this information for destructors
3846 and printers.
3847 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
3848 (handle_action_dollar): Use symbol_list_n_get and set used flag
3849 directly since symbol_list_n_used_set is removed.
3850 (translate_action): Add a code_props* argument and remove the rule,
3851 action, and location arguments. Pass the code_props* on to code_lex.
3852 (translate_rule_action, translate_symbol_action, translate_code):
3853 Rewrite as wrappers around the new code_props interface.
3854 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
3855 it would eventually need to break the encapsulation of code_props.
3856
3857 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3858
3859 * etc/.cvsignore: New.
3860
3861 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3862
3863 Add maintainer-push-check to run maintainer-check using push parsing in
3864 place of pull parsing where available.
3865 * Makefile.am (maintainer-push-check): New.
3866 * data/bison.m4 (b4_use_push_for_pull_if): New.
3867 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
3868 appropriately based on their existing values.
3869 (yypush_parse): Don't print push-parser-specific diagnostics if push
3870 parsing is being used in place of pull parsing.
3871 * data/yacc.c: If push parsing should replace pull parsing, redirect to
3872 push.c.
3873 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
3874 variable, and insert b4_use_push_for_pull_flag into muscles.
3875 * tests/Makefile.am (maintainer-push-check): New.
3876
3877 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3878
3879 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
3880 (whether successful or failed) so that yypush_parse can be invoked
3881 again to start a new parse using the same yypstate.
3882 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
3883 check multiple yypull_parse invocations on the same yypstate. For pull
3884 mode, extend to check multiple yyparse invocations.
3885 (Exploding the Stack Size with Alloca): Extend to try with
3886 %push-pull-parser.
3887 (Exploding the Stack Size with Malloc): Likewise.
3888
3889 * tests/calc.at (Simple LALR Calculator): Don't specify
3890 %skeleton "push.c" since %push-pull-parser implies that now.
3891 * tests/headers.at (export YYLTYPE): Don't check for the push
3892 declarations. Otherwise, this test case can't be used to see if push
3893 mode can truly emulate pull mode.
3894 * tests/input.at (Torturing the Scanner): Likewise.
3895 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
3896 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
3897 AT_YACC_IF, which now includes the case of push mode since %skeleton
3898 need not be used for push mode. This will be more intuitive once
3899 push.c is renamed to yacc.c.
3900
3901 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3902
3903 For push mode, convert yyparse from a macro to a function, invoke yylex
3904 instead of passing a yylexp argument to yypull_parse, and don't
3905 generate yypull_parse or yyparse unless %push-pull-parser is declared.
3906 Discussed starting at
3907 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
3908 * data/bison.m4 (b4_pull_if): New.
3909 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
3910 * data/push.c: Improve M4 quoting a little.
3911 (b4_generate_macro_args, b4_parenthesize): Remove.
3912 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
3913 any time a pull parser is requested.
3914 Don't #define this as a wrapper around yypull_parse. Instead, when
3915 both push and pull are requested, make it a function that does that
3916 same thing.
3917 (yypull_parse): If there's a b4_prefix, #define this to
3918 b4_prefix[pull_parse] when both push and pull are requested.
3919 Don't define this as a function unless both push and pull are
3920 requested.
3921 Remove the yylexp argument and hard-code yylex invocation instead.
3922 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
3923 %push-parser.
3924 * src/getargs.c (pull_parser): New global initialized to true.
3925 * getargs.h (pull_parser): extern it.
3926 * src/output.c (prepare): Insert pull_flag muscle.
3927 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
3928 (prologue_declaration): Set both push_parser and pull_parser = true for
3929 %push-pull-parser. Set push_parser = true and pull_parser = false for
3930 %push-parser.
3931 * src/scan-gram.l: Don't accept %push_parser as an alternative to
3932 %push-parser since there's no backward-compatibility concern here.
3933 Scan %push-pull-parser.
3934 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
3935 instead of %push-parser.
3936 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
3937 prototype it in the module that calls yyparse.
3938 * tests/input.at (Torturing the Scanner): Likewise.
3939 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
3940
3941 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
3942
3943 Update etc/bench.pl. Optimize push mode a little (the yyn change
3944 deserves most of the credit).
3945 * Makefile.am (SUBDIRS): Add etc subdirectory.
3946 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
3947 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
3948 yytoken, yyval, and yyloc declarations to...
3949 (yyparse or yypush_parse): ... here to improve performance. For
3950 yypush_parse invocations after the first, be sure to assign yyn its old
3951 value again.
3952 (yypstate_new): Don't bother initializing the yyresult field since the
3953 initial value isn't used.
3954 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
3955 remove the #define that, in push mode, set it to yyps->NAME.
3956 * etc/Makefile.am: New.
3957 * etc/bench.pl: Remove and build it instead from...
3958 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
3959 "tests/bison" from the build directory by default rather than just
3960 invoking "bison" from $PATH.
3961 (calc_grammar): Update push parser code: don't declare yylval globally,
3962 don't define yyparse_wrapper, and don't #define yyparse.
3963 (bench_grammar): Update to check all working combinations of yacc.c,
3964 push.c, impure, pure, pull, and push.
3965
3966 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
3967
3968 For push mode, add pull wrappers around yypush_parse.
3969 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
3970 (yypull_parse): New function wrapping yypush_parse.
3971 (yyparse): New #define wrapping yypull_parse.
3972 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
3973 is declared.
3974 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
3975 prototype yylex in the module that calls yyparse, and don't prototype
3976 yyparse there. Otherwise, the yyparse expansion won't compile.
3977 * tests/input.at (Torturing the Scanner): Likewise.
3978
3979 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
3980
3981 Enable push parsers to operate in impure mode. Thus, %push-parser no
3982 longer implies %pure-parser. The point of this change is to move
3983 towards being able to test the push parser code by running the entire
3984 test suite as if %push-parser had been declared.
3985 * data/push.c (yypush_parse): For impure mode, remove the
3986 yypushed_char, yypushed_val, and yypushed_loc arguments.
3987 Instead, declare these as local variables initialized to the global
3988 yychar, yylval, and yylloc.
3989 For the first yypush_parse invocation only, restore the initial values
3990 of these global variables when it's time to read a token since they
3991 have been overwritten.
3992 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
3993 %push-parser.
3994 * tests/calc.at (Simple LALR(1) Calculator): Always declare
3995 %pure-parser along with %push-parser since this test case was designed
3996 for pure push parsers.
3997 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
3998 (AT_YACC_OR_PUSH_IF): New.
3999 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
4000 add a note that it's still wrong for some cases (as it has been for a
4001 while).
4002 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
4003 %push-parser no longer implies %pure-parser.
4004
4005 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4006
4007 Remove some unnecessary differences between the pull parser code and
4008 the push parser code. This patch enables yynerrs in push mode.
4009 * data/push.c: Reformat M4 a little.
4010 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
4011 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
4012 because push mode is on. Instead, if pure mode is on, move yynerrs
4013 to...
4014 (b4_declare_parser_state_variables): ... here.
4015 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
4016 to yyps->NAME so it can be used in yypush_parse.
4017 (yypush_parse): Don't omit uses of yynerrs in push mode.
4018
4019 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4020
4021 Fix bug such that the first pushed token's value and location are
4022 sometimes overwritten (sometimes by %initial-action) before being used.
4023 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
4024 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
4025 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
4026 more closely mimic the pull parser logic.
4027 Don't copy the pushed token to yychar, yylval, and yylloc until it's
4028 time to read a token, which is after any initialization of yylval and
4029 yylloc.
4030 (gottoken): Rename label to...
4031 (yyread_pushed_token): ... for clarity and to avoid infringing on the
4032 user namespace.
4033
4034 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4035
4036 Rearrange initialization of the parser state variables so that the
4037 skeleton doesn't have to have a copy for pull mode and another for push
4038 mode. This patch also fixes at least a bug such that yylloc was not
4039 initialized (with b4_location_initial_line and
4040 b4_location_initial_column) upon calling yypush_parse. However, that
4041 initialization now overwrites the first token's location;
4042 %initial-action assigning @$ already did the same thing, and both bugs
4043 will be fixed in a later patch.
4044 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
4045 (b4_declare_parser_state_variables): Remove initialization of yytoken,
4046 yyss, yyvs, yyls, and yystacksize.
4047 (yypstate_new): Remove initialization of some yypstate fields: yystate,
4048 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
4049 yylsp.
4050 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
4051 yyps->NAME so it can be used in yypush_parse.
4052 (yyparse or yypush_parse): For yypush_parse, don't print the
4053 "Starting parse" diagnostic for invocations after the first.
4054 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
4055 yypush_parse, only do it for the first invocation.
4056 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
4057 initialization to occur in yypush_parse but only on the first
4058 invocation.
4059
4060 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4061
4062 * data/push.c: Add CPP guards around push parser declarations in both
4063 the header and the code file.
4064 In the code file, move the push parser declarations to the same place
4065 they appear in the header file.
4066 Clean up the M4 some, especially the inconsistent underquoting in
4067 some b4_c_function_def and b4_c_function_decl uses.
4068
4069 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4070
4071 Encapsulate the push parser state variables into an M4 macro so the
4072 push skeleton doesn't have to list them again for pull mode's yyparse.
4073 For push mode, remove yypush_parse's local equivalents of these
4074 variables to eliminate unnecessary copying between the two sets at
4075 run-time. This patch also fixes at least a bug related to multiple
4076 %initial-action invocations in push mode.
4077 * data/push.c (b4_declare_parser_variables): Rename to...
4078 (b4_declare_scanner_communication_variables): ... this for clarity and
4079 update both uses.
4080 (b4_declare_yyparse_variables): Remove and move its contents to the one
4081 spot where it was invoked.
4082 (b4_declare_parser_state_variables): New macro containing the parser
4083 state variables required by push mode.
4084 (struct yypstate): Replace all fields but yynew with
4085 b4_declare_parser_state_variables.
4086 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
4087 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
4088 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
4089 (yyparse or yypush_parse): For yyparse in pull mode, replace local
4090 parser state variable declarations with
4091 b4_declare_parser_state_variables.
4092 Don't initialize parser state variables when calling yypush_parse since
4093 yypstate_new already does that.
4094 Invoke the user's initial action only upon the first yypush_parse
4095 invocation.
4096 Remove all code that copies between the local parser state variables
4097 and the yypstate.
4098
4099 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4100
4101 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
4102 prevent a name collision in a future patch where these names will
4103 sometimes be #define'd.
4104 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
4105 since it no longer has the same name as the existing argument.
4106 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
4107
4108 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
4109 and Joel E. Denny <jdenny@ces.clemson.edu>
4110
4111 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4112 that the argument is case-insensitive, and there's no `=' here.
4113 For the %skeleton entry, mention that %language is better.
4114 (Bison Options): Likewise for --language and --skeleton. Move the
4115 --skeleton entry so that the `Tuning the parser' section is sorted
4116 alphabetically on long options.
4117 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
4118 %language directive in detail here; cross-reference the %language
4119 documentation instead.
4120 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
4121 `%require "2.3b"' so that the example is always up-to-date.
4122 (Table of Symbols): Add entries for %language and %skeleton.
4123 * examples/extexi (normalize): Instead of replacing every %require
4124 argument with the current Bison version, just substitute for
4125 `@value{VERSION}'. This guarantees that we're testing what actually
4126 appears in the documentation.
4127 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
4128 rather than `@VERSION@'.
4129
4130 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4131
4132 * NEWS: Reword the %language news a bit, and put it earlier.
4133
4134 * src/getargs.c (skeleton_arg): Last arg is now location const *.
4135 Rewrite to simplify the logic.
4136 (language_argmatch): Likewise.
4137 (program_name): We now own this var.
4138 * src/getargs.h (struct bison_language): Use char[] rather than
4139 const char *.
4140
4141 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
4142 Java is supported.
4143 * src/complain.c (program_name): Remove decl; no longer needed.
4144 * src/main.c (program_name): Remove; now belongs to getargs.
4145
4146 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
4147
4148 * NEWS: Document %language.
4149
4150 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
4151
4152 * data/c-skel.m4, data/c++-skel.m4: New files.
4153 * data/glr.c: Complain on push parsers.
4154
4155 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
4156 over %skeleton.
4157 (Decl Summary): Document %language and %skeleton.
4158 (Command line): Document -L.
4159
4160 * examples/extexi: Rewrite %require directive.
4161 * examples/calc++/Makefile.am: Pass VERSION to extexi.
4162
4163 * src/files.c (compute_exts_from_gc): Look in language structure
4164 for .y extension.
4165 (compute_file_name_parts): Check whether .tab should be added.
4166 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
4167 (language, skeleton_arg, language_argmatch): New.
4168 (long_options): Add --language.
4169 (getargs): Use skeleton_arg, add -L/--language.
4170 * src/getargs.h: Include location.h.
4171 (struct bison_language, language, skeleton_arg, language_argmatch): New.
4172 * src/output.c (prepare): Pick default skeleton from struct language.
4173 Don't dispatch C skeletons here.
4174 * src/parse-gram.y (PERCENT_LANGUAGE): New.
4175 (prologue_declaration): Add "%language" rule, use skeleton_arg.
4176 * src/scan-gram.l ("%language"): New rule.
4177
4178 * tests/calc.at: Test %skeleton and %language.
4179 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
4180 (AT_GLR_IF): Look for %skeleton "glr.cc".
4181 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
4182 (AT_YACC_IF): Reject %language.
4183
4184 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4185
4186 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
4187 since it wasn't used; only the typedef name 'semantic_type' is needed.
4188 Also, omit trailing white space.
4189
4190 * bootstrap: Sync from coreutils.
4191 (gnulib_extra_files): Add build-aux/announce.gen.
4192 (slurp): Adjust .gitignore files like .cvsignore files.
4193 * build-aux/announce-gen: Remove from CVS, since bootstrap
4194 now creates this.
4195
4196 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
4197
4198 Make %push-parser imply %pure-parser. This fixes several bugs; see
4199 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
4200 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
4201 pure_parser = true.
4202 * data/push.c: Don't bother testing b4_push_if when deciding whether
4203 to expand b4_declare_parser_variables globally.
4204 (yypush_parse): Likewise in here.
4205
4206 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
4207 (yy_reduce_print): Reformat M4 for readability.
4208
4209 2006-12-15 Bob Rossi <bob@brasko.net>
4210 and Joel Denny <jdenny@ces.clemson.edu>
4211
4212 * data/push.c (yypstate): Add typedef, and update all uses of
4213 struct yypstate to just yypstate.
4214 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
4215
4216 2006-12-14 Bob Rossi <bob@brasko.net>
4217
4218 * data/push.c (yypush_parse): Declare prototype regardless of
4219 %locations option.
4220
4221 2006-12-14 Bob Rossi <bob@brasko.net>
4222
4223 * data/push.c (yyparse): Remove the prototype and the #define when in
4224 push-parser mode.
4225
4226 2006-12-13 Bob Rossi <bob@brasko.net>
4227
4228 * data/push.c (yypstate_init): Rename to...
4229 (yypstate_new): ... this and use b4_c_function_def.
4230 (yypstate_delete): New.
4231 (yypush_parse): Change parameters yynval and yynlloc to be const.
4232 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
4233 yypstate_delete functions.
4234
4235 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
4236
4237 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
4238 strange test case titles. Reported by Bob Rossi.
4239
4240 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
4241
4242 * TODO: Add pointer to Sylvain Schmitz's work on static detection
4243 of potential ambiguities in GLR grammers.
4244
4245 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
4246
4247 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
4248 `bison ', use m4_index instead of m4_substr since chopping up a string
4249 containing M4-special characters causes problems here.
4250
4251 Fix a couple of bugs related to special characters in user-specified
4252 file names, and make it easier for skeletons to compute output file
4253 names with the same file name prefix as Bison-computed output file
4254 names.
4255 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
4256 b4_parser_file_name and b4_spec_defines_file instead of
4257 @output_parser_name@ and @output_header_name@, which are now redundant.
4258 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
4259 b4_parser_file_name, b4_spec_defines_file, and the new
4260 @basename(FILENAME@) instead of @output_parser_name@ and
4261 @output_header_name@, which inappropriately escaped the file names as
4262 C string literals.
4263 * src/files.c (all_but_ext): Remove static qualifier.
4264 (compute_output_file_names): Move `free (all_but_ext)' to...
4265 (output_file_names_free): ... here since all_but_ext is needed later.
4266 * src/files.h (all_but_ext): Extern.
4267 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
4268 exactly what MUSCLE_INSERT_STRING used to do.
4269 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
4270 characters are escaped properly.
4271 * src/output.c (prepare): Define muscle file_name_all_but_ext as
4272 all_but_ext.
4273 For pkgdatadir muscle, maintain previous functionality by using
4274 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
4275 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
4276 digraphs would never be expanded. Hopefully no one has M4-special
4277 characters in his Bison installation path.
4278 * src/scan-skel.l: Don't parse @output_header_name@ and
4279 @output_parser_name@ anymore since they're now redundant.
4280 In @output, use decode_at_digraphs.
4281 Parse a new @basename command that invokes last_component.
4282 (decode_at_digraphs): New.
4283 (BASE_QPUTS): Remove unused.
4284 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
4285 (Output file name): New tests.
4286
4287 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
4288
4289 Warn about output files that are generated by the skeletons and that
4290 conflict with other output files.
4291 * data/glr.c: Don't generate the header file here when glr.cc does.
4292 * src/files.c (file_names, file_names_count): New static globals.
4293 (compute_output_file_names): Invoke output_file_name_check for files
4294 not generated by the skeletons and remove existing checks.
4295 (output_file_name_check): New function that warns about conflicting
4296 output file names.
4297 (output_file_names_free): Free file_names.
4298 * src/files.h (output_file_name_check): Declare.
4299 * src/scan-skel.l: Invoke output_file_name_check for files generated by
4300 the skeletons.
4301 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
4302 (Conflicting output files): New tests.
4303
4304 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4305
4306 * doc/bison.texinfo: Fix a couple of typos.
4307
4308 2006-12-08 Bob Rossi <bob@brasko.net>
4309
4310 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
4311 Rename to...
4312 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
4313 update all uses.
4314 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
4315 (yypush_parse): Rename yypvars argument to yyps and remove redundant
4316 local pv.
4317 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
4318 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
4319
4320 2006-12-07 Bob Rossi <bob@brasko.net>
4321 and Joel Denny <jdenny@ces.clemson.edu>
4322
4323 * data/push.c (yypvarsinit): Change return type from void* to struct
4324 yypvars*. No longer cast to void* on return.
4325 (struct yypvars): Remove yylen since it need not be remembered between
4326 yypushparse invocations.
4327 (yypushparse): Don't copy between yylen and pv->yylen.
4328
4329 2006-12-05 Bob Rossi <bob@brasko.net>
4330
4331 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
4332 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
4333 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
4334 (struct yypvars): Remove b4_declare_parser_variables.
4335 (yypvarsinit): Remove init code for removed variables.
4336 (global scope): Do not declare b4_declare_parser_variables if
4337 push or pure mode.
4338 (yypushparse): Add b4_declare_parser_variables.
4339 Init new local variables, and remove init code for removed
4340 yypvars variables.
4341 (yyparse): Delete.
4342 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
4343 and yyparse for other modes.
4344 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
4345 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
4346 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
4347 (AT_PURE_LEX_IF): True if pure or push parser.
4348
4349 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
4350
4351 Document Yacc prologue alternatives and default %destructor's and
4352 %printer's as experimental. Don't mention Java yet. Discussed at
4353 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
4354 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
4355 (2.3a): Annotate this entry to say the old forms of these features were
4356 also experimental.
4357 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
4358 Table of Symbols): Say they're experimental. Comment out any mention
4359 of Java (we'll want this back eventually).
4360
4361 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4362
4363 Support a file name argument to %defines. Deprecate `=' in
4364 %file-prefix, %name-prefix, and %output. Discussed at
4365 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
4366 * NEWS (2.3a+): Mention.
4367 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
4368 form of %defines, and remove `=' from entries for %file-prefix,
4369 %name-prefix, and %output.
4370 * src/parse-gram.y (prologue_declaration): Implement.
4371 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
4372 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
4373 all but one occurrence of %name-prefix.
4374 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
4375 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
4376 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
4377 occurrence of each of %file-prefix and %output. Add check for %defines
4378 with argument.
4379 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
4380 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
4381 Remove the `=' from %output.
4382
4383 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
4384
4385 Don't escape $ in test case titles since Autoconf 2.61 now does that
4386 correctly.
4387 * tests/actions.at (Default %printer and %destructor are not for error
4388 or $undefined): Here.
4389 (Default %printer and %destructor are not for $accept): Here.
4390 * tests/input.at (Invalid $n and @n): Here.
4391
4392 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
4393
4394 Rename <!> to <>. Discussed starting at
4395 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
4396 * NEWS (2.3a+): Update.
4397 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
4398 Update.
4399 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
4400 * src/scan-gram.l (INITIAL): Implement.
4401 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
4402 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
4403 comment.
4404 * tests/actions.at (Default tagless %printer and %destructor,
4405 Default tagged and per-type %printer and %destructor,
4406 Default %printer and %destructor are not for error or $undefined,
4407 Default %printer and %destructor are not for $accept,
4408 Default %printer and %destructor for mid-rule values): Update.
4409 * tests/input.at (Default %printer and %destructor redeclared,
4410 Unused values with default %destructor): Update.
4411
4412 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
4413
4414 Don't let %prec take a nonterminal.
4415 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
4416 token.
4417 * tests/input.at (%prec takes a token): New test checking that %prec
4418 won't take a nonterminal.
4419
4420 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4421
4422 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
4423 it was double-quoted.
4424 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
4425 grammar is maintained with Bison's highest standards.
4426 * src/getargs.c: Fix some typos in Doxygen comments.
4427
4428 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4429
4430 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
4431 later. Reported by Paul Eggert in
4432 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
4433 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
4434 * src/scan-code.l (translate_action): Don't bother invoking
4435 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
4436 (code_scanner_free): Instead of invoking
4437 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
4438 which frees more.
4439 * src/scan-gram.l (gram_scanner_free): Likewise.
4440 * src/scan-skel.l (scan_skel): Likewise.
4441
4442 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4443
4444 * src/files.c (tr): Change return type to void.
4445 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
4446 has been called previously for the same key.
4447 (muscle_find): Return storage instead of value so that
4448 --enable-gcc-warnings doesn't produce warnings that the return discards
4449 const. aver that the value and storage are the same since storage
4450 could potentially be NULL when value is not.
4451 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
4452 same as 0.
4453
4454 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4455
4456 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
4457 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
4458 us a slightly cleaner distribution, and also works.
4459 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
4460 gnulib changes.
4461
4462 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
4463 and Paul Eggert <eggert@cs.ucla.edu>
4464
4465 Don't let Bison leak memory except when it complains.
4466 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
4467 (spec_defines_file, dir_prefix): Now char *, not const char *,
4468 since they are freed.
4469 * src/files.c: Likewise.
4470 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
4471 Likewise.
4472 (tr): Now operates in-place. All uses changed.
4473 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
4474 values.
4475 (compute_file_name_parts, compute_output_file_names): Don't store
4476 read-only data in variables that will be freed.
4477 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
4478 src_extension, and header_extension.
4479 (output_file_names_free): New public function to free
4480 spec_verbose_file, spec_graph_file, spec_defines_file,
4481 parser_file_name, and dir_prefix.
4482 * src/getargs.c (getargs): Don't store read-only data in variables that
4483 will be freed.
4484 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
4485 (which previously existed but was unused), and quotearg_free.
4486 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
4487 * src/muscle_tab.c: Likewise.
4488 (muscle_entry): Make the value char const *,
4489 and add a new storage member that is char * and can be freed.
4490 (muscle_entry_free): New private function.
4491 (muscle_init): Use it instead of free.
4492 (muscle_insert, muscle_grow): Update and use new storage member.
4493 (muscle_code_grow): Free the string passed to muscle_grow
4494 since it's not needed anymore.
4495 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
4496 add a new `char *code' member.
4497 ("{...}"): Declare semantic type as code.
4498 * src/scan-code.h (translate_rule_action):
4499 (translate_symbol_action, translate_code, translate_action): Return
4500 `char const *' rather than `char *' since external code should not free
4501 these strings.
4502 * src/scan-code.l: Likewise.
4503 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
4504 which is "{...}" in the parser.
4505 * tests/Makefile.am (maintainer-check-valgrind): Set
4506 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
4507 Valgrind.
4508 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
4509 complain.
4510 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
4511 expecting a non-zero exit status sets --leak-check=summary and
4512 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
4513 this case, and we don't want to hear about it.
4514
4515 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4516
4517 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
4518 instead of from the template, to simplify configuration a bit.
4519 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
4520 and m4/wint_t.m4, as they are needed with the latest gnulib.
4521
4522 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4523
4524 Disable unset/unused mid-rule value warnings by default, and recognize
4525 --warnings=midrule-values to enable them. Discussed starting at
4526 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
4527 * NEWS (2.3a+): Mention.
4528 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
4529 warnings): Add entry for midrule-values subargument.
4530 * src/reader.c (symbol_should_be_used): Don't return true just because
4531 the value is a set/used mid-rule value unless
4532 --warnings=midrule-values was specified.
4533 * tests/input.at (Unused values, Unused values before symbol
4534 declarations): Run tests with and without --warnings=midrule-values.
4535
4536 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
4537 than LIST_FREE directly.
4538
4539 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4540
4541 Finish implementing --warnings=error, which should not be implied by
4542 --warnings=all (or by its synonyms -W and --warnings without
4543 subarguments).
4544 * src/complain.c (set_warning_issued): New function to report that
4545 warnings are being treated as errors and to record an error if so.
4546 Invoke...
4547 (warn_at, warn): ... here.
4548 * src/getargs.c (warnings_args, warnings_types): Reorder so that
4549 "error - warnings are errors" does not appear above "all - all of the
4550 above".
4551 (getargs): For -W and --warnings without subarguments, don't let
4552 FLAGS_ARGMATCH set warnings_error in warnings_flag.
4553 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
4554
4555 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4556
4557 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
4558 empty subargument list. For example: `bison --warnings= parser.y'.
4559
4560 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4561
4562 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
4563 the parser header file so that gcc doesn't warn.
4564
4565 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4566
4567 Split the default %destructor/%printer into two kinds: <*> and <!>.
4568 Discussed starting at
4569 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
4570 * NEWS (2.3a+): Mention.
4571 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
4572 previous change today related to mid-rules.
4573 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
4574 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
4575 (TYPE_TAG_ANY): Add as <*>.
4576 (TYPE_TAG_NONE): Add as <!>.
4577 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
4578 for <*> and <!>.
4579 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
4580 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
4581 * src/symlist.c (symbol_list_default_new): Split into tagged and
4582 tagless versions.
4583 (symbol_list_destructor_set, symbol_list_printer_set): Split
4584 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
4585 SYMLIST_DEFAULT_TAGLESS.
4586 * src/symlist.h: Update symbol_list_default*_new prototypes.
4587 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
4588 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
4589 * src/symtab.c (default_destructor, default_destructor_location,
4590 default_printer, default_printer_location): Split each into tagged and
4591 tagless versions.
4592 (symbol_destructor_get, symbol_destructor_location_get,
4593 symbol_printer_get, symbol_printer_location_get): Implement tagged
4594 default and tagless default cases.
4595 (default_destructor_set, default_printer_set): Split each into tagged
4596 and tagless versions.
4597 * src/symtab.h: Update prototypes.
4598 * tests/actions.at (Default %printer and %destructor): Rename to...
4599 (Default tagless %printer and %destructor): ... this, and extend.
4600 (Per-type %printer and %destructor): Rename to...
4601 (Default tagged and per-type %printer and %destructor): ... this, and
4602 extend.
4603 (Default %printer and %destructor for user-defined end token): Extend.
4604 (Default %printer and %destructor are not for error or $undefined):
4605 Update.
4606 (Default %printer and %destructor are not for $accept): Update.
4607 (Default %printer and %destructor for mid-rule values): Extend.
4608 * tests/input.at (Default %printer and %destructor redeclared): Extend.
4609 (Unused values with default %destructor): Extend.
4610
4611 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4612
4613 Don't apply the default %destructor/%printer to an unreferenced midrule
4614 value. Mentioned at
4615 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
4616 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
4617 like $@n instead of just @n so that the default %destructor/%printer
4618 logic doesn't see them as user-defined symbols.
4619 (symbol_is_dummy): Check for both forms of the name.
4620 * src/reader.c (packgram): Remove the `$' from each midrule symbol
4621 name for which the midrule value is referenced in any action.
4622 * tests/actions.at (Default %printer and %destructor for mid-rule
4623 values): New test.
4624 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
4625 for change to dummy symbol names.
4626
4627 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4628
4629 Warn about unset midrule $$ if the corresponding $n is used.
4630 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
4631 $n usage.
4632 (packgram): Before invoking grammar_rule_check on any rule, make sure
4633 all actions have already been scanned in order to set `used' flags.
4634 Otherwise, checking that a midrule's $$ is set will not always work
4635 properly because the midrule check must forward-reference the midrule's
4636 parent rule.
4637 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
4638 warning.
4639
4640 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4641
4642 More improvements to the documentation of the prologue alternatives:
4643 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
4644 Bison manual.
4645 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
4646 some text to clarify the relative importance of the new directives and
4647 to show how these directives may be viewed as code labels.
4648
4649 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
4650
4651 Similar to the recently removed %before-header, add %code-top as the
4652 alternative to the pre-prologue. Mentioned at
4653 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
4654 Also, let the prologue alternatives appear in the grammar section.
4655 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
4656 (prologue_declaration): Move the existing prologue alternatives to...
4657 (grammar_declaration): ... here and add %code-top.
4658 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
4659
4660 Clean up and extend documentation for the prologue alternatives.
4661 * NEWS (2.3a+): Describe prologue alternatives.
4662 * doc/bison.texinfo (Prologue): Move discussion of prologue
4663 alternatives to...
4664 (Prologue Alternatives): ... this new section, and extend it to discuss
4665 all 4 directives in detail.
4666 (Table of Symbols): Clean up discussion of prologue alternatives and
4667 add %code-top.
4668
4669 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4670
4671 DJGPP specific issues.
4672
4673 * djgpp/config.bat: config.hin has been moved to lib. Adjust
4674 config.bat accordingly.
4675 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
4676 * djgpp/config.site: Likewise.
4677
4678 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
4679
4680 Replace %*-header with %provides, %requires, %code. See discussion at
4681 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
4682
4683 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
4684 (b4_user_start_header): Remove.
4685 * data/glr.c: Use new macros instead of b4_*start_header
4686 and b4_*end_header.
4687 * data/glr.cc: Likewise.
4688 * data/lalr1.cc: Likewise.
4689 * data/push.c: Likewise.
4690 * data/yacc.c: Likewise.
4691
4692 * doc/bison.texinfo: Remove %before-header, rename
4693 %{start,end,after}-header to %requires, %provides, %code.
4694
4695 * src/parse-gram.y: Likewise (also rename token names accordingly).
4696 * src/scan-gram.l: Likewise.
4697 * tests/actions.at: Likewise.
4698
4699 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
4700
4701 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
4702 Problem reported by Joel E. Denny.
4703
4704 2006-10-14 Jim Meyering <jim@meyering.net>
4705
4706 (Sync from coreutils.)
4707 Work also when the working directory (with e.g. coreutils sources)
4708 is version controlled with git, rather than CVS.
4709 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
4710 rather than CVS.
4711 In messages and comments, say e.g., "checked-out sources",
4712 rather than "CVS sources".
4713 (version_controlled_file): New function. Work for git as well as
4714 for CVS. Don't use grep's -q option.
4715 (slurp): Call it here, in place of CVS-specific code.
4716
4717 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
4718
4719 Fix testsuite for ./configure --enable-gcc-warnings:
4720 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
4721 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
4722 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
4723 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
4724 * test/regression.at (Diagnostic that expects two alternatives):
4725 Likewise.
4726
4727 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4728
4729 * bootstrap.conf (gnulib_modules): Add config-h.
4730 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
4731 worry about HAVE_CONFIG_H.
4732 * lib/abitset.c: Likewise.
4733 * lib/bitset.c: Likewise.
4734 * lib/bitset_stats.c: Likewise.
4735 * lib/bitsetv-print.c: Likewise.
4736 * lib/bitsetv.c: Likewise.
4737 * lib/ebitset.c: Likewise.
4738 * lib/get-errno.c: Likewise.
4739 * lib/lbitset.c: Likewise.
4740 * lib/subpipe.c: Likewise.
4741 * lib/timevar.c: Likewise.
4742 * lib/vbitset.c: Likewise.
4743 * lib/bitset.c: Include "bitset.h" first, to test interface.
4744 * lib/bitset_stats.c: Include "bitset_stats.h" first.
4745 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
4746 * lib/bitsetv.c: Include "bitsetv.h" first.
4747 * lib/get-errno.c: Include "get-errno.h" first.
4748 * m4/.cvsignore: Add config-h.m4.
4749 * tests/actions.at (Default %printer and %destructor for ...):
4750 Adjust expected line numbers in output to reflect removal of #if
4751 HAVE_CONFIG_H lines.
4752 * tests/glr-regression.at (Missed %merge type warnings when ...):
4753 Likewise.
4754 * tests/regression.at (Braced code in declaration in rules section):
4755 Likewise.
4756 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
4757 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
4758 Include <config.h> unconditionally.
4759
4760 * bootstrap: Sync from coreutils, as follows:
4761
4762 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4763
4764 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
4765 variable was sometimes used without being initialized. This
4766 messed up the installation of the INSTALL file in some cases.
4767
4768 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4769
4770 * bootstrap (usage, main program, symlink_to_gnulib): Add option
4771 --copy. Inspired by a suggestion from Bruno Haible.
4772
4773 2006-10-03 Jim Meyering <jim@meyering.net>
4774
4775 * bootstrap: Undo last change to this file, since now gnulib-tool
4776 sticks with the automake default in generating dependencies.
4777
4778 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4779
4780 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
4781 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
4782
4783 * doc/bison.1: Add copyright notice.
4784
4785 * data/glr.c: Don't include <stdarg.h>; not used.
4786
4787 * NEWS: The -g and --graph options now output graphs in Graphviz
4788 DOT format, not VCG format.
4789 * doc/bison.1: Likewise.
4790 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
4791 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
4792 of this change in
4793 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
4794 * TODO: Remove Graphviz entry.
4795 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
4796 remove vcg.c, vcg.h, vcg_defaults.h.
4797 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
4798 * src/graphviz.c, src/graphviz.h: New files.
4799 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
4800 * src/files.h: Make comment more generic.
4801 * src/main.c (main): Likewise.
4802 * src/print_graph.h: Likewise.
4803 * src/getargs.c (usage): Make usage description more generic.
4804 * src/print_graph.c: Include graphviz.h rather than vcg.h.
4805 (static_graph, fgraph): Remove. All uses changed to pass
4806 arguments instead of sharing a static var.
4807 (print_core, print_actions, print_state, print_graph):
4808 Output graphviz format rather than VCG format.
4809 * tests/.cvsignore: Remove *.vcg; add *.dot.
4810 * tests/output.at: Expect *.dot files, not *.vcg files.
4811
4812 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
4813 accommodates the 2006-10-08 change.
4814
4815 2006-10-11 Bob Rossi <bob@brasko.net>
4816
4817 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
4818 (b4_yyssa, b4_yyerror_range): New macros.
4819 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
4820 (yypvarsinit): Remove init of removed fields.
4821 (yypushparse): Remove use of removed fields; use new macros instead.
4822
4823 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4824
4825 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
4826 in a push parser. Reindent slightly to match yacc.c better.
4827
4828 2006-10-11 Bob Rossi <bob@brasko.net>
4829
4830 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
4831 yymsg_alloc fields.
4832 (yypvarsinit, yypushparse): Remove init of removed fields.
4833 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
4834
4835 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4836
4837 * THANKS: Add Paolo Bonzini and Bob Rossi.
4838
4839 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
4840
4841 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
4842 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
4843 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
4844 b4_define_user_cde and uses): Remove.
4845 (b4_comment, b4_prefix, b4_sync_start): New.
4846 * data/bison.m4: New file, with most of the content removed from c.m4.
4847 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
4848 * src/output.c (output_skeleton): Pass bison.m4.
4849 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
4850 only if specified.
4851
4852 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
4853
4854 Fix test failure reported by Tom Lane in
4855 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
4856 and try to make such failures easier to catch in the future.
4857 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
4858 that's now the caller's responsibility.
4859 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
4860 Set yychar = YYEOF if it's negative.
4861 * tests/actions.at (yylex): Abort if asked to read past EOF.
4862 * tests/conflicts.at (yylex): Likewise.
4863 * tests/cxx-type.at (yylex): Likewise.
4864 * tests/glr-regression.at (yylex): Likewise.
4865 * tests/input.at (yylex): Likewise.
4866 * tests/regression.at (yylex): Likewise.
4867 * tests/torture.at (yylex): Likewise.
4868
4869 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
4870
4871 Fix problems with translating English-language diagnostics.
4872 * bootstrap: Fix bug introduced in recent bootstrap changes, with
4873 respect to bison-runtime pot generation. The YY_ stuff
4874 wasn't being captured.
4875 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
4876 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
4877 * runtime-po/POTFILES.in: Add data/push.c.
4878
4879 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
4880
4881 Merge bootstrap changes from coreutils.
4882
4883 2006-09-28 Jim Meyering <jim@meyering.net>
4884
4885 Automatically generated dependencies are important even
4886 when all of the sources in a directory come from gnulib.
4887 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
4888 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
4889
4890 2006-09-23 Jim Meyering <jim@meyering.net>
4891
4892 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
4893
4894 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4895
4896 * bootstrap: Add support for --force.
4897 (usage): New function. Describe usage less tersely.
4898 (CVS_only_file): New var.
4899
4900 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
4901
4902 * data/push.c (YYPUSH_MORE): Make it an enum instead.
4903 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
4904 Adjust white space and comments to match GNU style better.
4905
4906 2006-09-20 Bob Rossi <bob@brasko.net>
4907
4908 * data/push.c (yyresult_get): Remove function.
4909 (YYPUSH_MORE): Add #define.
4910 (yypushparse): Modify return value.
4911
4912 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4913
4914 * stamp-h.in: Remove; no longer needed.
4915 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
4916 Remove config.h, config.hin, intl (no longer created).
4917 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
4918 stamp-h1.
4919
4920 Sync bootstrap from coreutils, as follows:
4921
4922 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
4923
4924 * bootstrap (symlink_to_gnulib): New function.
4925 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
4926 to copies-of-gnulib.
4927 (cp_mark_as_generated, slurp, gnulib_files):
4928 Avoid making a copy if it's the same as the old version.
4929 (gnulib_files): Add support for this variable (used by Bison).
4930
4931 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4932
4933 * src/getargs.c (usage): Rework to use conventions similar to
4934 coreutils, to make translation a bit easier and the code a bit
4935 smaller. Problem reported by Tim Van Holder.
4936
4937 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
4938
4939 Use some of gnulib's new modules, taken from coreutils.
4940
4941 * bootstrap: Sync from coreutils, except add support for gnulib_files.
4942 * bootstrap.conf: New file.
4943 (gnulib_modules): Add configmake, inttypes, unistd.
4944 (XGETTEXT_OPTIONS): Add complain, complain_at,
4945 fatal, fatal_at, warn, warn_at, unexpected_end.
4946 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
4947 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
4948 (gl_EARLY): Add.
4949 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
4950 (gl_INIT): Add
4951 (GNULIB_AUTOCONF_SNIPPET): Remove.
4952 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
4953 the pickiest.
4954 * lib/.cvsignore: Add inttypes_.h.
4955 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
4956 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
4957 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
4958 no-longer-necessary initializations.
4959 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
4960 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
4961 use the unistd module.
4962 * src/system.h: Likewise.
4963 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
4964 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
4965 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
4966 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
4967 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
4968 * src/system.h: Include inttypes.h unconditionally, now that we
4969 use the inttypes module. Don't bother to include stdint.h, since
4970 inttypes.h now does that for us.
4971 (LOCALEDIR): Remove, now that we use the configmake module.
4972 * src/getargs.c: Include configmake.h.
4973 * src/main.c: Likewise.
4974 * src/output.c: Likewise.
4975 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
4976 not from $abs_top_builddir, since config.h moved.
4977
4978
4979 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
4980 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
4981
4982 * src/parse-gram.y (symbol_declaration): Don't put statements
4983 before declarations; it's not portable to C89.
4984 * src/scan-code.l (handle_action_at): Likewise.
4985
4986 * src/scan-code.l: Always initialize braces_level; the old code
4987 left it uninitialized and therefore had undefined behavior.
4988
4989 Don't attempt to redefine 'assert', since it runs afoul of
4990 systems where standard headers (mistakenly) include <assert.h>.
4991 Instead, define and use our own alternative, called 'aver'.
4992 * src/reader.c: Don't include assert.h, since we no longer
4993 use assert.
4994 * src/scan-code.l: Likewise.
4995 * src/system.h (assert): Remove, replacing with....
4996 (aver): New function, taking a bool arg. All uses changed.
4997 * src/tables.c (pack_vector): Ensure that aver arg is bool,
4998 not merely an integer.
4999
5000 2006-09-15 Bob Rossi <bob@brasko.net>
5001
5002 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
5003 * data/c.m4 (YYPUSH): New.
5004 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
5005 * src/getargs.c (push_parser): New var.
5006 * src/getargs.h (push_parser): New declaration.
5007 * src/output.c (prepare): Add macro insertion of `push_flag'.
5008 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
5009 (prologue_declaration): Parse %push-parser.
5010 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
5011 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
5012 list of removed lines from the traces observed.
5013 (AT_CHECK_CALC_LALR): Added push parser tests.
5014
5015 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
5016
5017 * NEWS: Version 2.3a.
5018 * configure.ac (AC_INIT): Likewise.
5019
5020 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
5021 "#define YYSTYPE int" that caused "make maintainer-check" to fail
5022 due to header ordering dependencies. I don't know why the #define
5023 was there.
5024
5025 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
5026 runtime cost when YYDEBUG is not defined, and so that some tests
5027 that used to fail now work. Problem and initial suggestion by
5028 Paolo Bonzini.
5029 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
5030 * data/glr.cc (b4_parser_class_name):
5031 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
5032 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
5033 (yydebug_) [YYDEBUG]: New member.
5034 (yycdebug_): Now defined only if YYDEBUG.
5035 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
5036 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
5037 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
5038 if YYYDEBUG.
5039 (debug_stream, set_debug_stream, debug_level, set_debug_level):
5040 Define only if YYDEBUG.
5041 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
5042 set_debug_level.
5043 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
5044 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
5045 AT_CHECK_CALC_GLR_CC that are working now.
5046
5047 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
5048
5049 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
5050 We don't need them in glr.cc, and glr.c defines them.
5051 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
5052 assumes that defining it to anything is the same as defining
5053 it to 1. Problem reported by Paolo Bonzini.
5054
5055 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
5056
5057 * data/c.m4 (b4_null, b4_case): Define.
5058 * src/output.c (prepare_symbols): Use b4_null.
5059 (user_actions_output): Use b4_case.
5060
5061 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
5062
5063 * data/glr.c (b4_shared_declarations): Put start-header first,
5064 before any #includes that we generate, so that feature-test
5065 macros work. Problem reported by Michael Deutschmann in
5066 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
5067 * data/lalr1.cc: Likewise.
5068 * doc/bison.texinfo (Prologue): Document that feature-test macros
5069 should be defined before any Bison declarations.
5070 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
5071 that depend on location.hh after, not before, Bison decls, since
5072 we now include location.hh after the first user prologue.
5073
5074 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
5075 Sander Brandenburg in
5076 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
5077 Also, fix minor white space and comment issues.
5078 (Prologue): Mention that it's better to define feature-test macros
5079 before Bison declarations. Problem reported by Michael Deutschmann.
5080
5081 * README-cvs: Fix typo: "&" should be "&&". Problem reported
5082 by Jim Meyering.
5083 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
5084 This adjusts to recent gnulib changes.
5085
5086 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5087
5088 Finish implementation of per-type %destructor/%printer. Discussed
5089 starting at
5090 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
5091 and
5092 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
5093 * NEWS (2.3+): Add a description of this feature to the default
5094 %destructor/%printer description.
5095 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
5096 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5097 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
5098 list node contains a semantic type.
5099 * src/symtab.c, src/symtab.h: Extend with a table that associates
5100 semantic types with their %destructor's and %printer's.
5101 (semantic_type_from_uniqstr, semantic_type_get,
5102 semantic_type_destructor_set, semantic_type_printer_set): New functions
5103 composing the public interface of that table.
5104 (symbol_destructor_get, symbol_destructor_location_get,
5105 symbol_printer_get, symbol_printer_location_get): If there's no
5106 per-symbol %destructor/%printer, look up the per-type before trying
5107 the default.
5108 * tests/actions.at (Per-type %printer and %destructor): New test case.
5109 * tests/input.at (Default %printer and %destructor redeclared):
5110 Extend to check that multiple occurrences of %symbol-default in a
5111 single %destructor/%printer declaration is an error.
5112 (Per-type %printer and %destructor redeclared, Unused values with
5113 per-type %destructor): New test cases.
5114
5115 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5116
5117 Require default %destructor/%printer to be declared using
5118 %symbol-default instead of an empty symbol list, and start working on
5119 new per-type %destructor/%printer. Discussed at
5120 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
5121 * NEWS (2.3+): Add %symbol-default to example.
5122 * bison.texinfo (Freeing Discarded Symbols): Likewise.
5123 (Table of Symbols): Add entry for %symbol-default.
5124 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
5125 (generic_symlist, generic_symlist_item): New nonterminals for creating
5126 a list in which each item is a symbol, semantic type, or
5127 %symbol-default.
5128 (grammar_declaration): Use generic_symlist in %destructor and %printer
5129 declarations instead of symbols.1 or an empty list.
5130 (symbol_declaration, precedence_declaration, symbols.1): Update actions
5131 for changes to symbol_list.
5132 * src/reader.c: Update for changes to symbol_list.
5133 * src/scan-code.l: Likewise.
5134 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
5135 * src/symlist.c, src/symlist.h: Extend such that a list node may
5136 represent a semantic type or a %symbol-default in addition to just an
5137 ordinary symbol. Add switched functions for setting %destructor's and
5138 %printer's.
5139 * tests/actions.at, tests/input.at: Add %symbol-default to all default
5140 %destructor/%printer declarations.
5141
5142 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
5143
5144 Whether the default %destructor/%printer applies to a particular symbol
5145 isn't a question of whether the user *declares* that symbol (in %token,
5146 for example). It's a question of whether the user by any means
5147 *defines* the symbol at all (by simply using a char token, for
5148 example). $end is defined by Bison whereas any other token with token
5149 number 0 is defined by the user. The error token is always defined by
5150 Bison regardless of whether the user declares it with %token, but we
5151 may one day let the user define error as a nonterminal instead.
5152 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
5153 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
5154 the meaning of "user-defined".
5155 * tests/actions.at (Default %printer and %destructor for user-declared
5156 end token): Rename to...
5157 (Default %printer and %destructor for user-defined end token): ...
5158 this.
5159
5160 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
5161 computation of whether to apply the default, don't maintain a list of
5162 every Bison-defined symbol. Instead, just check for a first character
5163 of '$', which a user symbol cannot have, and check for the error token.
5164
5165 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
5166
5167 Don't apply the default %destructor or %printer to the error token,
5168 $undefined, or $accept. This change fits the general rule that the
5169 default %destructor and %printer are only for user-declared symbols,
5170 and it solves several difficulties that are described in the new test
5171 cases listed below.
5172 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
5173 * tests/actions.at (Default %printer and %destructor are not for error
5174 or $undefined, Default %printer and %destructor are not for $accept):
5175 New test cases.
5176
5177 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
5178
5179 Allow %start after the first rule.
5180 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
5181 when parsing the first rule.
5182 (check_and_convert_grammar): Search for it here after all grammar
5183 declarations have been parsed. Skip midrules, which have dummy LHS
5184 nonterminals.
5185 * src/symtab.c (symbol_is_dummy): New function.
5186 * src/symtab.h (symbol_is_dummy): Declare it.
5187 * tests/input.at (%start after first rule): New test.
5188
5189 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5190
5191 Redo some of the previous commit: add back the ability to use
5192 non-aliased/undeclared string literals since it might be useful to
5193 those declaring %token-table.
5194 * src/reader.c (check_and_convert_grammar): Undo changes in previous
5195 commit: don't worry about complaints from symbols_pack.
5196 * src/symtab.c (symbol_new, symbol_class_set,
5197 symbol_check_alias_consistency): Undo changes in previous commit: count
5198 each string literal as a new symbol and token, assign it a symbol
5199 number, and don't complain about non-aliased string literals.
5200 (symbols_pack): Since symbol_make_alias still does not decrement symbol
5201 and token counts but does still set aliased tokens to the same number,
5202 symbol_pack_processor now leaves empty slots in the symbols array.
5203 Remove those slots.
5204 * tests/regression.at (Undeclared string literal): Remove test case
5205 added in previous commit since non-aliased string literals are allowed
5206 again.
5207 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
5208 remove unnecessary string literal declarations.
5209 * tests/sets.at (Firsts): Likewise.
5210
5211 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5212
5213 Don't allow an undeclared string literal, but allow a string literal to
5214 be used before its declaration.
5215 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
5216 symbols_pack complained.
5217 * src/symtab.c (symbol_new): Don't count a string literal as a new
5218 symbol.
5219 (symbol_class_set): Don't count a string literal as a new token, and
5220 don't assign it a symbol number since symbol_make_alias does that.
5221 (symbol_make_alias): It's not necessary to decrement the symbol and
5222 token counts anymore. Don't assume that an alias declaration occurs
5223 before any uses of the identifier or string, and thus don't assert that
5224 one of them has the highest symbol number so far.
5225 (symbol_check_alias_consistency): Complain if there's a string literal
5226 that wasn't declared as an alias.
5227 (symbols_pack): Bail if symbol_check_alias_consistency failed since
5228 symbol_pack asserts that every token has been assigned a symbol number
5229 although undeclared string literals have not.
5230 * tests/regression.at (String alias declared after use, Undeclared
5231 string literal): New test cases.
5232 (Characters Escapes, Web2c Actions): Declare string literals as
5233 aliases.
5234 * tests/sets.at (Firsts): Likewise.
5235
5236 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
5237
5238 In the grammar scanner, STRING_FINISH unclosed constructs and return
5239 them to the parser in order to improve error messages.
5240 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
5241 SC_BRACED_CODE, SC_PROLOGUE): Implement.
5242 * tests/input.at (Unclosed constructs): New test case.
5243 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
5244 seen.
5245
5246 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
5247 unused global.
5248
5249 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
5250
5251 Handle string aliases for character tokens correctly.
5252 * src/symtab.c (symbol_user_token_number_set): If the token has an
5253 alias, check and set its alias's user token number instead of its own,
5254 which is set to indicate the alias. Previously, every occurrence of
5255 the character token in the grammar overwrote that alias indicator with
5256 the character code.
5257 * tests/input.at (String aliases for character tokens): New test.
5258
5259 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
5260
5261 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
5262
5263 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
5264
5265 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
5266 to prevent failures when building on older platforms.
5267 Check for autopoint failure.
5268 Set XGETTEXT_OPTIONS to values that check for C format strings,
5269 so that translators are warned about them (this also helps
5270 prevent core dumps).
5271
5272 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
5273 function, since it simplifies our code a bit.
5274
5275 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
5276 rather than -W, so we don't get bogus warnings about sign comparisons.
5277 Add -Wpointer-arith, since that warning is useful (it reports code
5278 that does not conform to C89 and that some compilers reject).
5279 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
5280 since it's no longer needed.
5281
5282 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
5283
5284 Clean up scanners a bit.
5285 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
5286 definitions so gcc won't warn when obstack_for_string is unused.
5287 * src/scan-code.l: config.h and system.h are already #include'd by
5288 scan-code-c.c, so get rid of them here.
5289 * src/scan-gram.l: Likewise.
5290 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
5291 definitions rather than duplicating the rest of it.
5292 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
5293
5294 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
5295
5296 Suppress signed/unsigned comparison warnings for yycheck.
5297 * data/c.m4 (b4_safest_int_type): New macro.
5298 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
5299 a signed int type, cast it to b4_safest_int_type first.
5300 * data/yacc.c: Likewise.
5301 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
5302 also overwritten.
5303
5304 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5305
5306 * doc/bison.texinfo: Fix some typos.
5307
5308 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
5309
5310 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
5311 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
5312
5313 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
5314 the latest gnulib does this a different way.
5315 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
5316 translation was patched, so stop omitting it.
5317
5318 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5319
5320 Enable declaration of default %printer/%destructor. Make the parser
5321 use these for all user-declared grammar symbols for which the user does
5322 not declare a specific %printer/%destructor. Thus, the parser uses it
5323 for token 0 if the user declares it but not if Bison generates it as
5324 $end. Discussed starting at
5325 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
5326 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
5327 and
5328 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
5329 * NEWS (2.3+): Mention.
5330 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
5331 declare a %destructor for a mid-rule's semantic value. It's just
5332 impossible to declare one specific to it.
5333 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
5334 code. Describe default %destructor form.
5335 * src/parse-gram.y (grammar_declaration): Parse default
5336 %printer/%destructor declarations.
5337 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
5338 and symbol_destructor_location_get rather than accessing the destructor
5339 and destructor_location members of struct symbol.
5340 (symbol_printers_output): Likewise but for %printer's.
5341 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
5342 again.
5343 * src/symtab.c (default_destructor, default_destructor_location,
5344 default_printer, default_printer_location): New static global
5345 variables to record the default %destructor and %printer.
5346 (symbol_destructor_get, symbol_destructor_location_get,
5347 symbol_printer_get, symbol_printer_location_get): New functions to
5348 compute the appropriate %destructor and %printer for a symbol.
5349 (default_destructor_set, default_printer_set): New functions to set the
5350 default %destructor and %printer.
5351 * src/symtab.h: Prototype all those new functions.
5352 * tests/actions.at (Default %printer and %destructor): New test to
5353 check that the right %printer and %destructor are called, that they're
5354 not called for $end, and that $$ and @$ work correctly.
5355 (Default %printer and %destructor for user-declared end token): New
5356 test to check that the default %printer and %destructor are called for
5357 a user-declared end token.
5358 * tests/input.at (Default %printer and %destructor redeclared, Unused
5359 values with default %destructor): New tests to check related grammar
5360 warnings and errors.
5361
5362 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5363
5364 Clean up handling of %destructor for the end token (token 0).
5365 Discussed starting at
5366 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
5367 and
5368 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
5369
5370 Make the skeletons consistent in how they pop the end token and invoke
5371 its %destructor.
5372 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
5373 state, which has token number 0, since this would invoke the
5374 %destructor for the end token.
5375 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
5376 until after shifting the end token, or else it won't be popped.
5377 * data/yacc.c (yyparse): Likewise.
5378
5379 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
5380 it's the end token. Upon termination, destroy an unshifted lookahead
5381 even when it's the end token.
5382 * data/lalr1.cc (yy::parser::parse): Likewise.
5383 * data/yacc.c (yyparse): Likewise.
5384
5385 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
5386 value warnings for the end token when the user gives the end token a
5387 %destructor.
5388
5389 * tests/actions.at (Printers and Destructors): Test all the above.
5390
5391 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
5392
5393 Update to latest gnulib and gettext versions.
5394 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
5395 Add fopen-safer.
5396 (gnulib_files): Add m4/warning.m4. Don't worry about files
5397 overwritten by autopoint.
5398 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
5399 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
5400 rejects them.
5401 Don't use autoreconf; instead, invoke autopoint etc. by hand,
5402 so that we can remove the intl files at a better time.
5403 (intl_files_to_remove): Remove aclocal.m4, since it gets
5404 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
5405 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
5406 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
5407 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
5408 Remove datarootdir hack; no longer needed.
5409 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
5410 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
5411 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
5412 strdup.h.
5413 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
5414 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
5415
5416 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
5417
5418 * bootstrap: Adjust to today's change to gnulib-tool by invoking
5419 it with --assume-autoconf='latest-stable'.
5420
5421 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
5422
5423 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
5424 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
5425 YYSTYPE' and `{'.
5426 * src/muscle_tab.h (muscle_grow): Replace the header comments with
5427 those from muscle_tab.c since the old ones are misleading.
5428
5429 2006-07-13 Akim Demaille <akim@epita.fr>
5430
5431 Support %define "KEY" {VALUE}.
5432 * src/scan-code.h, src/scan-code.l (translate_action)
5433 (translate_rule_action, translate_symbol_action, translate_code):
5434 Return char *, not const char *.
5435 * src/parse-gram.y (declaration): Rename as...
5436 (prologue_declaration): this.
5437 (string_content): Remove this nonterminal, use STRING.
5438 (braceless, content, content.opt): New nonterminal.
5439 Use them.
5440 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
5441 as value.
5442 * src/scan-gram.l (getargs.h): Don't include it.
5443
5444 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
5445
5446 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
5447 rather than a for-loop that declares a local bool variable. This
5448 should work around a compatibility problem with a Cray x1e C++
5449 compiler reported by Hung Nguyen in
5450 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
5451 The for-loop was introduced in the 2004-11-17 change but I don't
5452 know why it was needed.
5453
5454 2006-07-12 Akim Demaille <akim@epita.fr>
5455
5456 * data/c.m4: Comment changes.
5457
5458 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
5459
5460 * src/complain.c (error_message, ERROR_MESSAGE): New.
5461 To factor...
5462 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
5463 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
5464
5465 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5466
5467 * NEWS: Instead of %union, you can define and use your own union type
5468 YYSTYPE if your grammar contains at least one <type> tag.
5469 Your YYSTYPE need not be a macro; it can be a typedef.
5470 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
5471 (Union Decl, Decl Summary): Document this.
5472 * data/glr.c (YYSTYPE): Implement this.
5473 * data/glr.cc (YYSTYPE): Likewise.
5474 * data/lalr1.cc (YYSTYPE): Likewise.
5475 * data/yacc.c (YYSTYPE): Likewise.
5476 * src/output.c (prepare): Output tag_seen_flag.
5477 * src/parse-gram.y (declaration, grammar_declaration):
5478 Use 'union_seen' rather than 'typed' to determine whether
5479 %union has been seen, since grammars can now be typed without
5480 %union.
5481 (symbol_declaration, type.opt, symbol_def):
5482 Keep track of whether a tag has been seen.
5483 * src/reader.c (union_seen, tag_seen): New vars.
5484 (typed): remove.
5485 * src/reader.h (union_seen, tag_seen, typed): Likewise.
5486 * src/scan-code.l (untyped_var_seen): New variable.
5487 (handle_action_dollar): Adjust to above changes.
5488 (handle_action_dollar, handle_action_at):
5489 Improve overflow checking for outlandish numbers.
5490 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
5491 avoid new diagnostics generated by above changes.
5492 * tests/regression.at (YYSTYPE typedef): Add test to check
5493 for type tags without %union.
5494
5495 * src/symlist.c (symbol_list_length): Return int, not unsigned
5496 int, since callers expect int. This may need to get revisited
5497 once we have proper integer overflow checking.
5498
5499 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
5500 object is now static.
5501
5502 * src/getargs.c (flags_argmatch): Return void, not int,
5503 to pacify ./configure --enable-gcc-warnings.
5504
5505 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
5506 since last_string is already defined to FLEX_PREFIX (last_string).
5507
5508 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
5509
5510 Implement --warnings/-W.
5511 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
5512 replaced by...
5513 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
5514 Adjust callers.
5515 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
5516 (warnings_args, warnings_types): New.
5517 (getargs, short_options, long_options): Accept -W/--warnings.
5518 Sort the options by alphabetical order, upper case letter right
5519 before its lower case.
5520
5521 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5522
5523 Change %merge result type clash warnings to errors. Discussed at
5524 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
5525 * src/reader.c (record_merge_function_type): Use complain_at.
5526 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5527 declared later): Update test case results.
5528
5529 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
5530
5531 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
5532 to be in alphabetical order.
5533 (trace_args): Spelling fixes.
5534
5535 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5536
5537 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
5538 so they don't collide with user-defined macros.
5539 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
5540 this was never guaranteed, and now that we're using gnulib stdint,
5541 which defines int_fast16_t to long int, the problem is exposed.
5542
5543 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
5544
5545 * data/c.m4 (b4_basename): Simplify a bit, since we don't
5546 need the full POSIX semantics (and weren't implementing them
5547 anyway).
5548
5549 Adjust to Autoconf 2.60 and today's gnulib.
5550 * bootstrap (gnulib_modules): Add stdint.
5551 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
5552 no longer copies it.
5553 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
5554 since stdint needs the former and wcwidth (which is now required
5555 by mbswidth) needs the latter.
5556 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
5557 work around a compatibility glitch between gettext 0.14.6 and
5558 Autoconf 2.60.
5559 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
5560 Do not check for uintptr_t, since new stdint module does the right
5561 thing.
5562 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
5563 Add stdint.h, stdint_.h, wcwidth.h.
5564 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
5565 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
5566 stdint.m4, wchar_t.m4, wcwidth.m4.
5567 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
5568 usual order for ../lib/*.h files.
5569 (file_name_split): Use last_component, not base_name, to adjust
5570 to gnulib changes.
5571 * src/parse-gram.h: Include <strverscmp.h> in the usual order
5572 for ../lib/*.h files.
5573 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
5574 Define unconditionally, since we now assume the stdint module.
5575 * src/scan-skel.l: Include <dirname.h>.
5576 (BASE_QPUTS): Use last_component, not base_name.
5577 * src/system.h: Include <unlocked-io.h> in the usual order
5578 for ../lib/*.h files. Include <stdint.h> unconditionally,
5579 since we now use the stdint module.
5580 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
5581 HAVE_UINTPTR_T, since we now use the stdint module.
5582 (base_name): Remove decl, since files now include <dirname.h>
5583 to get the decl.
5584
5585 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
5586
5587 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
5588 New, default to 1.
5589 * data/yacc.c, data/glr.c, data/location.cc: Use them.
5590 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
5591 default.
5592 * tests/calc.at: Adjust.
5593
5594 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
5595
5596 * data/c.m4 (b4_basename): New.
5597 (b4_syncline): Also output the location of its invocation (from
5598 the skeleton).
5599 (b4_user_action, b4_define_user_action, b4_user_actions)
5600 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
5601 (b4_user_stype): New.
5602 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
5603
5604 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5605
5606 In the grammar file, the first column is 1 not 0 on the first line as
5607 on every other line.
5608 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
5609 * tests/input.at (Torturing the Scanner): Update output.
5610
5611 * src/scan-gram.l (scanner_cursor): Declare it static.
5612
5613 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5614
5615 In warnings, say "previous declaration" rather than "first
5616 declaration".
5617 * src/symtab.c (redeclaration): Do that here.
5618 * src/reader.c (record_merge_function_type): In the case of a result
5619 type clash, report the previous declaration rather than the very first
5620 one in the grammar file.
5621 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5622 declared later): Add a third declaration to check this behavior.
5623 * tests/input.at (Incompatible Aliases): Update output.
5624
5625 2006-06-27 Akim Demaille <akim@epita.fr>
5626
5627 * doc/Doxyfile.in: New.
5628 * doc/Makefile.am: Use it.
5629 * src/lalr.h, src/symtab.h: Initial doxygenation.
5630
5631 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5632
5633 Don't miss %merge result type warnings just because the LHS types are
5634 declared after the %merge. This continues the effort of the previous
5635 patch.
5636 * src/reader.c (get_merge_function): Don't set the merger type yet.
5637 (record_merge_function_type): New function for setting the merger type
5638 and checking for clashes.
5639 (grammar_current_rule_merge_set): Set the location of the %merge for
5640 the current rule.
5641 (packgram): Invoke record_merge_function_type for each rule now that
5642 all symbol type declarations have been parsed.
5643 * src/reader.h (merger_list.type_declaration_location): New member
5644 storing the location of the first %merge from which the type for this
5645 merging function was derived.
5646 * src/symlist.h (symbol_list.merger_declaration_location): New member
5647 storing the location of a rule's %merge, if any.
5648 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5649 declared later): New test to catch the error fixed by the above patch.
5650
5651 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5652
5653 Get action warnings (grammar_rule_check) right even when symbol
5654 declarations appear after the rules. Discussed at
5655 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
5656 and
5657 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
5658 Don't mistake the type of $$ in a midrule to be that of its parent
5659 rule's $$.
5660 * src/reader.c (grammar_current_rule_end): Don't invoke
5661 grammar_rule_check yet since not all symbol declarations may have been
5662 parsed yet.
5663 (grammar_midrule_action): Likewise.
5664 Don't record whether the midrule's $$ has been used yet since actions
5665 haven't been translated yet.
5666 Record the midrule's parent rule and its RHS index within the parent
5667 rule.
5668 (grammar_current_rule_action_append): Don't translate the action yet
5669 since not all symbol declarations may have been parsed yet and, thus,
5670 warnings about types for $$, $n, @$, and @n can't be reported yet.
5671 (packgram): Translate the action and invoke grammar_rule_check now that
5672 all symbol declarations have been parsed.
5673 * src/scan-code.l (handle_action_dollar): Now that this is invoked
5674 after parsing the entire grammar file, the symbol list here in the case
5675 of a midrule is actually the midrule's empty RHS, so reference its
5676 parent rule's RHS where necessary.
5677 On the other hand, now that you can already know it's a midrule, you
5678 aren't forced to think $$ has the same type as its parent rule's $$.
5679 (handle_action_at): In the case of a midrule, reference the parent rule
5680 where necessary.
5681 * src/symlist.c (symbol_list_new): Initialize new midrule-related
5682 members.
5683 (symbol_list_length): Now that this is invoked after all rules have
5684 been parsed, a NULL symbol (rather than a NULL symbol list node)
5685 terminates a rule. symbol_list_print already does this correctly.
5686 * src/symlist.h (symbol_list.midrule_parent_rule,
5687 symbol_list.midrule_parent_rhs_index): New members so that midrules can
5688 remember their relationships with their parents.
5689 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
5690 fixed by the above patch.
5691 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
5692 implementing...
5693 (Unused values): ... this old test case and...
5694 (Unused values before symbol declarations): ... this new test case.
5695 This one is the same as `Unused values' except that all symbol
5696 declarations appear after the rules in order to catch the rest of the
5697 errors fixed by the above patch.
5698
5699 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5700
5701 More cleanup.
5702 * src/reader.c (current_rule): Declare it static since it's no longer
5703 used outside this file.
5704 (grammar_current_rule_action_append): Remove redundant arguments from
5705 translate_rule_action invocation.
5706 * src/reader.h (current_rule): Remove this unused extern.
5707 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
5708 * src/scan-code.l (translate_rule_action): Likewise.
5709
5710 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
5711
5712 Clean up yesterday's patch.
5713 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
5714 to...
5715 * src/reader.c (grammar_current_rule_action_append): ... here for
5716 consistency with grammar_current_rule_symbol_append.
5717 * tests/regression.at (Braced code in declaration in rules section):
5718 Make yyerror and yylex static as usual.
5719
5720 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
5721
5722 Fix bug that mistakes braced code in a declaration in the rules section
5723 to be a rule action. Mentioned at
5724 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
5725 * src/scan-gram.l: Move midrule action detection from the start of the
5726 scanning of any braced code to...
5727 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
5728 action. For readability, use $2 and @2 rather than the equivalent
5729 global variables.
5730 * tests/regression.at (Braced code in declaration in rules section):
5731 New test to catch the error fixed by the above patch.
5732
5733 Work on code readability some.
5734 * src/scan-code.l (current_rule): Get rid of this misleading and
5735 redundant declaration: it's actually extern'ed in reader.h.
5736 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
5737 translate_action): Add a rule argument and use it instead of the global
5738 current_rule.
5739 (translate_rule_action): This already receives current_rule through an
5740 argument, so pass it on to translate_action instead of assigning
5741 current_rule to current_rule.
5742 (translate_symbol_action, translate_code): Pass rule = NULL to
5743 translate_action.
5744
5745 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
5746
5747 Rename %before-definitions to %start-header and %after-definitions to
5748 %end-header. Don't use these declarations to separate pre-prologue
5749 blocks from post-prologue blocks. Add new order-independent
5750 declarations %before-header and %after-header as alternatives to the
5751 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
5752 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
5753 * NEWS (2.3+): Update for these changes.
5754 * data/glr.c (b4_before_definitions): Update to...
5755 (b4_start_header): ... this.
5756 (b4_after_definitions): Update to...
5757 (b4_end_header): ... this.
5758 * data/glr.cc: Likewise.
5759 * data/lalr1.cc: Likewise.
5760 * data/yacc.c: Likewise.
5761 * doc/bison.texinfo (The prologue): Update names, and replace remaining
5762 prologue blocks with %*-header declarations.
5763 (Calc++ Parser): Likewise.
5764 (Decl Summary): Update names.
5765 (Table of Symbols): Update description.
5766 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
5767 (PERCENT_END_HEADER): ... this.
5768 (PERCENT_BEFORE_DEFINITIONS): Update to...
5769 (PERCENT_START_HEADER): ... this.
5770 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5771 (declaration): Update token names and m4 macro names.
5772 When parsing %end-header and %start-header, invoke translate_code
5773 before muscle_code_grow, and no longer set global booleans to remember
5774 whether these declarations have been seen.
5775 Parse new %after-header and %before-header.
5776 * src/reader.c (before_definitions, after_definitions): Remove.
5777 (prologue_augment): Accept a new bool argument to specify whether to
5778 augment the pre-prologue or post-prologue.
5779 * src/reader.h (before_definitions, after_definitions): Remove these
5780 extern's.
5781 (prologue_augment): Add new bool argument.
5782 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
5783 (PERCENT_END_HEADER): ... this.
5784 (PERCENT_BEFORE_DEFINITIONS): Update to...
5785 (PERCENT_START_HEADER): ... this.
5786 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5787 * tests/actions.at (Printers and Destructors): Update names.
5788
5789 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
5790
5791 Add comparison operators for C++ location classes. Discussed at
5792 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
5793 * data/c++.m4 (b4_define_location_comparison): New boolean %define
5794 declaration indicating whether filename_type has an operator==. If
5795 filename_type is `std::string', it defaults to `1', `0' otherwise.
5796 * data/location.cc: Iff b4_define_location_comparison is `1', add
5797 operator== and operator!= for class position and for class location.
5798
5799 Some minor fixes.
5800 * src/scan-action.l: Remove unused file.
5801 * src/symtab.c (symbol_printer_set): Use printer_location not
5802 destructor_location.
5803 * src/symtab.h (struct symbol): Replace incorrect source comment for
5804 printer members.
5805 * tests/input.at (Incompatible Aliases): Update output with correct
5806 printer location.
5807
5808 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
5809
5810 Don't put the pre-prologue in the header file. For the yacc.c code
5811 file and the glr.c header and code files, move the pre-prologue before
5812 the token definitions. Add new %before-definitions and
5813 %after-definitions to declare code that will go in both the header file
5814 and code file. Discussed at
5815 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
5816 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
5817 and
5818 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
5819 * NEWS (2.3+): Describe these changes.
5820 * data/glr.c (b4_pre_prologue): Move from within to before...
5821 (b4_shared_declarations): ... this.
5822 Add new b4_before_definitions before b4_token_enums.
5823 Add new b4_after_definitions at the end.
5824 * data/glr.cc (b4_pre_prologue): Replace with...
5825 (b4_before_definitions): ... this in the header file.
5826 (b4_after_definitions): New near the end of the header file.
5827 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
5828 code file right before including the header file.
5829 (b4_before_definitions): New in the previous position of
5830 b4_pre_prologue in the header file.
5831 (b4_after_definitions): New near the end of the header file.
5832 * data/yacc.c: Clean up some m4 quoting especially in the header file.
5833 (b4_token_enums_defines): In the code file, move to right before
5834 YYSTYPE for consistency with the header file.
5835 (b4_before_definitions): New right before b4_token_enums_defines in
5836 both the header and code file.
5837 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
5838 header and code file.
5839 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
5840 of prologues for %union dependencies.
5841 (Decl Summary): In %defines description, mention the effect of
5842 %before-definitions and %after-definitions on the header file.
5843 (Calc++ Parser): Forward declare driver in a %before-definitions rather
5844 than in the pre-prologue so that make check succeeds.
5845 (Table of Symbols): Add entries for %before-definitions and
5846 %after-definitions.
5847 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
5848 %before-definitions.
5849 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
5850 (declaration): Parse those declarations and append to
5851 b4_before_definitions and b4_after_definitions, respectively.
5852 * src/reader.c (before_definitions, after_definitions): New bools to
5853 track whether those declarations have been seen.
5854 (prologue_augment): Add to the post-prologue if %union,
5855 %before-definitions, or %after-definitions has been seen.
5856 * src/reader.h (before_definitions, after_definitions): New extern's.
5857 * src/scan-gram.l: Scan the new declarations.
5858 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
5859 prologue block in a %before-definitions or a %after-definitions based
5860 on whether the %union is declared.
5861 * tests/regression.at (Early token definitions with --yacc, Early token
5862 definitions without --yacc): Move tests for token definitions into the
5863 post-prologue since token names are no longer defined in the
5864 pre-prologue.
5865
5866 2006-06-20 Akim Demaille <akim@epita.fr>
5867
5868 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
5869 (symbol_get): Use it.
5870 * src/parse-gram.y: Use it.
5871
5872 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
5873
5874 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
5875 build succeeds when configured with --enable-gcc-warnings.
5876
5877 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
5878
5879 * src/parse-gram.y (char_name): New function.
5880 (CHAR, STRING, string_content): For %printer, properly escape.
5881 (ID): Prefer fputs to fprintf.
5882 (id): Reindent to be consistent with other rules.
5883 Properly quote char.
5884
5885 The Translation Project changed its way of publishing translations
5886 to maintainers. I haven't received any responses to my request
5887 for supporting the old way, or for documenting the new way. I
5888 have modified 'bootstrap' to use screen scraping
5889 (in this case, HTML scraping). This is unreliable and inelegant,
5890 but I don't see any better way. Yuck.
5891 * bootstrap (TP_URL, WGET_COMMAND): New vars.
5892 (get_translations): New function, which uses HTML scraping to
5893 deduce locations of latest translations.
5894 Use this function to grab both bison and bison-runtime .po files.
5895 Don't bother priming the pump for the runtime-po domain any more,
5896 as it's now translated better than bison is.
5897
5898 2006-06-19 Akim Demaille <akim@epita.fr>
5899
5900 * src/scan-gram.l: No longer "parse" things after `%union' until
5901 `{'. Rather, return a single "%union" token.
5902 No longer make symbols: return strings, and leave the conversion
5903 to symbols to the parser.
5904 (SC_PRE_CODE, token_type): Remove.
5905 * src/parse-gram.y (%union): New field `character'.
5906 Sort tokens.
5907 (CHAR): New token.
5908 (ID, ID_COLON): Now that the scanner no longer makes them
5909 identifiers, adjust all uses to invoke symbol_get.
5910 (id_colon): New, wraps the conversion from string to symbol.
5911 (%union): Accept a possible union_name.
5912 (symbol): Now can be a char.
5913 * data/c.m4 (b4_union_name): Leave a default value.
5914 * data/glr.c, data/yacc.c: Use it.
5915
5916 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
5917
5918 For associating token numbers with token names for "yacc.c", don't use
5919 #define statements unless `--yacc' is specified; always use enum
5920 yytokentype. Most important discussions start at:
5921 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
5922 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
5923 and
5924 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
5925 * NEWS (2.3+): Mention.
5926 * data/c.m4 (b4_yacc_if): New.
5927 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
5928 token #define's.
5929 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
5930 on token name definitions.
5931 * src/getargs.c (usage): Capitalize `Yacc' in English.
5932 * src/output.c (prepare): Define b4_yacc_flag.
5933 * tests/regression.at (Early token definitions): Test that tokens names
5934 are defined before the pre-prologue not just before the post-prologue.
5935 Remove this test case and copy to...
5936 (Early token definitions with --yacc): ... this to test #define's.
5937 (Early token definitions without --yacc): ... and this to test enums.
5938
5939 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
5940
5941 * NEWS: Reword the post-2.3 change to not be so optimistic about
5942 removing the old "look-ahead" spelling.
5943 Update previous look-ahead/lookahead change reports.
5944 * REFERENCES: look-ahead -> lookahead (since that's
5945 what he actually wrote).
5946 * doc/refcard.tex: look ahead -> lookahead,
5947 look-ahead -> lookahead
5948
5949 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
5950
5951 For consistency, use `lookahead' instead of `look-ahead' or
5952 `look_ahead'. Discussed starting at
5953 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
5954 and then at
5955 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
5956 * NEWS: For the next release, note the change to `--report'.
5957 * TODO, doc/bison.1: Update English.
5958 * doc/bison.texinfo: Update English.
5959 (Understanding Your Parser, Bison Options): Document as
5960 `--report=lookahead' rather than `--report=look-ahead'.
5961 * src/conflicts.c: Update English in comments.
5962 (lookahead_set): Rename from look_ahead_set.
5963 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
5964 (resolve_sr_conflict): Rename local look_ahead_tokens to
5965 lookahead_tokens, and update other uses.
5966 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
5967 count_rr_conflicts, conflicts_free): Update uses.
5968 * src/getargs.c (report_args): Move "lookahead" before alternate
5969 spellings.
5970 (report_types): Update uses.
5971 (usage): For `--report' usage description, state `lookahead' spelling
5972 rather than `look-ahead'.
5973 * src/getargs.h (report.report_lookahead_tokens): Rename from
5974 report_look_ahead_tokens.
5975 * src/lalr.c: Update English in comments.
5976 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
5977 (state_lookahead_tokens_count): Rename from
5978 state_look_ahead_tokens_count.
5979 Rename local n_look_ahead_tokens to n_lookahead_tokens.
5980 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
5981 Rename local n_look_ahead_tokens to n_lookahead_tokens.
5982 Update other uses.
5983 Update English in output.
5984 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
5985 * src/print.c: Update English in comments.
5986 (lookahead_set): Rename from look_ahead_set.
5987 (print_reduction): Rename argument lookahead_token from
5988 look_ahead_token.
5989 (print_core, state_default_rule, print_reductions, print_results):
5990 Update uses.
5991 * src/print_graph.c: Update English in comments.
5992 (print_core): Update uses.
5993 * src/state.c: Update English in comments.
5994 (reductions_new): Update uses.
5995 (state_rule_lookahead_tokens_print): Rename from
5996 state_rule_look_ahead_tokens_print, and update other uses.
5997 * src/state.h: Update English in comments.
5998 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
5999 (state_rule_lookahead_tokens_print): Rename from
6000 state_rule_look_ahead_tokens_print.
6001 * src/tables.c: Update English in comments.
6002 (conflict_row, action_row): Update uses.
6003 * tests/glr-regression.at
6004 (Incorrect lookahead during deterministic GLR,
6005 Incorrect lookahead during nondeterministic GLR): Rename
6006 print_look_ahead to print_lookahead.
6007 * tests/torture.at: Update English in comments.
6008 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
6009 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
6010 (Many lookahead tokens): Update uses.
6011 * data/glr.c: Update English in comments.
6012 * lalr1.cc: Likewise.
6013 * yacc.c: Likewise.
6014 * src/conflicts.h: Likewise.
6015 * src/lalr.h: Likewise.
6016 * src/main.c: Likewise.
6017 * src/output.c: Likewise.
6018 * src/parse-gram.c: Likewise.
6019 * src/tables.h: Likewise.
6020 * tests/calc.at: Likewise.
6021
6022 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
6023
6024 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
6025
6026 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
6027
6028 * TODO: Add request from Nelson H. F. Beebe to be able to install
6029 Bison without installing the yacc script.
6030
6031 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6032
6033 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
6034 and yytext if they're already #define'd.
6035 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6036 * src/scan-code-c.c: ... here.
6037 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
6038 <config.h>.
6039
6040 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6041
6042 Get Bison to build again when configured with --enable-gcc-warnings.
6043 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
6044 missing #include's.
6045 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
6046 loc argument as it shadows a global.
6047 * src/scan-gram.l: Remove stray comma that prevents boundary_set
6048 invocation.
6049
6050 * src/.cvsignore: Add scan-code.c.
6051
6052 2006-06-07 Akim Demaille <akim@epita.fr>
6053
6054 * src/scan-gram.l: Move the "add a trailing ; to actions" code
6055 to...
6056 * src/scan-code.l: here.
6057 * tests/input.at (Torturing the Scanner): Fix another location
6058 error.
6059
6060 2006-06-07 Akim Demaille <akim@epita.fr>
6061
6062 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
6063
6064 2006-06-06 Akim Demaille <akim@epita.fr>
6065
6066 Extract the parsing of user actions from the grammar scanner.
6067 As a consequence, the relation between the grammar scanner and
6068 parser is much simpler. We can also split "composite tokens" back
6069 into simple tokens.
6070 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
6071 * src/scan-gram.l (add_column_width, adjust_location): Move to and
6072 rename as...
6073 * src/location.h, src/location.c (add_column_width)
6074 (location_compute): these.
6075 Fix the column count: the initial column is 0.
6076 (location_print): Be robust to ending column being 0.
6077 * src/location.h (boundary_set): New.
6078 * src/main.c: Adjust to scanner_free being renamed as
6079 gram_scanner_free.
6080 * src/output.c: Include scan-code.h.
6081 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
6082 Use boundary_set.
6083 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
6084 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
6085 which is now, again, a separate token.
6086 Adjust all dependencies.
6087 Whereever actions with $ and @ are used, use translate_code.
6088 (action): Remove this nonterminal which is now useless.
6089 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
6090 (grammar_current_rule_action_append): Use translate_code.
6091 (packgram): Bound check ruleno, itemno, and rule_length.
6092 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
6093 (last_string, last_braced_code_loc, max_left_semantic_context)
6094 (scanner_initialize, scanner_free, scanner_last_string_free)
6095 (gram_out, gram_lineno, YY_DECL_): Move to...
6096 * src/scan-gram.h: this new file.
6097 (YY_DECL): Rename as...
6098 (GRAM_DECL): this.
6099 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
6100 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6101 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6102 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6103 Move these declarations, and...
6104 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
6105 these to...
6106 * src/flex-scanner.h: this new file.
6107 * src/scan-gram.l (rule_length, rule_length_overflow)
6108 (increment_rule_length): Remove.
6109 (last_braced_code_loc): Rename as...
6110 (gram_last_braced_code_loc): this.
6111 Adjust to the changes of the parser.
6112 Move all the handling of $ and @ into...
6113 * src/scan-code.l: here.
6114 * src/scan-gram.l (handle_dollar, handle_at): Remove.
6115 (handle_action_dollar, handle_action_at): Move to...
6116 * src/scan-code.l: here.
6117 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
6118 scan-code.h, scan-code-c.c, scan-gram.h.
6119 (EXTRA_bison_SOURCES): Add scan-code.l.
6120 (BUILT_SOURCES): Add scan-code.c.
6121 (yacc): Be robust to white spaces.
6122
6123 * tests/conflicts.at, tests/input.at, tests/reduce.at,
6124 * tests/regression.at: Adjust the column numbers.
6125 * tests/regression.at: Adjust the error message.
6126
6127 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6128
6129 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6130 Use Akim's wording from
6131 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
6132
6133 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6134
6135 Between Bison releases, manually append `+' to the previous Bison
6136 release number, and use that as a signal to automatically print the
6137 ChangeLog's CVS Id keyword from --version. Discussed starting at
6138 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
6139 * ChangeLog: Add Id header.
6140 * configure.ac (AC_INIT): Append `+' to `2.3'.
6141 * src/.cvsignore: Add revision.c.
6142 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
6143 (BUILT_SOURCES): Add revision.c.
6144 (revision.c): New target rule. This file defines a new global variable
6145 named revision. It initializes it with either the Id from ChangeLog
6146 or, if VERSION doesn't contain `+', with the empty string.
6147 * src/getargs.c (version): Print the value of revision.
6148 * src/revision.h: Extern revision.
6149
6150 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
6151
6152 * NEWS: Version 2.3.
6153 * configure.ac (AC_INIT): Likewise.
6154
6155 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
6156
6157 * data/glr.c (YYRECOVERING): Define to be a function-like macro
6158 with no arguments, not as an object-like macro. This is for
6159 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
6160 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
6161 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
6162 Document this.
6163
6164 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
6165
6166 * src/getargs.c (usage): Back out yesterday's modification of the
6167 --help output so that we don't have to wait for translation before
6168 releasing 2.3.
6169
6170 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
6171
6172 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
6173 Problem reported by Akim Demaille.
6174
6175 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6176
6177 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6178
6179 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
6180
6181 * data/yacc.c (yy_reduce_print): Omit trailing white space in
6182 generated source code. Problem reported by Frans Englich in
6183 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
6184
6185 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
6186
6187 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
6188 shell, not within 'make', so that 'make' by an ordinary builder
6189 (using GNU make) does not worry about configuring gzip. This also
6190 works around a bug reported independently by Keith Thompson and by
6191 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
6192 stderr rather than stdout, messing up the build logs.
6193
6194 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6195
6196 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
6197 to make sure that YYID will never be unused. This fixes a 'make
6198 maintainer-check' failure caused by the recent changes to the 'Trivial
6199 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
6200 not used.
6201 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
6202
6203 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6204
6205 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
6206 state before an empty RHS is always resolved here. Only the location
6207 of that state is guaranteed to be resolved, and that's enough. This
6208 fixes the remaining bug reported by Derek M. Jones in
6209 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6210 * tests/glr-regression.at (Uninitialized location when reporting
6211 ambiguity): Test the above case.
6212 Also, the embedded comments in this test case claim it checks the case
6213 of an empty RHS that has inherited the initial location. However, the
6214 corresponding LHS was already resolved, so yyresolveLocations didn't
6215 actually have reason to modify it. Fix this by forcing
6216 nondeterministic operation at the beginning of the parse.
6217
6218 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
6219
6220 * data/c.m4 (b4_yy_symbol_print_generate):
6221 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
6222 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
6223 of the bugs reported today by Derek M Jones in
6224 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6225 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
6226 defined to be a type name without parens or brackets.
6227 (Location Type): Similarly for YYLTYPE.
6228 * tests/regression.at (Trivial grammars): Put in a test for this
6229 bug that will be caught by 'make maintainer-check' (though not,
6230 alas, by 'make check' unless your compiler is picky).
6231
6232 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
6233
6234 * NEWS: Version 2.2.
6235 * configure.ac (AC_INIT): Likewise.
6236
6237 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
6238
6239 * data/glr.c (yyreportTree): Make room in yystates for the state
6240 preceding the RHS. This fixes the segmentation fault reported by Derek
6241 M. Jones in
6242 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
6243 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
6244 to the user. Reported for yyreportTree by Derek M. Jones later in the
6245 same thread.
6246 * THANKS: Add Derek M. Jones.
6247 Update my email address.
6248 Fix typo in Steve Murphy's name.
6249
6250 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
6251
6252 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
6253 checking against YYLAST that caused the parser to miss a potential
6254 alternative in its diagnostic.
6255 Problem reported by Maria Jose Moron Fernandez in
6256 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
6257 * data/lalr1.cc (yysyntax_error_): Likewise.
6258 * data/yacc.c (yysyntax_error): Likewise.
6259 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
6260 tokens, in case we run into an older C compiler.
6261 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
6262 Use them to check for the off-by-one error fixed above.
6263
6264 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
6265 YYSIZE_T, not size_t.
6266 * tests/regression.at (Trivial grammars): New test, to catch
6267 the error fixed by the above patch.
6268
6269 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6270
6271 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
6272 scheme.
6273 Reported by Steve Murphy.
6274
6275 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6276
6277 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
6278 * data/glr.cc: b4_location_flag is now b4_locations_flag.
6279
6280 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6281
6282 Implement --trace=m4.
6283 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
6284 * src/output.c (output_skeleton): When set, pass -dV to m4.
6285
6286 Factor the handling of flags in m4.
6287 * src/output.c (prepare): Rename the muscle names debug, defines,
6288 error_verbose to debug_flag, defines_flag, error_verbose_flag.
6289 * data/c.m4: Adjust.
6290 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
6291 Use b4_define_flag_if to define other b4_FLAG_if macros.
6292 (b4_location_if): As a consequence, rename as...
6293 (b4_locations_if): this, for consistency.
6294 Adjust all the skeletons.
6295
6296 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6297
6298 * etc/bench.pm: Shorten bench names.
6299
6300 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6301
6302 * src/output.h, src/output.c (error_verbose): Move to...
6303 * src/getargs.h, src/getargs.c: here.
6304 Sort the flags.
6305 Adjust dependencies.
6306
6307 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
6308
6309 * data/c.m4 (b4_copyright): Put the special exception for Bison
6310 skeletons here, so we don't have to put it in each skeleton. All
6311 uses changed. Suggested by Akim Demaille. Also, wrap the
6312 copyright notice, in case it is longer than 80 columns. Replace
6313 comma by newline after title.
6314
6315 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
6316
6317 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
6318 incompatibility, not a bug. Mention that it wasn't fixed as of
6319 flex 2.5.33.
6320
6321 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
6322
6323 * examples/extexi: Enforce the precedence of concatenation over
6324 >>.
6325 Reported by Tommy Nordgren.
6326
6327 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
6328
6329 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
6330 with the member "token".
6331 Reported by Martin Nylin.
6332
6333 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
6334
6335 * data/glr.c: Switch to Bison 2.2 special-exception language in
6336 the copyright notice. Use more-regular format for titles and
6337 copyright notices.
6338 * data/glr.cc: Likewise.
6339 * data/location.cc: Likewise.
6340 * data/yacc.cc: Likewise.
6341 * doc/bison.texinfo (Conditions): Document this.
6342 * NEWS: likewise. Upgrade version to 2.2.
6343
6344 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
6345
6346 * data/glr.cc: Remove dead code.
6347
6348 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
6349
6350 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
6351 that variable and the line breaks the bootstrap. Problem reported
6352 by Juan M. Guerrero.
6353
6354 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
6355
6356 * doc/bison.texinfo (Multiple start-symbols): New.
6357
6358 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
6359
6360 * etc/README, etc/bench.pl: New.
6361
6362 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
6363
6364 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
6365 rule.
6366 Reported by Mickael Labau.
6367 * tests/input.at (Torturing the Scanner): Test it.
6368
6369 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
6370
6371 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
6372 Problem reported by Bob Rossi.
6373
6374 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
6375
6376 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
6377 and didn't really work.
6378 For the index, use @ifnotinfo, not @iftex.
6379 Minor cleanups of spacing and terminology.
6380
6381 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
6382
6383 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
6384 of AT_NAME_PREFIX when %name-prefix is not used.
6385
6386 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
6387
6388 Apply --prefix to C++ skeletons too: they change the namespace.
6389 The test suite already exercize these cases.
6390 * data/c++.m4 (b4_namespace): New.
6391 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
6392 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
6393 * data/yacc.c, data/glr.c: Remove a useless `[]'.
6394 * doc/bison.texinfo: Document it.
6395 (Option Cross Key): Use @multitable in all formats. It looks
6396 nicer, even in TeX outputs.
6397 (Rules): Use the same code whatever the output type is.
6398 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
6399 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
6400 * tests/calc.at: Use it, instead of hard coding `yy'.
6401
6402 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
6403
6404 * TODO: Remove dead items.
6405
6406 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
6407
6408 * doc/FAQ: Remove, merged into...
6409 * doc/bison.texinfo (FAQ): this.
6410 * doc/Makefile.am (EXTRA_DIST): Adjust.
6411
6412 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
6413
6414 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
6415 even if empty.
6416 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
6417 * doc/bison.texinfo (Calc++ Scanner): Use it.
6418
6419 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
6420
6421 Fix two nits reported by twlevo, plus one more that I discovered.
6422
6423 * src/assoc.h (assoc_to_string): Give a name to the arg, as
6424 this is the usual Bison style.
6425 * src/location.h (location_print): Likewise.
6426
6427 * src/reader.h (token_name): Likewise.
6428
6429 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
6430
6431 Fix some nits reported by twlevo.
6432 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
6433 and "POSIX". Use more-modern syntax for URLs. Mention C++
6434 and ask for Java. Don't hardwire OS version numbers. Add
6435 copyright notice.
6436 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
6437 * src/conflicts.c (solved_conflicts_obstack): Now static.
6438
6439 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
6440
6441 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
6442 page. Say "you can use it" not "you may use it" as on the web page;
6443 we're describing capabilities not granting permission.
6444
6445 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
6446
6447 * data/glr.c (yyresolveLocations): Rename local variables to avoid
6448 shadowing warnings. Use usual patter for iterating through RHS.
6449 * tests/glr-regression.at
6450 (Uninitialized location when reporting ambiguity):
6451 Modify yylex so that it uses its argument, rather than trying
6452 to rely on ARGSUSED (which doesn't work for gcc with warnings).
6453 const char -> char const.
6454
6455 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
6456 Don't use tabs inside commands; it messes up 'ps'.
6457 Problem reported by twlevo.
6458
6459 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
6460
6461 * tests/glr-regression.at (Uninitialized location when reporting
6462 ambiguity): New test case.
6463 * data/glr.c (yyresolveLocations): New function, which uses
6464 YYLLOC_DEFAULT.
6465 (yyresolveValue): Invoke yyresolveLocations before reporting an
6466 ambiguity.
6467 * doc/bison.texinfo (Default Action for Locations): Note
6468 YYLLOC_DEFAULT's usage for ambiguity locations.
6469 (GLR Semantic Actions): Cross-reference those notes.
6470
6471 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
6472
6473 * tests/glr-regression.at (Leaked semantic values when reporting
6474 ambiguity): Remove unnecessary union and type declarations.
6475 (Leaked lookahead after nondeterministic parse syntax error): New test
6476 case.
6477 * data/glr.c (yyparse): Check for zero stacks remaining before
6478 attempting to shift the lookahead so that you don't lose it.
6479
6480 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6481
6482 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
6483 * tests/glr-regression.at (Leaked semantic values when reporting
6484 ambiguity): New test case.
6485 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
6486 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
6487 now unnecessary yystackp parameter.
6488 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
6489 destructors can be called.
6490
6491 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
6492 in existing testcases.
6493
6494 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6495
6496 Don't leak semantic values for parent RHS when a user action cuts the
6497 parser, and clean up related code a bit.
6498 * tests/glr-regression.at (Leaked merged semantic value if user action
6499 cuts parse): Rename to...
6500 (Leaked semantic values if user action cuts parse): ... this. Add check
6501 for leaked parent RHS values.
6502 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
6503 between an unresolved state (non-empty chain of semantic options) and
6504 an incomplete one (signaled by an empty chain).
6505 (yyresolveStates): Document the interface. Move all manipulation of a
6506 successfully or unsuccessfully resolved yyGLRState to...
6507 (yyresolveValue): ... here so that yyresolveValue always leaves a
6508 yyGLRState with consistent data and thus is easier to understand.
6509 Remove the yyvalp and yylocp parameters since they are always just
6510 taken from the yys parameter. When reporting a discarded merged value
6511 in debugging output, note that it is incompletely merged. Document the
6512 interface.
6513 (yyresolveAction): If resolving any of the RHS states fails, destroy
6514 them all rather than leaking them. Thus, as long as user actions are
6515 written to clean up the RHS correctly, yyresolveAction always cleans up
6516 the RHS of a semantic option. Document the interface.
6517
6518 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
6519
6520 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
6521 led to a segmentation fault in GNU Pascal. Problem reported
6522 by Waldek Hebisch.
6523
6524 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
6525
6526 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
6527 mid-rule action inside a nonterminal symbol in order to declare a
6528 destructor for its semantic value.
6529
6530 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
6531
6532 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
6533 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
6534 __cplusplus && ! defined _STDLIB_H && !
6535 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
6536 defined free))]: Include <stdlib.h> rather than rolling our own
6537 declarations of malloc and free, to avoid problems with
6538 incompatible declarations (using 'throw') C++'s stdlib.h. This
6539 should fix Debian bug 340012
6540 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
6541 reported by Guillaume Melquiond.
6542
6543 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6544
6545 * NEWS: Clarify symbols versus types in unused-value warnings.
6546
6547 * configure.ac (AC_INIT): Bump version number.
6548
6549 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6550
6551 * NEWS: Version 2.1a.
6552 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
6553 since C99 requires this.
6554
6555 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
6556
6557 * m4/c-working.m4: New file.
6558 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
6559
6560 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
6561
6562 * Makefile.maint: Merge from coreutils.
6563
6564 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
6565
6566 More portability fixes for problems summarized by Nelson H. F. Beebe.
6567
6568 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
6569 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
6570 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
6571 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
6572 messes up because C++ code is compiled in 32-bit mode but linked
6573 in 64-bit mode.
6574
6575 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
6576
6577 More portability fixes for problems summarized by Nelson H. F. Beebe.
6578
6579 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
6580 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
6581
6582 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
6583 nodist_PROGRAMS, since we don't need to actually compile the
6584 example if we're just doing a plain 'make'. This avoids bothering
6585 the installer unnecessarily about problems due to weird C++
6586 compilers.
6587
6588 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
6589
6590 More portability fixes for problems summarized by Nelson H. F. Beebe.
6591
6592 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
6593 than #include "...", and compile with -I'.'. The old method was
6594 not portable, according to Posix and the C standard, and it does
6595 not work with Sun C 5.7, where previous #line directives affect
6596 the working directory used in later #include "..." directives.
6597
6598 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6599
6600 Various DJGGP specific issues in /djgpp
6601
6602 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
6603
6604 More portability fixes for problems summarized by Nelson H. F. Beebe.
6605
6606 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
6607 '#include <map>' works and that you can apply ++ to iterators.
6608
6609 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
6610
6611 Work around portability problems summarized by Nelson H. F. Beebe in
6612 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
6613
6614 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6615 that '#include <string>' works.
6616
6617 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
6618 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
6619 "warning: sorry: semantics of inline function static data `const
6620 unsigned char translate_table[262]' are wrong (you'll wind up with
6621 multiple copies)".
6622
6623 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
6624 or, xor to not_, and_, or_, and xor_, respectively. This works
6625 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
6626 random system header somewhere that includes the equivalent of
6627 <iso646.h>.
6628
6629 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
6630 -E" works; it apparently doesn't work with PathScale EKO Compiler
6631 Suite Version 2.0.
6632
6633 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
6634
6635 During deterministic GLR operation, user actions should be able to
6636 influence the parse by changing yychar. To make this easier to fix and
6637 to make glr.c easier to evolve in general, don't maintain yytoken in
6638 parallel with yychar; just compute yytoken when needed.
6639 * tests/glr-regression.at (Incorrect lookahead during deterministic
6640 GLR): Check that setting yychar in a user action has the intended
6641 effect.
6642 * data/glr.c (yyGLRStack): Remove yytokenp member.
6643 (yyclearin): Don't set *yytokenp.
6644 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
6645 yychar rather than *yytokenp to determine the current lookahead.
6646 Compute yytoken locally when needed.
6647 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
6648 point to.
6649
6650 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
6651 after `--report' documentation.
6652
6653 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
6654
6655 * src/parse-gram.y (grammar_declaration): Location of printer
6656 symbol is @1, not list->location. Bug reported by twlevo.
6657 * tests/input.at (Incompatible Aliases): Adjust to above change.
6658
6659 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
6660
6661 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
6662 all the test at once. This makes the output easier to read in the
6663 normal case.
6664
6665 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
6666 got from <http://bro-ids.org/download.html>. The bug is that
6667 when two actions appeared in succession, the second one was
6668 scanned before the first one was added to the grammar rule
6669 as a midrule action. Bison then output the incorrect warning
6670 "parse.y:905.17-906.36: warning: unused value: $3".
6671 * src/parse-gram.y (BRACED_CODE, action): These are no longer
6672 associated with a value.
6673 (rhs): Don't invoke grammar_current_rule_action_append.
6674 (action): Invoke it here instead.
6675 * src/reader.c (grammar_midrule_action): Now extern.
6676 (grammar_current_rule_action_append): Don't invoke
6677 grammar_midrule_action; that is now the scanner's job.
6678 * src/reader.h (last_string, last_braced_code_loc):
6679 (grammar_midrule_action): New decls.
6680 * src/scan-gram.l (last_string): Now extern, sigh.
6681 (last_braced_code_loc): New extern variable.
6682 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
6683 rule already has an action.
6684 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
6685 * tests/input.at (AT_CHECK_UNUSED_VALUES):
6686 Add some tests to check that the above changes fixed the bug.
6687
6688 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
6689
6690 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
6691 All used changed. Check whether the symbol has a destructor,
6692 not whether it is typed.
6693 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
6694 that the values are still reported as unused. All line numbers
6695 adjusted.
6696
6697 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
6698
6699 Work around a bug in bro 0.8, which underparenthesizes its
6700 definition of YYLLOC_DEFAULT.
6701 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
6702 their arguments.
6703 * data/lalr1.cc: Likewise.
6704 * data/yacc.cc: Likewise.
6705
6706 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
6707
6708 Work around a bug in Pike 7.0, and give the Pike folks a
6709 better way to override the usual int widths.
6710 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
6711 user can override the types.
6712 (short): #undef, to work around a bug in Pike 7.0.
6713 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
6714 (union yyalloc.yyss): Use yytype_int16 rather than short.
6715 All uses changed.
6716 (yysigned_char): Remove.
6717 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
6718 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
6719 * tests/regression.at (Web2c Actions): Adjust to above changes.
6720
6721 * src/reader.c (check_and_convert_grammar): New function.
6722 (reader): Close the input file even if something went wrong during
6723 parsing. Minor file descriptor leak reported by twlevo.
6724
6725 * src/assoc.c (assoc_to_string): Use a default: abort (); case
6726 to pacify gcc -Wswitch-default.
6727 * src/scan-gram.l (adjust_location): Use a default: break; case
6728 to pacify gcc -Wswitch-default.
6729 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
6730 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6731 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6732 Move these decls to scan-skel.l, since they don't need to be
6733 visible elsewhere.
6734 * src/scan-skel.l: Accept the above decls.
6735 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
6736 is used.
6737
6738 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
6739
6740 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
6741 since we don't want to insist on a version number at the start
6742 of the changelog every time.
6743 * Makefile.maint: Sync from coreutils a bit better.
6744 (sc_trailing_blank): Renamed from sc_trailing_space.
6745 All uses changed.
6746 (sc_no_if_have_config_h, sc_require_config_h):
6747 (sc_prohibit_assert_without_use): New rules.
6748 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
6749 (sc_dd_max_sym_length): Fix leading spaces in rule.
6750 (sc_system_h_headers): Prefix with @.
6751 (sc_useless_cpp_parens, m4-check): Output line numbers.
6752 (changelog-check): Allow version only in head.
6753 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
6754 satisfy new Makefile.maint rule.
6755 * data/glr.c: Likewise.
6756 * data/glr.cc: Likewise.
6757 * data/lalr1.cc: Likewise.
6758 * data/yacc.c: Likewise.
6759 * lib/ebitsetv.c: Likewise.
6760 * lib/lbitset.c: Likewise.
6761 * lib/subpipe.c: Likewise.
6762 * lib/timevar.c: Likewise.
6763 * src/system.h: Likewise.
6764 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
6765 * djgpp/Makefile.maint: Add copyright notice.
6766 * djgpp/README.in: Likewise.
6767 * djgpp/config.bat: Likewise.
6768 * djgpp/config.site: Likewise.
6769 * djgpp/config_h.sed: Likewise.
6770 * djgpp/djunpack.bat: Likewise.
6771 * djgpp/config.sed: Fix copyright notice to match standard format.
6772 * djgpp/subpipe.h: Likewise.
6773 * lib/bitsetv-print.c: Likewise.
6774 * lib/bitsetv.c: Likewise.
6775 * lib/subpipe.h: Likewise.
6776 * lib/timevar.c: Likewise.
6777 * lib/timevar.h: Likewise.
6778 * djgpp/subpipe.c: Use standard recipe for config.h.
6779 * lib/abitset.c: Likewise.
6780 * lib/bitset.c: Likewise.
6781 * lib/bitset_stats.c: Likewise.
6782 * lib/bitsetv-print.c: Likewise.
6783 * lib/bitsetv.c: Likewise.
6784 * lib/ebitsetv.c: Likewise.
6785 * lib/get-errno.c: Likewise.
6786 * lib/lbitset.c: Likewise.
6787 * lib/subpipe.c: Likewise.
6788 * lib/timevar.c: Likewise.
6789 * lib/vbitset.c: Likewise.
6790 * tests/local.at: Likewise.
6791 * src/scan-gram.l: Don't include verify.h, since system.h does
6792 that for us.
6793 * .x-sc_require_config_h: New file.
6794 * .x-sc_unmarked_diagnostics: New file.
6795
6796 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
6797
6798 Be a bit more systematic about using 'abort'.
6799 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
6800 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
6801 Put 'default: abort ();' before some other case, to satisfy older
6802 pedantic compilers.
6803 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6804 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
6805 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
6806 * src/conflicts.c (resolve_sr_conflict): Likewise.
6807 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
6808 (get_decision_str, get_orientation_str, get_node_alignment_str):
6809 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
6810 (get_linestyle_str, get_arrowstyle_str): Likewise.
6811 * src/conflicts.c (resolve_sr_conflict):
6812 Use a default case rather than one for the one remaining enum
6813 value, to catch invalid enum values as well.
6814 * src/lalr.c (set_goto_map, map_goto):
6815 Prefer "assert (FOO);" to "if (!FOO) abort ();".
6816 * src/nullable.c (nullable_compute, token_definitions_output):
6817 Likewise.
6818 * src/reader.c (packgram, reader): Likewise.
6819 * src/state.c (transitions_to, state_new, state_reduction_find):
6820 Likewise.
6821 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
6822 (symbol_pack): Likewise.
6823 * src/tables.c (conflict_row, pack_vector): Likewise.
6824 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
6825 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
6826 * src/system.h: Don't include <assert.h>.
6827 (assert): New macro.
6828
6829 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
6830 (Destructor Decl, Parser Function, Pure Calling):
6831 Describe rules for braces inside C code more carefully.
6832
6833 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
6834
6835 Fix some porting glitches found by Nelson H. F. Beebe.
6836 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
6837 compilers that don't understand that abort () does not return.
6838 * src/state.c (transitions_to): Likewise.
6839 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6840 that '#include <cstdlib>' works.
6841 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
6842 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
6843 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
6844 for the benefit of some pre-C99 compilers.
6845
6846 * bootstrap: Undo changes to gnulib files that autoreconf made.
6847
6848 Minor fixups to get 'make maintainer-check' to work.
6849 * configure.ac: Don't use -Wnested-externs, as it's incompatible
6850 with the new verify.h implementation.
6851 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
6852 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
6853 * data/yacc.c (YYUSE): Likewise.
6854 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
6855 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
6856 * src/parse-gram.y (declaration): Don't pass a string constant
6857 to a function that expects char *, since GCC might complain
6858 about the constant value.
6859 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
6860 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
6861 before #defining them.
6862 * tests/glr-regression.at
6863 (Incorrectly initialized location for empty right-hand side in GLR):
6864 In yyerror, use the msg arg.
6865 (Corrupted semantic options if user action cuts parse):
6866 (Incorrect lookahead during deterministic GLR):
6867 (Incorrect lookahead during nondeterministic GLR):
6868 Don't name a local var 'index'; it shadows string.h's 'index'.
6869
6870 2006-01-19 Akim Demaille <akim@epita.fr>
6871
6872 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
6873 location, not just parts of it.
6874
6875 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
6876
6877 * NEWS: Document the fact that multiple %unions are now allowed.
6878 * doc/bison.texinfo (Union Decl): Likewise.
6879 * TODO: This feature is now implemented, so remove it from
6880 the wishlist.
6881
6882 * Makefile.maint: Merge with coreutils Makefile.maint.
6883 (CVS_LIST): Use build-aux version if available.
6884 (VERSION_REGEXP): New macro.
6885 (syntax-check-rules): Add sc_no_if_have_config_h,
6886 sc_prohibit_assert_without_use, sc_require_config_h,
6887 sc_useless_cpp_parens.
6888 (sc_obsolete_symbols): Check for O_NDELAY.
6889 (sc_dd_max_sym_length): Track coreutils.
6890 (sc_unmarked_diagnostics): Look in all files, not just *.c.
6891 (sc_useless_cpp_parens): New rule.
6892 (news-date-check): Look for version or today's date.
6893 (changelog-check): Don't require version number near head.
6894 (copyright-check): Use current year instead of hardwiring 2005.
6895 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
6896 (announcement): Add --gpg-key-ID.
6897
6898 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
6899 with "file system".
6900
6901 Avoid undefined behavior that addressed just before the start of an
6902 array. Problem reported by twlevo.
6903 * src/reader.c (packgram): Prepend a new sentinel before ritem.
6904 * src/lalr.c (build_relations): Rely on new sentinel.
6905 * src/gram.c (gram_free): Adjust to new sentinel.
6906
6907 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
6908
6909 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
6910 yylookaheadNeeds. All uses updated.
6911 (yysplitStack): Rename local yynewLookaheadStatuses to
6912 yynewLookaheadNeeds.
6913 * data/glr-regression.at (Incorrect lookahead during nondeterministic
6914 GLR): In comments, change `lookahead status' to `lookahead need'.
6915
6916 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6917
6918 * data/glr.c (yysplitStack): A little stylistic rewrite.
6919
6920 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6921
6922 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
6923
6924 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
6925
6926 * doc/bison.texinfo: Fix some typos.
6927 (GLR Semantic Actions): New subsection discussing special
6928 considerations because GLR semantic actions might be deferred.
6929 (Actions): Mention look-ahead usage of yylval.
6930 (Actions and Locations): Mention look-ahead usage of yylloc.
6931 (Special Features for Use in Actions): Add YYEOF entry and mention it
6932 in the yychar entry.
6933 In the yychar entry, remove mention of the local yychar case (pure
6934 parser) since this is irrelevant information when writing semantic
6935 actions and since it's already discussed in `Table of Symbols' where
6936 yychar is otherwise described as an external variable.
6937 In the yychar entry, don't call it the `current' look-ahead since it
6938 isn't when semantic actions are deferred.
6939 In the yychar and yyclearin entries, add note about deferred semantic
6940 actions.
6941 Add yylloc and yylval entries discussing look-ahead usage.
6942 (Look-Ahead Tokens): When discussing yychar, don't call it the
6943 `current' look-ahead, and do mention yylval and yylloc.
6944 (Error Recovery): Cross-reference `Action Features' when mentioning
6945 yyclearin.
6946 (Table of Symbols): In the yychar entry, don't call it the `current'
6947 look-ahead.
6948 In the yylloc and yylval entries, mention look-ahead usage.
6949
6950 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6951
6952 * tests/glr-regression.at: Update copyright year to 2006.
6953
6954 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6955
6956 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
6957 use during nondeterministic operation to track which stacks have
6958 actually needed the current lookahead.
6959 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
6960 Allocate, deallocate, resize, and otherwise shuffle space for
6961 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
6962 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
6963 appropriately during nondeterministic operation.
6964 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
6965 members to store the current lookahead to be used by the deferred
6966 user action.
6967 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
6968 from which the RHS is taken. Set the lookahead members of the new
6969 yySemanticOption according to the lookahead status for stack yyk.
6970 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
6971 yyaddDeferredAction.
6972 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
6973 members of yySemanticOption before invoking yyuserAction, and then set
6974 them back to their current values afterward.
6975 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
6976 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
6977 * tests/glr-regression.at: Remove `.' from the ends of recent test case
6978 titles for consistency.
6979 (Leaked merged semantic value if user action cuts parse): In order to
6980 suppress lint warnings, use arguments in merge function, and assign
6981 char value < 128 in main.
6982 (Incorrect lookahead during deterministic GLR): New test case.
6983 (Incorrect lookahead during nondeterministic GLR): New test case.
6984
6985 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6986
6987 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
6988 !yyvaluep as signal that no semantic value is available to print.
6989 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
6990 to print a semantic value.
6991
6992 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6993
6994 * tests/glr-regression.at: For consistency with my newer test cases,
6995 don't thank myself.
6996
6997 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6998
6999 * data/glr.c (yyresolveValue): When merging semantic options, if at
7000 least one user action succeeds but a later one cuts the parse, then
7001 destroy the semantic value before returning rather than leaking it.
7002 (yyresolveStates): If a user action cuts the parse and thus
7003 yyresolveValue fails, ignore the (unset) semantic value rather than
7004 corrupting the yyGLRState, and empty the semantic options list since
7005 the user actions should have called all necessary destructors.
7006 Simplify code with YYCHK.
7007 * tests/glr-regression.at (Corrupted semantic options if user action
7008 cuts parse): New test case.
7009 (Undesirable destructors if user action cuts parse): New test case.
7010 Before applying any of this patch, this test case never actually failed
7011 for me... but only because the corrupted semantic options usually
7012 masked this bug.
7013 (Leaked merged semantic value if user action cuts parse): New test
7014 case.
7015
7016 2006-01-05 Akim Demaille <akim@epita.fr>
7017
7018 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
7019
7020 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
7021
7022 * data/c.m4 (b4_c_modern): New macro, with a new provision for
7023 _MSC_VER. Problem reported by Cenzato Marco.
7024 (b4_c_function_def): Use it.
7025 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
7026 b4_c_modern.
7027 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
7028 than rolling our own.
7029
7030 2006-01-04 Akim Demaille <akim@epita.fr>
7031
7032 Also warn about non-used mid-rule values.
7033 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
7034 member.
7035 (symbol_list_new): Adjust.
7036 * src/reader.c (symbol_typed_p): New.
7037 (grammar_rule_check): Use it.
7038 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
7039 Check its rule.
7040 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
7041 Use it.
7042 * tests/actions.at (Exotic Dollars): Adjust.
7043
7044 2006-01-04 Akim Demaille <akim@epita.fr>
7045
7046 * src/reader.c (grammar_midrule_action): If $$ is set in a
7047 mid-rule, move the `used' bit to its lhs.
7048 * tests/input.at (Unused values): New.
7049 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
7050
7051 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
7052
7053 * doc/bison.texinfo (Bison Options): Say more accurately what
7054 --yacc does.
7055 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
7056 about declarations in the grammar when in Yacc mode, as POSIX does
7057 not require a diagnostic when the grammar uses extensions.
7058
7059 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
7060
7061 Warn about dubious constructions like "%token T T".
7062 Reported by twlevo.
7063 * src/symtab.h (struct symbol.declared): New member.
7064 * src/symtab.c (symbol_new): Initialize it to false.
7065 (symbol_class_set): New arg DECLARING, specifying whether
7066 this is a declaration that we want to warn about, if there
7067 is more than one of them. All uses changed.
7068
7069 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
7070 Allow multiple %union directives, whose contents concatenate.
7071 * src/parse-gram.y (grammar_declaration): Likewise.
7072 Use muscle_code_grow, so that we don't need stype_line any more.
7073 All uses changed.
7074
7075 * src/muscle_tab.c (muscle_grow): Fix comment.
7076
7077 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
7078 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
7079 Update copyright year to 2006.
7080
7081 2006-01-03 Akim Demaille <akim@epita.fr>
7082
7083 Have glr.cc pass (some of) the calc.at tests.
7084 * data/glr.cc (b4_parse_param_orig): New.
7085 (b4_parse_param): Improve its definition, and bound it more
7086 clearly in the skeleton.
7087 (b4_epilogue): Append, instead of prepending, in order to keep
7088 #line consistency.
7089 Simplify the generation of auxiliary functions: locations and
7090 purity are mandated.
7091 (b4_global_tokens_and_yystype): Honor it.
7092 * data/location.cc (c++.m4): Don't include it.
7093 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
7094 and AT_SKEL_CC_IF.
7095 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
7096 AT_LALR1_CC_IF.
7097 Be sure to initialize the first position's filename.
7098 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
7099 mandated anyway.
7100 (AT_CHECK_CALC_GLR_CC): New.
7101 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
7102
7103 2006-01-02 Akim Demaille <akim@epita.fr>
7104
7105 * src/output.c (output_skeleton): Don't hard wire the inclusion of
7106 c.m4.
7107 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
7108 * data/glr.cc: Do not include stack.hh.
7109
7110 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7111
7112 * data/glr.c: Reformat whitespace with tabs.
7113 (b4_lpure_formals): Remove this unused m4 macro.
7114 * tests/cxx-type.at: Reformat whitespace with tabs.
7115 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
7116 since it's a member. Rename type to isNterm for clarity.
7117
7118 2005-12-29 Akim <akim@sulaco.local>
7119
7120 Let glr.cc catch up with symbol_value_print.
7121 * data/glr.cc (b4_yysymprint_generate): Replace by...
7122 (b4_yy_symbol_print_generate): this.
7123 (yy_symbol_print, yy_symbol_value_print): Declare them.
7124
7125 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
7126
7127 * src/location.h (boundary): Note that a line or column equal
7128 to INT_MAX indicates an overflow.
7129 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
7130 (rule_length_overflow, increment_rule_length, add_column_width):
7131 New functions.
7132 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
7133 (<SC_BRACED_CODE>"}"):
7134 Use increment_rule_length rather than incrementing it by hand.
7135 (adjust_location, handle_syncline): Diagnose overflow.
7136 (handle_action_dollar, handle_action_at):
7137 Fix bug with monstrosities like $-2147483648.
7138 Remove now-unnecessary checks.
7139 (scan_integer): Verify assumptions and remove now-unnecessary checks.
7140 (convert_ucn_to_byte): Verify assumptions.
7141 (handle_syncline): New arg LOC. All callers changed.
7142 Don't store through a value derived from char const * pointer.
7143
7144 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
7145 GCC warnings.
7146
7147 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
7148
7149 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
7150 Remove unnecessary forward static decls.
7151
7152 2005-12-27 Akim Demaille <akim@epita.fr>
7153
7154 * src/reader.c (grammar_current_rule_check): Also check that $$
7155 is used.
7156 Take the rule to check as argument, hence rename as...
7157 (grammar_rule_check): this.
7158 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
7159 Rename as...
7160 (grammar_rule_begin, grammar_rule_end): these, for consistency.
7161 (grammar_midrule_action, grammar_symbol_append): Now static.
7162 * tests/torture.at (input): Don't rely on the default action
7163 being always performed.
7164 * tests/calc.at: "Set" $$ even when the action is "cut" with
7165 YYERROR or other.
7166 * tests/actions.at (Exotic Dollars): Instead of using unused
7167 values, check that the warning is issued.
7168
7169 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
7170
7171 * NEWS: Improve wording for unused-value warnings.
7172
7173 2005-12-22 Akim Demaille <akim@epita.fr>
7174
7175 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
7176 (b4_yysymprint_generate): Rename as...
7177 (b4_yy_symbol_print_generate): this.
7178 Generate yy_symbol_print instead of yysymprint.
7179 Generate also yy_symbol_value_print, and use it.
7180
7181 2005-12-22 Akim Demaille <akim@epita.fr>
7182
7183 * NEWS: Warn about unused values.
7184 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
7185 a `used' member.
7186 (symbol_list_n_get, symbol_list_n_used_set): New.
7187 (symbol_list_n_type_name_get): Use symbol_list_n_get.
7188 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
7189 * src/reader.c (grammar_current_rule_check): Check that values are
7190 used.
7191 * src/symtab.c (symbol_print): Accept 0.
7192 * tests/existing.at: Remove the type information.
7193 Empty the actions.
7194 Remove useless actions (beware of mid-rule actions: perl -000
7195 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
7196 * tests/actions.at (Exotic Dollars): Use unused values.
7197 * tests/calc.at: Likewise.
7198 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7199 Likewise.
7200
7201 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
7202 rule_useful_p.
7203
7204 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
7205
7206 Undo 2005-12-01 tentative license wording change. The wording is
7207 still being reviewed by the lawyers, and we don't want to wait for
7208 them before publishing a test release. For now, revert to the
7209 previous wording.
7210 * NEWS: Undo 2005-12-01 change.
7211 * data/glr.c: Revert to previous license wording.
7212 * data/glr.cc: Likewise.
7213 * data/lalr1.cc: Likewise.
7214 * data/location.cc: Likewise.
7215 * data/yacc.c: Likewise.
7216
7217 * NEWS: Reword %destructor vs YYABORT etc.
7218 * data/glr.c: Use American spacing, for consistency.
7219 * data/glr.cc: Likewise.
7220 * data/lalr1.cc: Likewise.
7221 * data/yacc.c: Likewise.
7222 * data/yacc.c: Reformat comments slightly.
7223 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
7224 for consistency. Fix some spelling errors and reword recently-included
7225 text slightly.
7226 * tests/cxx-type.at: Cast results of malloc, for C++.
7227
7228 2005-12-21 Joel E. Denny <address@hidden>
7229
7230 * tests/cxx-type.at: Construct a tree, count the parents of shared
7231 nodes, and free each node once and only once. Previously, the memory
7232 for semantic values was leaked instead.
7233
7234 2005-12-21 Joel E. Denny <address@hidden>
7235
7236 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
7237 (yylval, yylloc): If pure, #define to yystackp->yyval and
7238 yystackp->yyloc similar to yychar and yynerrs.
7239 (yyparse): If pure, remove local yylval and yylloc. Add local
7240 yystackp to accommodate pure definitions of yylval and yylloc.
7241 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
7242 yylvalp and yyllocp to &yylval and &yylloc.
7243 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
7244 namespace. Previously, nerrs and char were missing, but lval and lloc
7245 weren't necessary.
7246 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
7247 yylvalp and yyllocp parameters since, if pure, these are now always
7248 accessible through yystackp. If not pure, they are still accessible
7249 globally.
7250 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
7251 `if (YYID (N))' to pacify lint.
7252
7253 2005-12-21 Akim Demaille <akim@epita.fr>
7254
7255 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
7256 destroy the RHS symbols of a rule.
7257 * data/yacc.c (yylen): Initialize to 0.
7258 Keep its value to the number of items to possibly shift.
7259 In particular, a regular successful parse that ends on YYFINAL by
7260 a (internal) YYACCEPT must not have yylen != 0.
7261 (yyerrorlab, yyreturn): Pop the RHS.
7262 Reorder a bit to emphasize the `shifting' bits of code.
7263 (YYPOPSTACK): Now accept a number of items to pop.
7264 * data/lalr1.cc: Likewise.
7265 * data/glr.c: Formatting changes.
7266 Use goto instead of fall through.
7267 * doc/bison.texinfo (Destructor Decl): Complete.
7268
7269 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7270
7271 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7272 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
7273 * djgpp/config.bat: Replace every occurence of the file name
7274 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7275 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7276 * djgpp/config.sed: Replace every occurence of the file name
7277 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7278 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7279 * djgpp/djunpack.bat: DJGPP specific file.
7280 * djgpp/fnchange.lst: DJGPP specific file.
7281 * djgpp/README.in: Add new information about how to unpack the bison
7282 source on MSDOS and other systems which have 8.3 file name restrictions
7283 using djunpack.bat and fnchange.lst.
7284
7285 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
7286
7287 * bootstrap (build_cvs_prefix): Remove; unused.
7288 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
7289 when getting gnulib.
7290
7291 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
7292
7293 * data/glr.c: Reorder typedef declarations for structs to match order
7294 of struct declarations.
7295 Rename yystack everywhere to yystackp except in yyparse where it's not
7296 a pointer.
7297 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
7298 consistency.
7299 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
7300 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
7301 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
7302 lint.
7303
7304 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
7305
7306 * tests/sets.at (Accept): Fix typos in regular expression used to
7307 sed out the final state number.
7308
7309 Work around portability problem on Solaris 10: flex-generated
7310 files include <stdio.h> before <config.h>, which messes up
7311 because the latter defines __EXTENSIONS__. Address the problem
7312 by creating two new little files that include <config.h> first,
7313 then include the flex-generated files. Rewrite everyone else
7314 to include <config.h> first, as well.
7315 * lib/timevar.c: Always include "config.h".
7316 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
7317 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
7318 (EXTRA_bison_SOURCES): New macro.
7319 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
7320 * src/system.h: Don't include config.h.
7321 * src/LR0.c: Include <config.h> first.
7322 * src/assoc.c: Likewise.
7323 * src/closure.c: Likewise.
7324 * src/complain.c: Likewise.
7325 * src/conflicts.c: Likewise.
7326 * src/derives.c: Likewise.
7327 * src/files.c: Likewise.
7328 * src/getargs.c: Likewise.
7329 * src/gram.c: Likewise.
7330 * src/lalr.c: Likewise.
7331 * src/location.c: Likewise.
7332 * src/main.c: Likewise.
7333 * src/muscle_tab.c: Likewise.
7334 * src/nullable.c: Likewise.
7335 * src/output.c: Likewise.
7336 * src/parse-gram.y: Likewise.
7337 * src/print.c: Likewise.
7338 * src/print_graph.c: Likewise.
7339 * src/reader.c: Likewise.
7340 * src/reduce.c: Likewise.
7341 * src/relation.c: Likewise.
7342 * src/state.c: Likewise.
7343 * src/symlist.c: Likewise.
7344 * src/symtab.c: Likewise.
7345 * src/tables.c: Likewise.
7346 * src/uniqstr.c: Likewise.
7347 * src/vcg.c: Likewise.
7348
7349 * src/parse-gram.y: Fix minor problems uncovered by lint.
7350 (current_lhs, current_lhs_location): Now static.
7351 (current_assoc): Remove unused variable.
7352
7353 Cleanups so that Bison-generated parsers have less lint.
7354 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
7355 Prepend /*ARGSUSED*/, for lint's sake.
7356 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
7357 definition if 'lint' is defined.
7358 (YYID): New macro (or function, if lint).
7359 All uses of /*CONSTCOND*/0 replaced by YYID(0).
7360 * data/yacc.c: Likewise.
7361 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
7362 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
7363 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
7364 is C++ only.
7365 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
7366 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
7367 Use YYID(0) rather than 0, for lint.
7368 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
7369 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
7370
7371 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
7372
7373 * tests/glr-regression.at
7374 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7375 Close memory leak reported by twlevo.
7376
7377 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
7378
7379 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
7380 all stacks.
7381 (yyparse): Iterate another stack in order to call user destructors.
7382 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7383 New test case.
7384 (Duplicated user destructor for lookahead): This test now is expected
7385 to succeed.
7386
7387 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
7388
7389 * NEWS: Document the following change.
7390 * data/yacc.c: Say "parser skeleton" rather than "file", since
7391 it's no longer just a file.
7392 * data/glr.c: Grant a special exception for C GLR parsers, that
7393 reads like the already-existing exception for C LALR(1) parsers.
7394 * data/glr.cc: Likewise.
7395 * data/lalr1.cc: Likewise.
7396 * data/location.cc: Likewise.
7397 * data/yacc.c: Reword the "written by" statement to clarify that
7398 it was the parser skeleton, not the entire output file.
7399 * data/glr.c: Written by Paul Hilfinger.
7400 * data/glr.cc: Written by Akim Demaille.
7401 * data/lalr1.cc: Likewise.
7402
7403 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
7404
7405 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
7406 Fix typos in previous change that broke 'make check'.
7407 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
7408 supported in C.
7409 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
7410 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
7411 We can revert this once things settle down.
7412
7413 * src/conflicts.c (conflicts_print): Don't print file name twice
7414 when %expect fails because there were no conflicts.
7415 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
7416 change.
7417 * tests/conflicts.at (%expect not enough, %expect too much):
7418 (%expect with reduce conflicts): Adjust to new behavior.
7419
7420 2005-11-18 Akim Demaille <akim@epita.fr>
7421
7422 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
7423 errors.
7424 * NEWS: Document this.
7425 * doc/bison.texinfo (Expect Decl): Likewise.
7426
7427 2005-11-16 Akim Demaille <akim@epita.fr>
7428
7429 Generalize the display of semantic values and locations in traces.
7430 * data/glr.c (yy_reduce_print): Fix indices (again).
7431 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
7432 literal integers.
7433 * data/lalr1.cc (yyreduce_print): Rename as...
7434 (yy_reduce_print): this.
7435 Display values and locations.
7436 * data/yacc.c (yy_reduce_print): Likewise.
7437 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
7438 (yysymprint): Move higher to be visible from yy_reduce_print).
7439 (yyparse): Adjust.
7440 * tests/calc.at: Adjust the expected length of the traces.
7441
7442 2005-11-14 Akim Demaille <akim@epita.fr>
7443
7444 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
7445 from 1 to N, while values and location start at 0.
7446 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
7447
7448 2005-11-14 Akim Demaille <akim@epita.fr>
7449
7450 * data/glr.c (yy_reduce_print): Fix the $ number.
7451
7452 2005-11-14 Akim Demaille <akim@epita.fr>
7453
7454 "Use" parse parameters.
7455 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
7456 * data/glr.c, data/glr.cc: Use them.
7457 * data/glr.c (YYUSE): Have a C++ definition that supports
7458 non-pointer types.
7459
7460 2005-11-14 Akim Demaille <akim@epita.fr>
7461
7462 * data/glr.c (yyexpandGLRStack): Declare only if defined.
7463
7464 2005-11-14 Akim Demaille <akim@epita.fr>
7465
7466 * data/glr.cc: New.
7467 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
7468
7469 2005-11-12 Akim Demaille <akim@epita.fr>
7470
7471 Let position and location be PODs.
7472 * data/location.cc (position::initialize, location::initialize): New.
7473 (position::position, location::location): Define only if
7474 b4_location_constructors is defined.
7475 * data/lalr1.cc (b4_location_constructors): Define it for backward
7476 compatibility.
7477 * doc/bison.texinfo (Initial Action Decl): Use initialize.
7478
7479 2005-11-12 Akim Demaille <akim@epita.fr>
7480
7481 * data/lalr1.cc: Move the body of the ctor and dtor into the
7482 parser file (instead of the header).
7483 Wrap the implementations in a "namespace yy".
7484
7485 2005-11-12 Akim Demaille <akim@epita.fr>
7486
7487 Have glr.c include its header file when created.
7488 * data/glr.c (b4_shared_declarations): New.
7489 Output them verbatim in the parser if !%defines, otherwise
7490 output then in the header file, and include it instead.
7491
7492 2005-11-11 Akim Demaille <akim@epita.fr>
7493
7494 * data/glr.c: Comment changes.
7495
7496 2005-11-11 Akim Demaille <akim@epita.fr>
7497
7498 When yydebug, report semantic and location values for reductions.
7499 * data/glr.c (yy_reduce_print): Report the semantic values and the
7500 locations.
7501 (YY_REDUCE_PRINT): Adjust.
7502 (yyglrReduce): Use them.
7503 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
7504 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
7505 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
7506 traces.
7507
7508 2005-11-10 Akim Demaille <akim@epita.fr>
7509
7510 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
7511 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
7512 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
7513
7514 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
7515
7516 * m4/cxx.m4, examples/Makefile.am: Don't build
7517 examples/calc++ if no C++ compiler is available. (trivial change)
7518
7519 2005-11-09 Akim Demaille <akim@epita.fr>
7520
7521 * src/scan-skel.l: Use a couple of asserts.
7522
7523 2005-11-03 Akim Demaille <akim@epita.fr>
7524
7525 In some (weird) cases, the final state number is incorrect.
7526 Reported by Alexandre Duret-Lutz.
7527 * src/LR0.c (state_list_append): Remove the computation of
7528 final_state.
7529 (save_reductions): Do it here.
7530 (get_state): Alpha conversion.
7531 (generate_states): Use a for loop.
7532 * src/gram.h (item_number_is_rule_number)
7533 (item_number_is_symbol_number): New.
7534 * src/state.c: Use assert.
7535 * src/system.h: Include assert.h.
7536 * tests/sets.at (Accept): New.
7537
7538 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7539
7540 * data/glr.c (yyfill): Adjust comment.
7541 (yyresolveAction): Initialize default location properly
7542 for empty right-hand sides.
7543 (yydoAction): Ditto.
7544 Add comment explaining apparently dead code.
7545 * tests/glr-regression.at
7546 (Incorrectly initialized location for empty right-hand side in GLR):
7547 New test.
7548
7549 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
7550
7551 * bootstrap (cleanup_gnulib): New function. Use it to clean up
7552 gnulib when interrupted. This fixes some race conditions and
7553 works around some portability problems (one noted by Paul
7554 Hilfinger).
7555
7556 2005-10-22 Akim <akim@epita.fr>
7557
7558 * Makefile.cfg: Adjust to config -> build-aux.
7559 Reported by twledo.
7560
7561 2005-10-21 Akim Demaille <akim@epita.fr>
7562
7563 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
7564 the %parse-params.
7565 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
7566 * data/yacc.c (b4_Pure_if): Rename as...
7567 (b4_yacc_pure_if): this.
7568 (YY_SYMBOL_PRINT, yyparse): Adjust.
7569 * doc/bison.texinfo: Formatting changes.
7570
7571 2005-10-21 Akim Demaille <akim@epita.fr>
7572
7573 Finish the transition config -> build-aux.
7574 * configure.ac, Makefile.am: Use build-aux.
7575 * config/prev-version, config/announce-gen, config/Makefile.am:
7576 Move to...
7577 * build-aux/prev-version, build-aux/announce-gen,
7578 * build-aux/Makefile.am: here.
7579
7580 2005-10-14 Akim Demaille <akim@epita.fr>
7581
7582 * examples/calc++/test: Use set -x only when VERBOSE.
7583
7584 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
7585
7586 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
7587 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
7588
7589 2005-10-13 Akim Demaille <akim@epita.fr>
7590
7591 * src/scan-skel.l: Output the base name parts of the parser and
7592 header file names.
7593 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7594 additional checks.
7595 Use this to exercise C++ outputs in subdirs.
7596 Reported by Oleg Smolsky.
7597
7598 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
7599
7600 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
7601 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
7602 Problem reported by John P. Hartmann.
7603 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
7604 already defined it.
7605
7606 2005-10-12 Akim Demaille <akim@epita.fr>
7607
7608 * src/parse-gram.y (version_check): Exit 63 to please missing
7609 (stands for "version mismatch).
7610 * tests/input.at, doc/bison.texinfo: Adjust.
7611
7612 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
7613
7614 Work around portability problems with Visual Age C compiler
7615 (xlc and xlC_r) reported by John P. Hartmann.
7616 * data/location.cc (initial_column, initial_line): Remove.
7617 All uses replaced by 0 and 1.
7618 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
7619 that xlc complains about.
7620 * src/scan-skel.l (skel_wrap): Likewise.
7621 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
7622 as __STDC__.
7623 * data/yacc.c (YYMODERN_C): New macro, which also looks at
7624 __STDC_VERSION__. Use it everywhere instead of looking at
7625 __STDC__ and __cplusplus.
7626
7627 2005-10-10 Akim Demaille <akim@epita.fr>
7628
7629 * examples/calc++/test: Be quiet unless VERBOSE.
7630
7631 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
7632
7633 * data/c.m4 (yydestruct, yysymprint):
7634 Use YYUSE instead of casting to void.
7635 * data/glr.c (YYUSE): New macro.
7636 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7637 Use it instead of rolling our own.
7638 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7639 (YYCHK1):
7640 Use /*CONSTCOND*/ to suppress lint warnings.
7641 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7642 (YY_STACK_PRINT): Use 'false' not '0'.
7643 (YYUSE): New macro.
7644 (yysymprint_, yydestruct_): Use it instead of rolling our own.
7645 * data/yacc.c (YYUSE): New macro.
7646 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
7647 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
7648 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
7649
7650
7651 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
7652 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
7653
7654 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
7655
7656 Undo the parts of the unlocked-I/O change that substituted
7657 putc or puts for printf. This might hurt performance a bit,
7658 but some people prefer the printf style.
7659 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
7660 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
7661 All uses replaced by YYFPRINTF and YYDPRINTF.
7662 * data/yacc.c: Likewise.
7663 * lib/bitset.c (bitset_print): Likewise.
7664 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
7665 putc and puts.
7666 * lib/lbitset.c (debug_lbitset): Likewise.
7667 * src/closure.c (print_firsts, print_fderives): Likewise.
7668 * src/gram.c (grammar_dump): Likewise.
7669 * src/lalr.c (look_ahead_tokens_print): Likewise.
7670 * src/output.c (escaped_output): Likewise.
7671 (user_actions_output): Break apart two printfs.
7672 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
7673 * src/reduce.c (reduce_print): Likewise.
7674 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7675 * src/system.h: Include unlocked-io.h rathe than stdio.h.
7676
7677 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7678 Use assignments rather than casts-to-void to suppress
7679 unused-variable warnings. This pacifies 'lint'.
7680 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
7681 unused-variable warnings.
7682
7683 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7684
7685 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7686
7687 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
7688
7689 Use unlocked I/O for a minor performance improvement on hosts like
7690 GNU/Linux and Solaris that support unlocked I/O. The basic idea
7691 is to use the gnlib unlocked-io module, and to prefer putc and
7692 puts to printf when either will work (since the latter doesn't
7693 come in an unlocked flavor).
7694 * bootstrap (gnulib_modules): Add unlocked-io.
7695 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
7696 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
7697 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
7698 and similarly for puts and putc and printf.
7699 * data/yacc.c: Likewise.
7700 * lib/bitset.c (bitset_print): Likewise.
7701 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
7702 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
7703 to printf.
7704 * lib/lbitset.c (debug_lbitset): Likewise.
7705 * src/closure.c (print_firsts, print_fderives): Likewise.
7706 * src/gram.c (grammar_dump): Likewise.
7707 * src/lalr.c (look_ahead_tokens_print): Likewise.
7708 * src/output.c (escaped_output): Likewise.
7709 (user_actions_output): Coalesce two printfs.
7710 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
7711 * src/reduce.c (reduce_print): Likewise.
7712 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7713 * src/system.h: Include unlocked-io.h rather than stdio.h.
7714
7715 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
7716 this confuses xgettext.
7717
7718 2005-10-02 Akim Demaille <akim@epita.fr>
7719
7720 * bootstrap (gnulib_modules): Add strverscmp.
7721 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
7722 * m4/.cvsignore: Add strverscmp.m4.
7723 * src/parse-gram.y (%require): New token, new rule.
7724 (version_check): New.
7725 * src/scan-gram.l (%require): Adjust.
7726 * tests/input.at (AT_REQUIRE): New.
7727 Use it.
7728 * doc/bison.texinfo (Require Decl): New.
7729 (Calc++ Parser): Use %require.
7730
7731 2005-10-02 Akim Demaille <akim@epita.fr>
7732
7733 * data/location.cc: New.
7734
7735 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
7736 Akim Demaille <akim@epita.fr>
7737
7738 Make sure -odir/foo.cc creates dir/location.hh etc.
7739 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
7740 (spec_file_prefix, spec_verbose_file, spec_graph_file)
7741 (spec_defines_file): Now const.
7742 (dir_prefix): New.
7743 (short_base_name): Remove.
7744 * src/files.c: Adjust.
7745 (dirname.h): Include.
7746 (base_name): Don't prototype it.
7747 (finput): Remove, duplicates gram_in.
7748 (full_base_name, short_base_name): Replace by...
7749 (all_but_ext, all_but_tab_ext): these.
7750 (compute_base_names): Rename as...
7751 (compute_file_name_parts): this.
7752 Update to compute the new variables, including dir_prefix.
7753 Adjust dependencies.
7754 * src/output.c (prepare): Output them.
7755 * src/reader.c: Adjust to use gram_in, not finput.
7756 * src/scan-skel.l (@dir_prefix@): New.
7757
7758 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7759
7760 * lib/subpipe.c: New function end_of_output_subpipe() added
7761 to allow support for non-posix systems. This is a no-op function
7762 for posix systems.
7763
7764 * lib/subpipe.h: New function end_of_output_subpipe() added
7765 to allow support for non-posix systems. This is a no-op function
7766 for posix systems.
7767
7768 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
7769 handle the lack of pipe/fork functionality on non-posix systems.
7770
7771 * djgpp/Makefile.maint: DJGPP specific file.
7772
7773 * djgpp/README.in: DJGPP specific file.
7774
7775 * djgpp/config.bat: DJGPP specific configuration file.
7776
7777 * djgpp/config.sed: DJGPP specific configuration file.
7778
7779 * djgpp/config.site: DJGPP specific configuration file.
7780
7781 * djgpp/config_h.sed: DJGPP specific configuration file.
7782
7783 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
7784
7785 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
7786
7787 2005-10-02 Akim Demaille <akim@epita.fr>
7788
7789 * data/location.cc: New, extract from...
7790 * data/lalr1.cc: here.
7791 (location.hh): Include it after the user prologue, in case the
7792 filename type is defined by the user.
7793 Forward declation location and position before the pre-prologue.
7794 (yyresult_): Rename as...
7795 (yyresult): this, it's a local variable, not an attribute.
7796 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
7797
7798 2005-10-01 Akim Demaille <akim@epita.fr>
7799
7800 * examples/extexi: Restore the #line generation.
7801
7802 2005-09-30 Akim Demaille <akim@epita.fr>,
7803 Alexandre Duret-Lutz <adl@gnu.org>
7804
7805 Move the token type and YYSTYPE in the parser class.
7806 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
7807 (parser::token): New, from the moved free definition of tokens.
7808 (parser::semantic_value): Now a full definition instead of an
7809 indirection to YYSTYPE.
7810 (b4_post_prologue): No longer included in the header file, but
7811 in the implementation file.
7812 * doc/bison.texi (C+ Language Interface): Update.
7813 * src/parse-gram.y: Support unary %define.
7814 * tests/actions.at: Define global_tokens_and_yystype for backward
7815 compatibility until we update the tests.
7816 * tests/calc.at: Idem.
7817 (first_line, first_column, last_line, last_column): Define for lalr1.cc
7818 to simplify the code.
7819
7820 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
7821
7822 Port to SunOS 4.1.4, which lacks strtoul and strerror.
7823 Ah, the good old days! Problem reported by Peter Klein.
7824 * bootstrap (gnulib_modules): Add strerror, strtoul.
7825 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
7826 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
7827
7828 2005-09-29 Akim Demaille <akim@epita.fr>
7829
7830 * data/c.m4 (b4_error_verbose_if): New.
7831 * data/lalr1.cc: Use it.
7832 (YYERROR_VERBOSE_IF): Remove.
7833 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
7834 parser members, replaced by...
7835 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
7836 local variables.
7837 (yysyntax_error_): Takes the state number as argument.
7838 (yyreduce_print_): Use the argument yyrule, not the former
7839 attribute yyn_.
7840
7841 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
7842
7843 * bootstrap (gnulib_modules): Add verify.
7844 * lib/.cvsignore: Add verify.h.
7845 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
7846 * src/system.h (verify): Remove.
7847 Include verify.h instead.
7848 * src/tables.c (tables_generate): Use new API for 'verify'.
7849
7850 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
7851
7852 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
7853 local variables whose names begin with 'yy'.
7854 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
7855 Trivial changes from Joel E. Denny.
7856
7857 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
7858 it itself.
7859 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
7860 don't use alloca any more.
7861
7862 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
7863 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
7864 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
7865 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
7866 to match yacc.c, to test more hosts.
7867
7868 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
7869
7870 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
7871 doesn't affect behavior.
7872 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
7873 Solaris, AIX, MSC.
7874 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
7875 This works a bit better with glibc, if user code has already included
7876 stdlib.h.
7877 * doc/bison.texinfo (Bison Parser): Document that users can't
7878 arbitrarily use malloc and free for other purposes. Document
7879 that <alloca.h> and <malloc.h> might be included.
7880 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
7881 user must declare alloca.
7882
7883 * HACKING (release): Forwarn the Translation Project about
7884 stable releses.
7885
7886 2005-09-20 Akim Demaille <akim@epita.fr>
7887
7888 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
7889
7890 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
7891
7892 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
7893 (YYSTACK_ALLOC_MAXIMUM): Use it.
7894 (yysyntax_error): New function.
7895 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
7896 multiple syntax errors are reported, and alloca is being used.
7897 Instead, reallocate buffers twice as big each time, so that
7898 we waste at most half the allocated memory. Start with a small
7899 (128-byte) buffer that will suffice in most cases anyway.
7900 Use yysyntax_error to do most of the work.
7901
7902 * doc/bison.texinfo (Error Reporting, Table of Symbols):
7903 yynerrs is the number of errors reported, not the number of
7904 errors encountered.
7905
7906 * tests/glr-regression.at (Duplicated user destructor for lookahead):
7907 Mark it as expected to fail.
7908 Cast result of malloc; problem reported by twlevo@xs4all.nl.
7909 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
7910 Don't start user-code symbols with "yy", to avoid name space problems.
7911
7912 2005-09-19 Akim Demaille <akim@epita.fr>
7913
7914 Remove the traits, failed experiment.
7915 It never proved useful, and anyway because of the current
7916 definition, it was not possible to have several specialization of
7917 this traits, making it useless.
7918 * data/lalr1.cc (yy:traits): Remove.
7919 Inline its definitions in the parser class.
7920
7921 2005-09-19 Akim Demaille <akim@epita.fr>
7922
7923 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
7924 least Mac OSX with a /usr/local install of gettext.
7925
7926 2005-09-19 Akim Demaille <akim@epita.fr>
7927
7928 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
7929 and yytoken for similarity with the other skeletons.
7930
7931 2005-09-19 Akim Demaille <akim@epita.fr>
7932
7933 * NEWS, configure.ac: update version number to 2.1a.
7934
7935 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
7936
7937 * NEWS: Version 2.1.
7938
7939 * NEWS: Remove notice of yytname change, since it was never in an
7940 official release.
7941 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
7942 diagnostic.
7943 * src/output.c (prepare): Likewise.
7944 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
7945 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
7946 is not defined. This is an awful hack, but it's enough for now.
7947 All callers changed.
7948 * tests/glr-regression-at (make_value): Args are const pointers now,
7949 to avoid GCC warning.
7950 (Duplicated user destructor for lookahead): New test. Currently
7951 skipped. It fails on my host but I'm not sure it'll always fail.
7952
7953 2005-09-16 Akim Demaille <akim@epita.fr>
7954
7955 * src/symtab.h (struct symbol): Declare the printer and destructor
7956 as const, to avoid accidental calls to free.
7957 (symbol_destructor_set, symbol_printer_set): Adjust.
7958 * src/symtab.c: Adjust.
7959
7960 2005-09-16 Akim Demaille <akim@epita.fr>
7961
7962 * data/c.m4 (b4_token_enums): New.
7963 (b4_token_defines): Rename as...
7964 (b4_token_enums_defines): this.
7965 (b4_token_defines): New, output only the #defines.
7966 * data/yacc.c, data/glr.c: Adjust.
7967 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
7968 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
7969 as default values.
7970
7971 2005-09-16 Akim Demaille <akim@epita.fr>
7972
7973 * data/lalr1.cc (yylex_): Remove, inline its code.
7974 (yyreport_syntax_error_): Remove, replaced by...
7975 (yysyntax_error_): this which returns a string and leaves to the
7976 caller the call to the users' error function.
7977 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
7978 Move from members of the parser object...
7979 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
7980 to local variables of the parse function.
7981
7982 2005-09-16 Akim Demaille <akim@epita.fr>
7983
7984 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
7985 since it's in Bison's name space.
7986
7987 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
7988
7989 * data/glr.c (yyresolveValue): Add default case to pacify
7990 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
7991
7992 * NEWS: Document when yyparse started to return 2.
7993 * doc/bison.texinfo (Parser Function): Document when yyparse
7994 returns 2.
7995
7996 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
7997 (b4_filename_type): Renamed back from b4_file_name_type. All uses
7998 changed.
7999 (class position): file_name -> filename (reverting). All uses changed.
8000
8001 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
8002
8003 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
8004 do anything if $@ exists. This reverts part of the 2005-07-07
8005 patch.
8006
8007 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
8008
8009 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
8010 contains obsolete information and isn't worth distributing as a
8011 separate file anyway.
8012 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
8013 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
8014 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
8015 (yyparse): Abort if user code uses longjmp to throw an unexpected
8016 value.
8017
8018 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
8019
8020 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
8021 Suggested by twlevo@xs4all.nl.
8022
8023 * data/glr.c (YYCHK1): Do not assume YYE is in range.
8024 This avoids a diagnostic from gcc -Wswitch-enum.
8025 Problem reported by twlevo@xs4all.nl.
8026
8027 * doc/bison.texinfo: Don't use "filename", as per GNU coding
8028 standards. Use "file name" or "file" or "name", depending on
8029 the context.
8030 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
8031 not to hack/foo.tab.c.
8032 (Calc++ Top Level): 2nd arg of main is not const.
8033 * data/glr.c: b4_filename -> b4_file_name.
8034 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
8035 All uses changed.
8036 (class position): filename -> file_name. All uses changed.
8037 * data/yacc.c: b4_filename -> b4_file_name.
8038 * lib/bitset.h: filename -> file_name in local vars.
8039 * lib/bitset_stats.c: Likewise.
8040 * src/files.c: Likewise.
8041 * src/scan-skel.l ("@output ".*\n): Likewise.
8042 * src/files.c (file_name_split): Renamed from filename_split.
8043 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
8044
8045 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
8046
8047 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
8048 to accommodate latest gnulib.
8049
8050 * tests/glr-regression.at (Duplicate representation of merged trees):
8051 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
8052
8053 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
8054 needed.
8055
8056 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
8057
8058 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
8059 All uses changed. Invoke user destructor after an error during a
8060 split parse (trivial change from Joel E. Denny).
8061
8062 * tests/glr-regression.at
8063 (User destructor after an error during a split parse): New test case.
8064 Problem reported by Joel E. Denny in:
8065 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
8066
8067 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
8068
8069 * README-cvs: Give URLs for recommended tools.
8070 Mention Gzip version problem, and bootstrapping issues.
8071 Remove troubleshooting section, as it's somewhat obsolete.
8072
8073 * bootstrap (no_cache): New var, to accommodate different wget
8074 variants. Use it instead of '-C off'. Problem reported by
8075 twlevo@xs4all.nl.
8076
8077 * data/glr.c (yydestroyStackItem): New function.
8078 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
8079 debugging information. Problem reported by Joel E. Denny.
8080
8081 2005-08-25 Akim Demaille <akim@epita.fr>
8082
8083 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
8084
8085 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
8086
8087 * data/glr.c (yyrecoverSyntaxError, yyreturn):
8088 Don't invoke destructor on unresolved entries.
8089 * tests/glr-regression.at
8090 (User destructor for unresolved GLR semantic value): New test case.
8091 Problem reported by Joel E. Denny in:
8092 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
8093
8094 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
8095
8096 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
8097 Add strnlen.c.
8098 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
8099 lib-prefix.m4, po.m4.
8100
8101 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
8102 in yydestruct diagnostic, since it might not be an error.
8103 Problem reported by Joel Denny near end of
8104 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8105 * data/lalr1.cc (yyerturn): Likewise.
8106 * data/yacc.c (yyreturn): Likewise.
8107 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
8108
8109 * src/files.c: Remove obsolete FIXME comment.
8110
8111 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
8112 with the other templates, and to fix bogus run-on messages such
8113 as the one reported at the end of
8114 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8115 All callers changed to avoid the newline.
8116 (yyprocessOneStack): Output two lines rather than one, to accommodate
8117 the above change. This changes the debug output format slightly.
8118
8119 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
8120 reported by Joel E. Denny in
8121 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
8122 (trivial change).
8123 * tests/glr-regression.at (Duplicate representation of merged trees):
8124 New test, from Joel E. Denny in:
8125 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
8126 * THANKS: Add Joel E. Denny.
8127
8128 * configure.ac (AC_INIT): Bump to 2.0c.
8129
8130 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
8131
8132 * NEWS: Version 2.0b.
8133
8134 * Makefile.am (SUBDIRS): Put examples before tests, so that
8135 "make check" doesn't finish with "All 1 tests passed".
8136
8137 * tests/regression.at (Token definitions): Don't rely on
8138 AT_PARSER_CHECK for data that contains backslashes. It currently
8139 uses 'echo', and 'echo' isn't portable if its argument contains
8140 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
8141 that the byte '\0xff' is not printable in the C locale; it is,
8142 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
8143 not printable, so use '\0x81' to test.
8144
8145 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
8146 version of GCC, since the macro is used with non-GCC compilers.
8147
8148 Fix core dump reported by Pablo De Napoli in
8149 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
8150 * tests/regression.at (Invalid inputs with {}): New test.
8151 * src/parse-gram.y (token_name): Translate type before using
8152 it as an index.
8153
8154 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
8155 the user's name space. All uses changed to __attribute__
8156 ((__unused__)).
8157 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
8158 Add __attribute__ ((__noreturn__)).
8159
8160 * etc/clcommit: Remove. We weren't using it, and it failed
8161 "make maintainer-distcheck".
8162 * Makefile.maint: Merge from coreutils.
8163 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
8164 (syntax-check-rules): Change list of rules as described below.
8165 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
8166 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
8167 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
8168 (sc_trailing_space): New rules.
8169 (sc_xalloc_h_in_src): Remove.
8170 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
8171 (sc_space_tab, sc_error_exit_success, sc_changelog):
8172 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
8173 (makefile-check, po-check, author_mark_check):
8174 (makefile_path_separator_check, copyright-check):
8175 Use grep -n, to make it easier to find violations.
8176 Use CVS_LIST and CVS_LIST_EXCEPT.
8177 (header_regexp, h_re): Remove.
8178 (dd_c): New macro.
8179 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
8180 (my-distcheck): Use more-modern GCC flags.
8181 (signatures, %.asc): Remove.
8182 (rel-files, announcement): Remove signatures.
8183 Restore old updating code, even though we don't use it, so
8184 that we're the same as coreutils.
8185 (alpha, beta, major): Depend on news-date-check.
8186 Make the upload commands.
8187
8188 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
8189 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
8190 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
8191 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
8192 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
8193 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
8194 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
8195 * tests/sets.at: Likewise.
8196
8197 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
8198 we comment out the Autoconf version number.
8199 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
8200 it's error-prone and "make maintainer-distcheck" rejects it.
8201
8202 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
8203 Indent calls to "error" to pacify "make maintainer-distcheck",
8204 when the calls are not intended to be translated.
8205 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
8206
8207 * src/Makefile.am (DEFS): Use +=, to pacify
8208 "make maintainer-distcheck".
8209 (bison_SOURCES): Add scan-skel.h.
8210 (sc_tight_scope): New rule, from coreutils.
8211
8212 * src/files.c (src_extension, header_extension):
8213 Now static, not extern.
8214 * src/getargs.c (short_options): Likewise.
8215 * src/muscle_tab.c (muscle_table): Likewise.
8216 * src/parse-gram.y (current_class, current_type, current_prec):
8217 Likewise.
8218 * src/reader.c (grammar_end, previous_rule_end): Likewise.
8219 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
8220 * src/main.c (main): Cast bindtextdomain and textdomain calls to
8221 void, to avoid warning when NLS is disabled.
8222 * src/output.c: Include scan-skel.h.
8223 (scan_skel): Remove decl, since scan-skel.h does this.
8224 (output_skeleton):
8225 Indent calls to "error" to pacify "make maintainer-distcheck".
8226 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
8227 * src/reader.h (gram_end, gram_lineno): New decls to pacify
8228 "make maintainer-distcheck".
8229 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
8230 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
8231 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
8232 (skel_lex_destroy, scan_skel): Move these decls to...
8233 * src/scan-skel.h: New file.
8234 * src/uniqstr.c (uniqstr_assert):
8235 Indent calls to "error" to pacify "make maintainer-distcheck".
8236
8237 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
8238 not @VAR@.
8239
8240 * tests/torture.at: Revamp to avoid misuse of atoi that
8241 "make maintainer-distcheck" complained about.
8242
8243 * examples/extexi (message): Don't print a message more than once,
8244 and omit line-number decoration that makes Emacs compile think
8245 that informative messages are worth worrying about.
8246
8247 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
8248
8249 * configure.ac: Update version number.
8250
8251 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
8252 accidentally.
8253 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
8254 autogenerated by the maintainer.
8255 * examples/calc++/.cvsignore: Add *.yy.
8256
8257 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
8258 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8259 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8260
8261 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
8262
8263 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
8264 from maintainer-distcheck about casting the argument of 'free'.
8265
8266 * NEWS: Mention recent yytname changes.
8267 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
8268
8269 * bootstrap: For translations that have not yet been upgraded to
8270 the new runtime-po domain, prime the pump by extracting the
8271 relevant strings from the obsolete translations. This code can be
8272 removed once the bison-runtime domain has been translated by each
8273 team.
8274
8275 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
8276 now that token names are already quoted.
8277
8278 Fix problem reported by Anthony Heading.
8279 * data/glr.c (YYTOKEN_TABLE): New macro.
8280 (yytname): Define if YYTOKEN_TABLE.
8281 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
8282 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
8283 (YYERROR_VERBOSE): Define the same way the other skeletons do.
8284 * src/output.c (prepare_symbols): Output token_table_flag.
8285
8286 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
8287
8288 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
8289 again if the first call fails.
8290
8291 * data/glr.c (yytnamerr): New function.
8292 (yyreportSyntaxError): Use it to dequote most string literals.
8293 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
8294 with other skeletons. All uses changed.
8295 (yytnameerr_): New function.
8296 (yyreport_syntax_error): Use it to dequote most string literals.
8297 * data/yacc.c (yytnamerr): New function.
8298 (yyerrlab): Use it to decode most string literals.
8299 * doc/bison.texinfo (Decl Summary, Calling Convention):
8300 Clarify quoting convention of yytname.
8301 * src/output.c (prepare_symbols): Quote all names. This undoes
8302 the 2005-04-17 change, which is now accomplished (mostly) via
8303 changes in the parsers as described above.
8304 * tests/regression.at (Token definitions, Web2c Actions):
8305 Undo most 2005-04-17 change here, too.
8306
8307 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
8308
8309 Fix more problems reported by twlevo@xs4all.nl.
8310 * tests/cxx-type.at: Don't pipe output of ./types through sed to
8311 remove trailing spaces. This loses the exit status of ./types,
8312 and isn't needed since ./types shouldn't be emitting trailing
8313 spaces.
8314 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
8315 as the stack isn't valid in that case.
8316
8317 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8318 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8319 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8320 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
8321 is used.
8322 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
8323 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8324 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8325 Likewise.
8326
8327 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
8328 overly-picky compilers that reject 'char *foo = "bar";'.
8329
8330 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
8331 to FILE * parameter, not to stderr. This fixes a typo introduced
8332 in the 2005-07-12 change.
8333
8334 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
8335 warnings from GCC 4.
8336
8337 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
8338 (yyglrShiftDefer, yysplitStack):
8339 Remove unused parameters b4_pure_formals. All uses changed.
8340 (yyglrShift): Remove unused parameters b4_user_formals.
8341 All uses changed.
8342 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
8343
8344 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
8345
8346 Destructor cleanups and regularization among the three skeletons.
8347 * NEWS: Document the behavior changes.
8348 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
8349 stack before failing, as the cleanup code will do it for us now.
8350 * data/lalr1.cc (yyerrlab): Likewise.
8351 * data/glr.c (yyparse): Pop everything off the stack before
8352 freeing it, so that destructors get called properly.
8353 * data/lalr1.cc (yyreturn): Likewise.
8354 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
8355 This is more consistent.
8356 * doc/bison.texinfo (Destructor Decl): Mention more reasons
8357 why destructors might be called. 1.875 -> 2.1.
8358 (Destructor Decl, Decl Summary, Table of Symbols):
8359 Some English-language cleanups for %destructor.
8360 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8361 Add output line for destructor of start symbol.
8362 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
8363 because of that same extra output line.
8364
8365 * NEWS: Document minor wording changes in diagnostics of
8366 Bison-generated parsers.
8367 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
8368 Remove unused formals. All uses changed.
8369 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
8370 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
8371 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
8372 Rename yyoverflowab to yyexhaustedlab.
8373 When memory exhaustion occurs during syntax-error reporting,
8374 report it separately rather than in a single diagnostic; this
8375 eases translation.
8376 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
8377 (Memory Exhausted): Renamed from Parser Stack Overflow.
8378 Revamp wording slightly to prefer "memory exhaustion".
8379 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
8380
8381 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
8382
8383 Add i18n support to the GLR skeleton. Partially fix the C++
8384 skeleton; a C++ expert needs to finish this. Remove debugging
8385 msgids; there's little point to having them translated, since they
8386 can be understood only by someone who can read the
8387 (English-language) source code.
8388
8389 Generate runtime-po/bison-runtime.pot automatically, so that we
8390 don't have to worry about garbage getting in that file. We'll
8391 make sure after the next official release that old msgids don't
8392 get lost. See
8393 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
8394
8395 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
8396 Now auto-generated.
8397 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
8398 Fix typos in explanations of the runtime file.
8399 * bootstrap: Change gettext keyword from YYI18N to YY_.
8400 Use standard Makefile.in.in in runtime-po, since we'll arrange
8401 for backward-compatible bison-runtime.po files in a different way.
8402 * data/glr.c (YY_): New macro, from yacc.c.
8403 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
8404 Translate messages intended for users.
8405 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
8406 the wording in the other skeletons. We don't know that the memory
8407 is virtual.
8408 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
8409 Use same method that yacc.c uses.
8410 Don't translate debugging messages.
8411 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
8412 it doesn't work (yet), and requires C++ expertise to fix.
8413 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
8414 Move defn to a more logical place, to be consistent with other
8415 skeletons.
8416 Don't translate debugging messages.
8417 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
8418 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
8419 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
8420 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
8421
8422 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
8423 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
8424 void, not int.
8425 * tests/glr-regression.at (Badly Collapsed GLR States):
8426 Likewise.
8427 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8428 yylex should return 0 at EOF rather than aborting.
8429
8430 Improve tests for stack overflow in GLR parser.
8431 Problem reported by twlevo@xs4all.nl.
8432 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
8433 All uses removed.
8434 (yyStackOverflow): Just longjmp, but with value 2 so that caller
8435 can handle the problem.
8436 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
8437 (yyparse): New local variable yyresult to record the result.
8438 Use result of setjmp to set it, rather than storing itinto
8439 struct.
8440 (yyDone): Remove label.
8441 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
8442 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
8443 if YYABORT is used).
8444 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
8445 yyparse status; put status > 1 into diagnostic.
8446 Check that status==2 works.
8447 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
8448 Use exit status 3 for failure to open (which shouldn't happen).
8449
8450 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
8451
8452 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
8453 1 on syntax error; just let yyparse do its thing.
8454 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
8455 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
8456 (Exploding the Stack Size with Alloca):
8457 (Exploding the Stack Size with Malloc):
8458 Expect exit status 2, not 1, since the parser is supposed to blow
8459 its stack. Problem reported by twlevo@xs4all.nl.
8460
8461 * data/glr.c (yyparse): Don't assume that the initial calls
8462 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
8463 Print a stack-overflow message and fail instead.
8464 Initialize the line-number information before creating the stack,
8465 so that the stack-overflow message can report line zero safely.
8466
8467 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
8468
8469 Fix problems reported by twlevo@xs4all.nl.
8470 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
8471 (yyuserMerge): Provide a default case if b4_mergers is empty.
8472 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
8473 * tests/glr-regression.at
8474 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8475 Add casts to pacify C++ compilers.
8476 * tests/glr-regression.at (Improper merging of GLR delayed action
8477 sets): Declare yylex before using it.
8478 * tests/Makefile.am (maintainer-check-g++): Fix a stray
8479 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
8480 test for valgrind; valgrind is independent of g++.
8481 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
8482 for compatibility with POSIX 1003.1-2001 (if running coreutils).
8483 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
8484 Use a destructor, so that we can expand the stack. Change
8485 YYSTYPE to char * so that we can free it. Cast result of malloc.
8486
8487 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8488
8489 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
8490 a valgrind failure. Problem reported by twlevo@xs4all.nl.
8491
8492 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
8493
8494 * PACKAGING: New file, suggested by Bruno Haible and taken from
8495 similar wording in gettext's PACKAGING file.
8496 * NEWS: Mention PACKAGING.
8497 * Makefile.am (EXTRA_DIST): Add PACKAGING.
8498
8499 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
8500
8501 * NEWS: Document recent i18n improvements.
8502 * bootstrap: Get runtime translations into runtime-po.
8503 Create runtime-po files automatically, if possible.
8504 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
8505 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
8506 does not infringe on the user's name space.
8507 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
8508 * doc/bison.texinfo (Internationalization): Revamp the English
8509 and Texinfo syntax a bit, to try to make it clearer.
8510 (Bison Options, Option Cross Key): Mention --print-localedir.
8511 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
8512 YYENABLE_NLS. Quote a bit more.
8513 * runtime-po/.cvsignore: New file.
8514 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
8515 * runtime-po/Rules-quot: Remove; now created by bootstrap.
8516 * runtime-po/quot.sed: Likewise.
8517 * runtime-po/boldquot.sed: Likewise.
8518 * runtime-po/en@quot.header: Likewise.
8519 * runtime-po/en@boldquot.header: Likewise.
8520 * runtime-po/insert-header.sin: Likewise.
8521 * runtime-po/remove-potcdate.sin: Likewise.
8522 * runtime-po/Makevars: Likewise.
8523 * runtime-po/LINGUAS: Likewise.
8524 * runtime-po/de.po: Likewise; we will rely on the translation project
8525 to maintain this, so "bootstrap" should get it.
8526 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
8527 its value.
8528 * src/main.c (main): Bind the bison-runtime domain, too.
8529
8530 2005-07-12 Bruno Haible <bruno@clisp.org>
8531
8532 * data/yacc.c: Include <libintl.h> when NLS is enabled.
8533 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
8534 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
8535 * runtime-po: New directory.
8536 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
8537 $(DOMAIN).pot-update rule, so that old messages are never dropped.
8538 * runtime-po/Rules-quot: New file, copied from po/.
8539 * runtime-po/quot.sed: Likewise.
8540 * runtime-po/boldquot.sed: Likewise.
8541 * runtime-po/en@quot.header: Likewise.
8542 * runtime-po/en@boldquot.header: Likewise.
8543 * runtime-po/insert-header.sin: Likewise.
8544 * runtime-po/remove-potcdate.sin: Likewise.
8545 * runtime-po/Makevars: New file.
8546 * runtime-po/POTFILES.in: New file.
8547 * runtime-po/LINGUAS: New file.
8548 * runtime-po/bison-runtime.pot: New file.
8549 * runtime-po/de.po: New file.
8550 * m4/bison.m4: New file.
8551 * Makefile.am (SUBDIRS): Add runtime-po.
8552 (aclocaldir, aclocal_DATA): New variables.
8553 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
8554 Define aclocaldir.
8555 * src/getargs.c (usage): Document --print-localedir option.
8556 (PRINT_LOCALEDIR_OPTION): New enum item.
8557 (long_options): Add --print-localedir option.
8558 (getargs): Handle --print-localedir option.
8559 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
8560 (Internationalization): New section.
8561
8562 2005-07-12 Akim Demaille <akim@epita.fr>
8563
8564 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
8565 for consistency with the rest of the code.
8566 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
8567 Add separators.
8568
8569 2005-07-12 Akim Demaille <akim@epita.fr>
8570
8571 * src/parse-gram.y: Use %printer instead of YYPRINT.
8572
8573 2005-07-12 Akim Demaille <akim@epita.fr>
8574
8575 * src/symtab.h, src/symtab.c (symbol_print): New.
8576 * src/symlist.h, src/symlist.c (symbol_list_print): New.
8577 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
8578
8579 2005-07-12 Akim Demaille <akim@epita.fr>
8580
8581 * data/glr.c (b4_syncline): Fix (swap) the definitions of
8582 b4_at_dollar and b4_dollar_dollar.
8583
8584 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
8585
8586 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
8587 and Pennello's paper.
8588
8589 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
8590
8591 * data/yacc.c (yyparse): Undo previous patch. Instead,
8592 set yylsp[0] and yyvsp[0] only if the initial action
8593 sets yylloc and yylval, respectively.
8594
8595 * data/yacc.c (yyparse): In the initial action, set
8596 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
8597 This avoids the use of undefined variables if the initial
8598 action does not set yylloc and/or yylval.
8599
8600 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
8601
8602 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
8603 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
8604 Remove from CVS. These files are automatically generated.
8605 * examples/extexi: Clarify that this file is now part of Bison,
8606 not GNU M4, and that it works with any POSIX-compatible Awk.
8607 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
8608 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
8609 so that we also get calc++-parser.yy. Geneate it.
8610 Use $(AWK), not gawk, since any conforming Awk will do.
8611 Put comment before action, since older 'make' can't handle comment
8612 in action.
8613 $(BUILT_SOURCES): List all built sources, not just some of them.
8614 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
8615 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
8616 $($(calc_sources_generated)): Remove unnecessary test for existence
8617 of target. (This had a shell syntax error anyway; a stray "x".)
8618 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
8619 calc++-parser.yy.
8620 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
8621
8622 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
8623 implied by the other modules.
8624
8625 2005-07-06 Akim Demaille <akim@epita.fr>
8626
8627 Bind examples/calc++ to the package.
8628 * examples/calc++/Makefile: Remove, replaced by...
8629 * examples/calc++/Makefile.am: ... this new file.
8630 * examples/calc++/test: Remove input.
8631 * examples/calc++/compile: Remove.
8632 * examples/Makefile.am: New.
8633 * configure.ac, Makefile.am: Adjust.
8634 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
8635
8636 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
8637
8638 * data/glr.c (yyFail): Drastically simplify; since the format argument
8639 never had any % directives, we can simply pass it to yyerror.
8640 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
8641 be modified later, as that is the usual style in glr.c.
8642 Problems reported by Paul Hilfinger.
8643
8644 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
8645 and size overflow errors.
8646 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
8647 in case the user prolog sets feature-test macros like _GNU_SOURCE.
8648 (YYSIZEMAX): New macro.
8649 (yystpcpy): New function, taken from yacc.c.
8650 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
8651 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
8652 so that we don't have to maintain their signatures.
8653 (yyFail): Check for buffer overflow, by using vsnprintf rather
8654 than vsprintf. Allocate a bigger buffer if possible.
8655 Report an error if buffer allocation fails.
8656 (yyStackOverflow): New function.
8657 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
8658 the initialization was successful. It might fail if storage was
8659 exhausted.
8660 (yyexpandGLRStack): Add more checks for storage allocation failure.
8661 Use yyStackOverflow to report failures.
8662 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
8663 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
8664 Don't assume stack number fits in int.
8665 (yysplitStack): Check for storage allocation failure.
8666 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
8667 can print diagnostics on storage allocation failure. All callers
8668 changed.
8669 (yyresolveValue): Use yybool for boolean.
8670 (yyreportSyntaxError): Check for size-calculation overflow.
8671 This code is taken from yacc.c.
8672 (yyparse): Check for storage allocation errors when allocating
8673 the initial stack.
8674
8675 2005-07-05 Akim Demaille <akim@epita.fr>
8676
8677 Extract calc++ from the documentation.
8678 * doc/bison.texinfo (Calc++): Add the extraction marks.
8679 * examples/extexi: New, from the aborted GNU Programming 2E.
8680 Separate the different paragraph of a file with empty lines.
8681 * examples/Makefile: Use it to extract the whole calc++ example.
8682
8683 2005-06-24 Akim Demaille <akim@epita.fr>
8684
8685 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
8686 class typedefs.
8687
8688 2005-06-22 Akim Demaille <akim@epita.fr>
8689
8690 * doc/bison.texinfo (C++ Language Interface): First stab.
8691 (C++ Parsers): Remove.
8692
8693 2005-06-22 Akim Demaille <akim@epita.fr>
8694
8695 * data/lalr1.cc (yylex_): Honor %lex-param.
8696
8697 2005-06-22 Akim Demaille <akim@epita.fr>
8698
8699 Start a set of simple examples.
8700 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
8701 * examples/calc++/calc++-driver.hh,
8702 * examples/calc++/calc++-parser.yy,
8703 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
8704 * examples/calc++/compile, examples/calc++/test: New.
8705
8706 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
8707
8708 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
8709 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
8710 which stems from the 2005-05-27 patch.
8711
8712 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8713
8714 * data/glr.c: Modify treatment of unused parameters to permit use
8715 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
8716
8717 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
8718
8719 Fix infringement on user name space reported by Janos Zoltan Szabo.
8720 * data/yacc.c (yyparse): strlen -> yystrlen.
8721
8722 2005-05-30 Akim Demaille <akim@epita.fr>
8723
8724 * data/lalr1.cc (_): New.
8725 Translate the various messages.
8726
8727 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
8728
8729 Fix infringement on user name space reported by Bruno Haible.
8730 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
8731 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
8732 the user's name space.
8733 (alloca): Include <stdlib.h> to get it, if it's not built in.
8734 (YYMALLOC, YYFREE): Define only if needed.
8735 (malloc, free): Declare, but only if needed, as this infringes on
8736 the user name space.
8737
8738 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
8739
8740 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
8741 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
8742 with %d format.
8743 * lib/ebitset.c (min, max): Undef before defining.
8744 * lib/vbitset.c (min, max): Likewise.
8745 * lib/subpipe.c (create_subpipe): Save local variables in case
8746 vfork clobbers them.
8747
8748 2005-05-24 Bruno Haible <bruno@clisp.org>
8749
8750 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
8751 error message syntax used by gcc-4.0.
8752
8753 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
8754
8755 * README: Mention m4 1.4.3. Remove obsolete advice about
8756 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
8757
8758 * bootstrap: Remove workaround for problem I encountered with
8759 gettext 0.14.1; it seems to be fixed now.
8760
8761 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
8762
8763 * NEWS: Version 2.0a.
8764
8765 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
8766 the previous change.
8767
8768 Various maintainer cleanups.
8769 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
8770 conftest*, for benefit of CVS commands run at the same time as
8771 "configure". Add build-aux, since "bootstrap" now creates it and
8772 its subfiles.
8773 * Makefile.cfg (move_if_change): Remove.
8774 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
8775 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
8776 (po_repo, do-po-update, po-update, wget_files, get-targets):
8777 (config.guess-url_prefix, config.sub-url_prefix):
8778 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
8779 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
8780 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
8781 Remove.
8782 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
8783 this is now the recommended name.
8784 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
8785 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
8786 ylwrap. These files now go into build-aux.
8787 * config/move-if-change: Remove.
8788 * config/prev-version.txt: Bump from 1.75 to 2.0.
8789
8790 * bootstrap: Add stdio-safer, unistd-safer modules.
8791 Remove m4/glibc2.m4 (introduced by latest gnulib, but
8792 we don't need it).
8793 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
8794 fopen-safer.c, stdio-safer.h, unistd-safer.h.
8795 * lib/subpipe.c: Include "unistd-safer.h".
8796 (create_subpipe): Make sure all the newly-created
8797 file descriptors are > 2, so that diagnostics don't
8798 get sent down them (which might cause Bison to hang, in theory).
8799 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
8800 * src/files.c (xfopen): Use fopen_safer, not fopen.
8801
8802 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
8803 yesterday's yacc.c fix.
8804
8805 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
8806
8807 * data/glr.c, data/lalr1.cc: Update copyright date.
8808
8809 Fix a destructor bug reported by Wolfgang Spraul in
8810 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
8811 * data/yacc.c (yyabortlab): Don't call destructor, and
8812 don't set yychar to EMPTY.
8813 (yyoverflowlab): Don't call destructor.
8814 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
8815 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
8816 since we no longer output the message "discarding lookahead token
8817 end of input ()".
8818
8819 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8820
8821 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
8822 fix a small glitch in debugging output.
8823 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
8824 after YY_SYMBOL_PRINT where needed.
8825
8826 (struct yyGLRState): Add some comments.
8827 (struct yySemanticOption): Add some comments.
8828 (union yyGLRStackItem): Add comment.
8829
8830 (yymergeOptionSets): Correct this to properly perform the union,
8831 avoiding infinite reported by Michael Rosien.
8832 Update comment.
8833
8834 * tests/glr-regression.at: Add test for GLR merging error reported
8835 by M. Rosien.
8836
8837 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
8838
8839 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
8840 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
8841 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
8842 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
8843 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
8844 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
8845 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
8846 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
8847 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
8848 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
8849 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
8850 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
8851 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
8852 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
8853 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
8854 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
8855 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
8856 src/derives.h, src/files.c, src/files.h, src/getargs.c,
8857 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
8858 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
8859 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
8860 src/output.h, src/parse-gram.c, src/parse-gram.h,
8861 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
8862 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
8863 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
8864 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
8865 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
8866 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
8867 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
8868 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
8869 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
8870 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
8871 tests/reduce.at, tests/regression.at, tests/sets.at,
8872 tests/synclines.at, tests/testsuite.at, tests/torture.at:
8873 Update FSF postal mail address.
8874
8875 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
8876
8877 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
8878 Problem reported by Ralf Menzel.
8879
8880 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
8881
8882 * tests/actions.at: Test that stack overflow invokes destructors.
8883 From Marcus Holland-Moritz.
8884 * data/yacc.c (yyerrlab): Move the code that destroys the stack
8885 from here....
8886 (yyreturn): to here. That way, destructors are called properly
8887 even if the stack overflows, or the user calls YYACCEPT or
8888 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
8889 (yyoverflowlab): Destroy the lookahead.
8890
8891 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
8892
8893 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
8894
8895 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
8896
8897 * NEWS: Bison-generated C parsers no longer quote literal strings
8898 associated with tokens.
8899 * src/output.c (prepare_symbols): Don't escape strings,
8900 since users don't want to see C escapes.
8901 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
8902 in diagnostics.
8903 * tests/input.at (Torturing the Scanner): Likewise.
8904 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
8905
8906 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
8907
8908 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
8909 the data size is known to be too small and we can't increase it.
8910 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
8911
8912 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
8913
8914 * src/parse-gram.y: Include quotearg.h.
8915 (string_as_id): Quote $1 before using it as a key, since the
8916 lexer no longer quotes it for us.
8917 (string_content): Don't strip quotes, since lexer no longer
8918 quotes it for us.
8919 * src/scan-gram.l: Include quotearg.h.
8920 ("\""): Omit quote.
8921 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
8922 a key, since the rest of the lexer doesn't quote it.
8923 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
8924 * tests/regression.at (Token definitions): Check for backslashes
8925 in token strings.
8926
8927 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
8928 (YYSIZE_T): Define to unsigned long int when using an older compiler.
8929 (yyparse): Revamp code to generate long syntax error message, to
8930 make it easier to translate, and to avoid problems with arithmetic
8931 overflow. Change "virtual memory" to "memory" in diagnostic, since
8932 we don't know whether the memory is virtual.
8933
8934 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
8935
8936 * NEWS: Bison-generated C parsers now use the _ macro to
8937 translate strings.
8938 * data/yacc.c (_) [!defined _]: New macro.
8939 All English strings wrapped inside this macro.
8940 * doc/bison.texinfo (Bison Parser): Document _.
8941 * po/POTFILES.in: Include src/parse-gram.c, since it now
8942 includes translateable strings that parse-gram.y doesn't.
8943
8944 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
8945
8946 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
8947 reverting the 2004-10-11 change to this function.
8948 (symbol_check_alias_consistency): Don't call symbol_type_set
8949 if the type name is already correct.
8950 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
8951
8952 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
8953
8954 * tests/regression.at (Token definitions): Don't use a token named
8955 c, as that generates a "#define c ..." that runs afoul of buggy
8956 stdlib.h that uses the identifier c as a member of struct
8957 drand48_data. Problem reported by Horst Wente.
8958
8959 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
8960
8961 * bootstrap: Change translation URL from
8962 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
8963 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
8964 redirection glitches. Problem reported by twlevo@xs4all.nl.
8965
8966 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
8967
8968 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
8969 after operands; POSIX says this isn't portable for the c99 command.
8970
8971 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
8972
8973 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
8974 immediately if a data overrun has occurred; this may help us track
8975 down what may be a spurious failure on MacOS.
8976
8977 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
8978
8979 Respond to problems reported by twlevo@xs4all.nl.
8980
8981 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
8982
8983 * src/vcg.h: Comment fix.
8984 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
8985 (G_CMAX): Change to -1 instead of INT_MAX.
8986
8987 * data/yacc.c (yyparse): Omit spaces before #line.
8988
8989 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
8990
8991 * src/tables.c (state_number_to_vector_number): Put it inside an
8992 "#if 0", since it's not currently used. Problem reported by
8993 Roland McGrath.
8994
8995 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
8996
8997 * src/output.c (escaped_output): Renamed from
8998 escaped_file_name_output, since we now use it for symbol tags as
8999 well. All uses changed.
9000 (symbol_destructors_output, symbol_printers_output):
9001 Escape symbol tags too.
9002 Problem reported by Matyas Forstner in
9003 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
9004
9005 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
9006 not needed.
9007 * src/output.c (user_actions_output, token_definitions_output,
9008 symbol_destructors_output, symbol_printers_output): Likewise.
9009 * src/reader.c (prologue_augment): Likewise.
9010 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
9011
9012 * src/vcg.c (output_edge): Don't quote linestyle arg.
9013 Problem reported by twlevo@xs4all.nl.
9014
9015 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
9016
9017 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
9018 example, reported by Derek M Jones. Also, make the example even
9019 more outrageous, to better illustrate how bad the problem is.
9020
9021 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
9022
9023 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
9024 putsym. Typo reported by Sebastian Piping.
9025
9026 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
9027
9028 * doc/bison.texinfo (Language and Grammar): some -> same
9029 (Epilogue): int he -> in the
9030 Typos reported by Sebastian Piping via Justin Pence.
9031
9032 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
9033
9034 * tests/glr-regression.at (Improper handling of embedded actions
9035 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
9036 embedded actions and $-N in GLR parsers", work around an Autoconf bug
9037 with dollar signs in test names.
9038 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
9039 for a similar reason.
9040
9041 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
9042
9043 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
9044 wants to redefine G_VIEW.
9045
9046 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
9047
9048 * src/vcg.c (get_view_str): Remove case for normal_view.
9049 Problem reported by twlevo@xs4all.nl.
9050
9051 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
9052
9053 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
9054 Problem reported by twlevo@xs4all.nl.
9055
9056 * doc/bison.texinfo: Change @dircategory from "GNU programming
9057 tools" to "Software development". Requested by Richard Stallman
9058 via Karl Berry.
9059
9060 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
9061
9062 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
9063 Problem reported by twlevo@xs4all.nl.
9064
9065 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
9066
9067 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
9068 keyword; it's not needed with modern compilers, and it doesn't
9069 affect correctness with older compilers. Suggested by
9070 twlevo@xs4all.nl.
9071
9072 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
9073
9074 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
9075 gcc -Wswitch-default.
9076 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9077 * data/yacc.c (yyparse): Likewise.
9078
9079 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
9080
9081 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
9082 already. Let config.h define any nonstandard values.
9083
9084 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
9085
9086 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
9087 for the benefit of slower hosts. Problem reported by
9088 Nelson H. F. Beebe.
9089
9090 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
9091
9092 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
9093 being defined and not used.
9094 * data/lalr1.cc (yyparse): Likewise.
9095 Use "if (false)" rather than "if (0)".
9096
9097 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
9098
9099 * TODO: Mention that we should allow NUL bytes in tokens.
9100
9101 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
9102
9103 * src/scan-skel.l (<<EOF>>): Don't close standard output.
9104 Problem reported by Hans Aberg.
9105
9106 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
9107
9108 * src/getargs.c (version): Happy new year; update overall
9109 program copyright date from 2004 to 2005.
9110
9111 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
9112 Problem reported by Hans Aberg.
9113 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
9114 (Output file names.): Add a test for the case when standard output
9115 is closed.
9116
9117 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
9118
9119 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
9120 to fix an oversight in the Bison 2.0 manual.
9121
9122 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
9123
9124 * NEWS: Version 2.0. Reformat the existing news items since
9125 1.875, so that related items are grouped together.
9126 * configure.ac (AC_INIT): Bump version to 2.0.
9127 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
9128
9129 * tests/torture.at (Exploding the Stack Size with Alloca): Set
9130 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
9131 otherwise, we're not testing alloca. Unfortunately there's no
9132 simple way to consult HAVE_ALLOCA here.
9133
9134 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
9135 for yymsg, too.
9136
9137 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
9138 hand. This avoids a warning about comparing int to size_t when
9139 GCC warnings are enabled.
9140
9141 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
9142
9143 * NEWS: Bison-generated parsers no longer default to using the
9144 alloca function (when available) to extend the parser stack, due
9145 to widespread problems in unchecked stack-overflow detection.
9146 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
9147 responsibility to set it to a positive value. This lets the user
9148 specify a value that is not a preprocessor constant.
9149 * data/yacc.c (YYMAXDEPTH): Likewise.
9150 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
9151 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
9152 to be a compile-time constant. However, explain the constraints on it.
9153 Also, explain the constraints on YYINITDEPTH.
9154 (Table of Symbols): Explain that alloca is no longer the default.
9155 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
9156 to 1.
9157
9158 * doc/bison.texinfo (Location Default Action): Mention that n must
9159 be zero when k is zero. Suggested by Frank Heckenbach.
9160
9161 2004-12-22 Akim Demaille <akim@epita.fr>
9162
9163 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
9164 (parser::state_type, parser::semantic_type, parser::location_type):
9165 Private, not public.
9166 (parser::parse): Return ints, not bool.
9167 Returning a bool introduces a problem: 0 corresponds to false, and
9168 it seems weird to return false on success. Returning true changes
9169 the conventions for yyparse.
9170 Alternatively we could return void and send an exception.
9171 There is no clear consensus (yet?).
9172 (state_stack, semantic_stack, location_stack): Rename as...
9173 (state_stack_type, semantic_stack_type, location_stack_type): these.
9174 Private, not public.
9175 * tests/c++.at: New.
9176 * tests/testsuite.at, tests/Makefile.am: Adjust.
9177
9178 2004-12-21 Akim Demaille <akim@epita.fr>
9179
9180 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
9181
9182 2004-12-21 Akim Demaille <akim@epita.fr>
9183
9184 Don't impose std::string for filenames.
9185
9186 * data/lalr1.cc (b4_filename_type): New.
9187 (position::filename): Use it.
9188 (parser.hh): Move the inclusion of stack.hh and location.hh below
9189 the user code, so that needed headers for the filename type can be
9190 included first.
9191 Forward declare them before the user code.
9192 * tests/Makefile.am (check-local, installcheck-local): Pass
9193 TESTSUITEFLAGS to the TESTSUITE.
9194
9195 2004-12-20 Akim Demaille <akim@epita.fr>
9196
9197 Use more STL like names: my_class instead of MyClass.
9198
9199 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
9200 (SemanticStack, SemanticType, StateStack, StateType)
9201 (TokenNumberType, Stack, Slice, Traits, Parser::location)
9202 (Parser::value): Rename as...
9203 (location_stack, location_type, rhs_number_type, semantic_stack)
9204 (semantic_type, state_stack, state_type, token_number_type, stack)
9205 (slice, traits, parser::yylloc, parser::yylval): these.
9206
9207 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
9208
9209 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
9210
9211 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
9212 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9213
9214 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
9215
9216 Remove uses of 'short int' and 'unsigned short int'. This raises
9217 some arbitrary limits. It uses more memory but nowadays that's
9218 not much of an issue.
9219
9220 This change does not affect the generated parsers; that's a different
9221 task, as some users will want to conserve memory there.
9222
9223 Ideally we should use size_t to represent all object counts, and
9224 something like ptrdiff_t to represent signed differences of object
9225 counts; but that will require more code-cleanup than I have the
9226 time to do right now.
9227
9228 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
9229 Use size_t, not int or short int, to count objects.
9230 * src/closure.c (nritemset, closure): Likewise.
9231 * src/closure.h (nritemset, closure): Likewise.
9232 * src/nullable.c (nullable_compute): Likewise.
9233 * src/print.c (print_core): Likewise.
9234 * src/print_graph.c (print_core): Likewise.
9235 * src/state.c (state_compare, state_hash): Likewise.
9236 * src/state.h (struct state): Likewise.
9237 * src/tables.c (default_goto, goto_actions): Likewise.
9238
9239 * src/gram.h (rule_number, rule): Use int, not short int.
9240 * src/output.c (prepare_rules): Likewise.
9241 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
9242 errs, reductions): Likewise.
9243 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
9244 Likewise.
9245 * src/tables.c (vector_number, tally, action_number,
9246 ACTION_NUMBER_MINIMUM): Likewise.
9247 * src/output.c (muscle_insert_short_int_table): Remove.
9248
9249 2004-12-17 Akim Demaille <akim@epita.fr>
9250
9251 * data/lalr1.cc: Extensive Doxygenation.
9252 (error_): Rename as...
9253 (error): this, since it is visible to the user.
9254 Adjust callers.
9255 (Parser::message): Now an automatic variable from...
9256 (Parser::yyreport_syntax_error_): here.
9257 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
9258 Parser::error.
9259 * tests/input.at: Escape $.
9260
9261 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
9262
9263 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
9264 Parenthesize rhs to avoid obscure problems with mistakes like
9265 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
9266 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9267 b4_rhs_location): Likewise.
9268 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9269 b4_rhs_location): Likewise.
9270
9271 2004-12-16 Akim Demaille <akim@epita.fr>
9272
9273 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
9274 yacc.c: be sure to stay within yycheck_.
9275 * tests/actions.at: Re-enable C++ tests.
9276
9277 2004-12-16 Akim Demaille <akim@epita.fr>
9278
9279 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
9280 real.
9281
9282 2004-12-16 Akim Demaille <akim@epita.fr>
9283
9284 Use #define to handle the %name-prefix.
9285
9286 * data/glr.c, data/yacc.c: Comment changes.
9287 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
9288 so that one can refer to yylex in the parser file, and have it
9289 renamed, as is the case with other skeletons.
9290
9291 2004-12-16 Akim Demaille <akim@epita.fr>
9292
9293 Move lalr1.cc internals into yy*.
9294
9295 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
9296 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
9297 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
9298 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
9299 (empty_, final_, terror_, errcode_, ntokens_)
9300 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
9301 (looka_, ilooka_, error_range_, nerrs_):
9302 Rename as...
9303 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
9304 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
9305 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
9306 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
9307 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
9308 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
9309 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
9310 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
9311 these.
9312
9313 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
9314
9315 Fix some problems reported by twlevo at xs4all.
9316 * src/symtab.c (symbol_new): Report an error if the input grammar
9317 contains too many symbols. This is better than calling abort() later.
9318 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
9319 (struct node, struct graph):
9320 Rename member expand to stretch. All uses changed.
9321 (struct graph): Remove member layoutalgorithm. All uses removed.
9322 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
9323 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
9324 All uses changed.
9325 (N_STRETCH): Rename from N_EXPAND. All uses changed.
9326
9327 2004-12-15 Akim Demaille <akim@epita.fr>
9328
9329 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
9330 Add more Doxygen comments.
9331 (symprint_, stack_print_, reduce_print_, destruct_, pop)
9332 (report_syntax_error_, translate_): Rename as...
9333 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
9334 (yypop_, yyreport_syntax_error_, yytranslate_): this.
9335
9336 2004-12-15 Akim Demaille <akim@epita.fr>
9337
9338 * data/lalr1.cc (lex_): Rename as...
9339 (yylex_): this.
9340 Move the trace here.
9341 Take the %name-prefix into account.
9342 Reported by Alexandre Duret-Lutz.
9343
9344 2004-12-15 Akim Demaille <akim@epita.fr>
9345
9346 Simplify the C++ parser constructor.
9347
9348 * data/lalr1.cc (debug_): Rename as...
9349 (yydebug_): so that the parser's internals are always in the yy*
9350 pseudo namespace.
9351 Adjust uses.
9352 (b4_parse_param_decl): Remove the leading comma as it is now only
9353 called as unique argument list.
9354 (Parser::Parser): Remove the constructor accepting a location and
9355 an initial debugging level.
9356 Remove from the other ctor the argument for the debugging level.
9357 (debug_level_type, debug_level, set_debug_level): New.
9358
9359 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
9360 constructor calls.
9361
9362 2004-12-15 Akim Demaille <akim@epita.fr>
9363
9364 Remove b4_root related material: failure experiment
9365 (which goal was to allow to derive from a class).
9366
9367 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
9368 definitions and uses.
9369
9370 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
9371
9372 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
9373 not 2, since it's not portable to subtract 1 from the start of an
9374 array. The new item 0 is never set or used. All uses changed.
9375
9376 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
9377 the default definition of YYLLOC_DEFAULT. Problem reported
9378 by Frank Heckenbach.
9379
9380 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
9381
9382 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
9383 the normal case and one for the error case. Just use the
9384 first one uniformly. Problem reported by Frank Heckenbach.
9385 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
9386 use exactly the same macro in both places.
9387 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
9388 so that the normal-case YYRHSLOC works for the error case too.
9389 All uses changed.
9390 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
9391 (YYLLOC_DEFAULT): Use the same macro as glr.c.
9392 * doc/bison.texinfo (Location Default Action): Don't claim that
9393 we have an array of locations. Use the same macro for both glr
9394 and lalr parsers. Mention YYRHSLOC. Mention what happens when
9395 the index is 0.
9396
9397 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9398
9399 * HACKING: Update email addresses to send announcements to.
9400
9401 * configure.ac (AC_INIT): Bump version to 1.875f.
9402
9403 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9404
9405 * NEWS: Version 1.875e.
9406 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
9407
9408 * src/scan-skel.l: Include "complain.h", for "fatal".
9409
9410 * src/relation.h (relation_print, relation_digraph):
9411 Relation sizes are of type relation_node, not size_t (this is
9412 merely a doc fix, since the two types are equivalent).
9413 (relation_transpose): Relation sizes are of type relation_node,
9414 not int.
9415 * src/relation.c: Likewise.
9416 (top, infinity): Now of type relation_node, not int.
9417 (traverse, relation_transpose): Use relation_node, not int.
9418
9419 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
9420 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
9421 (yyparse): Remove unused local introduced in 2004-10-25 patch.
9422
9423 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
9424 specifying whether the test should be skipped. Use it tp
9425 specify that the [%defines %skeleton "lalr1.cc"] tests currently
9426 fail on some hosts, and should be skipped.
9427
9428 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
9429
9430 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
9431 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
9432 unless otherwise specified below.
9433
9434 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
9435 to allocate kernel_base, kernel_items, kernel_size, since
9436 they needn't be initialized to 0.
9437 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
9438 * src/closure.c (new_closure): Likewise, for itemset.
9439 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
9440 * src/lalr.c (set_goto_map): Likewise, for temp_map.
9441 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
9442 (build_relations): Likewise for edge, states1, includes.
9443 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
9444 * src/reader.c (packgram): Likewise, for ritem, rules.
9445 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
9446 * src/relation.c (relation_digraph): Likewise for VERTICES.
9447 (relation_transpose): Likewise for new_R, end_R.
9448 * src/symtab.c (symbols_token_translations_init): Likewise for
9449 token_translations.
9450 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
9451 (token_actions): Likewise for yydefact, actrow, conflrow,
9452 conflict_list.
9453 (save_column): Likewise for froms[symno], tos[symno].
9454 (goto_actions): Likewise for state_count.
9455 (pack_table): Likewise for base, pos, check.
9456 (tables_generate): Likewise for width.
9457
9458 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
9459 for initial core. Just have a separate core, so we needn't worry
9460 about whether kernel_size and kernel_base are initialized.
9461
9462 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
9463 kernel_size, kernel_items): Remove unnecessary initialization.
9464 * src/conflicts.c (conflicts): Likewise.
9465 * src/derives.c (derives): Likewise.
9466 * src/muscle_tablc (muscle_insert): Likewise.
9467 * src/relation.c (relation_digraph): Likewise.
9468 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
9469 conflrow, conflict_table, conflict_list, table, check):
9470 Likewise.
9471
9472 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
9473 This is because all callers pass unsigned int.
9474 * src/closure.h (new_closure): Likewise.
9475
9476 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
9477 (build_relations): Initialize includes[i] in all cases.
9478 * src/reader.c (packgram): Always initialize rules[ruleno].prec
9479 and rules[ruleno].precsym. Initialize members in order.
9480 * src/relation.c (relation_transpose): Always initialize new_R[i]
9481 and end_R[i].
9482 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
9483
9484 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
9485 conflict_list[0] was always 0, but now it isn't initialized.
9486
9487 * src/table.c (table_grow): When conflict_table grew, the grown
9488 area wasn't cleared. Fix this.
9489
9490 * lib/.cvsignore: Add strdup.c, strdup.h.
9491 * m4/.cvsignore: Add strdup.m4.
9492
9493 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
9494
9495 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
9496 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
9497 GOTO_NUMBER_MAXIMUM, since we occasionally compute
9498 ngotos + 1 without checking for overflow.
9499 (build_relations): Use END_NODE, not -1, to denote end of edges.
9500 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
9501 build_relations): Use goto_number, not int, for goto numbers.
9502 * src/tables.c (save_column, default_goto): Likewise.
9503
9504 2004-11-23 Akim Demaille <akim@epita.fr>
9505
9506 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
9507 of #defining from yystype.
9508 Don't typedef yystype, C++ does not need it.
9509 This lets it possible to forward declare it as union.
9510
9511 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
9512
9513 * bootstrap (gnulib_modules): Add extensions.
9514 Problem reported by Jim Meyering.
9515
9516 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
9517
9518 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
9519 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
9520 src/system.h, src/tables.c: XFREE -> free, to accommodate
9521 recent change to gnulib xalloc.h.
9522 Problem reported by Jim Meyering.
9523
9524 2004-11-17 Akim Demaille <akim@epita.fr>
9525
9526 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
9527
9528 2004-11-17 Akim Demaille <akim@epita.fr>,
9529 Alexandre Duret-Lutz <adl@gnu.org>
9530
9531 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
9532 changes.
9533 (YYCDEBUG): Adjust.
9534 Use it instead of cdebug_.
9535 (Parser::debug_stream, Parser::set_debug_stream): New.
9536 (Parser::symprint_): Define cdebug_ for temporary backward
9537 compatibility.
9538 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
9539 debug_stream ().
9540
9541 2004-11-17 Akim Demaille <akim@epita.fr>
9542
9543 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
9544 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
9545 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
9546 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9547
9548 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
9549
9550 * data/glr.c (yyloc_default): Remove; not used.
9551 Problem reported by Frank Heckenbach.
9552
9553 2004-10-25 Akim Demaille <akim@epita.fr>
9554
9555 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
9556 Introduce another definition to address simple location arrays.
9557 (yyGLRStack): New member: yyerror_range.
9558 (yyrecoverSyntaxError, yyparse): Update it.
9559 (yyrecoverSyntaxError): Use it when shifting the error token to
9560 have an accurate range, equivalent to the one computed by both
9561 yacc.c and lalr1.cc.
9562 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
9563 that column numbers start at column 0, as per GNU Coding
9564 Standards, the others tests, and the doc.
9565 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
9566 Adjust to the above change (first column is 0).
9567 And adjust the location of the "<error>", now covering the whole
9568 line.
9569
9570 2004-10-22 Akim Demaille <akim@epita.fr>
9571 and Paul Eggert <eggert@cs.ucla.edu>
9572
9573 Remove some arbitrary limits on goto numbers and relations.
9574 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
9575 initial values, since they're never used.
9576 (set_goto_map): ngotos is now unsigned, so test for overflow
9577 by seeing whether it wraps around to zero.
9578 * src/lalr.h (goto_number): Now size_t, not short int.
9579 (GOTO_NUMBER_MAXIMUM): Remove.
9580 * src/relation.c (relation_print, traverse, relation_transpose):
9581 Check for END_NODE rather than looking at sign.
9582 * src/relation.h (END_NODE): New macro.
9583 (relation_node): Now size_t, not short int.
9584
9585 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
9586
9587 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
9588 keyword, not an identifier. Problem reported by Baron Schwartz in
9589 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
9590
9591 2004-10-11 Akim Demaille <akim@epita.fr>
9592
9593 * src/symtab.c (symbol_check_alias_consistency): Also check
9594 type names, destructors, and printers.
9595 Reported by Alexandre Duret-Lutz.
9596 Recode the handling of associativity and precedence in terms
9597 of symbol_precedence_set.
9598 Accept no redeclaration at all, not even equal to the previous
9599 value.
9600 (redeclaration): New.
9601 Use it to factor redeclaration complaints.
9602 (symbol_make_alias): Don't set the type of the alias, let
9603 symbol_check_alias_consistency do it as for other features.
9604 * src/symtab.h (symbol): Add new member prec_location, and
9605 type_location.
9606 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
9607 * tests/input.at (Incompatible Aliases): New.
9608
9609 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
9610
9611 .cvsignore fixes to accommodate gnulib changes,
9612 and the practice of naming build directories "_build".
9613 * .cvsignore: Add "_*". Sort.
9614 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
9615 * m4/.cvsignore: Add "*_gl.m4".
9616
9617 2004-10-06 Akim Demaille <akim@epita.fr>
9618
9619 * src/parse-gram.y (add_param): Fix the truncation of trailing
9620 spaces.
9621
9622 2004-10-05 Akim Demaille <akim@epita.fr>
9623
9624 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
9625 whether the reducion was empty or not. This leaves room to
9626 improve the use of YYLLOC_DEFAULT in such a case.
9627 lalr1.cc is still experimental, so changing this is acceptable.
9628 And finally, there are probably not many users who changed the
9629 handling of locations in GLR, so changing is admissible too.
9630
9631 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
9632 empty reduction, set @$ to an empty location ending the previously
9633 stacked symbol.
9634 Adjust uses to make sure the code is triggered on empty
9635 reductions.
9636 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
9637 expected output: empty reductions have empty locations.
9638
9639 2004-09-29 Akim Demaille <akim@epita.fr>
9640
9641 * data/lalr1.cc: Move towards a more standard C++ coding style
9642 for templates: Class < T > -> Class<T>.
9643
9644 2004-09-29 Akim Demaille <akim@epita.fr>
9645
9646 * data/lalr1.cc: Reinstall the former ctor, for sake of
9647 compatibility, but warn it will be removed.
9648 Move towards a more standard C++ coding style (i.e., type *var ->
9649 type* var).
9650
9651 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
9652
9653 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
9654 since it's less likely to work if NULs are involved in the future.
9655
9656 2004-09-27 Akim Demaille <akim@epita.fr>
9657
9658 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
9659
9660 2004-09-27 Akim Demaille <akim@epita.fr>
9661
9662 * data/lalr1.cc (b4_parse_param_decl_1): New.
9663 (b4_parse_param_decl): Use it to have different names between attribute
9664 and argument names.
9665 (b4_cc_constructor_call): Likewise.
9666
9667 2004-09-24 Akim Demaille <akim@epita.fr>
9668
9669 * src/parse-gram.y (add_param): Strip the leading and trailing
9670 blanks from a formal argument declaration.
9671 (YY_LOCATION_PRINT): New.
9672
9673 2004-09-24 Akim Demaille <akim@epita.fr>
9674
9675 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
9676 after the location.
9677
9678 2004-09-24 Akim Demaille <akim@epita.fr>
9679
9680 * doc/bison.texinfo (Table of Symbols): Sort.
9681
9682 2004-09-21 Akim Demaille <akim@epita.fr>
9683
9684 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
9685 the useless parentheses.
9686 Suggested by Paul Eggert.
9687
9688 2004-09-20 Akim Demaille <akim@epita.fr>
9689
9690 Let the initial-action act on the look-ahead, and use it for the
9691 "initial push" (corresponding to an hypothetical beginning-of-file).
9692 And let lalr1.cc honor %initial-action.
9693
9694 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
9695 example.
9696 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
9697 (Parser::Parser): Remove the ctor that used to initialize it.
9698 (Parser::parse): Like in the other skeletons, issue the "starting
9699 parse" message before any action.
9700 Honor %initial-action.
9701 Initialize the stacks with the lookahead.
9702 * data/yacc.c: Let $$ and @$ in %initial-action designate the
9703 look-ahead.
9704 Push them in the stacks.
9705 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
9706
9707 2004-09-20 Akim Demaille <akim@epita.fr>
9708
9709 * doc/bison.texinfo (Initial Action Decl): New.
9710
9711 2004-09-20 Akim Demaille <akim@epita.fr>
9712
9713 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
9714 clearer criterion to define it.
9715 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
9716 When reducing on an empty RHS, use the latest stacked location as
9717 location.
9718 yylloc is not always available.
9719 * data/glr.c: Likewise.
9720 Also, honor initial-actions.
9721
9722 2004-09-20 Akim Demaille <akim@epita.fr>
9723
9724 * data/yacc.c (YY_LOCATION_PRINT): New.
9725 Define when we know YYLTYPE's structure, i.e., when the default
9726 YYLLOC_DEFAULT is used.
9727 * data/c.m4 (b4_yysymprint_generate): Use it.
9728 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
9729 value of the result.
9730 (error_start_): Replace with...
9731 (error_range_): this location array.
9732 This allows to replace code relying on the implementation of
9733 locations by portable code.
9734 * data/yacc.c (yylerrsp): Replace with...
9735 (yyerror_range): this.
9736 Every time a token is popped, update yyerror_range[0], to have an
9737 accurate location for the error token.
9738 * data/glr.c (YY_LOCATION_PRINT): New.
9739 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
9740 deference a pointer.
9741 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
9742 report the location in %printers.
9743
9744 * src/scan-skel.l: Instead of abort, report error messages to ease
9745 understanding skeleton scanning failures.
9746
9747 2004-09-16 Akim Demaille <akim@epita.fr>
9748
9749 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
9750 (iterator, const_iterator): these, to be more in the C++ spirit.
9751 Also, return reverse iterators so that when displaying the stack
9752 we display its bottom first.
9753 (Parser::stack_print_, Parser::reduce_print_): Match the messages
9754 from yacc.c.
9755 We should probably use vector here though.
9756
9757 2004-09-16 Akim Demaille <akim@epita.fr>
9758
9759 Have more complete shift traces.
9760
9761 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
9762 to report Shifts instead of ad hoc YYDPRINTF invocations,
9763 including for the error token.
9764 * data/lalr1.cc (symprint_): Output the location.
9765 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
9766 output the location within the %printer.
9767 Activate GLR tests, at least to make sure they compile properly.
9768 They still don't pass though.
9769 * tests/calc.at: Adjust expect verbose output, since now "Entering
9770 state..." is on a different line than the "Shifting" message.
9771
9772 2004-09-08 Akim Demaille <akim@epita.fr>
9773
9774 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
9775 Bison directive from the Bison file to the invocation of this
9776 macro, so that these directives are passed to
9777 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
9778 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
9779 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
9780 the extra Bison directives instead of the whole series.
9781 Change the grammar so that there are recoverable errors, and
9782 unrecoverable errors. Now we can have the parser give up before
9783 consuming the whole input. As a result we now can observe that
9784 the lookahead is freed when needed.
9785 Change the parser source to parse argv[1] instead of a hard coded
9786 string.
9787 Simplify yylex, and give a value and location to EOF.
9788 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
9789 passed directives already coded in the file.
9790 Add some tests to check the location of "error".
9791 For some tests, the C++ parser is correct, and not yacc.c.
9792 For other tests, they provide different, but unsatisfying, values,
9793 so keep the C++ value so that at least one parser is "correct"
9794 according to the test suite.
9795 (Actions after errors): Remove, this is subsumed by the
9796 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
9797
9798 2004-09-06 Akim Demaille <akim@epita.fr>
9799
9800 * data/lalr1.cc: Adjust the indentation of the labels.
9801 (Parser::pop): New.
9802 Use it.
9803
9804 2004-09-06 Akim Demaille <akim@epita.fr>
9805
9806 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
9807 argument, an informative message.
9808 Call YY_SYMBOL_PRINT.
9809 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
9810 * data/lalr1.cc (destruct_): Likewise.
9811 In addition, no longer depend on b4_yysymprint_generate and
9812 b4_yydestruct_generate to generate these functions, do it "by
9813 hand".
9814
9815 2004-09-03 Akim Demaille <akim@epita.fr>
9816
9817 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
9818 invoked, yydestruct the lookahead.
9819 * tests/calc.at (Calculator $1): Update the expected lengths of
9820 traces: there is an added line for the discarded lookahead.
9821 * doc/bison.texinfo (Destructor Decl): Some rewording.
9822 Define "discarded" symbols.
9823
9824 2004-09-02 Akim Demaille <akim@epita.fr>
9825
9826 * data/lalr1.cc (translate_, destruct_): No reason to be static.
9827
9828 2004-09-02 Akim Demaille <akim@epita.fr>
9829
9830 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
9831 (YYDSYMPRINTF): Rename as...
9832 (YY_SYMBOL_PRINT): this.
9833 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
9834 two.
9835 Use it instead of direct symprint_ calls.
9836 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
9837 one.
9838
9839 2004-09-02 Akim Demaille <akim@epita.fr>
9840
9841 * data/lalr1.cc (b4_yysymprint_generate): New.
9842 (symprint_): New member function, defined when YYDEBUG.
9843 Use it consistently instead of token/nterm debugging output by
9844 hand.
9845 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
9846 %printer calls to use cdebug_ when using lalr1.cc.
9847
9848 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
9849
9850 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
9851 with #ifdef YYDEBUG.
9852
9853 2004-08-26 Akim Demaille <akim@epita.fr>
9854
9855 * doc/bison.texinfo (Implementing Loops): Rename as...
9856 (Implementing Gotos/Loops): this.
9857
9858 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
9859
9860 Adjust to latest gnulib.
9861 * bootstrap (gnulib_modules): Add xalloc-die.
9862 Set LC_ALL=C so that file names sort consistently.
9863 Prefer the gnulib copies of gettext.m4, glibc21.m4,
9864 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
9865 uintmax_t.m4, ulonglong.m4.
9866 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
9867 po.m4 since we are now using _gl.m4 instead.
9868
9869 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
9870
9871 * src/scan-action.l: Remove. Scanning of semantic actions is
9872 handled in scan-gram.l.
9873
9874 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
9875
9876 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
9877
9878 * src/location.h (struct): The file member is a uniqstr.
9879 (equal_boundaries): Use UNIQSTR_EQ for comparison.
9880
9881 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
9882
9883 Fix bug with non-%union parsers that have printers or destructors,
9884 which led to a Bison core dump. Reported by Peter Fales in
9885 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
9886
9887 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
9888 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
9889 not to our own type.
9890 * src/output.c (symbol_destructors_output, symbol_printers_output):
9891 Don't assume %union.
9892 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
9893 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
9894 UNION-FLAG. All callers changed.
9895 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
9896 Use type char, not unsigned int, when declaring an array of char;
9897 this lets us remove a cast.
9898 (Printers and Destructors): Add non-%union test cases.
9899
9900 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9901
9902 * doc/bison.texinfo: Minor editorial changes, mostly to the new
9903 GLR writeups. E.g., avoid frenchspacing and the future tense,
9904 change "lookahead" to "look-ahead", and change "wrt" to "with
9905 respect to".
9906
9907 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9908
9909 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
9910 New sections, split off from the GLR Parsers section. Put the new
9911 Simple GLR Parser near the start of the GLR section, for clarity.
9912 Rewrite connective text.
9913
9914 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
9915
9916 * doc/bison.texinfo (Simple GLR Parsers): New section.
9917
9918 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9919
9920 * NEWS, TODO, doc/bison.texinfo:
9921 Use "look-ahead" instead of "lookahead", to be consistent.
9922 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
9923 while we're fixing "look-ahead".
9924 * src/conflicts.c (shift_set): Renamed from shiftset.
9925 (look_ahead_set): Renamed from lookaheadset.
9926 * src/print.c: Likewise.
9927 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
9928 name for "lookahead".
9929 (report_types, usage): Likewise.
9930 * src/getargs.h (report_look_ahead_tokens): Renamed from
9931 report_lookaheads.
9932 * src/lalr.c (compute_look_ahead_tokens): Renamed from
9933 compute_lookaheads.
9934 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
9935 (look_ahead_tokens_print): Renamed from lookaheads_print.
9936 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
9937 state_rule_lookaheads_print.
9938 * src/state.h: Likewise.
9939 (reductions.look_ahead_tokens): Renamed from lookaheads.
9940 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
9941 AT_DATA_LOOKAHEADS_GRAMMAR.
9942
9943 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
9944
9945 * README: Update location of patched M4 distribution.
9946
9947 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
9948
9949 Don't assume the C++ compiler takes the same arguments as the C compiler
9950 (trivial change).
9951 * configure.ac (O0CXXFLAGS): New var.
9952 * tests/atlocal.in (CXXFLAGS): Use it.
9953
9954 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
9955
9956 Fix some "make check" problems with C++ reported by
9957 Albert Chin-A-Young for Tru64 C++ in this thread:
9958 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
9959
9960 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
9961 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9962 Output to a .cc file for C++, not to a .c file.
9963 * tests/calc.at (AT_CHECK_CALC): Likewise.
9964 * tests/regression.at (AT_CHECK_DANCER): Likewise.
9965 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
9966
9967 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
9968
9969 * tests/calc.at, tests/actions.at: Workaround for SGI
9970 C++ compiler. (trivial change)
9971
9972 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
9973
9974 Spent a few hours checking out which prerequisite versions the
9975 current sources actually require. I went all the way back to
9976 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
9977 a seemingly endless set of combinations of versions more recent
9978 than that. The bottom line is that the current sources require
9979 fairly recent versions of the build tools, and it'll be some work
9980 to change this.
9981 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
9982 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
9983 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
9984 Add comments explaining why those particular versions are
9985 currently needed.
9986
9987 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
9988 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
9989 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
9990
9991 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
9992 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
9993
9994 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
9995
9996 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
9997 0.11.5. Suggested by Bruno Haible.
9998 * bootstrap: Remove gettext version checking.
9999
10000 * doc/bison.texinfo (Decl Summary): Also mention that %union
10001 can depend on prerequisite types. Problem reported by Tim
10002 Van Holder.
10003
10004 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
10005
10006 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
10007 * README-alpha: Don't tell people not to package this.
10008
10009 * bootstrap: Don't assume $(...) works; use `...` instead.
10010 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
10011 gettext better.
10012
10013 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
10014 put into the -d output file, and mention what to do if YYSTYPE is
10015 defined as a macro.
10016
10017 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
10018
10019 Undo change made earlier today: it caused autopoint to not bring
10020 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
10021 autopoint's.
10022
10023 * bootstrap: Check that gettext version matches what's in
10024 configure.ac. Warn users to ignore robots.txt ERROR 404.
10025 * bootstrap: Undo today's earlier change (logged below).
10026 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
10027
10028 The gettext version checking is causing more trouble than it's
10029 curing; remove it. Problem reported by Paul Hilfinger.
10030
10031 * bootstrap: Issue a warning that one can expect a message
10032 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
10033 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
10034
10035 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
10036
10037 Ensure that the C++ compiler used for testing actually works on a
10038 simple test program; if not, skip the C++-related tests. Problem
10039 reported by Vin Shelton in:
10040 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
10041
10042 * m4/cxx.m4: New file.
10043 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
10044 * tests/atlocal.in (BISON_CXX_WORKS): Add.
10045 * tests/local.at (AT_COMPILE_CXX): Use it.
10046
10047 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10048
10049 * data/glr.c (yylloc): Output this macro even if locations are not
10050 being generated, as the GLR parser needs it even in that case.
10051 Problem reported by Troy A. Johnson
10052 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
10053
10054 * configure.ac (AC_INIT): Update to 1.875e.
10055
10056 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10057
10058 * NEWS: Version 1.875d.
10059 * configure.ac (AC_INIT): Likewise.
10060 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
10061
10062 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
10063 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
10064 lalr1.cc runs afoul of the first, and the last two are no longer
10065 supported by GCC 3.4.0.
10066 * README: Mention GNU m4 1.4 or later; mention m4 patches.
10067 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
10068
10069 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
10070
10071 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
10072 unsigned int, for compatibility with latest gnulib hash module.
10073 * src/state.c (state_hash, state_hasher): Likewise.
10074 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
10075 * src/uniqstr.c (hash_uniqstr): Likewise.
10076
10077 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
10078
10079 * NEWS: Unescaped newlines are no longer allowed in char & strings.
10080
10081 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
10082 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
10083 character and string literals.
10084 (unexpected_end): New function.
10085 (unexpected_eof): Use it.
10086 (unexpected_newline): New function.
10087 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
10088 actions.
10089
10090 * NEWS: Document %expect-rr.
10091
10092 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
10093 Fix typo by replacing $1 with $option.
10094 Remove more 'intl'-related files.
10095 Don't DEFUN AM_INTL_SUBDIR twice.
10096
10097 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
10098 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
10099 strtoul.c.
10100 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
10101 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
10102 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
10103 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
10104 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
10105 * src/.cvsignore: Add *.output.
10106
10107 * src/parse-gram.y: Put copyright notice inside %{ %} so it
10108 gets copied to the output file.
10109
10110 2004-04-28 Paul Eggert <eggert@twinsun.com>
10111
10112 Get files from the gnulib and po repositories, instead of relying
10113 on them being in our CVS. Upgrade to latest versions of gnulib
10114 and Automake.
10115
10116 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
10117 * bootstrap: Bootstrap from gnulib and po repositories.
10118 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
10119 * README-cvs: Document these changes. Remove version numbers from
10120 mentions of build tools, since they change so often. Mention Flex.
10121
10122 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
10123 (gl_USE_SYSTEM_EXTENSIONS): Add.
10124 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
10125 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
10126 does this for us.
10127 (AC_ISC_POSIX): Remove; we no longer support this
10128 ancient OS, as it gets in the way of latest Autoconf & gnulib.
10129 (AC_HEADER_STDC): Remove: we now assume C89 or better.
10130 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
10131 Do not check for C89 headers, except for locale.h which is used
10132 by the Yacc library and must port to K&R hosts.
10133 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
10134 Do not check for C89 functions, except for setlocale which is
10135 used by the Yacc library.
10136 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
10137 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
10138 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
10139 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
10140 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
10141 AM_GNU_GETTEXT): Remove; now done by:
10142 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
10143 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
10144 for us.
10145
10146 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
10147 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
10148 Define to empty, as gnulib.mk will do the rest for us.
10149 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
10150 for us.
10151 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
10152 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
10153
10154 * src/files.c: Include gnulib's xstrndup.h.
10155
10156 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
10157 (REALLOC): Use xnrealloc, for likewise.
10158 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
10159 (strnlen, memrchr): Remove decls; functions no longer used.
10160 Include <stpcpy.h>.
10161
10162 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
10163 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10164 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
10165 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
10166 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
10167 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
10168 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
10169 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
10170 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
10171 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
10172 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
10173 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10174 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
10175 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
10176 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
10177 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
10178 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
10179 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
10180 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
10181 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
10182 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
10183 Remove, as these files are now generated automatically
10184 by bootstrap or automake.
10185
10186 * po/ChangeLog: Remove: all but one entry was a duplicate
10187 of this file, and I moved that 2000-11-02 entry here.
10188
10189 * config/.cvsignore: Add Makefile, depcomp, install-sh.
10190 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
10191 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
10192 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
10193 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
10194 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
10195 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
10196 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
10197 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
10198 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
10199 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
10200 xstrndup.h.
10201 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
10202 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
10203 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
10204 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
10205 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
10206 * src/.cvsignore: Remove *_.c.
10207
10208
10209 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
10210 support it. (The latest stable gzip doesn't.)
10211
10212 2004-04-27 Paul Eggert <eggert@twinsun.com>
10213
10214 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
10215 case, as stos_ is now used by destructors due to the 2004-02-09
10216 change.
10217
10218 Remove more K&R C support.
10219 * lib/libiberty.y (PARAMS): Remove. All uses removed.
10220 * lib/subpipe.c (errno): Remove decl.
10221 Include <stdlib.h> unconditionally.
10222 (EXIT_FAILURE): Remove macro.
10223 * src/complain.c (vfprintf, strerror): Remove.
10224 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
10225 unconditionally.
10226 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
10227 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
10228 (strchr, strspn, memchr): Remove decls.
10229 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
10230 unconditionally. Do not declare perror.
10231 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
10232 unconditionally.
10233
10234 * src/complain.c (_): Remove useless defn, as system.h defines this.
10235
10236 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
10237 with latest obstack.h.
10238 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
10239 to procedure types, as obstack.h now does that for us.
10240 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
10241
10242 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
10243 so that this include file can stand alone.
10244 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
10245 does this now. Include subpipe.h first after config.h, to
10246 test whether it can stand alone.
10247
10248 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
10249 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
10250 unused declaration.
10251
10252 * tests/synclines.at (%union synch line): Put a dummy member in
10253 the union, because empty unions aren't allowed in C. Caught
10254 by GCC 3.4.0.
10255
10256 2004-04-13 Jim Meyering <jim@meyering.net>
10257
10258 * src/conflicts.c (conflicts_print): Correct format string typo:
10259 use `%%' to produce literal `%'. (trivial change)
10260
10261 2004-03-30 Paul Eggert <eggert@twinsun.com>
10262
10263 * src/getargs.c (version): Update copyright year to 2004.
10264
10265 * data/c.m4 (b4_int_type): Use 'short int' rather than
10266 'short', and similarly for 'long', 'unsigned', etc.
10267 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
10268 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
10269 yy_yypstack, yydumpstack): Likewise.
10270 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
10271 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
10272 Likewise.
10273 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
10274 yy_stack_print, yyparse): Likewise.
10275 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
10276 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
10277 * lib/bitset.c (bitset_print): Likewise.
10278 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
10279 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10280 * lib/bitsetv.c (bitsetv_dump): Likewise.
10281 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
10282 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
10283 Likewise.
10284 * src/LR0.c (allocate_itemsets): Likewise.
10285 * src/gram.h (rule_number, rule): Likewise.
10286 * src/lalr.h (goto_number): Likewise.
10287 * src/nullable.c (nullable_compute): Likewise.
10288 * src/output.c (prepare_rules): Likewise.
10289 * src/relation.c (relation_print, relation_digraph): Likewise.
10290 * src/relation.h (relation_node): Likewise.
10291 * src/state.h (state_number, transitions, errs, reductions,
10292 struct state): Likewise.
10293 * src/symtab.h (symbol_number, struct symbol): Likewise.
10294 * src/tables.c (vector_number, tally, action_number,
10295 default_goto, goto_actions): Likewise.
10296 * tests/existing.at (GNU Cim Grammar): Likewise.
10297 * tests/regression.at (Web2c Actions): Likewise.
10298
10299 * src/output.c (muscle_insert_short_int_table): Renamed from
10300 muscle_insert_short_table. All uses changed.
10301
10302 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10303
10304 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
10305 (declaration): Replace expected_conflicts with expected_sr_conflicts.
10306 Add %expect-rr rule.
10307
10308 * src/scan-gram.l: Recognize %expect-rr.
10309
10310 * src/conflicts.h (expected_sr_conflicts): Rename from
10311 expected_conflicts.
10312 (expected_rr_conflicts): Declare.
10313
10314 * src/conflicts.c (expected_sr_conflicts): Rename from
10315 expected_conflicts.
10316 (expected_rr_conflicts): Define.
10317 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
10318 for GLR parsers.
10319 Use expected_sr_conflicts in place of expected_conflicts.
10320 Warn if expected_rr_conflicts used in non-GLR parser.
10321
10322 * doc/bison.texinfo: Add documentation for %expect-rr.
10323
10324 2004-03-08 Paul Eggert <eggert@gnu.org>
10325
10326 Add support for hex token numbers. Suggested by Odd Arild Olsen in
10327 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
10328
10329 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
10330 in lalr1.cc.
10331 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
10332 * src/scan-gram.l (scan_integer): New function.
10333 ({int}): Use it.
10334 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
10335 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
10336 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
10337 Say "long int", not "long", for uniformity with GNU style.
10338
10339 2004-02-25 Paul Eggert <eggert@twinsun.com>
10340
10341 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
10342 compilers. This fixes a problem with Intel's C++ compiler being
10343 chatty, reported by Guido Trentalancia in
10344 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
10345
10346 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
10347
10348 Support %destructor and merge error locations in lalr1.cc.
10349
10350 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
10351 (Parser::stos_): Define unconditionally.
10352 (Parser::destruct_): New method. Generate its body with
10353 b4_yydestruct_generate.
10354 (Parser::error_start_): New attribute.
10355 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
10356 token which are discarded.
10357 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
10358 error_start_ when erroneous token are discarded.
10359 (Parser::parse) <yyerrlab1>: Compute the location of the error
10360 token so that it covers all the discarded tokens.
10361 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
10362 it can be called with `%skeleton "lalr1.cc"', and do that.
10363
10364 2004-02-02 Paul Eggert <eggert@twinsun.com>
10365
10366 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
10367 $(top_srcdir)/lib and ../lib. This fixes a bug reported
10368 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
10369 There's no need to mention top_builddir since Automake does that
10370 for us.
10371 (INCLUDES): Remove, as Automake says it's obsolescent.
10372 Contents migrated into AM_CPPFLAGS as described above.
10373 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
10374
10375 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10376
10377 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
10378 (yyreportSyntaxError): Handle case where lookahead token is
10379 YYEMPTY.
10380
10381 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10382
10383 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
10384 resulting parsers are compilable with C++.
10385
10386 2003-12-23 Paul Eggert <eggert@twinsun.com>
10387
10388 * config/depcomp, config/install-sh: Sync with Automake 1.8.
10389 * src/output.c (output_skeleton): Rename local var.
10390 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
10391 Bison tokens, as this runs afoul of the 2003-10-07 change that
10392 disallowed NUL bytes in character constants or string literals.
10393
10394 * tests/local.at: Require Autoconf 2.59's Autotest.
10395 * tests/testsuite.at: Don't include local.at, since we now assume
10396 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
10397 including it.
10398 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
10399 multiple inclusion warnings.
10400
10401 2003-12-02 Akim Demaille <akim@epita.fr>
10402
10403 * doc/bison.texinfo (How Can I Reset the Parser): More about start
10404 conditions.
10405 From Bruno Haible.
10406
10407 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
10408
10409 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
10410
10411 2003-10-07 Paul Eggert <eggert@twinsun.com>
10412
10413 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
10414 if testsuite doesn't exist.
10415
10416 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
10417 literals, unfortunately.
10418 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
10419 Complain about NUL bytes in character constants or string literals.
10420
10421 2003-10-05 Paul Eggert <eggert@twinsun.com>
10422
10423 * NEWS: Don't document %no-default-prec, as it's still
10424 too experimental.
10425 * doc/bison.texinfo: Document %no-default-prec only if
10426 the defaultprec flag is set. Normally it's not.
10427
10428 2003-10-04 Paul Eggert <eggert@twinsun.com>
10429
10430 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
10431 non-modifiable lvalue, instead of a modifiable one.
10432 * doc/bison.texinfo (Actions): Document that $$ can
10433 be assigned to. Do not claim that $$ and $N are
10434 array element references: user code should not rely on this.
10435
10436 2003-10-01 Paul Eggert <eggert@twinsun.com>
10437
10438 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
10439 (grammar_declaration): Use it.
10440 * src/scan-gram.l: New token %no-default-prec.
10441 * tests/conflicts.at: Revamp tests to use %no-default-prec.
10442 * NEWS, doc/bison.texinfo: Document the above.
10443
10444 2003-10-01 Akim Demaille <akim@epita.fr>
10445
10446 VCG no longer supports long_straight_phase.
10447
10448 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
10449 * src/print_graph.c (print_graph): Adjust.
10450
10451 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
10452 and Paul Eggert <eggert@twinsun.com>
10453
10454 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
10455 Table of Symbols): Document %default-prec.
10456 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
10457 (grammar_declaration): Set default_prec on %default-prec.
10458 * src/scan-gram.l (%default-prec): New token.
10459 * src/reader.h (default_prec): New flag.
10460 * src/reader.c: Likewise.
10461 (packgram): Handle it.
10462 * tests/conflicts.at (%default-prec without %prec,
10463 %default-prec with %prec, %default-prec 1): New tests.
10464
10465 2003-09-30 Paul Eggert <eggert@twinsun.com>
10466
10467 * tests/testsuite.at: Include local.at, not input.at, fixing
10468 a typo in the 2003-08-25 patch.
10469
10470 2003-08-27 Akim Demaille <akim@epita.fr>
10471
10472 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
10473 GCC warnings.
10474
10475 2003-08-26 Akim Demaille <akim@epita.fr>
10476
10477 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
10478 "<\#" to avoid magic from Gnus when posting parts of this script.
10479
10480 2003-08-26 Akim Demaille <akim@epita.fr>
10481
10482 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
10483 (Parser::parse): here.
10484 Adjust: nerrs and errstatus is now replaced by...
10485 (Parser::nerrs_, Parser::errstatus_): New.
10486
10487 2003-08-25 Akim Demaille <akim@epita.fr>
10488
10489 * config/announce-gen, Makefile.cfg: New.
10490 * Makefile.am: Adjust.
10491 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
10492 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
10493
10494 2003-08-25 Akim Demaille <akim@epita.fr>
10495
10496 When reducing initial empty rules, Bison parser read an initial
10497 location that is not defined. This results in garbage, and that
10498 affects Bison's own parser. Therefore we need (i) to extend Bison
10499 to support a means to initialize this location, and (ii) to use
10500 this CVS Bison to fix CVS Bison's parser.
10501
10502 * src/reader.h, reader.c (epilogue_augment): Remove, replace
10503 with...
10504 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
10505 * src/parse-gram.y: Adjust.
10506 (%initial-action): New.
10507 (%error-verbose): Since we require CVS Bison, there is no reason
10508 not to use it.
10509 * src/scan-gram.l: Adjust.
10510 * src/Makefile.am (YACC): New, to make sure we use our own parser.
10511 * data/yacc.c (yyparse): Use b4_initial_action.
10512
10513 2003-08-25 Akim Demaille <akim@epita.fr>
10514
10515 * doc/bison.texinfo: Don't promote stdout for error messages.
10516
10517 2003-08-25 Akim Demaille <akim@epita.fr>
10518
10519 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
10520 From Alexandre Duret-Lutz.
10521
10522 2003-08-25 Akim Demaille <akim@epita.fr>
10523
10524 Version 1.875c.
10525
10526 2003-08-25 Akim Demaille <akim@epita.fr>
10527
10528 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
10529 Use them.
10530
10531 2003-08-25 Akim Demaille <akim@epita.fr>
10532
10533 * data/lalr1.cc (Parser::reduce_print_): New.
10534 Use it.
10535
10536 2003-08-25 Akim Demaille <akim@epita.fr>
10537
10538 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
10539 error recovery loops. This patch is based on
10540 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
10541 Also, augment the similarity between lalr1.cc and yacc.c.
10542 Note: the locations of error recovery rules are not correct yet.
10543
10544 * data/lalr1.cc: Comment changes to augment the similarity between
10545 lalr1.cc and yacc.c.
10546 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
10547 (yyerrlab1): Remove, but where it used to be (now the bottom part of
10548 yyerrlab), when hitting EOF, pop the whole stack here instead of
10549 merely falling thru the default error handling mechanism.
10550 (yyerrorlab): New label, with the old contents of YYERROR,
10551 plus the following change: pop the stack of rhs corresponding
10552 to the production that invoked YYERROR. That is how Yacc
10553 behaves (required by POSIX).
10554 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
10555 fail.
10556
10557 2003-08-25 Akim Demaille <akim@epita.fr>
10558
10559 Tune local.at so that people can "autom4te -l autotest calc.at -o
10560 calc" for instance, to extract a sub test suite.
10561
10562 * tests/testsuite.at: Move the initialization, Autotest version
10563 requirement, and AT_TESTED invocation into...
10564 * tests/local.at: here.
10565 * tests/testsuite.at: Include it for compatibility with Autoconf
10566 2.57.
10567 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
10568 be ignore.
10569
10570 2003-08-04 Paul Eggert <eggert@twinsun.com>
10571
10572 Rework code slightly to avoid gcc -Wtraditional warnings.
10573 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
10574 The returned value is now stored in *YY0. All callers changed.
10575 * src/output.c (merge_output): Adjust to the above change.
10576
10577 2003-07-26 Paul Eggert <eggert@twinsun.com>
10578
10579 * data/glr.c (YYASSERT): New macro.
10580 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
10581 yyresolveStates, yyprocessOneStack):
10582 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
10583 Derived from a suggestion by Frank Heckenbach.
10584
10585 2003-07-25 Paul Eggert <eggert@twinsun.com>
10586
10587 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
10588 for portability to K&R C (after ansi2knr, presumably). See
10589 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
10590 by Frank Heckenbach, though I have omitted the structure-initialization
10591 part of his glr-knr.diff patch since I recall that the Portable
10592 C Compiler didn't require that change.
10593
10594 Let the user specify how to allocate and free memory.
10595 Derived from a suggestion by Frank Heckenbach in
10596 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
10597 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
10598 All uses of free, malloc, realloc changed to use these macros,
10599 and unnecessary casts removed.
10600 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
10601
10602 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
10603
10604 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
10605 use s.empty() rather than s == "" to test for empty string; see
10606 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
10607 (trivial change)
10608
10609 2003-06-25 Akim Demaille <akim@epita.fr>
10610
10611 * config/depcomp, config/install-sh: Update from masters.
10612
10613 2003-06-20 Paul Eggert <eggert@twinsun.com>
10614
10615 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
10616 and return properly parenthesized result.
10617 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
10618 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10619 Remove unnecessary parentheses from uses.
10620 * doc/bison.texinfo (Location Default Action): Describe the
10621 conventions for parentheses.
10622
10623 2003-06-19 Paul Eggert <eggert@twinsun.com>
10624
10625 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
10626 yyreportTree): Do not assume that size_t is the same width as int,
10627 when printing sizes. Print sizes using an unsigned format.
10628 Problem reported by Frank Heckenbach in
10629 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
10630
10631 Port to Forte Developer 7 C compiler.
10632 * data/glr.c (struct YYLTYPE): If locations are not being used,
10633 declare a single dummy member, as empty structs do not conform
10634 to the C standard.
10635 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
10636 the Forte Developer 7 C compiler complains that end-of-loop
10637 code is not reached.
10638
10639 2003-06-17 Paul Eggert <eggert@twinsun.com>
10640
10641 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
10642 avoid warnings from picky compilers about redefinition of PARAMS.
10643
10644 2003-06-17 Paul Eggert <eggert@twinsun.com>
10645
10646 Version 1.875b.
10647
10648 * NEWS: Document 1.875b.
10649
10650 * lib/bbitset.h: Do not include config.h; that's the includer's job.
10651 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
10652 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
10653 Don't use 'index' in comments, as it's a builtin fn on some hosts.
10654 * lib/bitset_stats.c: Include gettext.h unconditionally, as
10655 per recent gettext manual's suggestion.
10656 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
10657 Use prototypes, not old-style definitions.
10658 * lib/lbitset.c (lbitset_unused_clear): Likewise.
10659 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
10660 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
10661 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
10662 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
10663 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
10664 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
10665 vbitset_or_and_cmp, vbitset_copy): Likewise.
10666
10667 * lib/libiberty.h: Do not include config.h; that's the includer's job.
10668 Do not include <stdlib.h>.
10669 (PARAMS): Define unconditionally for C89.
10670 (ATTRIBUTE_NORETURN): Remove.
10671 (ATTRIBUTE_UNUSED): Define unconditionally.
10672
10673 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
10674 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
10675 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
10676 * lib/vbitset.c, lib/vbitset.h: New files.
10677 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10678 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
10679 from libbitset.
10680
10681 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
10682 `How Can I Reset @code{yyparse}', since texinfo does not allow
10683 arbitrary @ in node names.
10684
10685 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
10686 shouldn't be needed according to the gettext 0.12.1 documentation
10687 but which seem to be needed anyway: codeset.m4 glibc21.m4
10688 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
10689 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
10690 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
10691
10692 * lib/.cvsignore: Add stdbool.h.
10693 * m4/.cvsignore: Add nls.m4, po.m4.
10694
10695 Upgrade to CVS gnulib.
10696 * stdbool_.h: File renamed from stdbool.h.in.
10697 * configure.ac (AM_STDBOOL_H): Invoke this instead of
10698 AC_HEADER_STDBOOL.
10699 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
10700 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
10701 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
10702 (MOSTLYCLEANFILES): New var.
10703 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
10704 (stdbool.h): New rule.
10705 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
10706 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
10707 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
10708 m4/quote.m4: Upgrade to today's gnulib.
10709
10710 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
10711 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
10712 the tests right now.
10713 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
10714 yyerror are declared before use; C99 requires this.
10715
10716 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10717
10718 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
10719 first.
10720 (yyrecoverSyntaxError): Correct the logic for setting and testing
10721 yyerrState.
10722 Correct comment on handling EOF.
10723 Allow states with only a default reduction, rather than failing
10724 (I can't quite reconstruct why these were not allowed before).
10725
10726 Fixes to avoid problem that $-N rules in GLR parsers can cause
10727 buffer overruns, corrupting state.
10728
10729 * src/output.c (prepare_rules): Output max_left_semantic_context
10730 definition.
10731 * src/reader.h (max_left_semantic_context): New variable declaration.
10732 * src/scan-gram.l (max_left_semantic_context): Define.
10733 (handle_action_dollar): Update max_left_semantic_context.
10734 * data/glr.c (YYMAXLEFT): New definition.
10735 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
10736 (yyresolveAction): Ditto.
10737
10738 Fixes to problems with location handling in GLR parsers reported by
10739 Frank Heckenbach (2003/06/05).
10740
10741 * data/glr.c (YYLTYPE): Make trivial if locations not used.
10742 (YYRHSLOC): Add parentheses, and define only if locations used.
10743 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
10744 locations not used.
10745 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
10746 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
10747
10748 * tests/cxx-type.at: Exercise location information; update tests
10749 to differentiate output with and without locations.
10750 Remove forward declarations of yylex and yyerror---caused errors
10751 because default YYLTYPE not yet defined.
10752 Change semantic actions to compute strings, rather than printing
10753 them directly (to test proper passing of semantics values). Change
10754 output to prefix notation and update test data and expected results.
10755 (yylex): Track locations.
10756 (stmtMerge): Return value rather than printing, and include arguments
10757 in value.
10758
10759 2003-06-03 Paul Eggert <eggert@twinsun.com>
10760
10761 Avoid warnings generated by GCC 2.95.4 when Bison is
10762 configured with --enable-gcc-warnings.
10763 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
10764 yy::]b4_parser_class_name[::translate_,
10765 yy::Stack::operator[] (unsigned),
10766 yy::Stack::operator[] (unsigned) const,
10767 yy::Slice::operator[] (unsigned),
10768 yy::Slice::operator[] (unsigned) const):
10769 Rename local vars to avoid warnings.
10770 * tests/glr-regression.at (Improper handling of embedded actions
10771 and $-N in GLR parsers): Remove unused local variable from yylex.
10772 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
10773 (void) as arg when not pure, since we now assume C89 when building
10774 Bison. Pacify GCC by using parameter.
10775
10776 2003-06-02 Paul Eggert <eggert@twinsun.com>
10777
10778 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
10779 yy::Location::lines, yy::Location::columns): Rename arguments
10780 to avoid shadowing; this removes a warning generated by GCC 3.3.
10781
10782 2003-06-01 Paul Eggert <eggert@twinsun.com>
10783
10784 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
10785 to g++, as GCC 3.3 complains if you do it.
10786 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
10787 everything that WARNING_CFLAGS has, except omit warnings
10788 not suitable for C++.
10789 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
10790 * tests/atlocal.in (CXXFLAGS): New var.
10791 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
10792
10793 Fix a GLR parser bug I reported in February; see
10794 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
10795 The problem was that GLR parsers did not conform to the C standard,
10796 because actions like { $1 = $2 + $3; } expanded to expressions
10797 that invoked YYFILL in separate subexpressions, and YYFILL assigned
10798 to a local variable. The C standard says that expressions
10799 like (var = f ()) + (var = f ()) have undefined behavior.
10800 Another problem was that GCC sometimes issues warnings that
10801 yyfill and its parameters are unused.
10802
10803 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
10804 as possibly unused.
10805 (yyfill): New function.
10806 (YYFILL): Use it.
10807 (yyuserAction): Change type of yynormal to bool, so that it matches
10808 the new yyfill signature. Mark it as possibly unused.
10809
10810
10811 Follow up on a bug I reported in February, where a Bison-generated
10812 parser can loop. Provide a test case and a fix for yacc.c. I
10813 don't have a fix for lalr1.cc or for glr.c, unfortunately.
10814 The original bug report is in:
10815 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
10816
10817 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
10818 macro's size was becoming unwieldy.
10819 (yyerrlab): Do not discard an empty lookahead symbol, as this
10820 might destroy garbage.
10821 (yyerrorlab): New label, with the old contents of YYERROR,
10822 plus the following change: pop the stack of rhs corresponding
10823 to the production that invoked YYERROR. That is how Yacc
10824 behaves, and POSIX requires this behavior.
10825 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
10826 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
10827 Define 'alarm' to do nothing if unistd.h is not available.
10828 Add a new rule "exp: '-' error;" to test the above change to
10829 data/yacc.c. Use 'alarm' to abort any test taking longer than
10830 10 seconds, as it's probably looping.
10831 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
10832 Also, the new yacc.c generates two fewer diagnostics for an
10833 existing test.
10834
10835 2003-05-24 Paul Eggert <eggert@twinsun.com>
10836
10837 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
10838 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
10839 This fixes a problem reported by John Bowman when the Compaq/HP
10840 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
10841 -ansi -Wall -gall).
10842 * data/yacc.c (union yyalloc): Likewise.
10843 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
10844
10845 Switch from 'int' to 'bool' where that makes sense.
10846
10847 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
10848 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
10849 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
10850 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
10851 Return or accept bool, not int. All callers changed.
10852 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
10853 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
10854 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
10855 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
10856 bitset_or_and_cmp_): Likewise.
10857 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
10858 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
10859 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
10860 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
10861 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
10862 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
10863 bitset_stats_or_and_cmp): Likewise.
10864 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
10865 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
10866 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
10867 ebitset_xor_cmp): Likewise.
10868 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
10869 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
10870 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
10871 lbitset_xor_cmp): Likewise.
10872 * lib/bbitset.h: Include <stdbool.h>.
10873 (struct bitset_vtable): The following members now return bool, not
10874 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
10875 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
10876 or_and_cmp).
10877 * src/conflicts.c (count_rr_conflicts): Likewise.
10878 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
10879 All uses changed.
10880 * lib/ebitset.c (ebitset_obstack_init): Likewise.
10881 * lib/lbitset.c (lbitset_obstack_init): Likewise.
10882 * src/getargs.c (debug_flag, defines_flag, locations_flag,
10883 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10884 graph_flag): Likewise.
10885 * src/getargs.h (debug_flag, defines_flag, locations_flag,
10886 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10887 graph_flag): Likewise.
10888 * src/output.c (error_verbose): Likewise.
10889 * src/output.h (error_verbose): Likewise.
10890 * src/reader.c (start_flag, typed): Likewise.
10891 * src/reader.h (typed): Likewise.
10892 * src/getargs.c (LOCATIONS_OPTION): New constant.
10893 (long_options, getargs): Use it.
10894 * src/lalr.c (build_relations): Use bool, not int.
10895 * src/nullable.c (nullable_compute): Likewise.
10896 * src/print.c (print_reductions): Likewise.
10897 * src/tables.c (action_row, pack_vector): Likewise.
10898 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
10899 * src/output.c (prepare): Use it.
10900 * src/output.c (token_definitions_output,
10901 symbol_destructors_output, symbol_destructors_output): Use string,
10902 not boolean integer, to keep track of whether to output separator.
10903 * src/print_graph.c (print_core): Likewise.
10904 * src/state.c (state_rule_lookaheads_print): Likewise.
10905
10906 * config/install-sh: Sync from automake 1.7.5.
10907
10908 2003-05-14 Paul Eggert <eggert@twinsun.com>
10909
10910 * src/parse-gram.y (rules_or_grammar_declaration): Require a
10911 semicolon after a grammar declaration, in the interest of possible
10912 future changes to the Bison input language.
10913 Do not allow a stray semicolon at the start of the grammar.
10914 (rhses.1): Allow one or more semicolons after any rule, including
10915 just before "|" as required by POSIX.
10916 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
10917 grammar.
10918
10919 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
10920
10921 %parse-param support for lalr1.cc.
10922
10923 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
10924 b4_cc_constructor_calls, b4_cc_constructor_call,
10925 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
10926 definitions.
10927 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
10928 parse-param arguments.
10929 (yy::b4_parser_class_name): Declare instance variables to
10930 hold parse-param arguments.
10931 * tests/calc.at: s/value/semantic_value/ because value clashes
10932 with a member of yy::b4_parser_class_name. Adjust C++ code
10933 to handle %parse-param. Enable %parse-param test in C++.
10934
10935 2003-05-12 Paul Eggert <eggert@twinsun.com>
10936
10937 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
10938 English a bit. Fix fclose typo. Change "const char" to "char
10939 const", and use ANSI C rather than K&R for "main". Suggest
10940 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
10941 and suggest yy_switch_to_buffer.
10942
10943 2003-05-05 Paul Eggert <eggert@twinsun.com>
10944
10945 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
10946 C89. This avoids a diagnostic on compilers that define __STDC__
10947 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
10948 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
10949
10950 2003-05-03 Paul Eggert <eggert@twinsun.com>
10951
10952 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
10953 Do not overrun array bounds.
10954 This should fix a bug reported today by Olatunji Oluwabukunmi in
10955 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
10956
10957 2003-04-29 Akim Demaille <akim@epita.fr>
10958
10959 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
10960 * src/getargs.c, src/getargs.h: here, as bool, not int.
10961 (nondeterministic_parser): New.
10962 * src/parse-gram.y, src/scan-gram.l: Support
10963 %nondeterministic-parser.
10964 * src/output.c (prepare): Use nondeterministic_parser instead
10965 of glr_parser where appropriate.
10966 * src/tables.c (conflict_row, action_row, save_row)
10967 (token_actions, token_actions, pack_vector): Ditto.
10968
10969 2003-04-29 Akim Demaille <akim@epita.fr>
10970
10971 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
10972
10973 2003-04-29 Akim Demaille <akim@epita.fr>
10974
10975 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
10976 with %pure-parser and %locations to exercise the patch from Yakov
10977 Markovitch below.
10978
10979 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
10980
10981 * data/yacc.c: (b4_lex_param): Corrected for the case where
10982 %lex-param is provided and %pure-parser isn't.
10983
10984 2003-04-27 Paul Eggert <eggert@twinsun.com>
10985
10986 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
10987 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
10988 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
10989 if it is not defined.
10990 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
10991
10992 2003-04-26 Paul Eggert <eggert@twinsun.com>
10993
10994 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
10995 Declare to be of type suitable for the ninf value itself, not of
10996 type suitable for the corresponding table, since the latter might
10997 be unsigned but the ninf value might be negative. This fixes a
10998 bug reported by Alexandre Duret-Lutz in
10999 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
11000
11001 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
11002 invokes it. We shouldn't invoke it twice because it will attempt
11003 to put error.o in the archive twice. This fixes a glitch reported
11004 by Martin Mokrejs in
11005 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
11006
11007 2003-04-21 Paul Eggert <eggert@twinsun.com>
11008
11009 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
11010 to gnulib.
11011
11012 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
11013
11014 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
11015 Fix obvious typo that results in uncompilable GLR parsers
11016 when both %pure-parser and %locations are used. (trivial change)
11017
11018 2003-04-17 Paul Eggert <eggert@twinsun.com>
11019
11020 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
11021 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
11022 Do not insert the expected token via unput, as this runs afoul
11023 of a POSIX-compatibility bug in flex 2.5.31.
11024 All uses changed to BEGIN the parent state,
11025 since we no longer insert the expected token via unput.
11026 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
11027 that is no longer emitted after the above change.
11028
11029 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
11030 the first one. This change is from Paul Hilfinger, and it fixes
11031 regression reported by Werner Lemberg in
11032 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
11033
11034 (resolve_sr_conflict): Don't invoke state_errs_set
11035 unless one or more tokens have been explicitly made errors.
11036 Otherwise, the above change causes Bison to abort.
11037
11038 * tests/existing.at (GNU pic Grammar): New test case, taken from
11039 Lemberg's email.
11040
11041 2003-03-31 Akim Demaille <akim@epita.fr>
11042
11043 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
11044
11045 2003-03-31 Akim Demaille <akim@epita.fr>
11046
11047 * src/output.c (prepare_symbols): Avoid trailing spaces in the
11048 output.
11049
11050 2003-03-31 Akim Demaille <akim@epita.fr>
11051
11052 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
11053 From Paul Hilfinger.
11054
11055 2003-03-29 Akim Demaille <akim@epita.fr>
11056
11057 * m4/error.m4: Do not put under dynamic conditions some code which
11058 expansion is under static control.
11059
11060 2003-03-29 Akim Demaille <akim@epita.fr>
11061
11062 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
11063
11064 2003-03-29 Akim Demaille <akim@epita.fr>
11065
11066 * doc/bison.texinfo (Strings are Destroyed): New.
11067
11068 2003-03-13 Paul Eggert <eggert@twinsun.com>
11069
11070 * .cvsignore: Add configure.lineno.
11071 * src/.cvsignore: Add yacc.
11072 * tests/.cvsignore: Add testsuite.log.
11073 * doc/fdl.texi: Sync with latest FSF version.
11074
11075 2003-03-12 Paul Eggert <eggert@twinsun.com>
11076
11077 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
11078 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
11079 cursor, instead of leaving it undefined. This fixes a bug
11080 reported by Tim Van Holder in
11081 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
11082 * tests/input.at (Torturing the Scanner): Test the scanner on
11083 an empty input file, which was Tim Van Holder's test case.
11084
11085 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
11086 <sys/resource.h> can be included, include sys/time.h and
11087 sys/times.h first, if available. This works around the SunOS
11088 4.1.4 porting bug reported by Bruce Becker in
11089 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
11090
11091 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
11092 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
11093 AC_HEADER_SYS_WAIT.
11094
11095 Merge changes from gnulib. This was prompted because the CVS
11096 snapshot didn't build on Solaris 7 due to strnlen problems.
11097
11098 These changes need to be merged back into gnulib:
11099 * lib/hash.c: Include <stdbool.h> unconditionally.
11100 * m4/onceonly.m4 (m4_quote): New macro.
11101 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
11102 Quote AC_FOREACH variable-expansions properly.
11103 The 2003-01-03 obstack.h change also needs merging.
11104 {end of changes requiring merging}
11105
11106 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11107 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
11108 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
11109 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
11110 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
11111 New files, imported from gnulib.
11112 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
11113 above.
11114
11115 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
11116 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
11117 gnulib sources.
11118
11119 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
11120 Add.
11121 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
11122 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
11123 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
11124 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
11125 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
11126 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
11127 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
11128 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
11129 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
11130 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
11131 (jm_PREREQ_ARGMATCH): Remove.
11132 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
11133 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
11134
11135 * src/system.h: Include <stdbool.h> unconditionally.
11136
11137 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
11138 assuming at least C89 in the bitset code for some time now.
11139
11140 2003-03-03 Akim Demaille <akim@epita.fr>
11141
11142 * ro.po: New.
11143
11144 2003-03-02 Akim Demaille <akim@epita.fr>
11145
11146 * doc/bison.texinfo (Table of Symbols): Reactivate the
11147 documentation for %lex-param, and %parse-param.
11148
11149 2003-03-02 Akim Demaille <akim@epita.fr>
11150
11151 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
11152 generate verbose error messages.
11153 Use the number of tokens as an upper bound in yytname, as it
11154 cannot be a non terminal.
11155
11156 2003-03-02 Akim Demaille <akim@epita.fr>
11157
11158 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
11159 message.
11160
11161 2003-03-02 Akim Demaille <akim@epita.fr>
11162
11163 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
11164 Use them to exercise yycheck overrun.
11165 Based on Andrew Suffield's grammar.
11166
11167 2003-03-02 Akim Demaille <akim@epita.fr>
11168
11169 Create tests/local.at for Bison generic testing macros.
11170
11171 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
11172 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
11173 This new file.
11174 * tests/calc.at (AT_CHECK_CALC): Adjust.
11175 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
11176 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
11177 * tests/local.at: here.
11178 (AT_COMPILE_CXX): Tags the tests using it as c++.
11179 Ignore the test if CXX is not functional.
11180
11181 2003-03-01 Paul Eggert <eggert@twinsun.com>
11182
11183 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
11184 not loc->end, since loc->end might contain garbage and this leads
11185 to undefined behavior on some platforms.
11186 (id_loc, token_start): Use (IF_LINTed) initial values that do not
11187 depend on *loc, so that the reader doesn't give the the false
11188 impression that *loc is initialized.
11189 (<INITIAL>"%%"): Do not bother setting code_start, since its value
11190 does not survive the return.
11191
11192 2003-03-01 Akim Demaille <akim@epita.fr>
11193
11194 * src/scan-gram.l (code_start): Always initialize it when entering
11195 into yylex, as SC_EPILOGUE is activated *before* the corresponding
11196 yylex invocation. An alternative would be making it static, but
11197 then it starts with the second %%'s beginning, instead of its end.
11198
11199 2003-02-28 Paul Eggert <eggert@twinsun.com>
11200
11201 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
11202 around a UnixWare 7.1.1 porting bug reported by John Hughes in
11203 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
11204
11205 2003-02-26 Paul Eggert <eggert@twinsun.com>
11206
11207 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
11208 Remove Sequent/Pyramid discussion (nobody uses them any more).
11209 Merge VMS and MS-DOS discussion; these ports may well be dead
11210 but let's keep mentioning them for now. Put <> around email
11211 addresses. Add copyright notice.
11212
11213 2003-02-24 Paul Eggert <eggert@twinsun.com>
11214
11215 * data/glr.c (yy_reduce_print): yylineno -> yylno,
11216 to avoid collision with flex use of yylineno.
11217 Problem reported by Bruce Lilly in
11218 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
11219 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11220 * data/yacc.c (yy_reduce_print): Likewise.
11221
11222 * config/depcomp: Sync with Automake 1.7.3.
11223
11224 2003-02-21 Akim Demaille <akim@epita.fr>
11225
11226 * data/lalr1.cc: Use temporary variables instead of casts to
11227 change integer types.
11228 Suggested by Paul Eggert.
11229
11230 2003-02-21 Akim Demaille <akim@epita.fr>
11231
11232 * doc/bison.texinfo: Use "location" consistently to refer to @n,
11233 to avoid confusions with lalr1.cc's notion of Position.
11234 Suggested by Paul Eggert.
11235
11236 2003-02-20 Akim Demaille <akim@epita.fr>
11237
11238 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
11239 before initial_columns.
11240 (location.hh): Use consistent variable names when defining the
11241 operator<<.
11242 Use "last" so that we subtract from Positions, not from unsigned.
11243
11244 2003-02-20 Akim Demaille <akim@epita.fr>
11245
11246 * data/lalr1.cc (position.hh): New subfile, including the extended
11247 and Doxygen'ed documentation of class Position.
11248 (location.hh): Use it.
11249 Document a` la Doxygen.
11250 With the help of Benoit Perrot.
11251
11252 2003-02-20 Akim Demaille <akim@epita.fr>
11253
11254 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
11255 AT_YACC_IF.
11256 Redefine AT_YYERROR_SEES_LOC_IF using it.
11257 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
11258 not defined.
11259 Don't use the location in yy::Parser::error_ and
11260 yy::Parser::print_ when not %locations.
11261 Activate more lalr1.cc tests.
11262
11263 2003-02-19 Akim Demaille <akim@epita.fr>
11264
11265 * data/lalr1.cc: When displaying a line number, be sure to make it
11266 an int.
11267
11268 2003-02-19 Akim Demaille <akim@epita.fr>
11269
11270 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
11271 Remove, useless.
11272 (YYABORT, YYACCEPT, YYERROR): New.
11273 * tests/calc.at: Renable the lalr1.cc test.
11274
11275 2003-02-19 Akim Demaille <akim@epita.fr>
11276
11277 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
11278 error recovery, mixing with/without pops and discarding of the
11279 lookahead.
11280 Exercise YYERROR.
11281 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
11282
11283 2003-02-17 Paul Eggert <eggert@twinsun.com>
11284
11285 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
11286 * tests/testsuite.at (AT_COMPILE): Use them.
11287 This fixes the testsuite problem reported by Robert Lentz in
11288 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
11289
11290 2003-02-12 Paul Eggert <eggert@twinsun.com>
11291
11292 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
11293 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
11294 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
11295 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
11296 Check for malloc failure, for consistency with yacc.c.
11297 (yytname_size): Remove, for consistency with yacc.c.
11298
11299 The bug still remains in data/lalr1.cc, as I didn't have time
11300 to fix it there.
11301
11302 2003-02-06 Akim Demaille <akim@epita.fr>
11303
11304 * configure.ac (GXX): Rename as...
11305 (CXX): this, to keep the original Autoconf semantics.
11306 Require 2.57.
11307 * data/lalr1.cc: Fix b4_copyright invocations.
11308 If YYDEBUG is not defined, don't depend upon name_ being defined.
11309 (location.hh): Include string and iostream.
11310 (Position::filename): New member.
11311 (Position::Position ()): New.
11312 (operator<< (Position)): New.
11313 (operator- (Position, int)): New.
11314 (Location::first, Location::last): Rename as...
11315 (Location::begin, Location::end): these, to mock the conventional
11316 iterator names.
11317 (operator<< (Location)): New.
11318 * tests/atlocal.in (CXX): New.
11319 * tests/testsuite.at (AT_COMPILE_CXX): New.
11320 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
11321 locations in a more synthetic way.
11322 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
11323 lalr1.cc is used.
11324 Adjust the C locations to match those from Emacs: first column is
11325 column 0.
11326 Change all the expected results.
11327 Conform to the GCS: simplify the locations when applicable.
11328 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
11329 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
11330 these CPP macros with the m4 macros new defined by...
11331 (AT_CHECK_PUSHDEFS): this, i.e.:
11332 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
11333 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
11334 New macros.
11335 (AT_CHECK_POPDEFS): Undefine them.
11336 (AT_CHECK_CALC_LALR1_CC): New.
11337 Use it for the first lalr1.cc test.
11338
11339 2003-02-04 Akim Demaille <akim@epita.fr>
11340
11341 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
11342 Location as is defined.
11343
11344 2003-02-04 Akim Demaille <akim@epita.fr>
11345
11346 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
11347 name_ being defined.
11348
11349 2003-02-03 Paul Eggert <eggert@twinsun.com>
11350
11351 * src/gram.h (start_symbol): Remove unused decl.
11352
11353 Use more-consistent naming conventions for local vars.
11354
11355 * src/derives.c (derives_compute): Change type of local var from
11356 int to rule_number.
11357 * src/gram.c (grammar_rules_partial_print): Likewise.
11358 * src/print.c (print_core): Likewise.
11359 * src/reduce.c (reduce_grammar_tables): Likewise.
11360
11361 * src/gram.c (grammar_dump): Change name of item_number *
11362 local var from r to rp.
11363 * src/nullable.c (nullable_compute): Likewise.
11364
11365 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
11366
11367 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
11368 for symbol or symbol_number var.
11369 * src/reader.c (grammar_start_symbol_set): Likewise.
11370 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
11371 Likewise.
11372 * src/state.c (transitions_to): Likewise.
11373 * src/state.h: Likewise.
11374 * src/tables.c (symbol_number_to_vector_number): Likewise.
11375
11376 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
11377 char * var.
11378
11379 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
11380 var.
11381
11382 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
11383 var.
11384
11385 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
11386 Use str, not s, for char * var. Use ch, not c, for character var.
11387 Use size for size var.
11388
11389 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
11390 char * var.
11391 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
11392 uniqstr var.
11393 * src/uniqstr.h: Likewise.
11394
11395 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11396 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11397 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
11398 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
11399 param to have same name as that of enum, so that we don't use
11400 "s" to stand for a non-state.
11401
11402 2003-02-02 Akim Demaille <akim@epita.fr>
11403
11404 * src/scan-skel.l: Scan more than one inert character per yylex
11405 invocation.
11406
11407 2003-02-01 Paul Eggert <eggert@twinsun.com>
11408
11409 Version 1.875a.
11410
11411 * po/LINGUAS: Add ms.
11412
11413 2003-01-30 Akim Demaille <akim@epita.fr>
11414
11415 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
11416
11417 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11418
11419 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
11420 of $1.
11421
11422 Changes in response to error report by S. Eken: GLR mode does not
11423 handle negative $ indices or $ indices in embedded rules correctly.
11424 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
11425
11426 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
11427 (b4_rhs_location): Ditto.
11428 (yyfill): New function to copy from stack tree into array
11429 incrementally.
11430 (yyuserAction): Modify to allow incremental move of semantic values
11431 to rhs array when in GLR mode.
11432 Define YYFILL to use in user-defined actions to fill semantic array
11433 as needed.
11434 Remove dummy use of yystack, as there is now a guaranteed use.
11435 (yydoAction): Modify to allow incremental move of semantic values
11436 to rhs array when in GLR mode.
11437 (yyresolveAction): Ditto.
11438 (yyglrShiftDefer): Update comment.
11439 (yyresolveStates): Use X == NULL for pointers, not !X.
11440 (yyglrReduce): Ditto.
11441 (yydoAction): Ditto
11442
11443 * tests/glr-regr1.at: Rename to ...
11444 * tests/glr-regression.at: Add new regression test for the problems
11445 described above (adapted from S. Eken).
11446 Update copyright notice.
11447 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
11448 * tests/Makefile.am: Ditto.
11449
11450 2003-01-28 Paul Eggert <eggert@twinsun.com>
11451
11452 * data/lalr1.cc: Do not use @output_header_name@ unless
11453 b4_defines_flag is set. This fixes two bugs reported by
11454 Tim Van Holder in
11455 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
11456 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
11457
11458 2003-01-21 Paul Eggert <eggert@twinsun.com>
11459
11460 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
11461 we don't need to worry about yyerrlab1 being reported as an
11462 "unused label" by non-GCC C compilers. The downside is that if
11463 locations are used then a couple of statements are duplicated each
11464 time YYERROR is invoked, but the upside is that the warnings
11465 should vanish.
11466 (yyerrlab1): Move code to YERROR.
11467 (yyerrlab2): Remove. Change uses back to yyerrlab1.
11468 This reverts some of the 2002-12-27 change.
11469
11470 2003-01-17 Paul Eggert <eggert@twinsun.com>
11471
11472 * src/output.c (symbol_printers_output): Fix typo that led
11473 to core dump. Problem reported by Antonio Rus in
11474 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
11475
11476 2003-01-13 Akim Demaille <akim@epita.fr>,
11477 Quoc Peyrot <chojin@lrde.epita.fr>,
11478 Robert Anisko <anisko_r@lrde.epita.fr>
11479
11480 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
11481 when the stacks contain one element, as the loop would otherwise
11482 free the last state, and then use the top state (the one we just
11483 popped). This means that the initial elements will not be freed
11484 explicitly, as is the case in yacc.c; it is not a problem, as
11485 these elements have fake values.
11486
11487 2003-01-11 Paul Eggert <eggert@twinsun.com>
11488
11489 * NEWS: %expect-violations are now just warnings, reverting
11490 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
11491 bootstrapping problem reported by Matthias Klose; see
11492 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
11493 * src/conflicts.c (conflicts_print): Likewise.
11494 * tests/conflicts.at (%expect not enough, %expect too much,
11495 %expect with reduce conflicts): Likewise.
11496 * doc/bison.texinfo (Expect Decl): Document this. Also mention
11497 that the warning is enabled if the number of conflicts changes
11498 (not necessarily increases).
11499
11500 * src/getargs.c (version): Update copyright year.
11501
11502 2003-01-09 Akim Demaille <akim@epita.fr>
11503
11504 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
11505
11506 2003-01-08 Paul Eggert <eggert@twinsun.com>
11507
11508 * Makefile.maint (WGETFLAGS):
11509 New macro, containing "-C off" to disable proxy caches.
11510 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
11511 (rel-check): Use $(WGET) instead of wget.
11512
11513 2003-01-06 Paul Eggert <eggert@twinsun.com>
11514
11515 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
11516 the GLR paper of Scott, Johnstone and Hussain.
11517
11518 2003-01-04 Paul Eggert <eggert@twinsun.com>
11519
11520 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
11521 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
11522 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
11523 (EXTRA_LIBRARIES): New var, for liby.a.
11524 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
11525 (EXTRA_SCRIPTS): New var, for yacc.
11526
11527 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
11528 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
11529 Problem reported by Nelson H. F. Beebe.
11530
11531 2003-01-03 Paul Eggert <eggert@twinsun.com>
11532
11533 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
11534 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
11535 when compiling Bison 1.875's `bitset bset = obstack_alloc
11536 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
11537
11538 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
11539 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
11540 grow to a huge size with typical invocation.
11541
11542 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
11543 Use the pattern recommended by Autoconf 2.57, except also protect
11544 against double-definition.
11545 * src/system.h: Likewise.
11546 Portability issues reported by Nelson H. F. Beebe.
11547
11548 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
11549 All uses changed. Provide a definition in both C and C++.
11550 (yytrue, yyfalse): Define even if defined (__cplusplus).
11551
11552 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
11553 Reported by Nelson H. F. Beebe.
11554
11555 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
11556
11557 2003-01-02 Paul Eggert <eggert@twinsun.com>
11558
11559 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
11560 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
11561 Bug reported by Nelson H. F. Beebe.
11562
11563 2003-01-01 Paul Eggert <eggert@twinsun.com>
11564
11565 * Version 1.875.
11566
11567 2002-12-30 Paul Eggert <eggert@twinsun.com>
11568
11569 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
11570 Moved here from...
11571 (<INITIAL>","): Here. This causes stray "," to be treated
11572 more uniformly.
11573
11574 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
11575 last brace in braced code when not in Yacc mode, for compatibility
11576 with Bison 1.35. This resurrects the 2001-12-15 patch to
11577 src/reader.c.
11578
11579 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
11580 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
11581
11582 2002-12-28 Paul Eggert <eggert@twinsun.com>
11583
11584 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
11585 that of SYM's type. This fixes Debian bug 168069, reported by
11586 Thomas Olsson.
11587
11588 2002-12-28 Paul Eggert <eggert@twinsun.com>
11589
11590 Version 1.75f.
11591
11592 Switch back to the Yacc style of conflict reports, undoing some
11593 of the 2002-07-30 change.
11594 * doc/bison.texinfo (Understanding): Use Yacc style for
11595 conflict reports. Also, use new way of locating rules.
11596 * src/conflicts.c (conflict_report):
11597 Renamed from conflict_report_yacc, removing the old
11598 'conflict_report'. Translate the entire conflict report at once,
11599 so that we don't assume that "," has the same interpretation in
11600 all languages.
11601 (conflicts_output): Use Yacc-style conflict report for each state,
11602 instead of our more-complicated style.
11603 (conflicts_print): Use Yacc-style conflict report, except print
11604 the input file name when not emulating Yacc.
11605 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
11606 Conflicted Reduction, %expect not enough, %expect too much,
11607 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
11608 * tests/existing.at (GNU Cim Grammar): Likewise.
11609 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
11610
11611 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
11612 fatal): Don't invoke fflush; it's not needed and it might even be
11613 harmful for stdout, as stdout might not be open.
11614 * src/reduce.c (reduce_print): Likewise.
11615
11616 2002-12-27 Paul Eggert <eggert@twinsun.com>
11617
11618 Fix a bug where error locations were not being recorded correctly.
11619 This problem was originally reported by Paul Hilfinger in
11620 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
11621
11622 * data/yacc.c (yyparse): New local var yylerrsp, to record the
11623 top of the location stack's error locations.
11624 (yyerrlab): Set it. When discarding a token, push its location
11625 onto yylerrsp so that we don't lose track of the error's end.
11626 (yyerrlab1): Now is only the target of YYERROR, so that we can
11627 properly record the location of the action that failed. For GCC
11628 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
11629 GCC warning about yyerrlab1 being unused if YYERROR is unused.
11630 (yyerrlab2): New label, which yyerrlab now falls through to.
11631 Compute the error's location by applying YYLLOC_DEFAULT to
11632 the locations of all the symbols that went into the error.
11633 * doc/bison.texinfo (Location Default Action): Mention that
11634 YYLLOC_DEFAULT is also invoked for syntax errors.
11635 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11636 Error locations include the locations of all the tokens that were
11637 discarded, not just the last token.
11638
11639 2002-12-26 Paul Eggert <eggert@twinsun.com>
11640
11641 * src/files.c: Include quote.h.
11642 (compute_output_file_names): Warn if we detect conflicting
11643 outputs to the same file. This should catch the misunderstanding
11644 exemplified by Debian Bug 165349, reported by Bruce Stephens..
11645
11646 * src/conflicts.c (conflicts_print): If the user specifies
11647 "%expect N", report an error if there are any reduce/reduce
11648 conflicts. This is what the manual says should happen.
11649 This fixes Debian bug 130890, reported by Anthony DeRobertis.
11650 * tests/conflicts.at (%expect with reduce conflicts): New test.
11651
11652 Don't use m4_include on relative file names, as it doesn't work as
11653 desired if there happens to be a file with that name under ".".
11654
11655 * m4sugar/version.m4: Remove; it was included but it wasn't used.
11656 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
11657 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
11658 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
11659 * src/output.c (output_skeleton): Use full path names when
11660 specifying a file to include; don't rely on include path, as
11661 it's unreliable when the working file contains a file with
11662 that name.
11663
11664 2002-12-25 Paul Eggert <eggert@twinsun.com>
11665
11666 Remove obsolete references to bison.simple and bison.hairy.
11667 Problem mentioned by Aubin Mahe in
11668 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
11669 * data/glr.c: Comment fix.
11670 * doc/bison.1: Remove references. Also, mention "yacc".
11671
11672 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
11673 with -g option.
11674
11675 * src/parse-gram.y (declaration): Use enum "report_states" rather
11676 than its numeric value 1.
11677
11678 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
11679 opening a new one. This fixes Debian bug 165349, reported by
11680 Bruce Stephens.
11681
11682 2002-12-24 Paul Eggert <eggert@twinsun.com>
11683
11684 Version 1.75e.
11685
11686 * Makefile.maint (cvs-update): Don't assume that the shell
11687 supports $(...), as Solaris sh doesn't.
11688
11689 * src/parse-gram.y (lloc_default): Remove test for empty
11690 nonterminals at the end, since it didn't change the result.
11691
11692 2002-12-24 Paul Eggert <eggert@twinsun.com>
11693
11694 If the user does not define YYSTYPE as a macro, Bison now declares it
11695 using typedef instead of defining it as a macro. POSIX requires this.
11696 For consistency, YYLTYPE is also declared instead of defined.
11697
11698 %union directives can now have a tag before the `{', e.g., the
11699 directive `%union foo {...}' now generates the C code
11700 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
11701 The default union tag is `YYSTYPE', for compatibility with Solaris 9
11702 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
11703 instead of `yyltype'.
11704
11705 `yystype' and `yyltype' are now obsolescent macros instead of being
11706 typedefs or tags; they are no longer documented and will be
11707 withdrawn in a future release.
11708
11709 * data/glr.c (b4_location_type): Remove.
11710 (YYSTYPE): Renamed from yystype.
11711 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
11712 (struct YYLTYPE): Renamed from struct yyltype.
11713 (YYLTYPE): Renamed from yyltype.
11714 (yyltype, yystype): New (and obsolescent) macros,
11715 for backward compatibility.
11716 * data/yacc.c: Likewise.
11717
11718 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
11719 does not specify a union tag. This is for compatibility with
11720 Solaris 9 yacc.
11721
11722 * src/parse-gram.y (add_param): 2nd arg is now char * not char
11723 const *, since it is now modified by stripping surrounding { }.
11724 (current_braced_code): Remove.
11725 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
11726 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
11727 trailing " {...}". Now of type <chars>.
11728 (grammar_declaration): Adjust to bundled tokens.
11729 (code_content): Remove; stripping is now done by add_param.
11730 (print_token_value): Print contents of bundled tokens.
11731 (token_name): New function.
11732
11733 * src/reader.h (braced_code, current_braced_code): Remove.
11734 (token_name): New decl.
11735
11736 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
11737 token_type, not braced_code code_kind. All uses changed.
11738 (SC_PRE_CODE): New state, for scanning after a keyword that
11739 has (or usually has) an immediately-following braced code.
11740 (token_type): New local var, to keep track of which token type
11741 to return when scanning braced code.
11742 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
11743 <INITIAL>"%parse-param", <INITIAL>"%printer",
11744 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
11745 instead of returning a token type immediately.
11746 (<INITIAL>"{"): Set token type.
11747 (<SC_BRACED_CODE>"}"): Use it.
11748 (handle_action_dollar, handle_action_at): Now returns bool
11749 indicating success. Fail if ! current_rule; this prevents a core dump.
11750 (handle_symbol_code_dollar, handle_symbol_code_at):
11751 Remove; merge body into caller.
11752 (handle_dollar, handle_at): Complain in invalid contexts.
11753
11754 * NEWS, doc/bison.texinfo: Document the above.
11755 * NEWS: Fix years and program names in copyright notice.
11756
11757 2002-12-17 Paul Eggert <eggert@twinsun.com>
11758
11759 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
11760 Reporting, Table of Symbols): Omit mentions of %lex-param and
11761 %parse-param from the documentation for now.
11762
11763 2002-12-15 Paul Eggert <eggert@twinsun.com>
11764
11765 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
11766 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
11767 lookahead symbol, and which sets yychar in parser actions) and it
11768 disagreed with the Bison documentation. Bug
11769 reported by Andrew Walrond.
11770
11771 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
11772 as the caller now does that.
11773 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
11774 (YYEMPTY): Parenthesize right hand side, since others use it.
11775 (yyparse): Don't assume that our generated code is the only code
11776 that sets yychar.
11777
11778 2002-12-13 Paul Eggert <eggert@twinsun.com>
11779
11780 Version 1.75d.
11781
11782 POSIX requires a "yacc" command.
11783 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
11784 (MOSTLYCLEANFILES): Add yacc.
11785 (yacc): New rule.
11786 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
11787 as an alias for bison y.
11788
11789 * po/LINGUAS: Add da.
11790
11791 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
11792 problem with latest <getopt.h>.
11793 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
11794
11795 * doc/fdl.texi: Upgrade to 1.2.
11796 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
11797 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
11798 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
11799 gnulib.
11800 * config/install-sh: Sync with autotools.
11801
11802 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
11803 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
11804 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
11805 locations are requested.
11806 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
11807 locations are requested.
11808
11809 2002-12-12 Paul Eggert <eggert@twinsun.com>
11810
11811 Remove unportable casts and storage allocation tricks.
11812 While we're at it, remove almost all casts, since they
11813 usually aren't needed and are a sign of trouble.
11814
11815 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
11816
11817 * src/derives.c (derives_compute): Do not subtract NTOKENS from
11818 the pointer DSET returned by malloc; this isn't portable.
11819 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
11820 Similarly for DERIVES.
11821 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
11822 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
11823 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
11824
11825 * src/derives.c (derives_compute): Do not bother invoking
11826 int_of_rule_number, since rule numbers are integers.
11827
11828 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
11829 rather than XMALLOC (char, N).
11830
11831 * src/files.c (filename_split): Rewrite to avoid cast.
11832
11833 * src/gram.h (symbol_number_as_item_number,
11834 item_number_as_symbol_number, rule_number_as_item_number,
11835 item_number_as_rule_number):
11836 Now inline functions rather than macros, to avoid casts.
11837 * src/state.h (state_number_as_int): Likewise.
11838 * src/tables.c (state_number_to_vector_number,
11839 symbol_number_to_vector_number): Likewise.
11840
11841 * src/gram.h (int_of_rule_number): Remove; no longer used.
11842
11843 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
11844 since the resulting storage is always stored into.
11845
11846 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
11847 where it's needed.
11848
11849 * src/muscle_tab.c (muscle_m4_output):
11850 Now inline. Return bool, not int.
11851 * src/state.c (state_compare): Likewise.
11852 * src/symtab.c (symbol_check_defined,
11853 symbol_check_alias_consistency, symbol_pack, symbol_translation,
11854 hash_compare_symbol, hash_symbol):
11855 Likewise.
11856 * src/uniqstr.c (uniqstr_print): Likewise.
11857 * src/muscle_tab.c (muscle_m4_output_processor):
11858 New function, to avoid casts.
11859 * src/state.c (state_comparator, stage_hasher): Likewise.
11860 * src/symtab.c (symbol_check_defined_processor,
11861 symbol_check_alias_consistency_processor, symbol_pack_processor,
11862 symbol_translation_processor, hash_symbol_comparator,
11863 hash_symbol_hasher): Likewise.
11864 * src/uniqstr.c (uniqstr_print_processor): Likewise.
11865 * src/muscle_tab.c (muscles_m4_output):
11866 Use new functions instead of casting old functions unportably.
11867 * src/state.c (state_hash_new): Likewise.
11868 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
11869 symbols_token_translations_init):
11870 Likewise.
11871 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
11872
11873 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
11874 var instead of casting to long, to avoid casts.
11875 (prepare_states): Use MALLOC rather than alloca, so that we don't
11876 have to worry about alloca.
11877 * src/state.c (state_hash_lookup): Likewise.
11878
11879 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
11880 local var instead of casting to unsigned char, to avoid casts.
11881
11882 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
11883 STATE_ALLOC): Remove.
11884 (transitions_new, errs_new, reductions_new, state_new): Use malloc
11885 rather than calloc, and use offsetof to avoid allocating slightly
11886 too much storage.
11887 (state_new): Initialize all members.
11888
11889 * src/state.c (state_hash): Use unsigned accumulator, not signed.
11890
11891 * src/symtab.c (symbol_free): Remove; unused.
11892 (symbol_get): Remove cast in lhs of assignment.
11893 (symbols_do): Now static. Accept generic arguments, not
11894 hashing-related ones.
11895
11896 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
11897 (symbol_processor): Remove.
11898 (symbols_do): Remove decl; now static.
11899
11900 * src/system.h (alloca): Remove; decl no longer needed.
11901 (<stddef.h>): Include, for offsetof.
11902 (<inttypes.>, <stdint.h>): Include if available.
11903 (uintptr_t): New type, if system lacks it.
11904 (CALLOC, MALLOC, REALLOC): New macros.
11905 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
11906 new macros.
11907
11908 * src/tables.c (table_size): Now int, to pacify GCC.
11909 (table_grow, table_ninf_remap): Use signed table size.
11910 (save_row): Don't bother initializing locals when not needed.
11911 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
11912 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
11913
11914 * src/vcg.h: Correct misspellings.
11915
11916 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
11917
11918
11919 * src/getargs.c (getargs): Don't assume EOF == -1.
11920
11921 2002-12-09 Paul Eggert <eggert@twinsun.com>
11922
11923 Change identifier spellings to avoid collisions with names
11924 that are reserved by POSIX.
11925
11926 Don't use names ending in _t, since POSIX reserves them.
11927 For consistency, remove _e and _s endings -- they're weren't
11928 needed to remove ambiguity. All uses changed.
11929 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
11930 turn was just renamed from struniq_t.
11931 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
11932 which in turn was just renamed from struniq_processor_t.
11933 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
11934 in turn was renamed from hash_compare_struniq_t.
11935 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
11936 (state_list): Renamed from state_list_t.
11937 * src/assoc.h (assoc): Renamed from assoc_t.
11938 * src/conflicts.c (enum conflict_resolution): Renamed from
11939 enum conflict_resolution_e.
11940 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
11941 (rule_list): Renamed from rule_list_t.
11942 * src/getargs.h (enum trace): Renamed from enum trace_e.
11943 (enum report): Renamed from enum report_e.
11944 * src/gram.h (item_number): Renamed from item_number_t.
11945 (rule_number): Renamed from rule_number_t.
11946 (struct rule_s): Remove the "rule_s" part; not used.
11947 (rule): Renamed from rule_t.
11948 (rule_filter): Renamed from rule_filter_t.
11949 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
11950 (goto_list): Renamed from goto_list_t.
11951 * src/lalr.h (goto_number): Renamed from goto_number_t.
11952 * src/location.h (location): Renamed from location_t.
11953 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
11954 and moved here from:
11955 * src/muscle_tab.h (muscle_entry_t): here.
11956 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
11957 (rule_list): Renamed from rule_list_t.
11958 * src/print_graph.c (static_graph): Renamed from graph.
11959 * src/reader.h (braced_code): Renamed from braced_code_t.
11960 Remove brace_code_e tag.
11961 * src/relation.h (relation_node): Renamed from relation_node_t.
11962 (relation_nodes): Renamed from relation_nodes_t.
11963 (relation): Renamed from relation_t.
11964 * src/state.h (state_number): Renamed from state_number_t.
11965 (struct state): Renamed from struct state_s.
11966 (state): Renamed from state_t.
11967 (transitions): Renamed from transitions_t. Unused (and
11968 misspelled) transtion_s tag removed.
11969 (errs): Renamed from errs_t. Unused errs_s tag removed.
11970 (reductions): Renamed from reductions_t. Unused tag
11971 reductions_s removed.
11972 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
11973 (struct symbol_list): Renamed from struct symbol_list_s.
11974 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
11975 (struct symbol): Renamed from struct symbol_s.
11976 (symbol): Renamed from symbol_t.
11977 * src/tables.c (vector_number): Renamed from vector_number_t.
11978 (action_number): Renamed from action_t.
11979 * src/tables.h (base_number): Renamed from base_t.
11980 * src/vcg.h (enum color): Renamed from enum color_e.
11981 (enum textmode): Renamed from enum textmode_e.
11982 (enum shape): Renamed from enum shape_e.
11983 (struct colorentry): Renamed from struct colorentry_s.
11984 (struct classname): Renamed from struct classname_s.
11985 (struct infoname): Renamed from struct infoname_s.
11986 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
11987 (enum decision): Renamed from enum decision_e.
11988 (enum orientation): Renamed from enum orientation_e.
11989 (enum alignment): Renamed from enum alignment_e.
11990 (enum arrow_mode): Renamed from enum arrow_mode_e.
11991 (enum crossing_type): Renamed from enum crossing_type_e.
11992 (enum view): Renamed from enum view_e.
11993 (struct node): Renamed from struct node_s.
11994 (node): Renamed from node_t.
11995 (enum linestyle): Renamed from enum linestyle_e.
11996 (enum arrowstyle): Renamed from enum arrowstyle_e.
11997 (struct edge): Renamed from struct edge.
11998 (edge): Renamed from edge_t.
11999 (struct graph): Renamed from struct graph_s.
12000 (graph): Renamed from graph_t.
12001 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
12002 Rename value_t -> value.
12003 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
12004 value_t_as_yystype -> value_as_yystype.
12005
12006 Don't include <errno.h> in the mainstream code, since it
12007 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
12008 * lib/get-errno.c, lib/get-errno.h: New files.
12009 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
12010 get-errno.c.
12011 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
12012 * src/output.c (output_skeleton): Likewise.
12013 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
12014 instead of errno.
12015 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
12016 Likewise.
12017 (handle_action_dollar, handle_action_at): Likewise.
12018 * src/system.h: Do not include <errno.h>.
12019 (TAB_EXT): Renamed from EXT_TAB.
12020 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
12021
12022 Avoid str[a-z]*, since <string.h> reserves that name space.
12023 Change all instances of "struniq" in names to "uniqstr", and
12024 likewise for "STRUNIQ" and "UNIQSTR".
12025 * src/uniqstr.c: Renamed from src/struniq.c.
12026 * src/uniqstr.h: Renamed from src/struniq.h.
12027 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
12028 * src/files.c (strsuffix): Remove; unused.
12029 (concat2): Renamed from stringappend. Now static.
12030 * src/files.h (strsuffix, stringappend): Remove; unused.
12031 * src/parse-gram.y (<chars>): Renamed from <string>.
12032 (<uniqstr>): Renamed from <struniq>.
12033 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
12034 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
12035 (struct graph_s.expand): Renamed from struct graph_s.stretch.
12036 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
12037 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
12038 (N_EXPAND): Renamed from N_STRETCH.
12039
12040 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
12041 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
12042 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
12043 Remove; unused.
12044 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
12045 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
12046 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
12047 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
12048 (BASE_MAXIMUM): Renamed from BASE_MAX.
12049 (BASE_MINIMUM): Renamed from BASE_MIN.
12050 (ACTION_MAX): Remove; unused.
12051 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
12052 Unnecessary casts removed from above defines.
12053
12054
12055 Fix misspelling in names.
12056 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
12057 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
12058 G_NODE_ALIGNEMENT.
12059
12060
12061 * lib/timevar.c (timevar_report): Renamed from time_report,
12062 for consistency with other names.
12063 * lib/timevar.h (timevar_report): New decl.
12064 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
12065
12066
12067 Sort include-file uses.
12068
12069 Reorder all include files under src to be in the order "system.h".
12070 then the ../lib include files in angle brackets (alphabetized),
12071 then the . include files in double-quotes (alphabetized). Fix
12072 dependency breakages encountered in this process, as follows:
12073 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
12074 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
12075 * src/state.h: Include "symtab.h".
12076
12077 2002-12-08 Paul Eggert <eggert@twinsun.com>
12078
12079 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
12080 since this causes problems when __file__ contains character
12081 sequences like "@" that are treated specially by src/scan-skel.l.
12082 Instead, just use the file's basename. This fixes the bug
12083 reported by Martin Mokrejs in
12084 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
12085
12086 2002-12-06 Paul Eggert <eggert@twinsun.com>
12087
12088 Add support for rules that do not have trailing semicolons, as
12089 POSIX requires. Improve the quality of locations in Bison
12090 diagnostics.
12091
12092 * src/location.c: Include <quotearg.h>.
12093 (empty_location): Now const.
12094 (location_print): New function. Follow the recommendation of the
12095 GNU Coding Standards for locations that span file boundaries.
12096 * src/location.h: Do not include <quotearg.h>; no longer needed.
12097 (boundary): New type.
12098 (location_t): Use it. This allows locations to span file boundaries.
12099 All member uses changed: file -> start.file or end.file (as needed),
12100 first_line -> start.line, first_column -> start.column,
12101 last_line -> end.line, last_column -> end.column.
12102 (equal_boundaries): New function.
12103 (LOCATION_RESET, LOCATION_STEP): Remove.
12104 (LOCATION_PRINT): Remove. All callers changed to use location_print.
12105 (empty_location): Now const.
12106 (location_print): New decl.
12107 * src/parse-gram.y (lloc_default): New function, which handles
12108 empty locations more accurately.
12109 (YYLLOC_DEFAULT): Use it.
12110 (%token COLON): Remove.
12111 (%token ID_COLON): New token.
12112 (rules): Use it.
12113 (declarations, rules): Remove trailing semicolon.
12114 (declaration, rules_or_grammar_declaration):
12115 Allow empty (";") declaration.
12116 (symbol_def): Remove empty actions; no longer needed.
12117 (rules_or_grammar_declaration): Remove trailing semicolon.
12118 (semi_colon.opt): Remove.
12119 * src/reader.h: Include location.h.
12120 (scanner_cursor): New decl.
12121 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
12122 rolling our own.
12123 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
12124 of *loc.
12125 (STEP): Remove. No longer needed, now that adjust_location does
12126 the work. All uses removed.
12127 (scanner_cursor): New var.
12128 (adjust_location): Renamed from extend_location. It now sets
12129 *loc and adjusts the scanner cursor. All uses changed.
12130 Don't bother testing for CR.
12131 (handle_syncline): Remove location arg; now updates scanner cursor.
12132 All callers changed.
12133 (unexpected_end_of_file): Now accepts start boundary of token or
12134 comment, not location. All callers changed. Update scanner cursor,
12135 not the location.
12136 (SC_AFTER_IDENTIFIER): New state.
12137 (context_state): Renamed from c_context. All uses changed.
12138 (id_loc, code_start, token_start): New local vars.
12139 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
12140 processing of Yacc white space and equivalents here.
12141 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
12142 instead of returning ID immediately, since we need to search for
12143 a subsequent colon.
12144 (<INITIAL>"'", "\""): Save token_start.
12145 (<INITIAL>"%{", "{", "%%"): Save code_start.
12146 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
12147 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
12148 BEGIN context_state at end, not INITIAL.
12149 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
12150 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
12151 Return correct token start.
12152 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
12153 the start of a character, string or multiline comment is found.
12154 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
12155 Reduction): Adjust reported locations to match the more-precise
12156 results now expected.
12157 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
12158 * tests/reduce.at (Useless Rules, Reduced Automaton,
12159 Underivable Rules): Likewise.
12160 * tests/regression.at (Invalid inputs): No longer `expecting ";"
12161 or "|"' now that so many other tokens are allowed by the new grammar.
12162
12163 * src/complain.h (current_file): Remove duplicate decl;
12164 current_file is now owned by files.h.
12165 * src/complain.c, src/scan-gram.l: Include files.h.
12166
12167 2002-12-06 Paul Eggert <eggert@twinsun.com>
12168
12169 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
12170 promotes to int; it might be unsigned int.
12171 * data/yacc.c (yy_reduce_print): Likewise.
12172
12173 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
12174 be #defined in the prologue, not in the Bison declarations.
12175 This fixes Debian Bug 102878, reported by Shaul Karl.
12176
12177 2002-12-02 Paul Eggert <eggert@twinsun.com>
12178
12179 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
12180 * lib/strtoul.c: New file, from gnulib.
12181 This fixes a porting bug reported by Peter Klein in
12182 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
12183
12184 2002-11-30 Paul Eggert <eggert@twinsun.com>
12185
12186 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
12187 and put only a forward declaration in the prologue. This is for
12188 consistency with the other scanner helper functions.
12189
12190 Type clashes now generate warnings, not errors, since it
12191 appears that POSIX may allow some grammars with type clashes.
12192 * src/reader.c (grammar_current_rule_check): Warn about
12193 type clashes instead of complaining.
12194 * tests/input.at (Type Clashes): Expect warnings, not complaints.
12195
12196 Add Yacc library, since POSIX requires it.
12197 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
12198 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
12199 * lib/main.c, lib/yyerror.c: New files.
12200
12201 gram_error can be static; it need not be extern.
12202 * src/reader.h (gram_error): Remove decl.
12203 * src/parse-gram.y (gram_error): Now static. Add static decl.
12204 (print_token_value): Omit parameter names from forward decl,
12205 for consistency.
12206
12207 2002-11-29 Paul Eggert <eggert@twinsun.com>
12208
12209 * doc/bison.texinfo: Emphasize that yylex and yyerror must
12210 be declared before being used. E.g., one should typically
12211 declare them in the prologue. Use GNU coding style in examples.
12212 Put "const" consistently after the type it modifies. Mention
12213 that C99 supports "inline". Mention that yyerror traditionally
12214 returns "int".
12215
12216 %parse-param and %lex-param now take just one argument, the
12217 declaration; the argument name is deduced from the declaration.
12218
12219 * doc/bison.texinfo (Parser Function, Pure Calling, Error
12220 Reporting, Table of Symbols): Document this.
12221 * src/parse-gram.y (add_param): New function.
12222 (COMMA): Remove.
12223 (declaration): Implement new rule for %parse-param and %lex-param.
12224 * src/scan-gram.l: "," now elicits a warning, rather than being
12225 a token; this is more compatible with byacc.
12226 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
12227
12228 2002-11-27 Paul Eggert <eggert@twinsun.com>
12229
12230 Rename identifiers to avoid real and potential collisions.
12231
12232 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
12233 to avoid collision with lex macro described by Bruce Lilly in
12234 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
12235 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12236 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
12237 * src/parse-gram.y (print_token_value): Renamed from yyprint.
12238 All uses changed.
12239 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
12240 The name "yycontrol" violates the name space rules, and this stuff
12241 wasn't being used anyway.
12242 (input): Remove action; this stuff wasn't being used.
12243 (gram_error): Rename local variable yylloc -> loc.
12244 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
12245 (YY_DECL): Don't use "yy" at start of local variables.
12246 All uses changed, e.g., yylloc -> loc.
12247 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
12248 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
12249 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
12250 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
12251
12252 * src/parse-gram.y (gram_error): loc is now const *.
12253 * src/reader.h (gram_error): Likewise.
12254
12255 2002-11-24 Paul Eggert <eggert@twinsun.com>
12256
12257 Version 1.75c.
12258
12259 * tests/actions.at (Actions after errors): Use an output format
12260 more similar to that of the Printers and Destructors test.
12261 Test the position of the ';' token too.
12262 (Printers and Destructors): Likewise.
12263 (Printers and Destructors: %glr-parser): Remove for now, to avoid
12264 unnecessarily alarming people when the test fails.
12265
12266 * data/yacc.c (yyerrlab1): Move this label down, so that the
12267 parser does not discard the lookahead token if the user code
12268 invokes YYERROR. This change is required for POSIX conformance.
12269
12270 * lib/error.c: Sync with gnulib.
12271
12272 2002-11-22 Paul Eggert <eggert@twinsun.com>
12273
12274 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
12275 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
12276 * lib/xmalloc.c: Likewise.
12277
12278 2002-11-20 Paul Eggert <eggert@twinsun.com>
12279
12280 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
12281
12282 2002-11-20 Paul Eggert <eggert@twinsun.com>
12283
12284 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
12285 should use `if (! x) abort ();' rather than `assert (x);', and
12286 anyway it's one less thing to worry about configuring.
12287
12288 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
12289 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
12290 and replace all instances of assert with abort.
12291 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
12292 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
12293
12294 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
12295 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
12296 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
12297 hash_find_entry, hash_rehash, hash_insert): Likewise.
12298 * src/conflicts.c (resolve_sr_conflict): Likewise.
12299 * src/lalr.c (set_goto_map, map_goto): Likewise.
12300 * src/nullable.c (nullable_compute): Likewise.
12301 * src/output.c (prepare_rules, token_definitions_output): Likewise.
12302 * src/reader.c (packgram, reader): Likewise.
12303 * src/state.c (state_new, state_free, state_transitions_set,
12304 state_reduction_find): Likewise.
12305 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
12306 symbol_pack): Likewise.
12307 * src/tables.c (conflict_row, pack_vector): Likewise.
12308 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12309 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12310 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
12311 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
12312
12313 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
12314 (ARGMATCH_CONSTRAINT): New macro.
12315 (ARGMATCH_ASSERT): Use it.
12316
12317 * src/system.h (verify): New macro.
12318 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
12319 rather than assert.
12320 * src/tables.c (tables_generate): Likewise.
12321
12322 * src/struniq.c (struniq_assert): Now returns void, and aborts
12323 if the assertion is false.
12324 (struniq_assert_p): Remove.
12325 * src/struniq.h: Likewise.
12326
12327 2002-11-18 Paul Eggert <eggert@twinsun.com>
12328
12329 * data/glr.c (yygetLRActions): Replace `yyindex' with
12330 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
12331 This fixes the regression with Sun ONE Studio 7 cc that I reported in
12332 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
12333
12334 2002-11-18 Akim Demaille <akim@epita.fr>
12335
12336 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
12337 space.
12338 From Tim Van Holder.
12339
12340 2002-11-17 Paul Eggert <eggert@twinsun.com>
12341
12342 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
12343 to "SyntaxError" for consistency with my 2002-11-15 change.
12344
12345 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
12346 not define to {}, since this breaks the common use of `YYDPRINTF
12347 ((...));' if a single statement is desired (e.g. before `else').
12348 Work around GCC warnings by surrounding corresponding calls with
12349 {} if needed.
12350 (yyhasResolvedValue): Remove unused function.
12351 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
12352 loop body.
12353 (yyreportSyntaxError): Renamed from yyreportParseError.
12354 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
12355 All uses changed.
12356 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
12357 extern when possible. Remove unused initializations.
12358
12359 2002-11-16 Akim Demaille <akim@epita.fr>
12360
12361 Augment the similarity between GLR and LALR traces.
12362
12363 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
12364 (YY_REDUCE_PRINT): New.
12365 (yyparse): Use them.
12366 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
12367 YYDPRINT here.
12368 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
12369 state reached after the reduction/recovery, since...
12370 (yyparse, yyprocessOneStack): Report the state we are entering in.
12371
12372 2002-11-16 Akim Demaille <akim@epita.fr>
12373
12374 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
12375 Add support for --trace=skeleton.
12376 * src/scan-skel.l: %option debug.
12377 Scan strings of non-@ or \n instead of character by character.
12378 (scan_skel): Handle trace_skeleton.
12379 (QPUTS): New.
12380 (@output_parser_name@, @output_header_name@): ``Restore'' their
12381 support (used to be M4 macros).
12382 * data/yacc.c: Quote larger chunks, a la glr.c.
12383 * data/lalr1.cc: Likewise.
12384 The header guards are no longer available, so use some other
12385 string than `YYLSP_NEEDED'.
12386
12387 2002-11-16 Akim Demaille <akim@epita.fr>
12388
12389 Make the ``Printers and Destructors'' test more verbose, taking
12390 `yacc.c''s behavior as (possibly wrong) reference.
12391
12392 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
12393 instead of fprint on stdout.
12394 Set and report the last_line of the symbols.
12395 Consistently display values and locations.
12396
12397 2002-11-16 Paul Eggert <eggert@twinsun.com>
12398
12399 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
12400
12401 2002-11-15 Paul Eggert <eggert@twinsun.com>
12402
12403 * tests/actions.at (Actions after errors): New test case.
12404
12405 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
12406 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
12407 tests/action.at, tests/calc.at, tests/conflicts.at,
12408 tests/cxx-type.at, tests/regression.at:
12409 "parse error" -> "syntax error" for POSIX compatibility.
12410 "parsing stack overflow..." -> "parser stack overflow" so
12411 that code matches Bison documentation.
12412
12413 2002-11-15 Akim Demaille <akim@epita.fr>
12414
12415 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
12416 take two BRACED_CODE, not two string_content.
12417 Free the scanner's obstack when we are done.
12418 (code_content): New.
12419 * tests/calc.at: Adjust.
12420 * doc/bison.texinfo: Adjust.
12421 Also, make sure to include the `,' for these declarations.
12422
12423 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
12424
12425 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
12426 definition; avoids potential autoreconf problems.
12427
12428 2002-11-15 Akim Demaille <akim@epita.fr>
12429
12430 Always check the value returned by yyparse.
12431
12432 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
12433 returned by yyparse.
12434 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
12435 Adjust calls.
12436 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
12437 returned by yyparse.
12438
12439 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12440
12441 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
12442 on input.at test.
12443
12444 2002-11-14 Paul Eggert <eggert@twinsun.com>
12445
12446 * src/output.c (output_skeleton): Call xfopen instead of
12447 duplicating xfopen's body.
12448
12449 Fix bugs reported by Nelson H. F. Beebe in
12450 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
12451
12452 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
12453 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
12454 Group compiler. Instead, use "$CC -E bar.c". Include the .h
12455 file twice in the grammar, as an extra check.
12456
12457 * tests/input.at (Torturing the Scanner): Surround the
12458 backslash-newline tests with "#if 0", to make it less likely that
12459 we'll run into compiler bugs. Bring back solitary \ inside
12460 comment, but add a closing comment to work around HP C bug. Don't
12461 test backslash-newline in C character constant.
12462
12463 2002-11-14 Akim Demaille <akim@epita.fr>
12464
12465 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
12466 status of the compiler.
12467 Calling `exit 1' is no longer needed.
12468 Reported by Nelson H. F. Beebe.
12469
12470 2002-11-14 Akim Demaille <akim@epita.fr>
12471
12472 * tests/atlocal.in (CPPFLAGS): We have config.h.
12473 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
12474 New.
12475 * tests/actions.at, tests/calc.at, tests/conflicts.at,
12476 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
12477 * tests/regression.at, tests/torture.at: Use them for all the
12478 grammars that are to be compiled.
12479 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
12480 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
12481 * doc/bison.texinfo (GLR Parsers): Document `inline'.
12482
12483 2002-11-14 Akim Demaille <akim@epita.fr>
12484
12485 * doc/bison.texinfo: Various formatting changes (alignments in
12486 samples, additional @group/@end group, GCS in samples.
12487 Use @deffn instead of simple @table to define the directives,
12488 macros, variables etc.
12489
12490 2002-11-13 Paul Eggert <eggert@twinsun.com>
12491
12492 Fix some bugs reported by Albert Chin-A-Young in
12493 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
12494
12495 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
12496 -o c"; the HP C compiler chatters during compilation.
12497 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
12498 * tests/headers.at (export YYLTYPE): Likewise.
12499
12500 * tests/input.at (Torturing the Scanner): Remove lines containing
12501 solitary backslashes, as they tickle a bug in the HP C compiler.
12502
12503 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
12504 comments, since they're not portable. Use GNU coding style.
12505
12506 2002-11-13 Akim Demaille <akim@epita.fr>
12507
12508 * data/yacc.c: Leave bigger chunks of quoted text.
12509 (YYDSYMPRINTF): New.
12510 Use it to report symbol activities.
12511 * data/glr.c (YYDSYMPRINTF): New.
12512 Use it.
12513
12514 2002-11-12 Paul Eggert <eggert@twinsun.com>
12515
12516 Version 1.75b.
12517
12518 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
12519 (yyglrReduce): Return yyok, not 0.
12520 This should avoid the enumerated-type warnings reported
12521 by Nelson H. F. Beebe in
12522 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
12523
12524 * lib/bbitset.h (BITSET_INLINE): Remove.
12525 * lib/bitset.h [! BITSET_INLINE]: Remove.
12526 (bitset_set, bitset_reset, bitset_test): Rename local vars
12527 to avoid shadowing warnings by GCC.
12528
12529 * data/glr.c (inline): Remove #define. It's the user's
12530 responsibility to #define it away, just like 'const'.
12531 This fixes one of the bugs reported by Nelson H. F. Beebe in
12532 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
12533
12534 * Makefile.maint (po-check): Scan .l and .y files instead of the
12535 .c and the .h files that they generate. This fixes the bug
12536 reported by Tim Van Holder in:
12537 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
12538 Look for N_ as well as for _. Try to avoid matching #define for
12539 N_ and _.
12540 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
12541 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
12542 * src/scan-gram.l: Revamp regular expressions so that " and '
12543 do not confuse xgettext.
12544
12545 * src/struniq.h (struniq_new): Do not declare the return type
12546 to be 'const'; this violates the C standard.
12547 * src/struniq.c (struniq_new): Likewise.
12548
12549 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
12550
12551 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
12552 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
12553 linker.
12554
12555 2002-11-12 Akim Demaille <akim@epita.fr>
12556
12557 * Makefile.maint: Sync with Autoconf:
12558 (local_updates): New.
12559
12560 2002-11-12 Akim Demaille <akim@epita.fr>
12561
12562 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
12563
12564 2002-11-12 Akim Demaille <akim@epita.fr>
12565
12566 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
12567 locations.
12568
12569 2002-11-12 Akim Demaille <akim@epita.fr>
12570
12571 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
12572 not yyvalue.
12573
12574 2002-11-12 Akim Demaille <akim@epita.fr>
12575
12576 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
12577 Use it to test the GLR parser.
12578
12579 2002-11-12 Akim Demaille <akim@epita.fr>
12580
12581 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
12582 defines it.
12583 * data/glr.c (yystos): New.
12584 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
12585 (YYDSYMPRINT): New.
12586 (yyval): Don't define it, it is handled via M4.
12587 (yyrecoverParseError): Free verbosely the discarded symbols.
12588 * data/yacc.c (yysymprint): Remove, rather...
12589 (b4_yysymprint_generate): invoke.
12590 * data/c.m4 (b4_yysymprint_generate): New.
12591 Accept pointers as arguments, as opposed to the version from
12592 yacc.c.
12593 (b4_yydestruct_generate): Likewise.
12594 * tests/cations.at (Printers and Destructors): Use Bison directives
12595 instead of CPP macros.
12596 Don't rely on internal details.
12597
12598 2002-11-12 Akim Demaille <akim@epita.fr>
12599
12600 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
12601 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
12602 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
12603 it against YYEMPTY and so forth), work on yytoken (i.e., set
12604 it to YYEMPTY etc.).
12605 (yydestruct): Replace with a b4_yydestruct_generate invocation.
12606 (b4_symbol_actions): Remove.
12607 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
12608 for 0, end-of-input.
12609
12610 2002-11-12 Akim Demaille <akim@epita.fr>
12611
12612 * doc/bison.texinfo (Destructor Decl): New.
12613
12614 2002-11-12 Akim Demaille <akim@epita.fr>
12615
12616 * src/tables.c (tables_generate): Use free for pointers that
12617 cannot be NULL, not XFREE.
12618 (pack_vector): Use assert, not fatal, for bound violations.
12619 * src/state.c (state_new): Likewise.
12620 * src/reader.c (reader): Likewise.
12621 * src/lalr.c (set_goto_map): Likewise.
12622 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
12623 the file name.
12624
12625 2002-11-12 Akim Demaille <akim@epita.fr>
12626
12627 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
12628 Restore.
12629 * src/scan-gram.l (last_string): Is global to the file, not to
12630 yylex.
12631 * src/parse-gram.y (input): Don't append the epilogue here,
12632 (epilogue.opt): do it here, and free the scanner's obstack.
12633 * src/reader.c (epilogue_set): Rename as...
12634 (epilogue_augment): this.
12635 * data/c.m4 (b4_epilogue): Defaults to empty.
12636
12637 2002-11-12 Akim Demaille <akim@epita.fr>
12638
12639 * src/getargs.c (long_options): Remove duplicates.
12640 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
12641 Remove.
12642 * doc/bison.rnh: Remove.
12643 * doc/bison.texinfo (VMS Invocation): Remove.
12644
12645 2002-11-12 Akim Demaille <akim@epita.fr>
12646
12647 * src/struniq.h, src/struniq.c (struniq_t): Is const.
12648 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
12649
12650 Use struniq for symbols.
12651
12652 * src/symtab.h (symbol_t): The tag member is a struniq.
12653 (symbol_type_set): Adjust.
12654 * src/symtab.c (symbol_new): Takes a struniq.
12655 (symbol_free): Don't free the tag member.
12656 (hash_compare_symbol_t, hash_symbol_t): Rename as...
12657 (hash_compare_symbol, hash_symbol): these.
12658 Use the fact that tags as struniqs.
12659 (symbol_get): Use struniq_new.
12660 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
12661 Returns a strniq.
12662 * src/reader.h (merger_list, grammar_currentmerge_set): The name
12663 and type members are struniqs.
12664 * src/reader.c (get_merge_function)
12665 (grammar_current_rule_merge_set): Adjust.
12666 (TYPE, current_type): Are struniq.
12667
12668 Use struniq for file names.
12669
12670 * src/files.h, src/files.c (infile): Split into...
12671 (grammar_file, current_file): these.
12672 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
12673 * src/reduce.c (reduce_print): Likewise.
12674 * src/getargs.c (getargs): Likewise.
12675 * src/complain.h, src/complain.c: Likewise.
12676 * src/main.c (main): Call struniqs_new early enough to use it for
12677 file names.
12678 Don't free the input file name.
12679
12680 2002-11-12 Akim Demaille <akim@epita.fr>
12681
12682 * src/symtab.c (symbol_free): Remove dead deactivated code:
12683 type_name are properly removed.
12684 Don't use XFREE to free items that cannot be NULL.
12685 * src/struniq.h, src/struniq.c: New.
12686 * src/main.c (main): Initialize/free struniqs.
12687 * src/parse-gram.y (%union): Add astruniq member.
12688 (yyprint): Adjust.
12689 * src/scan-gram.l (<{tag}>): Return a struniq.
12690 Free the obstack bit that used to store it.
12691 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
12692
12693 2002-11-11 Paul Eggert <eggert@twinsun.com>
12694
12695 Revamp to fix many (but not all) of the C- and M4-related quoting
12696 problems. Among other things, this fixes the Bison bug reported
12697 by Jan Hubicka when processing the Bash grammar; see:
12698 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
12699
12700 Use new @ escapes consistently. Represent brackets with @{ and @}
12701 rather than @<:@ and @:>@, since this works a bit better with dumb
12702 editors like vi. Represent @ with @@, since @ is now consistently
12703 an escape. Use @oline@ and @ofile@ rather than __oline__ and
12704 __ofile__, to avoid unexpected expansions. Similarly, use @output
12705 rather than #output.
12706
12707 * data/c.m4 (b4_copyright): Omit file name from comment, since
12708 the file name could contain "*/".
12709 (b4_synclines_flag): Don't quote the 2nd argument; it should already
12710 be quoted. All uses changed.
12711
12712 * data/glr.c: Use new @ escapes consistently.
12713 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
12714 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
12715 Remove, since they couldn't handle arbitrary characters in file
12716 names.
12717 * data/lalr1.cc: Likewise.
12718 * data/yacc.c: Likewise.
12719
12720 * src/files.c (output_infix): Remove; all uses removed.
12721 * src/files.h: Likewise.
12722
12723 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
12724 mishandled funny characters in file names, and anyway it isn't
12725 needed any more.
12726 * data/yacc.c: Likewise.
12727 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
12728
12729 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
12730 * data/yacc.c: Likewise.
12731
12732 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
12733 strings now.
12734 (muscle_init): Quote filename as a C string.
12735 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
12736 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
12737 * src/output.c (escaped_file_name_output): New function.
12738 (prepare_symbols): Quote tokens for M4.
12739 (prepare): Don't insert output_infix, output_prefix,
12740 output_parser_name, output_header_name; this is now down by scan-skel.
12741 Insert skeleton as a C string.
12742
12743 * src/output.c (user_actions_output, symbol_destructors_output,
12744 symbol_printers_output): Quote filenames for C and M4.
12745 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12746
12747 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
12748 escapes other than \\ and \'; this simplifies the code.
12749 (<SC_STRING>): Likewise, for \\ and \".
12750 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
12751 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
12752 Use new escapes @{ and @} for [ and ].
12753
12754 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
12755 them with auto vars.
12756 Switch to new escape scheme, where @ is the escape character uniformly.
12757 Abort if a stray escape character is found. Avoid unbounded input
12758 buffer when parsing non-escaped text.
12759
12760 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
12761 __oline__, #output, $@, and @{ do not have unintended meanings.
12762
12763 2002-11-09 Paul Eggert <eggert@twinsun.com>
12764
12765 Fix the test failure due to GCC warnings described in
12766 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
12767 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
12768 evaluate to 0 if it's impossible for NINF to be in the respective
12769 table.
12770 (yygetLRActions, yyrecoverParseError): Use them.
12771
12772 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
12773 counted in the token inserted at end of file. Now takes
12774 location_t *, not location_t, so that the location can be
12775 adjusted. All uses changed.
12776
12777 * tests/regression.at (Invalid inputs): Adjust wording in
12778 diagnostic to match the new behavior.
12779
12780 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
12781 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
12782 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
12783 abort ();'. This reduces the runtime of the "Many lookaheads"
12784 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
12785 GCC 3.2.
12786
12787 2002-11-07 Paul Eggert <eggert@twinsun.com>
12788
12789 * src/parse-gram.y (CHARACTER): Remove unused token.
12790 All uses removed.
12791
12792 * src/scan-gram.l: Remove stack option. We no longer use the
12793 stack, since the stack was never deeper than 1; instead, use the
12794 new auto var c_context to record the stacked value.
12795
12796 Remove nounput option. At an unexpected end of file, we now unput
12797 the minimal input necessary to end cleanly; this simplifies the
12798 code.
12799
12800 Avoid unbounded token sizes where this is easy.
12801
12802 (unexpected_end_of_file): New function.
12803 Use it to systematize the error message on unexpected EOF.
12804 (last-string): Now auto, not static.
12805 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
12806 (scanner_last_string_free): Remove; not used.
12807 (percent_percent_count): Move decl to just before use.
12808 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
12809 not the (never otherwised-used) CHARACTER.
12810
12811 2002-11-07 Akim Demaille <akim@epita.fr>
12812
12813 Let yyerror always receive the msg as last argument, so that
12814 yyerror can be variadic.
12815
12816 * data/yacc.c (b4_yyerror_args): New.
12817 Use it when calling yyerror.
12818 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
12819 Use it when calling yyerror.
12820 * doc/bison.texinfo (Error Reporting): Adjust.
12821 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
12822 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
12823
12824 2002-11-06 Akim Demaille <akim@epita.fr>
12825
12826 #line should have quoted strings.
12827 Ideally, this should be done by m4_quotearg.
12828
12829 * src/scan-skel.l: Include quotearg.h.
12830 Quote __ofile__.
12831 * src/output.c (symbol_printers_output)
12832 (symbol_destructors_output): Quote the file name.
12833
12834 2002-11-06 Akim Demaille <akim@epita.fr>
12835
12836 * tests/regression.at (Invalid inputs): Adjust to the recent
12837 messages.
12838
12839 2002-11-06 Akim Demaille <akim@epita.fr>
12840
12841 Restore --no-lines.
12842 Reported by Jim Kent.
12843
12844 * data/c.m4 (b4_syncline): New.
12845 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
12846 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
12847 * src/output.c (user_actions_output): Likewise.
12848 (prepare): Define 'b4_synclines_flag'.
12849 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
12850
12851 2002-11-06 Akim Demaille <akim@epita.fr>
12852
12853 * src/main.c (main): Free `infile'.
12854 * src/scan-gram.l (handle_syncline): New.
12855 Recognize `#line'.
12856 * src/output.c (user_actions_output, symbol_destructors_output)
12857 (symbol_printers_output): Use the location's file name, not
12858 infile.
12859 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12860
12861 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12862
12863 * src/tables.c (matching_state): Don't allow states to match if
12864 either has GLR conflict entries.
12865
12866 2002-11-05 Paul Eggert <eggert@twinsun.com>
12867
12868 * src/scan-gram.l: Use more accurate diagnostics, e.g.
12869 "integer out of range" rather than "invalid value".
12870 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
12871 accordingly.
12872
12873 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
12874 Also, remove one static variable in the scanner.
12875
12876 * src/scan-gram.l (braces_level): Now auto, not static.
12877 Initialize to zero if the compiler is being picky.
12878 (INITIAL): Clear braces_level instead of incrementing it.
12879 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
12880 as POSIX 1003.1-2001 requires.
12881 * src/system.h (IF_LINT): New macro, taken from coreutils.
12882 * configure.ac: Define "lint" if --enable-gcc-warnings.
12883
12884 2002-11-05 Akim Demaille <akim@epita.fr>
12885
12886 * src/scan-gram.l: When it starts with `%', complain about the
12887 whole directive, not just that `invalid character: %'.
12888
12889 2002-11-04 Akim Demaille <akim@epita.fr>
12890
12891 * Makefile.maint: Update from Autoconf.
12892 (update, cvs-update, po-update, do-po-update): New.
12893
12894 2002-11-04 Akim Demaille <akim@epita.fr>
12895
12896 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
12897 and yyerror.
12898 Have yyerror `use' its arguments.
12899 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
12900 returns true when location & yacc & pure & parse-param.
12901 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
12902
12903 2002-11-04 Akim Demaille <akim@epita.fr>
12904
12905 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
12906 clashes.
12907 * src/scan-gram.l: Use [\'] instead of ['] to pacify
12908 font-lock-mode.
12909 Use complain_at.
12910 Use quote, not quote_n since LOCATION_PRINT no longer uses the
12911 slot 0.
12912
12913 2002-11-03 Paul Eggert <eggert@twinsun.com>
12914
12915 * src/reader.c (get_merge_function, grammar_current_rule_check):
12916 Use consistent diagnostics for reporting type name clashes.
12917 Quote the types with <>, for consistency with Yacc.
12918 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
12919
12920 2002-11-03 Akim Demaille <akim@epita.fr>
12921
12922 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
12923 New.
12924 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
12925 (b4_parse_param): Remove.
12926 Use b4_identification.
12927 Propagate b4_pure_args where needed to pass them to yyerror.
12928 * data/glr.m4 (b4_parse_param): Remove.
12929 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
12930 (b4_lpure_formals): New.
12931 Use b4_identification.
12932 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
12933 b4_user_formals and b4_user_args.
12934 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
12935 (yyreportAmbiguity): When using a pure parser, also need
12936 the location, and the parse-params.
12937 Adjust callers.
12938 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
12939 When using a pure parser, also need the parse-params.
12940 Adjust callers.
12941 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
12942 (%pure-parser + %parse-param) LALR and GLR parsers.
12943 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
12944 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
12945 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
12946 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
12947 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
12948 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
12949 * doc/bison.texinfo: Untabify the whole file.
12950 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
12951 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
12952 (Error Reporting): Adjust to these new directives.
12953 Document %error-verbose, deprecate YYERROR_VERBOSE.
12954
12955 2002-11-03 Akim Demaille <akim@epita.fr>
12956
12957 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
12958 AT_CHECK_CALC_GLR invocations to use % directives, instead of
12959 command line options.
12960 * tests/cxx-type.at: Formatting changes.
12961
12962 2002-11-03 Paul Eggert <eggert@twinsun.com>
12963
12964 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
12965 to count columns correctly, and to check for invalid inputs.
12966
12967 Use mbsnwidth to count columns correctly. Account for tabs, too.
12968 Include mbswidth.h.
12969 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
12970 (extend_location): New function.
12971 (YY_LINES): Remove.
12972
12973 Handle CRLF in C code rather than in Lex code.
12974 (YY_INPUT): New macro.
12975 (no_cr_read): New function.
12976
12977 Scan UCNs, even though we don't fully handle them yet.
12978 (convert_ucn_to_byte): New function.
12979
12980 Handle backslash-newline correctly in C code.
12981 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
12982 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
12983 all uses changed.
12984 (tag, splice): New EREs. Do not allow NUL or newline in tags.
12985 Use {splice} wherever C allows backslash-newline.
12986 YY_STEP after space, newline, vertical-tab.
12987 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
12988
12989 (letter, id): Don't assume ASCII; e.g., spell out a-z.
12990
12991 ({int}, handle_action_dollar, handle_action_at): Check for integer
12992 overflow.
12993
12994 (YY_STEP): Omit trailing semicolon, so that it's more like C.
12995
12996 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
12997 as well as \000. Check for UCHAR_MAX, not 255.
12998 Allow \x with an arbitrary positive number of digits, as in C.
12999 Check for overflow here.
13000 Allow \? and UCNs, for compatibility with C.
13001
13002 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
13003 with quote slot used by complain_at.
13004
13005 * tests/input.at: Add tests for backslash-newline, m4 quotes
13006 in symbols, long literals, and funny escapes in strings.
13007
13008 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
13009 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
13010 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
13011 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
13012 * m4/mbswidth.m4: New file, from GNU coreutils.
13013
13014 * doc/bison.texinfo (Grammar Outline): Document // comments.
13015 (Symbols): Document that trigraphs have no special meaning in Bison,
13016 nor is backslash-newline allowed.
13017 (Actions): Document that trigraphs have no special meaning.
13018
13019 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
13020 no longer used.
13021
13022 2002-11-02 Paul Eggert <eggert@twinsun.com>
13023
13024 * src/reader.c: Don't include quote.h; not needed.
13025 (get_merge_function): Reword warning to be consistent with
13026 type clash diagnostic in grammar_current_rule_check.
13027
13028 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
13029 bug in trigraph handling.
13030
13031 * src/output.c (prepare_symbols): When printing token names,
13032 escape "[" as "@<:@" and likewise for "]".
13033
13034 * src/system.h (errno): Remove declaration, as we are now
13035 assuming C89 or better, and C89 guarantees errno.
13036
13037 2002-10-30 Paul Eggert <eggert@twinsun.com>
13038
13039 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
13040 Check for close failures.
13041 * src/files.h (xfclose): Return void, not int, since it always
13042 returned zero.
13043 * src/files.c (xfclose): Likewise. Report I/O error if ferror
13044 indicates one.
13045 * src/output.c (output_skeleton): Use xfclose rather than fclose
13046 and ferror. xfclose now checks ferror.
13047
13048 * data/glr.c (YYLEFTMOST_STATE): Remove.
13049 (yyreportTree): Use a stack-based leftmost state. This avoids
13050 our continuing battles with bogus warnings about initializers.
13051
13052 2002-10-30 Akim Demaille <akim@epita.fr>
13053
13054 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
13055 #if.
13056
13057 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13058
13059 * tests/glr-regr1.at: New test for reported regressions.
13060 * tests/testsuite.at: Add glr-regr1.at test.
13061 * tests/Makefile.am: Add glr-regr1.at test.
13062
13063 2002-10-24 Paul Eggert <eggert@twinsun.com>
13064
13065 Version 1.75a.
13066
13067 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
13068 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
13069 we use malloc. Don't assume 'A' through 'Z' are contiguous.
13070 Don't assume strdup exists; POSIX says its an XSI extension.
13071 Check for buffer overflow on input.
13072
13073 2002-10-24 Akim Demaille <akim@epita.fr>
13074
13075 * src/output.c (output_skeleton): Don't disable M4sugar comments
13076 too soon: it results in comments being expanded.
13077 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
13078 first output.
13079
13080 2002-10-24 Akim Demaille <akim@epita.fr>
13081
13082 * data/yacc.c (m4_int_type): New.
13083 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
13084 char' as only yacc.c wants K&R portability.
13085 * data/glr.c (yysigned_char): Remove.
13086 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
13087 Reported by Quoc Peyrot.
13088
13089 2002-10-23 Paul Eggert <eggert@twinsun.com>
13090
13091 * src/main.c (main): With --trace=time, report times even if a
13092 non-fatal error occurs. Formerly, the times were reported in some
13093 such cases but not in others.
13094 * src/reader.c (reader): Just return if a complaint has been issued,
13095 instead of exiting, so that 'main' can report times.
13096
13097 2002-10-22 Akim Demaille <akim@epita.fr>
13098
13099 * src/system.h: Include sys/types.
13100 Reported by Bert Deknuydt.
13101
13102 2002-10-23 Paul Eggert <eggert@twinsun.com>
13103
13104 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
13105 Suggested by Art Haas.
13106
13107 2002-10-22 Paul Eggert <eggert@twinsun.com>
13108
13109 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
13110 decl; not needed any more.
13111 * src/main.c (main): Use return to exit, undoing yesterday's change.
13112 The last OS that we could find where this wouldn't work is
13113 SunOS 3.5, and that's too old to worry about now.
13114
13115 * data/glr.c (struct yyltype): Define members even when not
13116 doing locations. This is more consistent with yacc.c, and it
13117 works around the following bug reports:
13118 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
13119 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
13120
13121 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
13122 @acronym consistently. Standardize on "Yacc" instead of "YACC",
13123 "Algol" instead of "ALGOL". Give a bit more history about BNF.
13124
13125 2002-10-22 Akim Demaille <akim@epita.fr>
13126
13127 * data/README: New.
13128
13129 2002-10-21 Paul Eggert <eggert@twinsun.com>
13130
13131 Be consistent about 'bool'; the old code used an enum in one
13132 module and an int in another, and this violates the C standard.
13133 * m4/stdbool.m4: New file, from coreutils 4.5.3.
13134 * configure.ac (AC_HEADER_STDBOOL): Add.
13135 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
13136 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
13137 * src/symtab.c (hash_compare_symbol_t): Likewise.
13138 * src/system.h (bool, false, true): Use a definition consistent
13139 with ../lib/hash.c. All uses changed.
13140
13141 * src/complain.c (warning_issued): Renamed from warn_message_count,
13142 so that we needn't worry about integer overflow (!).
13143 Now of type bool. All uses changed.
13144 (complaint_issued): Renamed from complain_message_count; likewise.
13145
13146 * src/main.c (main): Use exit to exit with failure.
13147
13148 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
13149 rather than 1 and 0.
13150 * src/main.c (main): Likewise.
13151 * src/getargs.c (getargs): Likewise.
13152 * src/reader.c (reader): Likewise.
13153
13154 * src/getarg.c (getargs): Remove duplicate code for
13155 "Try `bison --help'".
13156
13157 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
13158 What was that "2" for?
13159
13160 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
13161 * src/getargs.c (usage): Likewise.
13162
13163 * src/getargs.c (getargs): When there are too few operands, report
13164 the last one. When there are too many, report the first extra
13165 one. This is how diffutils does it.
13166
13167 2002-10-20 Paul Eggert <eggert@twinsun.com>
13168
13169 Remove K&R vestiges.
13170 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
13171 * src/complain.c (VA_START): Remove. Assume prototypes.
13172 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
13173 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
13174 fatal): Assume prototypes.
13175 * src/complain.h: Assume prototypes.
13176 * src/system.h (PARAMS): Remove.
13177 Include <limits.h> unconditionally, since it's guaranteeed even
13178 for a freestanding C89 compiler.
13179 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
13180 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
13181
13182 2002-10-20 Akim Demaille <akim@epita.fr>
13183
13184 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
13185 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
13186 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
13187 (yyresolveStates, yyresolveAction, yyresolveStack)
13188 (yyprocessOneStack): Use them.
13189 (yy_reduce_print): New.
13190 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
13191
13192 2002-10-20 Akim Demaille <akim@epita.fr>
13193
13194 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
13195 arguments and output `void'.
13196 (b4_c_function): Rename as...
13197 (b4_c_function_def): this.
13198 (b4_c_function_decl, b4_c_ansi_function_def)
13199 (b4_c_ansi_function_decl): New.
13200 Change the interpretation of the arguments: before `int, foo', now
13201 `int foo, foo'.
13202 * data/yacc.c (yyparse): Prototype and define thanks to these.
13203 Adjust b4_c_function_def uses.
13204 * data/glr.c (yyparse): Likewise, but ANSI only.
13205
13206 2002-10-20 Akim Demaille <akim@epita.fr>
13207
13208 * src/output.c (prepare): Move the definition of `tokens_number',
13209 `nterms_number', `undef_token_number', `user_token_number_max'
13210 to...
13211 (prepare_tokens): Here.
13212 (prepare_tokens): Rename as...
13213 (prepare_symbols): this.
13214 (prepare): Move the definition of `rules_number' to...
13215 (prepare_rules): here.
13216 (prepare): Move the definition of `last', `final_state_number',
13217 `states_number' to...
13218 (prepare_states): here.
13219 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
13220
13221 2002-10-20 Akim Demaille <akim@epita.fr>
13222
13223 * src/tables.h, src/tables.c, src/output.c: Comment changes.
13224
13225 2002-10-20 Akim Demaille <akim@epita.fr>
13226
13227 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
13228 * data/c.m4: here.
13229
13230 2002-10-20 Akim Demaille <akim@epita.fr>
13231
13232 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
13233 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
13234 `pair'.
13235 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
13236 `name' to...
13237 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
13238 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
13239 These.
13240
13241 2002-10-19 Paul Eggert <eggert@twinsun.com>
13242
13243 Do not create a temporary file, as that involves security and
13244 cleanup headaches. Instead, use a pair of pipes.
13245 Derived from a suggestion by Florian Krohm.
13246 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
13247 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
13248 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
13249 (BISON_PREREQ_SUBPIPE): Add.
13250 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
13251 Add subpipe.h, subpipe.c.
13252 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
13253 * po/POTFILES.in: Add lib/subpipe.c.
13254 * src/output.c: Include "subpipe.h".
13255 (m4_invoke): Remove decl.
13256 (scan_skel): New decl.
13257 (output_skeleton): Use pipe rather than temporary file for m4 input.
13258 Check that m4sugar.m4 is readable, to avoid deadlock.
13259 Check for pipe I/O error.
13260 * src/scan-skel.l (readpipe): Remove decl.
13261 (scan_skel): New function, to be used in place of m4_invoke.
13262 Read from stream rather than file.
13263
13264 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
13265 float, as this generates a warning on Solaris 8 + GCC 3.2 with
13266 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
13267 this generates a more-accurate value anyway.
13268
13269 * lib/timevar.c (timervar_accumulate): Rename locals to
13270 avoid confusion with similarly-named more-global.
13271 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
13272
13273 * src/output.c (prepare): Use xstrdup to convert char const *
13274 to char *, to avoid GCC warning.
13275
13276 2002-10-19 Akim Demaille <akim@epita.fr>
13277
13278 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
13279 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
13280 Use them to have `calc.y' ready for %pure-parser.
13281 * data/yacc.c (YYLEX): Pass a yylex return type to
13282 b4_c_function_call.
13283
13284 2002-10-19 Akim Demaille <akim@epita.fr>
13285
13286 Prototype support of %lex-param and %parse-param.
13287
13288 * src/parse-gram.y: Add the definition of the %lex-param and
13289 %parse-param tokens, plus their rules.
13290 Drop the `_' version of %glr-parser.
13291 Add the "," token.
13292 * src/scan-gram.l (INITIAL): Scan them.
13293 * src/muscle_tab.c: Comment changes.
13294 (muscle_insert, muscle_find): Rename `pair' as `probe'.
13295 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
13296 (muscle_entry_s): The `value' member is no longer const.
13297 Adjust all dependencies.
13298 * src/muscle_tab.c (muscle_init): Adjust: use
13299 MUSCLE_INSERT_STRING.
13300 Initialize the obstack earlier.
13301 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
13302 (muscle_pair_list_grow): New.
13303 * data/c.m4 (b4_c_function_call, b4_c_args): New.
13304 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
13305 * tests/calc.at: Use %locations, not --locations.
13306 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
13307
13308 2002-10-19 Akim Demaille <akim@epita.fr>
13309
13310 * src/getargs.c (usage): Take status as argument and exit
13311 accordingly.
13312 Report the traditional `Try ... --help' message when status != 0.
13313 (usage, version): Don't take a FILE * as arg, it is pointless.
13314 (getargs): When there is an incorrect number of arguments, make it
13315 an error, and report it GNUlically thanks to `usage ()'.
13316
13317 2002-10-18 Paul Eggert <eggert@twinsun.com>
13318
13319 * data/glr.c (yyreportParseError): Don't assume that sprintf
13320 yields the length of the printed string, as this is not true
13321 on SunOS 4.1.4. Reported by Peter Klein.
13322
13323 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
13324 * tests/conflicts.at (%nonassoc and eof): Likewise.
13325 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
13326
13327 2002-10-17 Akim Demaille <akim@epita.fr>
13328
13329 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
13330 * src/getargs.c (trace_types, trace_args): Adjust.
13331 * src/reader.c (grammar_current_rule_prec_set)
13332 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
13333 Standardize error messages.
13334 And s/@prec/%prec/!
13335 (reader): Use trace_flag to enable scanner/parser debugging,
13336 instead of an adhoc scheme.
13337 * src/scan-gram.l: Remove trailing debugging code.
13338
13339 2002-10-16 Paul Eggert <eggert@twinsun.com>
13340
13341 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
13342 MUSCLE_TAB_H.
13343
13344 * NEWS: Officially drop support for building Bison with K&R C,
13345 since it didn't work anyway and it's not worth worrying about.
13346 * Makefile.maint (wget_files): Remove ansi2knr.c.
13347 (ansi2knr.c-url_prefix): Remove.
13348 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
13349 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13350 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13351
13352 2002-10-15 Paul Eggert <eggert@twinsun.com>
13353
13354 Stop using the "enum_" trick for K&R-style function definitions;
13355 it confused me, and I was the author! Instead, assume that people
13356 who want to use K&R C compilers (when using these modules in GCC,
13357 perhaps?) will run ansi2knr.
13358
13359 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
13360 All uses of "enum_" changed to "enum ".
13361 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13362 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13363
13364 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
13365 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
13366 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
13367 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
13368 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
13369 abitset_not, abitset_ones, abitset_or, abitset_or_and,
13370 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
13371 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
13372 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
13373 Use function prototypes; this removes the need for declaring
13374 static functions simply to provide their prototypes.
13375 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
13376 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
13377 bitset_count_, bitset_create, bitset_dump, bitset_first,
13378 bitset_free, bitset_init, bitset_last, bitset_next,
13379 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
13380 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
13381 bitset_print, bitset_release_memory, bitset_toggle_,
13382 bitset_type_choose, bitset_type_get, bitset_type_name_get,
13383 debug_bitset): Likewise.
13384 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
13385 * lib/bitset_stats.c (bitset_log_histogram_print,
13386 bitset_percent_histogram_print, bitset_stats_and,
13387 bitset_stats_and_cmp, bitset_stats_and_or,
13388 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
13389 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
13390 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
13391 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
13392 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
13393 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
13394 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
13395 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
13396 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
13397 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
13398 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
13399 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
13400 bitset_stats_zero): Likewise.
13401 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13402 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13403 bitsetv_dump, debug_bitsetv): Likewise.
13404 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
13405 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
13406 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
13407 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
13408 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
13409 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
13410 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
13411 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
13412 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
13413 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
13414 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
13415 Likewise.
13416 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
13417 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
13418 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
13419 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
13420 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
13421 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
13422 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
13423 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
13424 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
13425 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
13426 lbitset_xor_cmp, lbitset_zero): Likewise.
13427
13428 2002-10-14 Akim Demaille <akim@epita.fr>
13429
13430 Version 1.75.
13431
13432 2002-10-14 Akim Demaille <akim@epita.fr>
13433
13434 * tests/Makefile.am (maintainer-check-posix): New.
13435
13436 2002-10-14 Akim Demaille <akim@epita.fr>
13437
13438 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
13439 member.
13440
13441 2002-10-14 Akim Demaille <akim@epita.fr>
13442
13443 * src/tables.c (table_ninf_remap): base -> tab.
13444 Reported by Matt Rosing.
13445
13446 2002-10-14 Paul Eggert <eggert@twinsun.com>
13447
13448 * tests/action.at, tests/calc.at, tests/conflicts.at,
13449 tests/cxx-type.at, tests/headers.at, tests/input.at,
13450 tests/regression.at, tests/synclines.at, tests/torture.at:
13451 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
13452 so that the tests still work even if POSIXLY_CORRECT is set.
13453 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
13454
13455 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
13456 for portability to K&R hosts. Fix typo: signed char is guaranteed
13457 only to 127, not to 128.
13458 * data/glr.c (yysigned_char): New type.
13459 * data/yacc.c (yysigned_char): Likewise.
13460 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
13461
13462 2002-10-13 Paul Eggert <eggert@twinsun.com>
13463
13464 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
13465 true due to limited range of data type" warning from GCC.
13466
13467 * data/c.m4 (b4_token_defines): Protect against double-inclusion
13468 by wrapping enum yytokentype's definition inside #ifndef
13469 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
13470
13471 2002-10-13 Akim Demaille <akim@epita.fr>
13472
13473 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
13474 Un yy- yyrhs to avoid the name clash with the global YYRHS.
13475
13476 2002-10-13 Akim Demaille <akim@epita.fr>
13477
13478 * Makefile.maint: Update from Autoconf 2.54.
13479 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
13480
13481 2002-10-13 Akim Demaille <akim@epita.fr>
13482
13483 * src/print.c (print_state): Separate the list of solved conflicts
13484 from the other items.
13485 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
13486
13487 2002-10-13 Akim Demaille <akim@epita.fr>
13488
13489 Let nondeterministic skeletons be usable with deterministic
13490 tables.
13491
13492 With the patch, GAWK compiled by GCC without -O2 passes its test
13493 suite using a GLR parser driven by LALR tables. It fails with -O2
13494 because `struct stat' gives two different answers on my machine:
13495 88 (definition of an auto var) and later 96 (memset on this var).
13496 Hence the stack is badly corrumpted. The headers inclusion is to
13497 blame: if I move the awk.h inclusion before GLR's system header
13498 inclusion, the two struct stat have the same size.
13499
13500 * src/tables.c (pack_table): Always create conflict_table.
13501 (token_actions): Always create conflict_list.
13502 * data/glr.c (YYFLAG): Remove, unused.
13503
13504 2002-10-13 Akim Demaille <akim@epita.fr>
13505
13506 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
13507 (O0FLAGS): New.
13508 (VALGRIND, GXX): New.
13509 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
13510 * tests/bison.in: Run $PREBISON a pre-command.
13511 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
13512 (maintainer-check-g++): New.
13513 * Makefile.am (maintainer-check): New.
13514
13515 2002-10-13 Akim Demaille <akim@epita.fr>
13516
13517 * data/glr.c: Formatting changes.
13518 Tweak some trace messages to match yacc.c's.
13519
13520 2002-10-13 Akim Demaille <akim@epita.fr>
13521
13522 GLR parsers sometimes raise parse errors instead of performing the
13523 default reduction.
13524 Reported by Charles-Henry de Boysson.
13525
13526 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
13527 check the length of the traces when %glr.
13528 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
13529 GLR's traces.
13530 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
13531 Test GLR parsers.
13532 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
13533 (yyltype): Remove the yy prefix from the member names.
13534 (yytable): Complete its comment.
13535 (yygetLRActions): Map error action number from YYTABLE from
13536 YYTABLE_NINF to 0.
13537 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
13538 (which was a bug: it should have been YYTABEL_NINF, and yet it was
13539 not satisfying as we could compare an YYACTION computed from
13540 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
13541 only value for error actions.
13542 (yyreportParseError): In verbose parse error messages, don't issue
13543 `error' in the list of expected tokens.
13544 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
13545 next action to perform to match glr.c's decoding.
13546 (yytable): Complete its comment.
13547
13548 2002-10-13 Paul Eggert <eggert@twinsun.com>
13549
13550 Fix problem reported by Henrik Grubbstroem in
13551 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
13552 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
13553 because the Bison parser reads the second action before reducing
13554 the first one.
13555 * src/scan-gram.l (rule_length): New static var.
13556 Use it to keep track of the rule length in the scanner, since
13557 we can't expect the parser to be in lock-step sync with the scanner.
13558 (handle_action_dollar, handle_action_at): Use this var.
13559 * tests/actions.at (Exotic Dollars): Test for the problem.
13560
13561 2002-10-12 Paul Eggert <eggert@twinsun.com>
13562
13563 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
13564 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
13565 Include <sys/time.h> when checking for clock_t and struct tms.
13566 Use same include order as source.
13567 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
13568 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
13569
13570 * lib/timevar.c: Update copyright date and clarify comments.
13571 (get_time) [IN_GCC]: Keep the GCC version for reference.
13572
13573 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
13574 GCC version as of today, then merge Bison's changes.
13575 Change "GCC" to "Bison" in copyright notice. timevar.def's
13576 author is Akim, so change that too.
13577
13578 * src/reader.c (grammar_current_rule_check):
13579 Don't worry about the default action if $$ is untyped.
13580 Prevents bogus warnings reported by Jim Gifford in
13581 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
13582
13583 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
13584 * data/glr.c, data/lalr1.cc, data/yacc.c:
13585 Output token definitions before the first part of user declarations.
13586 Fixes compatibility problem reported by Jim Gifford for kbd in
13587 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
13588
13589 2002-10-11 Paul Eggert <eggert@twinsun.com>
13590
13591 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
13592 (yyparse): here. This undoes some of the 2002-07-25 change.
13593 Compatibility problem reported by Ralf S. Engelschall with
13594 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
13595
13596 2002-10-11 Akim Demaille <akim@epita.fr>
13597
13598 * tests/regression.at Characters Escapes): New.
13599 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
13600 characters.
13601 Reported by Jan Nieuwenhuizen.
13602
13603 2002-10-11 Akim Demaille <akim@epita.fr>
13604
13605 * po/id.po: New.
13606
13607 2002-10-10 Paul Eggert <eggert@twinsun.com>
13608
13609 Portability fixes for bitsets; this also avoids several GCC
13610 warnings.
13611
13612 * lib/abitset.c: Include <stddef.h>, for offsetof.
13613 * lib/lbitset.c: Likewise.
13614
13615 * lib/abitset.c (abitset_bytes): Return a size that is aligned
13616 properly for vectors of objects. Do not assume that adding a
13617 header size to a multiple of a word size yields a value that is
13618 properly aligned for the whole union.
13619 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13620
13621 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
13622 unique names for structures.
13623 * lib/ebitset.c (ebitset_bytes): Likewise.
13624 * lib/lbitset.c (lbitset_bytes): Likewise.
13625
13626 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
13627 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
13628 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
13629 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
13630 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
13631 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
13632 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
13633 to improve the type-checking that GCC can do.
13634 * lib/bitset.c (bitset_op4_cmp): Likewise.
13635 * lib/bitset_stats.c (bitset_stats_count,
13636 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
13637 bitset_stats_copy, bitset_stats_disjoint_p,
13638 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
13639 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
13640 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
13641 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
13642 bitset_stats_and_or_cmp, bitset_stats_andn_or,
13643 bitset_stats_andn_or_cmp, bitset_stats_or_and,
13644 bitset_stats_or_and_cmp): Likewise.
13645 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
13646 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
13647 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
13648 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
13649
13650 * lib/abitset.h: Include bitset.h, not bbitset.h.
13651 * lib/ebitset.h: Likewise.
13652 * lib/lbitset.h: Likewise.
13653
13654 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
13655 All instances of parameters of type enum bitset_opts are now of
13656 type enum_bitset_opts, to conform to the C Standard, and similarly
13657 for enum_bitset_type.
13658 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13659 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13660
13661 Do not use "struct bitset_struct" to mean different things in
13662 different modules. Not only is this confusing, it violates
13663 the C Standard, which requires that structure types in different
13664 modules must be compatible if one is to be passed to the other.
13665 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
13666 All instances of "struct bitset_struct *" replaced with "bitset".
13667 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
13668 (union bitset_union, struct abitset_struct, struct ebitset_struct,
13669 struct lbitset_struct, struct bitset_stats_struct): New types.
13670 All uses of struct bitset_struct changed to union bitset_union,
13671 etc.
13672 * lib/abitset.c (struct abitset_struct, abitset,
13673 struct bitset_struct): Remove.
13674 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
13675 struct bitset_struct): Remove.
13676 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
13677 bitset_struct): Remove.
13678 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
13679 Likewise.
13680
13681 Do not call a function of type T using a call that assumes the
13682 function is of a different type U. Standard C requires that a
13683 function must be called with a type that is compatible with its
13684 definition.
13685 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13686 New decls.
13687 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13688 New functions.
13689 * lib/ebitset.c (PFV): Remove.
13690 * lib/lbitset.c (PFV): Likewise.
13691 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
13692 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
13693 decls.
13694 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
13695 (ebitset_vtable): Use them.
13696 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
13697 lbitset_xor): New functions.
13698 (lbitset_vtable): Use them.
13699
13700 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
13701 Declare.
13702
13703 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
13704 GCC warning.
13705 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
13706 Use offsetof, for simplicity.
13707
13708 2002-10-06 Paul Eggert <eggert@twinsun.com>
13709
13710 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
13711 the same width as int. This reapplies a hunk of the 2002-08-12 patch
13712 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
13713 which was inadvertently undone by the 2002-09-30 patch.
13714 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
13715 the same width as int.
13716
13717 2002-10-04 Paul Eggert <eggert@twinsun.com>
13718
13719 Version 1.50.
13720
13721 * configure.ac (AC_INIT), NEWS: Increment version number.
13722
13723 * doc/bison.texinfo: Minor spelling, grammar, and white space
13724 fixes.
13725 (Symbols): Mention that any negative value returned from yylex
13726 signifies end-of-input. Warn about negative chars. Mention
13727 the portable Standard C character set.
13728
13729 The GNU coding standard says CFLAGS and YFLAGS are reserved
13730 for the installer to set.
13731 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
13732 * src/Makefile.am (AM_CFLAGS): Likewise.
13733 (AM_YFLAGS): Renamed from YFLAGS.
13734
13735 Fix some MAX and MIN problems.
13736 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
13737 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
13738 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
13739 * src/reader.c (reader): Use it.
13740
13741 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
13742 POSIX 1003.1-2001 has removed fgrep.
13743
13744 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
13745
13746 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
13747 interpreted as signed.
13748 * lib/ebitset.c (ebitset_list): Fix bug.
13749
13750 2002-10-01 Paul Eggert <eggert@twinsun.com>
13751
13752 More fixes for 64-bit hosts and large bitsets.
13753
13754 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
13755 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
13756 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
13757 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
13758 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
13759 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
13760 bitset_count_): Likewise.
13761 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
13762 bitset_first, bitset_last): Likewise.
13763 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
13764 bitset_stats_list_reverse, bitset_stats_size,
13765 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
13766 Likewise.
13767 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13768 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13769 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13770 bitsetv_reflexive_transitive_closure): Likewise.
13771 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
13772 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
13773 Likewise.
13774 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
13775 Likewise.
13776
13777 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
13778 Use size_t, not unsigned int, to count bytes.
13779 * lib/abitset.h (abitset_bytes): Likewise.
13780 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
13781 Likewise.
13782 * lib/bitset.h (bitset_bytes): Likewise.
13783 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
13784 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
13785 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13786 * lib/ebitset.c (ebitset_bytes): Likewise.
13787 * lib/ebitset.h (ebitset_bytes): Likewise.
13788 * lib/lbitset.c (lbitset_bytes): Likewise.
13789 * lib/lbitset.h (lbitset_bytes): Likewise.
13790
13791 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
13792 abitset_subset_p, abitset_disjoint_p, abitset_and,
13793 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
13794 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
13795 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
13796 abitset_or_and, abitset_or_and_cmp):
13797 Use bitset_windex instead of unsigned int.
13798 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13799 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
13800 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
13801 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
13802 Likewise.
13803 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
13804
13805 * lib/bitset.c (bitset_print):
13806 Use proper printf formats for widths of integer types.
13807 * lib/bitset_stats.c (bitset_percent_histogram_print,
13808 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
13809 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13810 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13811 * lib/lbitset.c (lbitset_bytes): Likewise.
13812
13813 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
13814 BITSET_SIZE_MAX): New macros.
13815 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
13816 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
13817 to BITSET_WINDEX_MAX.
13818
13819 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
13820 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
13821 since we now return the bitset_bindex type (not int).
13822
13823 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
13824 when computing sizes.
13825 * lib/ebitset.c (ebitset_elts_grow): Likewise.
13826
13827 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
13828 and avoid cast to unsigned.
13829
13830 2002-09-30 Akim Demaille <akim@epita.fr>
13831
13832 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13833 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
13834 Updates from Michael Hayes.
13835
13836 2002-09-30 Art Haas <ahaas@neosoft.com>
13837
13838 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
13839 invocations.
13840 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
13841 defined.
13842
13843 2002-09-27 Akim Demaille <akim@epita.fr>
13844
13845 Version 1.49c.
13846
13847 2002-09-27 Akim Demaille <akim@epita.fr>
13848
13849 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
13850 (Because of AC_LIBSOURCE).
13851
13852 2002-09-27 Akim Demaille <akim@epita.fr>
13853
13854 Playing with Autoscan.
13855
13856 * configure.ac: Remove the old LIBOBJ tweaks.
13857 (AC_REPLACE_FUNCS): Add strrchr and strtol.
13858 * lib/strrchr.c: New.
13859 * lib/strtol.c: New, from the Coreutils 4.5.1.
13860
13861 2002-09-27 Akim Demaille <akim@epita.fr>
13862
13863 Playing with Autoscan.
13864
13865 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
13866 * lib/Makefile.am (libbison_a_SOURCES): No longer include
13867 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
13868 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
13869 Coreutils 4.5.1.
13870
13871 2002-09-24 Akim Demaille <akim@epita.fr>
13872
13873 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
13874 (Frequently Asked Questions, Parser Stack Overflow): New.
13875
13876 2002-09-13 Akim Demaille <akim@epita.fr>
13877
13878 Playing with autoscan.
13879
13880 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
13881 * src/files.c (skeleton_find): Remove, unused.
13882 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
13883 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
13884
13885 2002-09-13 Akim Demaille <akim@epita.fr>
13886
13887 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
13888 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
13889
13890 2002-09-13 Akim Demaille <akim@epita.fr>
13891
13892 * configure.ac: Require 2.54.
13893 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
13894 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
13895 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
13896 Remove, provided by Autoconf macros.
13897
13898 2002-09-12 Akim Demaille <akim@epita.fr>
13899
13900 * m4/prereq.m4: Update, from Coreutils 4.5.1.
13901
13902 2002-09-12 Akim Demaille <akim@epita.fr>
13903
13904 * m4/prereq.m4: Update, from Fileutils 4.1.5.
13905 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
13906 Reported by Martin Mokrejs.
13907
13908 2002-09-10 Akim Demaille <akim@epita.fr>
13909
13910 * src/parse-gram.y: Associate a human readable string to each
13911 token type.
13912 * tests/regression.at (Invalid inputs): Adjust.
13913
13914 2002-09-10 Gary V. Vaughan <gary@gnu.org>
13915
13916 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
13917 with an Autoconf-2.5x style configure.ac.
13918
13919 2002-09-06 Paul Eggert <eggert@twinsun.com>
13920
13921 * doc/bison.texinfo (Conditions): Make explicit that the GPL
13922 exception applies only to yacc.c. This is a modification of a
13923 patch originally suggested by Akim Demaille.
13924
13925 2002-09-06 Akim Demaille <akim@epita.fr>
13926
13927 * data/c.m4 (b4_copyright): Move the GPL exception comment from
13928 here to...
13929 * data/yacc.c: here.
13930
13931 * data/lalr1.cc (struct yyltype): Don't define it, since we use
13932 LocationType.
13933 (b4_ltype): Default to yy::Location from location.hh.
13934
13935 2002-09-04 Jim Meyering <jim@meyering.net>
13936
13937 * data/yacc.c: Guard the declaration of yytoknum also with
13938 `#ifdef YYPRINT', so it is declared only when used.
13939
13940 2002-09-04 Akim Demaille <akim@epita.fr>
13941
13942 * configure.in: Rename as...
13943 * configure.ac: this.
13944 Bump to 1.49c.
13945
13946 2002-09-04 Akim Demaille <akim@epita.fr>
13947
13948 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
13949 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
13950 translate maintainer only messages.
13951
13952 2002-08-12 Paul Eggert <eggert@twinsun.com>
13953
13954 Version 1.49b.
13955
13956 * Makefile.am (SUBDIRS): Remove intl.
13957 (DISTCLEANFILES): Remove.
13958 * NEWS: Mention that GNU M4 is now required. Clarify what is
13959 meant by "larger grammars". Mention the pt_BR translation.
13960 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
13961 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
13962 Bump version from 0.11.2 to 0.11.5.
13963 (BISON_PREREQ_STAGE): Remove.
13964 (AM_GNU_GETTEXT): Use external gettext.
13965 (AC_OUTPUT): Remove intl/Makefile.
13966
13967 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
13968
13969 * data/glr.c: Include string.h, for strlen.
13970 (yyreportParseError): Use size_t for yysize.
13971 (yy_yypstack): No longer nested inside yypstates, as nested
13972 functions are not portable. Do not assume size_t is the
13973 same width as int.
13974 (yypstates): Do not assume that ptrdiff_t is the same width
13975 as int, and similarly for yyposn and YYINDEX.
13976
13977 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
13978
13979 * lib/Makefile.am (INCLUDES): Do not include from the intl
13980 directory, which has been removed.
13981 * src/Makefile.am (INCLUDES): Likewise.
13982
13983 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
13984 (bitsets_sources, additional_bitsets_sources, timevars_sources):
13985 New vars.
13986
13987 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
13988 * tests/Makefile.am (EXTRA_DIST): Likewise.
13989
13990 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
13991 Do not assume that bitset_windex is the same width as unsigned.
13992
13993 * lib/abitset.c (abitset_unused_clear): Do not assume that
13994 bitset_word is the same width as int.
13995 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
13996 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
13997 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
13998 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
13999 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
14000
14001 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
14002 portability to one's complement hosts!).
14003 * lib/ebitset.c (ebitset_op1): Likewise.
14004 * lib/lbitset.c (lbitset_op1): Likewise.
14005
14006 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
14007 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14008 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
14009 Sync with fileutils.
14010 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
14011 lib/gettext.h: Sync with diffutils.
14012
14013 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
14014 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
14015
14016 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
14017 PROTOTYPES to check for prototypes, and "defined __STDC__" to
14018 check for void *.
14019
14020 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
14021 size_t; the old version tried to do this but casted improperly.
14022 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
14023 (bitset_test): Now returns int, not unsigned long.
14024
14025 * lib/bitset_stats.c: Include "gettext.h".
14026 (_): New macro.
14027 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
14028 name locals "index", as it generates unnecessary warnings on some
14029 hosts that have an "index" function.
14030
14031 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
14032 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
14033 they need translation.
14034 * src/LR0.c (state_list_append, new_itemsets, get_state,
14035 append_states, generate_states): Likewise.
14036 * src/assoc.c (assoc_to_string): Likewise.
14037 * src/closure.c (print_closure, set_firsts, closure): Likewise.
14038 * src/gram.c (grammar_dump): Likewise.
14039 * src/injections.c (injections_compute): Likewise.
14040 * src/lalr.c (lookaheads_print): Likewise.
14041 * src/relation.c (relation_transpose): Likewise.
14042 * src/scan-gram.l: Likewise.
14043 * src/tables.c (table_grow, pack_vector): Likewise.
14044
14045 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
14046 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
14047 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
14048 * m4/mbstate_t.m4: Sync with fileutils.
14049 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
14050
14051 * po/LINGUAS: Add pt_BR.
14052 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
14053 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
14054 lib/timevar.c.
14055 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
14056 manual recommends.
14057 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
14058
14059 * src/complain.c (strerror_r): Remove decl; not needed.
14060 (strerror): Use same pattern as ../lib/error.c.
14061
14062 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
14063
14064 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
14065
14066 * src/main.c (main): Cast result of bindtextdomain and textdomain
14067 to void, to avoid a GCC warning when --disable-nls is in effect.
14068
14069 * src/scan-gram.l: Use strings rather than escapes when possible,
14070 to minimize the number of warnings from xgettext.
14071 (handle_action_dollar, handle_action_at): Don't use isdigit,
14072 as it mishandles negative chars and it may not work as expected
14073 outside the C locale.
14074
14075 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
14076 this is a GCC extension and is not portable to other compilers.
14077
14078 * src/system.h (alloca): Use same pattern as ../lib/error.c.
14079 Do not include <ctype.h>; no longer needed.
14080 Do not include <malloc.h>; no longer needed (and generates
14081 warnings on OpenBSD 3.0).
14082
14083 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
14084 it's not portable.
14085
14086 * tests/regression.at: Do not use 'cc -c input.c -o input';
14087 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
14088
14089 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
14090 exit status as failure, not just exit status 1. Sun C exits
14091 with status 2 sometimes.
14092
14093 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
14094 Use it for the two large tests.
14095
14096 2002-08-02 Akim Demaille <akim@epita.fr>
14097
14098 * src/conflicts.c (conflicts_output): Don't output rules never
14099 reduced here, since anyway that computation doesn't work.
14100 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
14101 (rule_useless_p, rule_never_reduced_p): New.
14102 (grammar_rules_partial_print): Use a filter instead of a range.
14103 Display the title only if needed.
14104 (grammar_rules_print): Adjust.
14105 (grammar_rules_never_reduced_report): New.
14106 * src/tables.c (action_row): Move the computation of rules never
14107 reduced to...
14108 (token_actions): here.
14109 * src/main.c (main): Make the parser before making the report, so
14110 that rules never reduced are computed.
14111 Call grammar_rules_never_reduced_report.
14112 * src/print.c (print_results): Report rules never reduced.
14113 * tests/conflicts.at, tests/reduce.at: Adjust.
14114
14115 2002-08-01 Akim Demaille <akim@epita.fr>
14116
14117 Instead of attaching lookaheads and duplicating the rules being
14118 reduced by a state, attach the lookaheads to the reductions.
14119
14120 * src/state.h (state_t): Remove the `lookaheads',
14121 `lookaheads_rule' member.
14122 (reductions_t): Add a `lookaheads' member.
14123 Use a regular array for the `rules'.
14124 * src/state.c (reductions_new): Initialize the lookaheads member
14125 to 0.
14126 (state_rule_lookaheads_print): Adjust.
14127 * src/state.h, src/state.c (state_reductions_find): New.
14128 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
14129 (count_rr_conflicts): Adjust.
14130 * src/lalr.c (LArule): Remove.
14131 (add_lookback_edge): Adjust.
14132 (state_lookaheads_count): New.
14133 (states_lookaheads_initialize): Merge into...
14134 (initialize_LA): this.
14135 (lalr_free): Adjust.
14136 * src/main.c (main): Don't free nullable and derives too early: it
14137 is used by --verbose.
14138 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
14139
14140 2002-08-01 Akim Demaille <akim@epita.fr>
14141
14142 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
14143 `rule_number_t**'.
14144 (set_derives, free_derives): Rename as...
14145 (derives_compute, derives_free): this.
14146 Adjust all dependencies.
14147 * src/nullable.c (set_nullable, free_nullable): Rename as...
14148 (nullable_compute, nullable_free): these.
14149 (rule_list_t): Store rule_t *, not rule_number_t.
14150 * src/state.c (state_rule_lookaheads_print): Directly compare rule
14151 pointers, instead of their numbers.
14152 * src/main.c (main): Call nullable_free, and derives_free earlier,
14153 as they were lo longer used.
14154
14155 2002-08-01 Akim Demaille <akim@epita.fr>
14156
14157 * lib/timevar.c (get_time): Include children time.
14158 * src/lalr.h (LA, LArule): Don't export them: used with the
14159 state_t.
14160 * src/lalr.c (LA, LArule): Static.
14161 * src/lalr.h, src/lalr.c (lalr_free): New.
14162 * src/main.c (main): Call it.
14163 * src/tables.c (pack_vector): Check whether loc is >= to the
14164 table_size, not >.
14165 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
14166 (tables_generate): do it, since that's also it which allocates
14167 them.
14168 Don't free LA and LArule, main does.
14169
14170 2002-07-31 Akim Demaille <akim@epita.fr>
14171
14172 Separate parser tables computation and output.
14173
14174 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
14175 (conflict_list, conflict_list_cnt, table, check, table_ninf)
14176 (yydefgoto, yydefact, high): Move to...
14177 * src/tables.h, src/tables.c: here.
14178 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14179 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14180 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
14181 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
14182 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
14183 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
14184 (action_row, save_row, token_actions, save_column, default_goto)
14185 (goto_actions, sort_actions, matching_state, pack_vector)
14186 (table_ninf_remap, pack_table, prepare_actions): Move to...
14187 * src/tables.c: here.
14188 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
14189 * src/output.c (token_actions, output_base, output_conflicts)
14190 (output_check): Merge into...
14191 (prepare_actions): this.
14192 (actions_output): Rename as...
14193 (user_actions_output): this.
14194 * src/main.c (main): Call tables_generate and tables_free.
14195
14196 2002-07-31 Akim Demaille <akim@epita.fr>
14197
14198 Steal GCC's --time-report support.
14199
14200 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
14201 stolen/adjusted from GCC.
14202 * m4/stage.m4: Remove time related checks.
14203 * m4/timevar.m4: New.
14204 * configure.in: Adjust.
14205 * src/system.h: Adjust to using timevar.h.
14206 * src/getargs.h, src/getargs.c: Support trace_time for
14207 --trace=time.
14208 * src/main.c (stage): Remove.
14209 (main): Replace `stage' invocations with timevar calls.
14210 * src/output.c: Insert pertinent timevar calls.
14211
14212 2002-07-31 Akim Demaille <akim@epita.fr>
14213
14214 Let --trace have arguments.
14215
14216 * src/getargs.h (enum trace_e): New.
14217 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
14218 (long_options, short_options): --trace/-T takes an optional
14219 argument.
14220 Change all the uses of trace_flag to reflect the new flags.
14221 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
14222
14223 Strengthen `stage' portability.
14224
14225 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
14226 * configure.in: Use it.
14227 Don't check for malloc.h and sys/times.h.
14228 * src/system.h: Include them when appropriate.
14229 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
14230 times and struct tms are available.
14231
14232 2002-07-30 Akim Demaille <akim@epita.fr>
14233
14234 In verbose parse error message, don't report `error' as an
14235 expected token.
14236 * tests/actions.at (Printers and Destructors): Adjust.
14237 * tests/calc.at (Calculator $1): Adjust.
14238 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
14239 error message, do not report the parser accepts the error token in
14240 that state.
14241
14242 2002-07-30 Akim Demaille <akim@epita.fr>
14243
14244 Normalize conflict related messages.
14245
14246 * src/complain.h, src/complain.c (warn, complain): New.
14247 * src/conflicts.c (conflicts_print): Use them.
14248 (conflict_report_yacc): New, extracted from...
14249 (conflicts_print): here.
14250 * tests/conflicts.at, tests/existing.at: Adjust.
14251
14252 2002-07-30 Akim Demaille <akim@epita.fr>
14253
14254 Report rules which are never reduced by the parser: those hidden
14255 by conflicts.
14256
14257 * src/LR0.c (save_reductions): Don't make the final state too
14258 different: save its reduction (accept) instead of having a state
14259 without any action (no shift or goto, no reduce).
14260 Note: the final state is now a ``regular'' state, i.e., the
14261 parsers now contain `reduce 0' as default reduction.
14262 Nevertheless, since they decide to `accept' when yystate =
14263 final_state, they still will not reduce rule 0.
14264 * src/print.c (print_actions, print_reduction): Adjust.
14265 * src/output.c (action_row): Track reduced rules.
14266 (token_actions): Report rules never reduced.
14267 * tests/conflicts.at, tests/regression.at: Adjust.
14268
14269 2002-07-30 Akim Demaille <akim@epita.fr>
14270
14271 `stage' was accidently included in a previous patch.
14272 Initiate its autoconfiscation.
14273
14274 * configure.in: Look for malloc.h and sys/times.h.
14275 * src/main.c (stage): Adjust.
14276 Report only when trace_flag.
14277
14278 2002-07-29 Akim Demaille <akim@epita.fr>
14279
14280 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
14281 state_number_t.
14282 (errs_t): symbol_t*, not symbol_number_t.
14283 (reductions_t): rule_t*, not rule_number_t.
14284 (FOR_EACH_SHIFT): New.
14285 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
14286 * src/print.c, src/print_graph.c: Adjust.
14287
14288 2002-07-29 Akim Demaille <akim@epita.fr>
14289
14290 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
14291
14292 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
14293 (endtoken, accept): these.
14294 * src/reader.c (reader): Set endtoken's default tag to "$end".
14295 Set undeftoken's tag to "$undefined" instead of "$undefined.".
14296 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
14297 Adjust.
14298
14299 2002-07-29 Akim Demaille <akim@epita.fr>
14300
14301 * src/reduce.c (reduce_grammar): When the language is empty,
14302 complain about the start symbol, not the axiom.
14303 Use its location.
14304 * tests/reduce.at (Empty Language): New.
14305
14306 2002-07-26 Akim Demaille <akim@epita.fr>
14307
14308 * src/reader.h, src/reader.c (gram_error): ... can't get
14309 yycontrol without making too strong assumptions on the parser
14310 itself.
14311 * src/output.c (prepare_tokens): Use the real 0th value of
14312 token_translations instead of `0'.
14313 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
14314 visible here.
14315 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
14316 for the time being: %locations ought to provide it to yyerror.
14317
14318 2002-07-25 Akim Demaille <akim@epita.fr>
14319
14320 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
14321 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
14322 * tests/regression.at (Web2c Actions): Adjust.
14323
14324 2002-07-25 Akim Demaille <akim@epita.fr>
14325
14326 Stop storing rules from 1 to nrules + 1.
14327
14328 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
14329 * src/nullable.c, src/output.c, src/print.c, src/reader.c
14330 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
14331 Iterate from 0 to nrules.
14332 Use rule_number_as_item_number and item_number_as_rule_number.
14333 Adjust to `derive' now containing possibly 0.
14334 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
14335 Handle the `- 1' part in rule numbers from/to item numbers.
14336 * src/conflicts.c (log_resolution): Fix the message which reversed
14337 shift and reduce.
14338 * src/output.c (action_row): Initialize default_rule to -1.
14339 (token_actions): Adjust.
14340 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
14341 expected output.
14342 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
14343
14344 2002-07-25 Akim Demaille <akim@epita.fr>
14345
14346 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
14347 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
14348 (b4_c_knr_arg_decl): New.
14349 * data/yacc.c: Use it to define yysymprint, yydestruct, and
14350 yyreport_parse_error.
14351
14352 2002-07-25 Akim Demaille <akim@epita.fr>
14353
14354 * data/yacc.c (yyreport_parse_error): New, extracted from...
14355 (yyparse): here.
14356 (yydestruct, yysymprint): Move above yyparse.
14357 Be K&R compliant.
14358
14359 2002-07-25 Akim Demaille <akim@epita.fr>
14360
14361 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
14362 replace...
14363 (b4_sint_type, b4_uint_type): these.
14364 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
14365 * tests/regression.at (Web2c Actions): Adjust.
14366
14367 2002-07-25 Akim Demaille <akim@epita.fr>
14368
14369 * src/gram.h (TIEM_NUMBER_MAX): New.
14370 (item_number_of_rule_number, rule_number_of_item_number): Rename
14371 as...
14372 (rule_number_as_item_number, item_number_as_rule_number): these.
14373 Adjust dependencies.
14374 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14375 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14376 (symbol_number_to_vector_number): New.
14377 (order): Of vector_number_t* type.
14378 (base_t, BASE_MAX, BASE_MIN): New.
14379 (froms, tos, width, pos, check): Of base_t type.
14380 (action_number_t, ACTION_MIN, ACTION_MAX): New.
14381 (actrow): Of action_number_t type.
14382 (conflrow): Of unsigned int type.
14383 (table_ninf, base_ninf): New.
14384 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
14385 (muscle_insert_int_table, muscle_insert_base_table)
14386 (muscle_insert_rule_number_table): New.
14387 (prepare_tokens): Output `toknum' as int_table.
14388 (action_row): Returns a rule_number_t.
14389 Use ACTION_MIN, not SHRT_MIN.
14390 (token_actions): yydefact is rule_number_t*.
14391 (table_ninf_remap): New.
14392 (pack_table): Use it for `base' and `table'.
14393 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
14394 replaced with...
14395 (YYPACT_NINF, YYTABLE_NINF): these.
14396 (yypact, yytable): Compute their types instead of hard-coded
14397 `short'.
14398 * tests/regression.at (Web2c Actions): Adjust.
14399
14400 2002-07-19 Akim Demaille <akim@epita.fr>
14401
14402 * src/scan-gram.l (id): Can start with an underscore.
14403
14404 2002-07-16 Akim Demaille <akim@epita.fr>
14405
14406 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
14407 Adjust all former `associativity' dependencies.
14408 * src/symtab.c (symbol_new): Default associativity is `undef', not
14409 `right'.
14410 (symbol_check_alias_consistence): Adjust.
14411
14412 2002-07-09 Akim Demaille <akim@epita.fr>
14413
14414 * doc/bison.texinfo: Properly set the ``header'' part.
14415 Use @dircategory ``GNU programming tools'' as per Texinfo's
14416 documentation.
14417 Use @copying.
14418
14419 2002-07-09 Akim Demaille <akim@epita.fr>
14420
14421 * lib/quotearg.h: Protect against multiple inclusions.
14422 * src/location.h (location_t): Add a `file' member.
14423 (LOCATION_RESET, LOCATION_PRINT): Adjust.
14424 * src/complain.c (warn_at, complain_at, fatal_at): Drop
14425 `error_one_per_line' support.
14426
14427 2002-07-09 Akim Demaille <akim@epita.fr>
14428
14429 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
14430 * src/reader.c (lineno): Remove.
14431 Adjust all dependencies.
14432 (get_merge_function): Take a location and use complain_at.
14433 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
14434 * tests/regression.at (Invalid inputs, Mixing %token styles):
14435 Adjust.
14436
14437 2002-07-09 Akim Demaille <akim@epita.fr>
14438
14439 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
14440 recovery rule, and forbid extensions when --yacc.
14441 (gram_error): Use complain_at.
14442 * src/reader.c (reader): Exit if there were parse errors.
14443
14444 2002-07-09 Akim Demaille <akim@epita.fr>
14445
14446 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
14447 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
14448 Reported by R Blake <blakers@mac.com>.
14449
14450 2002-07-09 Akim Demaille <akim@epita.fr>
14451
14452 * data/yacc.c: Output the copyright notive in the header.
14453
14454 2002-07-03 Akim Demaille <akim@epita.fr>
14455
14456 * src/output.c (froms, tos): Are state_number_t.
14457 (save_column): sp, sp1, and sp2 are state_number_t.
14458 (prepare): Rename `final' as `final_state_number', `nnts' as
14459 `nterms_number', `nrules' as `rules_number', `nstates' as
14460 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
14461 unused.
14462 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
14463 * data/lalr1.cc (nsym_): Remove, unused.
14464
14465 2002-07-03 Akim Demaille <akim@epita.fr>
14466
14467 * src/lalr.h, src/lalr.c (goto_number_t): New.
14468 * src/lalr.c (goto_list_t): New.
14469 Propagate them.
14470 * src/nullable.c (rule_list_t): New.
14471 Propagate.
14472 * src/types.h: Remove.
14473
14474 2002-07-03 Akim Demaille <akim@epita.fr>
14475
14476 * src/closure.c (print_fderives): Use rule_rhs_print.
14477 * src/derives.c (print_derives): Use rule_rhs_print.
14478 (rule_list_t): New, replaces `shorts'.
14479 (set_derives): Add comments.
14480 * tests/sets.at (Nullable, Firsts): Adjust.
14481
14482 2002-07-03 Akim Demaille <akim@epita.fr>
14483
14484 * src/output.c (prepare_actions): Free `tally' and `width'.
14485 (prepare_actions): Allocate and free `order'.
14486 * src/symtab.c (symbols_free): Free `symbols'.
14487 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
14488 * src/output.c (m4_invoke): Move to...
14489 * src/scan-skel.l: here.
14490 (<<EOF>>): Close yyout, and free its name.
14491
14492 2002-07-03 Akim Demaille <akim@epita.fr>
14493
14494 Fix some memory leaks, and fix a bug: state 0 was examined twice.
14495
14496 * src/LR0.c (new_state): Merge into...
14497 (state_list_append): this.
14498 (new_states): Merge into...
14499 (generate_states): here.
14500 (set_states): Don't ensure a proper `errs' state member here, do it...
14501 * src/conflicts.c (conflicts_solve): here.
14502 * src/state.h, src/state.c: Comment changes.
14503 (state_t): Rename member `shifts' as `transitions'.
14504 Adjust all dependencies.
14505 (errs_new): For consistency, also take the values as argument.
14506 (errs_dup): Remove.
14507 (state_errs_set): New.
14508 (state_reductions_set, state_transitions_set): Assert that no
14509 previous value was assigned.
14510 (state_free): New.
14511 (states_free): Use it.
14512 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
14513 temporary storage: use `errs' and `nerrs' as elsewhere.
14514 (set_conflicts): Allocate and free this `errs'.
14515
14516 2002-07-02 Akim Demaille <akim@epita.fr>
14517
14518 * lib/libiberty.h: New.
14519 * lib: Update the bitset implementation from upstream.
14520 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
14521 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
14522 * src/main.c: Adjust bitset stats calls.
14523
14524 2002-07-01 Paul Eggert <eggert@twinsun.com>
14525
14526 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
14527 char, so that negative chars don't collide with $.
14528
14529 2002-06-30 Akim Demaille <akim@epita.fr>
14530
14531 Have the GLR tests be `warning' checked, and fix the warnings.
14532
14533 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
14534 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
14535 (yyremoveDeletes): `yyi' and `yyj' are size_t.
14536 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
14537 (yyaddDeferredAction): static.
14538 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
14539 (yyreportParseError): yyprefix is const.
14540 yytokenp is used only when verbose.
14541 (yy__GNUC__): Replace with __GNUC__.
14542 (yypdumpstack): yyi is size_t.
14543 (yypreference): Un-yy local variables and arguments, to avoid
14544 clashes with `yyr1'. Anyway, we are not in the user name space.
14545 (yytname_size): be an int, as is compared with ints.
14546 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
14547 Use them.
14548 * tests/cxx-gram.at: Use quotation to protect $1.
14549 Use AT_COMPILE to enable warnings hunts.
14550 Prototype yylex and yyerror.
14551 `Use' argc.
14552 Include `string.h', not `strings.h'.
14553 Produce and prototype stmtMerge only when used.
14554 yylex takes a location.
14555
14556 2002-06-30 Akim Demaille <akim@epita.fr>
14557
14558 We spend a lot of time in quotearg, in particular when --verbose.
14559
14560 * src/symtab.c (symbol_get): Store a quoted version of the key.
14561 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
14562 Adjust all callers.
14563
14564 2002-06-30 Akim Demaille <akim@epita.fr>
14565
14566 * src/state.h (reductions_t): Rename member `nreds' as num.
14567 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
14568 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
14569
14570 2002-06-30 Akim Demaille <akim@epita.fr>
14571
14572 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
14573 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
14574 (shifts_to): Rename as...
14575 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
14576 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
14577 (TRANSITION_IS_DISABLED, transitions_to): these.
14578
14579 2002-06-30 Akim Demaille <akim@epita.fr>
14580
14581 * src/print.c (print_shifts, print_gotos): Merge into...
14582 (print_transitions): this.
14583 (print_transitions, print_errs, print_reductions): Align the
14584 lookaheads columns.
14585 (print_core, print_transitions, print_errs, print_state,
14586 print_grammar): Output empty lines separator before, not after.
14587 (state_default_rule_compute): Rename as...
14588 (state_default_rule): this.
14589 * tests/conflicts.at (Defaulted Conflicted Reduction),
14590 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
14591 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
14592
14593 2002-06-30 Akim Demaille <akim@epita.fr>
14594
14595 Display items as we display rules.
14596
14597 * src/gram.h, src/gram.c (rule_lhs_print): New.
14598 * src/gram.c (grammar_rules_partial_print): Use it.
14599 * src/print.c (print_core): Likewise.
14600 * tests/conflicts.at (Defaulted Conflicted Reduction),
14601 (Unresolved SR Conflicts): Adjust.
14602 (Unresolved SR Conflicts): Adjust and rename as...
14603 (Resolved SR Conflicts): this, as was meant.
14604 * tests/regression.at (Web2c Report): Adjust.
14605
14606 2002-06-30 Akim Demaille <akim@epita.fr>
14607
14608 * src/print.c (state_default_rule_compute): New, extracted from...
14609 (print_reductions): here.
14610 Pessimize, but clarify the code.
14611 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
14612
14613 2002-06-30 Akim Demaille <akim@epita.fr>
14614
14615 * src/output.c (action_row): Let default_rule be always a rule
14616 number.
14617
14618 2002-06-30 Akim Demaille <akim@epita.fr>
14619
14620 * src/closure.c (print_firsts, print_fderives, closure):
14621 Use BITSET_EXECUTE.
14622 * src/lalr.c (lookaheads_print): Likewise.
14623 * src/state.c (state_rule_lookaheads_print): Likewise.
14624 * src/print_graph.c (print_core): Likewise.
14625 * src/print.c (print_reductions): Likewise.
14626 * src/output.c (action_row): Likewise.
14627 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
14628
14629 2002-06-30 Akim Demaille <akim@epita.fr>
14630
14631 * src/print_graph.c: Use report_flag.
14632
14633 2002-06-30 Akim Demaille <akim@epita.fr>
14634
14635 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
14636 to...
14637 * src/relation.h, src/relation.c (traverse, relation_digraph)
14638 (relation_print, relation_transpose): New.
14639
14640 2002-06-30 Akim Demaille <akim@epita.fr>
14641
14642 * src/state.h, src/state.c (shifts_to): New.
14643 * src/lalr.c (build_relations): Use it.
14644
14645 2002-06-30 Akim Demaille <akim@epita.fr>
14646
14647 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
14648 (item_number_of_rule_number, rule_number_of_item_number): New.
14649 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
14650 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14651 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
14652 Propagate their use.
14653 Much remains to be done, in particular wrt `shorts' from types.h.
14654
14655 2002-06-30 Akim Demaille <akim@epita.fr>
14656
14657 * src/symtab.c (symbol_new): Initialize the `printer' member.
14658
14659 2002-06-30 Akim Demaille <akim@epita.fr>
14660
14661 * src/LR0.c (save_reductions): Remove, replaced by...
14662 * src/state.h, src/state.c (state_reductions_set): New.
14663 (reductions, errs): Rename as...
14664 (reductions_t, errs_t): these.
14665 Adjust all dependencies.
14666
14667 2002-06-30 Akim Demaille <akim@epita.fr>
14668
14669 * src/LR0.c (state_list_t, state_list_append): New.
14670 (first_state, last_state): Now symbol_list_t.
14671 (this_state): Remove.
14672 (new_itemsets, append_states, save_reductions): Take a state_t as
14673 argument.
14674 (set_states, generate_states): Adjust.
14675 (save_shifts): Remove, replaced by...
14676 * src/state.h, src/state.c (state_shifts_set): New.
14677 (shifts): Rename as...
14678 (shifts_t): this.
14679 Adjust all dependencies.
14680 * src/state.h (state_t): Remove the `next' member.
14681
14682 2002-06-30 Akim Demaille <akim@epita.fr>
14683
14684 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
14685 escaped in slot 0.
14686
14687 2002-06-30 Akim Demaille <akim@epita.fr>
14688
14689 Use hash.h for the state hash table.
14690
14691 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
14692 (allocate_storage): Use state_hash_new.
14693 (free_storage): Use state_hash_free.
14694 (new_state, get_state): Adjust.
14695 * src/lalr.h, src/lalr.c (states): Move to...
14696 * src/states.h (state_t): Remove the `link' member, no longer
14697 used.
14698 * src/states.h, src/states.c: here.
14699 (state_hash_new, state_hash_free, state_hash_lookup)
14700 (state_hash_insert, states_free): New.
14701 * src/states.c (state_table, state_compare, state_hash): New.
14702 * src/output.c (output_actions): Do not free states now, since we
14703 still need to know the final_state number in `prepare', called
14704 afterwards. Do it...
14705 * src/main.c (main): here: call states_free after `output'.
14706
14707 2002-06-30 Akim Demaille <akim@epita.fr>
14708
14709 * src/state.h, src/state.c (state_new): New, extracted from...
14710 * src/LR0.c (new_state): here.
14711 * src/state.h (STATE_ALLOC): Move to...
14712 * src/state.c: here.
14713 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
14714 * src/state.h, src/state.c: here.
14715
14716 2002-06-30 Akim Demaille <akim@epita.fr>
14717
14718 * src/reader.c (gensym): Rename as...
14719 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
14720 (getsym): Rename as...
14721 (symbol_get): this.
14722
14723 2002-06-30 Akim Demaille <akim@epita.fr>
14724
14725 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
14726 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
14727 * src/output.c, src/print.c, src/print_graph.c: Propagate.
14728 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
14729
14730 2002-06-30 Akim Demaille <akim@epita.fr>
14731
14732 Make the test suite pass with warnings checked.
14733
14734 * tests/actions.at (Printers and Destructors): Improve.
14735 Avoid unsigned vs. signed issues.
14736 * tests/calc.at: Don't exercise the scanner here, do it...
14737 * tests/input.at (Torturing the Scanner): here.
14738
14739 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14740
14741 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
14742 reorganize first lines parallel to yacc.c.
14743
14744 2002-06-28 Akim Demaille <akim@epita.fr>
14745
14746 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
14747 (b4_token_enum, b4_token_defines): New, factored from...
14748 * data/lalr1.cc, data/yacc.c, glr.c: here.
14749
14750 2002-06-28 Akim Demaille <akim@epita.fr>
14751
14752 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
14753 unused variables.
14754 * src/output.c (merger_output): static.
14755
14756 2002-06-28 Akim Demaille <akim@epita.fr>
14757
14758 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
14759 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
14760 pacify GCC.
14761 * src/output.c (save_row): Initialize all the variables to pacify GCC.
14762
14763 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14764
14765 Accumulated changelog for new GLR parsing features.
14766
14767 * src/conflicts.c (count_total_conflicts): Change name to
14768 conflicts_total_count.
14769 * src/conflicts.h: Ditto.
14770 * src/output.c (token_actions): Use the new name.
14771 (output_conflicts): Change conflp => conflict_list_heads, and
14772 confl => conflict_list for better readability.
14773 * data/glr.c: Use the new names.
14774 * NEWS: Add self to GLR announcement.
14775
14776 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
14777
14778 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
14779 Akim Demaille.
14780
14781 * data/bison.glr: Change name to glr.c
14782 * data/glr.c: Renamed from bison.glr.
14783 * data/Makefile.am: Add glr.c
14784
14785 * src/getargs.c:
14786
14787 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
14788 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
14789
14790 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14791
14792 * data/bison.glr: Be sure to restore the
14793 current #line when returning to the skeleton contents after having
14794 exposed the input file's #line.
14795
14796 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14797
14798 * data/bison.glr: Bring up to date with changes to bison.simple.
14799
14800 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14801
14802 * data/bison.glr: Correct definitions that use b4_prefix.
14803 Various reformatting.
14804 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
14805 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
14806 yytokenp argument; now part of stack.
14807 (yychar): Define to behave as documented.
14808 (yyclearin): Ditto.
14809
14810 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14811
14812 * src/reader.h: Add declaration for free_merger_functions.
14813
14814 * src/reader.c (merge_functions): New variable.
14815 (get_merge_function): New function.
14816 (free_merger_functions): New function.
14817 (readgram): Check for %prec that is not followed by a symbol.
14818 Handle %dprec and %merge declarations.
14819 (packgram): Initialize dprec and merger fields in rules array.
14820
14821 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
14822 conflict_list_cnt, conflict_list_free): New variables.
14823 (table_grow): Also grow conflict_table.
14824 (prepare_rules): Output dprec and merger tables.
14825 (conflict_row): New function.
14826 (action_row): Output conflict lists for GLR parser. Don't use
14827 default reduction in conflicted states for GLR parser so that there
14828 are spaces for the conflict lists.
14829 (save_row): Also save conflict information.
14830 (token_actions): Allocate conflict list.
14831 (merger_output): New function.
14832 (pack_vector): Pack conflict table, too.
14833 (output_conflicts): New function to output yyconflp and yyconfl.
14834 (output_check): Allocate conflict_tos.
14835 (output_actions): Output conflict tables, also.
14836 (output_skeleton): Output b4_mergers definition.
14837 (prepare): Output b4_max_rhs_length definition.
14838 Use 'bison.glr' as default skeleton for GLR parsers.
14839
14840 * src/gram.c (glr_parser): New flag.
14841 (grammar_free): Call free_merger_functions.
14842
14843 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
14844 all pairs of conflicting reductions, rather than just all tokens
14845 causing conflicts. Needed to size conflict tables.
14846 (conflicts_output): Modify call to count_rr_conflicts for new
14847 interface.
14848 (conflicts_print): Ditto.
14849 (count_total_conflicts): New function.
14850
14851 * src/reader.h (merger_list): New type.
14852 (merge_functions): New variable.
14853
14854 * src/lex.h (tok_dprec, tok_merge): New token types.
14855
14856 * src/gram.h (rule_s): Add dprec and merger fields.
14857 (glr_parser): New flag.
14858
14859 * src/conflicts.h (count_total_conflicts): New function.
14860
14861 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
14862
14863 * doc/bison.texinfo (Generalized LR Parsing): New section.
14864 (GLR Parsers): New section.
14865 (Language and Grammar): Mention GLR parsing.
14866 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
14867 Correct typo ("tge" -> "the").
14868
14869 * data/bison.glr: New skeleton for GLR parsing.
14870
14871 * tests/cxx-gram.at: New tests for GLR parsing.
14872
14873 * tests/testsuite.at: Include cxx-gram.at.
14874
14875 * tests/Makefile.am: Add cxx-gram.at.
14876
14877 * src/parse-gram.y:
14878
14879 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
14880
14881 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
14882
14883 2002-06-27 Akim Demaille <akim@epita.fr>
14884
14885 * src/options.h, src/options.c: Remove.
14886 * src/getargs.c (short_options, long_options): New.
14887
14888 2002-06-27 Akim Demaille <akim@epita.fr>
14889
14890 * data/bison.simple, data/bison.c++: Rename as...
14891 * data/yacc.c, data/lalr1.cc: these.
14892 * doc/bison.texinfo (Environment Variables): Remove.
14893
14894 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
14895
14896 * src/getargs.c (report_argmatch): Initialize strtok().
14897
14898 2002-06-20 Akim Demaille <akim@epita.fr>
14899
14900 * data/bison.simple (b4_symbol_actions): New, replaces...
14901 (b4_symbol_destructor, b4_symbol_printer): these.
14902 (yysymprint): Be sure to call YYPRINT only for tokens, and using
14903 user token numbers.
14904
14905 2002-06-20 Akim Demaille <akim@epita.fr>
14906
14907 * data/bison.simple (yydestructor): Rename as...
14908 (yydestruct): this.
14909
14910 2002-06-20 Akim Demaille <akim@epita.fr>
14911
14912 * src/symtab.h, src/symtab.c (symbol_type_set)
14913 (symbol_destructor_set, symbol_precedence_set): The location is
14914 the last argument.
14915 Adjust all callers.
14916
14917 2002-06-20 Akim Demaille <akim@epita.fr>
14918
14919 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
14920 internals.
14921 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
14922 Takes a location.
14923 * src/symtab.h, src/symtab.c (symbol_class_set)
14924 (symbol_user_token_number_set): Likewise.
14925 Adjust all callers.
14926 Promote complain_at.
14927 * tests/input.at (Type Clashes): Adjust.
14928
14929 2002-06-20 Akim Demaille <akim@epita.fr>
14930
14931 * data/bison.simple (YYLEX): Fix the declaration when
14932 %pure-parser.
14933
14934 2002-06-20 Akim Demaille <akim@epita.fr>
14935
14936 * data/bison.simple (yysymprint): Don't print the token number,
14937 just its name.
14938 * tests/actions.at (Destructors): Rename as...
14939 (Printers and Destructors): this.
14940 Also exercise %printer.
14941
14942 2002-06-20 Akim Demaille <akim@epita.fr>
14943
14944 * data/bison.simple (YYDSYMPRINT): New.
14945 Use it to remove many of the #if YYDEBUG/if (yydebug).
14946
14947 2002-06-20 Akim Demaille <akim@epita.fr>
14948
14949 * src/symtab.h, src/symtab.c (symbol_t): printer and
14950 printer_location are new members.
14951 (symbol_printer_set): New.
14952 * src/parse-gram.y (PERCENT_PRINTER): New token.
14953 Handle its associated rule.
14954 * src/scan-gram.l: Adjust.
14955 (handle_destructor_at, handle_destructor_dollar): Rename as...
14956 (handle_symbol_code_at, handle_symbol_code_dollar): these.
14957 * src/output.c (symbol_printers_output): New.
14958 (output_skeleton): Call it.
14959 * data/bison.simple (yysymprint): New. Cannot be named yyprint
14960 since there are already many grammar files with a user `yyprint'.
14961 Replace the calls to YYPRINT to calls to yysymprint.
14962 * tests/calc.at: Adjust.
14963 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
14964 taking advantage of parser very internal details (stack size!).
14965
14966 2002-06-20 Akim Demaille <akim@epita.fr>
14967
14968 * src/scan-gram.l: Complete the scanner with the missing patterns
14969 to pacify Flex.
14970 Use `quote' and `symbol_tag_get' where appropriate.
14971
14972 2002-06-19 Akim Demaille <akim@epita.fr>
14973
14974 * tests/actions.at (Destructors): Augment to test locations.
14975 * data/bison.simple (yydestructor): Pass it the current location
14976 if locations are enabled.
14977 Prototype only when __STDC__ or C++.
14978 Change the argument names to move into the yy name space: there is
14979 user code here.
14980
14981 2002-06-19 Akim Demaille <akim@epita.fr>
14982
14983 * data/bison.simple (b4_pure_if): New.
14984 Use it instead of #ifdef YYPURE.
14985
14986 2002-06-19 Akim Demaille <akim@epita.fr>
14987
14988 * data/bison.simple (b4_location_if): New.
14989 Use it instead of #ifdef YYLSP_NEEDED.
14990
14991 2002-06-19 Akim Demaille <akim@epita.fr>
14992
14993 Prepare @$ in %destructor, but currently don't bind it in the
14994 skeleton, as %location use is not cleaned up yet.
14995
14996 * src/scan-gram.l (handle_dollar, handle_destructor_at)
14997 (handle_action_at): New.
14998 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
14999 a braced_code_t and a location as additional arguments.
15000 (handle_destructor_dollar): Instead of requiring `b4_eval', just
15001 unquote one when outputting `b4_dollar_dollar'.
15002 Adjust callers.
15003 * data/bison.simple (b4_eval): Remove.
15004 (b4_symbol_destructor): Adjust.
15005 * tests/input.at (Invalid @n): Adjust.
15006
15007 2002-06-19 Zack Weinberg <zack@codesourcery.com>
15008
15009 * doc/bison.texinfo: Document ability to have multiple
15010 prologue sections.
15011
15012 2002-06-18 Akim Demaille <akim@epita.fr>
15013
15014 * src/files.c (compute_base_names): When computing the output file
15015 names from the input file name, strip the directory part.
15016
15017 2002-06-18 Akim Demaille <akim@epita.fr>
15018
15019 * data/bison.simple.new: Comment changes.
15020 Reported by Andreas Schwab.
15021
15022 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
15023
15024 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
15025 there are no `label `yyoverflowlab' defined but not used' warnings
15026 when yyoverflow is defined.
15027
15028 2002-06-18 Akim Demaille <akim@epita.fr>
15029
15030 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
15031 new member.
15032 (symbol_destructor_set): Adjust.
15033 * src/output.c (symbol_destructors_output): Output the destructor
15034 locations.
15035 Output the symbol name.
15036 * data/bison.simple (b4_symbol_destructor): Adjust.
15037
15038 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
15039 and Akim Demaille <akim@epita.fr>
15040
15041 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
15042 what's left on the stack when the error recovery hits EOF.
15043 * tests/actions.at (Destructors): Complete to exercise this case.
15044
15045 2002-06-17 Akim Demaille <akim@epita.fr>
15046
15047 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
15048 arguments is really empty, not only equal to `[]'.
15049 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
15050 member.
15051 (symbol_destructor_set): New.
15052 * src/output.c (symbol_destructors_output): New.
15053 * src/reader.h (brace_code_t, current_braced_code): New.
15054 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
15055 (handle_dollar): Rename as...
15056 (handle_action_dollar): this.
15057 (handle_destructor_dollar): New.
15058 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
15059 (grammar_declaration): Use it.
15060 * data/bison.simple (yystos): Is always defined.
15061 (yydestructor): New.
15062 * tests/actions.at (Destructors): New.
15063 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
15064
15065 2002-06-17 Akim Demaille <akim@epita.fr>
15066
15067 * src/symlist.h, src/symlist.c (symbol_list_length): New.
15068 * src/scan-gram.l (handle_dollar, handle_at): Compute the
15069 rule_length only when needed.
15070 * src/output.c (actions_output, token_definitions_output): Output
15071 the full M4 block.
15072 * src/symtab.c: Don't access directly to the symbol tag, use
15073 symbol_tag_get.
15074 * src/parse-gram.y: Use symbol_list_free.
15075
15076 2002-06-17 Akim Demaille <akim@epita.fr>
15077
15078 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
15079 (symbol_list_prepend, get_type_name): Move to...
15080 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
15081 (symbol_list_prepend, symbol_list_n_type_name_get): here.
15082 Adjust all callers.
15083 (symbol_list_free): New.
15084 * src/scan-gram.l (handle_dollar): Takes a location.
15085 * tests/input.at (Invalid $n): Adjust.
15086
15087 2002-06-17 Akim Demaille <akim@epita.fr>
15088
15089 * src/reader.h, src/reader.c (symbol_list_new): Export it.
15090 (symbol_list_prepend): New.
15091 * src/parse-gram.y (%union): `list' is a new member.
15092 (symbols.1): New, replaces...
15093 (terms_to_prec.1, nterms_to_type.1): these.
15094 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
15095 Take a location as additional argument.
15096 Adjust all callers.
15097
15098 2002-06-15 Akim Demaille <akim@epita.fr>
15099
15100 * src/parse-gram.y: Move %token in the declaration section so that
15101 we don't depend upon CVS Bison.
15102
15103 2002-06-15 Akim Demaille <akim@epita.fr>
15104
15105 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
15106 * src/print.c (print_core): Use it.
15107
15108 2002-06-15 Akim Demaille <akim@epita.fr>
15109
15110 * src/conflicts.c (log_resolution): Accept the rule involved in
15111 the sr conflicts instead of the lookahead number that points to
15112 that rule.
15113 (flush_reduce): Accept the current lookahead vector as argument,
15114 instead of the index in LA.
15115 (resolve_sr_conflict): Accept the current number of lookahead
15116 bitset to consider for the STATE, instead of the index in LA.
15117 (set_conflicts): Adjust.
15118 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
15119
15120 2002-06-15 Akim Demaille <akim@epita.fr>
15121
15122 * src/state.h (state_t): Replace the `lookaheadsp' member, a
15123 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
15124 Adjust all dependencies.
15125 * src/lalr.c (initialize_lookaheads): Split into...
15126 (states_lookaheads_count, states_lookaheads_initialize): these.
15127 (lalr): Adjust.
15128
15129 2002-06-15 Akim Demaille <akim@epita.fr>
15130
15131 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
15132 out of...
15133 (grammar_rules_print): here.
15134 * src/reduce.c (reduce_output): Use it.
15135 * tests/reduce.at (Useless Rules, Reduced Automaton)
15136 (Underivable Rules): Adjust.
15137
15138 2002-06-15 Akim Demaille <akim@epita.fr>
15139
15140 Copy BYacc's nice way to report the grammar.
15141
15142 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
15143 New.
15144 Don't print the rules' location, it is confusing and useless.
15145 (rule_print): Use grammar_rhs_print.
15146 * src/print.c (print_grammar): Use grammar_rules_print.
15147
15148 2002-06-15 Akim Demaille <akim@epita.fr>
15149
15150 Complete and rationalize `useless thing' warnings.
15151
15152 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
15153 (symbol_tag_print): New.
15154 Use them everywhere in place of accessing directly the tag member.
15155 * src/gram.h, src/gram.c (rule_print): New.
15156 Use it where a rule used to be printed `by hand'.
15157 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
15158 (reduce_grammar_tables): Report the useless rules.
15159 (reduce_print): Useless things are a warning, not an error.
15160 Report it as such.
15161 * tests/reduce.at (Useless Nonterminals, Useless Rules):
15162 (Reduced Automaton, Underivable Rules): Adjust.
15163 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
15164 * tests/conflicts.at (Unresolved SR Conflicts)
15165 (Solved SR Conflicts): Adjust.
15166
15167 2002-06-15 Akim Demaille <akim@epita.fr>
15168
15169 Let symbols have a location.
15170
15171 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
15172 (getsym): Adjust.
15173 Adjust all callers.
15174 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
15175 Use location_t, not int.
15176 * src/symtab.c (symbol_check_defined): Take advantage of the
15177 location.
15178 * tests/regression.at (Invalid inputs): Adjust.
15179
15180 2002-06-15 Akim Demaille <akim@epita.fr>
15181
15182 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
15183 (input): Don't try to initialize yylloc here, do it in the
15184 scanner.
15185 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
15186 * src/gram.h (rule_t): Change line and action_line into location
15187 and action_location, of location_t type.
15188 Adjust all dependencies.
15189 * src/location.h, src/location.c (empty_location): New.
15190 * src/reader.h, src/reader.c (grammar_start_symbol_set)
15191 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
15192 (grammar_current_rule_symbol_append)
15193 (grammar_current_rule_action_append): Expect a location as argument.
15194 * src/reader.c (grammar_midrule_action): Adjust to attach an
15195 action's location as dummy symbol location.
15196 * src/symtab.h, src/symtab.c (startsymbol_location): New.
15197 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
15198 the line numbers.
15199
15200 2002-06-14 Akim Demaille <akim@epita.fr>
15201
15202 Grammar declarations may be found in the grammar section.
15203
15204 * src/parse-gram.y (rules_or_grammar_declaration): New.
15205 (declarations): Each declaration may end with a semicolon, not
15206 just...
15207 (grammar_declaration): `"%union"'.
15208 (grammar): Branch to rules_or_grammar_declaration.
15209
15210 2002-06-14 Akim Demaille <akim@epita.fr>
15211
15212 * src/main.c (main): Invoke scanner_free.
15213
15214 2002-06-14 Akim Demaille <akim@epita.fr>
15215
15216 * src/output.c (m4_invoke): Extracted from...
15217 (output_skeleton): here.
15218 Free tempfile.
15219
15220 2002-06-14 Akim Demaille <akim@epita.fr>
15221
15222 * src/parse-gram.y (directives, directive, gram)
15223 (grammar_directives, precedence_directives, precedence_directive):
15224 Rename as...
15225 (declarations, declaration, grammar, grammar_declaration)
15226 (precedence_declaration, precedence_declarator): these.
15227 (symbol_declaration): New.
15228
15229 2002-06-14 Akim Demaille <akim@epita.fr>
15230
15231 * src/files.c (action_obstack): Remove, unused.
15232 (output_obstack): Remove it, and all its dependencies, as it is no
15233 longer needed.
15234 * src/reader.c (epilogue_set): Build the epilogue in the
15235 muscle_obstack.
15236 * src/output.h, src/output.c (muscle_obstack): Move to...
15237 * src/muscle_tab.h, src/muscle_tab.h: here.
15238 (muscle_init): Initialize muscle_obstack.
15239 (muscle_free): New.
15240 * src/main.c (main): Call it.
15241
15242 2002-06-14 Akim Demaille <akim@epita.fr>
15243
15244 * src/location.h: New, extracted from...
15245 * src/reader.h: here.
15246 * src/Makefile.am (noinst_HEADERS): Merge into
15247 (bison_SOURCES): this.
15248 Add location.h.
15249 * src/parse-gram.y: Use location_t instead of Bison's.
15250 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
15251 Use location_t instead of ints.
15252
15253 2002-06-14 Akim Demaille <akim@epita.fr>
15254
15255 * data/bison.simple, data/bison.c++: Be sure to restore the
15256 current #line when returning to the skeleton contents after having
15257 exposed the input file's #line.
15258
15259 2002-06-12 Akim Demaille <akim@epita.fr>
15260
15261 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
15262 eager.
15263 * tests/actions.at (Exotic Dollars): New.
15264
15265 2002-06-12 Akim Demaille <akim@epita.fr>
15266
15267 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
15268 ['"/] too eagerly.
15269 * tests/input.at (Torturing the Scanner): New.
15270
15271 2002-06-11 Akim Demaille <akim@epita.fr>
15272
15273 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
15274 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
15275 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
15276 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
15277 * src/reader.c (reader): Use it.
15278
15279 2002-06-11 Akim Demaille <akim@epita.fr>
15280
15281 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
15282 Adjust all callers.
15283 (scanner_last_string_free): New.
15284
15285 2002-06-11 Akim Demaille <akim@epita.fr>
15286
15287 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
15288 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
15289 (last_string, YY_OBS_FREE): New.
15290 Use them when returning an ID.
15291
15292 2002-06-11 Akim Demaille <akim@epita.fr>
15293
15294 Have Bison grammars parsed by a Bison grammar.
15295
15296 * src/reader.c, src/reader.h (prologue_augment): New.
15297 * src/reader.c (copy_definition): Remove.
15298
15299 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
15300 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
15301 (grammar_current_rule_prec_set, grammar_current_rule_check)
15302 (grammar_current_rule_symbol_append)
15303 (grammar_current_rule_action_append): Export.
15304 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
15305 (symbol_list_action_append): Remove.
15306 Hook the routines from reader.
15307 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
15308 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
15309
15310 * src/reader.c (read_declarations): Remove, unused.
15311
15312 * src/parse-gram.y: Handle the epilogue.
15313 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
15314 (grammar_start_symbol_set): this.
15315 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
15316 * src/reader.c (readgram): Remove, unused.
15317 (reader): Adjust to insert eoftoken and axiom where appropriate.
15318
15319 * src/reader.c (copy_dollar): Replace with...
15320 * src/scan-gram.h (handle_dollar): this.
15321 * src/parse-gram.y: Remove `%thong'.
15322
15323 * src/reader.c (copy_at): Replace with...
15324 * src/scan-gram.h (handle_at): this.
15325
15326 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
15327 New.
15328
15329 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
15330 time being.
15331
15332 * src/reader.h, src/reader.c (grammar_rule_end): New.
15333
15334 * src/parse.y (current_type, current_class): New.
15335 Implement `%nterm', `%token' support.
15336 Merge `%term' into `%token'.
15337 (string_as_id): New.
15338 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
15339 type name.
15340
15341 * src/parse-gram.y: Be sure to handle properly the beginning of
15342 rules.
15343
15344 * src/parse-gram.y: Handle %type.
15345 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
15346
15347 * src/parse-gram.y: More directives support.
15348 * src/options.c: No longer handle source directives.
15349
15350 * src/parse-gram.y: Fix %output.
15351
15352 * src/parse-gram.y: Handle %union.
15353 Use the prologue locations.
15354 * src/reader.c (parse_union_decl): Remove.
15355
15356 * src/reader.h, src/reader.c (epilogue_set): New.
15357 * src/parse-gram.y: Use it.
15358
15359 * data/bison.simple, data/bison.c++: b4_stype is now either not
15360 defined, then default to int, or to the contents of %union,
15361 without `union' itself.
15362 Adjust.
15363 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
15364
15365 * src/output.c (actions_output): Don't output braces, as they are
15366 already handled by the scanner.
15367
15368 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
15369 characters to themselves.
15370
15371 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
15372 that the epilogue has a proper #line.
15373
15374 * src/parse-gram.y: Handle precedence/associativity.
15375
15376 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
15377 a terminal.
15378 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
15379 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
15380 at all to define terminals that cannot be emitted.
15381
15382 * src/scan-gram.l: Escape M4 characters.
15383
15384 * src/scan-gram.l: Working properly with escapes in user
15385 strings/characters.
15386
15387 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
15388 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
15389 grammar.
15390 Use more modest sizes, as for the time being the parser does not
15391 release memory, and therefore the process swallows a huge amount
15392 of memory.
15393
15394 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
15395 stricter %token grammar.
15396
15397 * src/symtab.h (associativity): Add `undef_assoc'.
15398 (symbol_precedence_set): Do nothing when passed an undef_assoc.
15399 * src/symtab.c (symbol_check_alias_consistence): Adjust.
15400
15401 * tests/regression.at (Invalid %directive): Remove, as it is now
15402 meaningless.
15403 (Invalid inputs): Adjust to the new error messages.
15404 (Token definitions): The new grammar doesn't allow too many
15405 eccentricities.
15406
15407 * src/lex.h, src/lex.c: Remove.
15408 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
15409 (copy_character, copy_string2, copy_string, copy_identifier)
15410 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
15411 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
15412 (parse_action): Remove.
15413 * po/POTFILES.in: Adjust.
15414
15415 2002-06-11 Akim Demaille <akim@epita.fr>
15416
15417 * src/reader.c (parse_action): Don't store directly into the
15418 rule's action member: return the action as a string.
15419 Don't require `rule_length' as an argument: compute it.
15420 (grammar_current_rule_symbol_append)
15421 (grammar_current_rule_action_append): New, eved out from
15422 (readgram): here.
15423 Remove `action_flag', `rulelength', unused now.
15424
15425 2002-06-11 Akim Demaille <akim@epita.fr>
15426
15427 * src/reader.c (grammar_current_rule_prec_set).
15428 (grammar_current_rule_check): New, eved out from...
15429 (readgram): here.
15430 Remove `xaction', `first_rhs': useless.
15431 * tests/input.at (Type clashes): New.
15432 * tests/existing.at (GNU Cim Grammar): Adjust.
15433
15434 2002-06-11 Akim Demaille <akim@epita.fr>
15435
15436 * src/reader.c (grammar_midrule_action): New, Eved out from
15437 (readgram): here.
15438
15439 2002-06-11 Akim Demaille <akim@epita.fr>
15440
15441 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
15442 New.
15443 (readgram): Use them as replacement of inlined code, crule and
15444 crule1.
15445
15446 2002-06-11 Akim Demaille <akim@epita.fr>
15447
15448 * src/reader.c (grammar_end, grammar_symbol_append): New.
15449 (readgram): Use them.
15450 Make the use of `p' as local as possible.
15451
15452 2002-06-10 Akim Demaille <akim@epita.fr>
15453
15454 GCJ's parser requires the tokens to be defined before the prologue.
15455
15456 * data/bison.simple: Output the token definition before the user's
15457 prologue.
15458 * tests/regression.at (Braces parsing, Duplicate string)
15459 (Mixing %token styles): Check the output from bison.
15460 (Early token definitions): New.
15461
15462 2002-06-10 Akim Demaille <akim@epita.fr>
15463
15464 * src/symtab.c (symbol_user_token_number_set): Don't complain when
15465 assigning twice the same user number to a token, so that we can
15466 use it in...
15467 * src/lex.c (lex): here.
15468 Also use `symbol_class_set' instead of hand written code.
15469 * src/reader.c (parse_assoc_decl): Likewise.
15470
15471 2002-06-10 Akim Demaille <akim@epita.fr>
15472
15473 * src/symtab.c, src/symtab.c (symbol_class_set)
15474 (symbol_user_token_number_set): New.
15475 * src/reader.c (parse_token_decl): Use them.
15476 Use a switch instead of ifs.
15477 Use a single argument.
15478
15479 2002-06-10 Akim Demaille <akim@epita.fr>
15480
15481 Remove `%thong' support as it is undocumented, unused, duplicates
15482 `%token's job, and creates useless e-mail traffic with people who
15483 want to know what it is, why it is undocumented, unused, and
15484 duplicates `%token's job.
15485
15486 * src/reader.c (parse_thong_decl): Remove.
15487 * src/options.c (option_table): Remove "thong".
15488 * src/lex.h (tok_thong): Remove.
15489
15490 2002-06-10 Akim Demaille <akim@epita.fr>
15491
15492 * src/symtab.c, src/symtab.c (symbol_type_set)
15493 (symbol_precedence_set): New.
15494 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
15495 (value_components_used): Remove, unused.
15496
15497 2002-06-09 Akim Demaille <akim@epita.fr>
15498
15499 Move symbols handling code out of the reader.
15500
15501 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
15502 (axiom): Move to...
15503 * src/symtab.h, src/symtab.c: here.
15504
15505 * src/gram.c (start_symbol): Remove: use startsymbol->number.
15506 * src/reader.c (startval): Rename as...
15507 * src/symtab.h, src/symtab.c (startsymbol): this.
15508 * src/reader.c: Adjust.
15509
15510 * src/reader.c (symbol_check_defined, symbol_make_alias)
15511 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15512 (token_translations_init)
15513 Move to...
15514 * src/symtab.c: here.
15515 * src/reader.c (packsymbols): Move to...
15516 * src/symtab.h, src/symtab.c (symbols_pack): here.
15517 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
15518 argument.
15519
15520 2002-06-03 Akim Demaille <akim@epita.fr>
15521
15522 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
15523 then statements.
15524
15525 2002-06-03 Akim Demaille <akim@epita.fr>
15526
15527 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
15528 structs with non literals.
15529 * src/scan-skel.l: never-interactive.
15530 * src/conflicts.c (enum conflict_resolution_e): No trailing
15531 comma.
15532 * src/getargs.c (usage): Split long literal strings.
15533 Reported by Hans Aberg.
15534
15535 2002-05-28 Akim Demaille <akim@epita.fr>
15536
15537 * data/bison.c++: Use C++ ostreams.
15538 (cdebug_): New member.
15539
15540 2002-05-28 Akim Demaille <akim@epita.fr>
15541
15542 * src/output.c (output_skeleton): Be sure to allocate enough room
15543 for `/' _and_ for `\0' in full_skeleton.
15544
15545 2002-05-28 Akim Demaille <akim@epita.fr>
15546
15547 * data/bison.c++: Catch up with bison.simple:
15548 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15549 and Paul Eggert <eggert@twinsun.com>: `error' handing.
15550 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
15551 and popping traces.
15552
15553 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15554
15555 * src/output.c (output_skeleton): Put an explicit path in front of
15556 the skeleton file name, rather than relying on the -I directory,
15557 to partially alleviate effects of having a skeleton file lying around
15558 in the current directory.
15559
15560 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15561
15562 * src/conflicts.c (log_resolution): Correct typo:
15563 obstack_printf should be obstack_fgrow1.
15564
15565 2002-05-26 Akim Demaille <akim@epita.fr>
15566
15567 * src/state.h (state_t): `solved_conflicts' is a new member.
15568 * src/LR0.c (new_state): Set it to 0.
15569 * src/conflicts.h, src/conflicts.c (print_conflicts)
15570 (free_conflicts, solve_conflicts): Rename as...
15571 (conflicts_print, conflicts_free, conflicts_solve): these.
15572 Adjust callers.
15573 * src/conflicts.c (enum conflict_resolution_e)
15574 (solved_conflicts_obstack): New, used by...
15575 (log_resolution): this.
15576 Adjust to attach the conflict resolution to each state.
15577 Complete the description with the precedence/associativity
15578 information.
15579 (resolve_sr_conflict): Adjust.
15580 * src/print.c (print_state): Output its solved_conflicts.
15581 * tests/conflicts.at (Unresolved SR Conflicts)
15582 (Solved SR Conflicts): Exercise --report=all.
15583
15584 2002-05-26 Akim Demaille <akim@epita.fr>
15585
15586 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15587 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15588 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
15589 (token_number_t, item_number_as_token_number)
15590 (token_number_as_item_number, muscle_insert_token_number_table):
15591 Rename as...
15592 (symbol_number_t, item_number_as_symbol_number)
15593 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
15594 these, since it is more appropriate.
15595
15596 2002-05-26 Akim Demaille <akim@epita.fr>
15597
15598 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
15599 `Error:' lines.
15600 * data/bison.simple (yystos) [YYDEBUG]: New.
15601 (yyparse) [YYDEBUG]: Display the symbols which are popped during
15602 error recovery.
15603 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
15604
15605 2002-05-25 Akim Demaille <akim@epita.fr>
15606
15607 * doc/bison.texinfo (Debugging): Split into...
15608 (Tracing): this new section, its former contents, and...
15609 (Understanding): this new section.
15610 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
15611 by...
15612 (report_flag): this.
15613 Adjust all dependencies.
15614 (report_args, report_types, report_argmatch): New.
15615 (usage, getargs): Report/support -r, --report.
15616 * src/options.h
15617 (struct option_table_struct): Rename as..,
15618 (struct option_table_s): this.
15619 Rename the `set_flag' member to `flag' to match with getopt_long's
15620 struct.
15621 * src/options.c (option_table): Split verbose into an entry for
15622 %verbose, and another for --verbose.
15623 Support --report/-r, so remove -r from the obsolete --raw.
15624 * src/print.c: Attach full item sets and lookaheads reports to
15625 report_flag instead of trace_flag.
15626 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
15627
15628 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15629 and Paul Eggert <eggert@twinsun.com>
15630
15631 * data/bison.simple (yyparse): Correct error handling to conform to
15632 POSIX and yacc. Specifically, after syntax error is discovered,
15633 do not reduce further before shifting the error token.
15634 Clean up the code a bit by removing the labels yyerrdefault,
15635 yyerrhandle, yyerrpop.
15636 * NEWS: Document the above.
15637
15638 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15639
15640 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
15641 type; it isn't always big enough, since it doesn't necessarily
15642 include non-terminals.
15643 (yytranslate): Expand definition of yy_token_number_type, so that
15644 the latter can be removed.
15645 (yy_token_number_type): Remove, only one use.
15646 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
15647 don't use TokenNumberType as element type.
15648
15649 * tests/regression.at: Modify expected output to agree with change
15650 to yyr1 and yytranslate.
15651
15652 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
15653
15654 * src/reader.c (parse_action): Use copy_character instead of
15655 obstack_1grow.
15656
15657 2002-05-13 Akim Demaille <akim@epita.fr>
15658
15659 * tests/regression.at (Token definitions): Prototype yylex and
15660 yyerror.
15661
15662 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15663
15664 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
15665 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
15666 32-bit arithmetic.
15667 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
15668
15669 2002-05-07 Akim Demaille <akim@epita.fr>
15670
15671 * tests/synclines.at: Be sure to prototype yylex and yyerror to
15672 avoid GCC warnings.
15673
15674 2002-05-07 Akim Demaille <akim@epita.fr>
15675
15676 Kill GCC warnings.
15677
15678 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
15679 over the RHS of each rule.
15680 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
15681 * src/state.h (state_t): Member `nitems' is unsigned short.
15682 * src/LR0.c (get_state): Adjust.
15683 * src/reader.c (packgram): Likewise.
15684 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
15685 `Type'.
15686 (muscle_insert_int_table): Remove, unused.
15687 (prepare_rules): Remove `max'.
15688
15689 2002-05-06 Akim Demaille <akim@epita.fr>
15690
15691 * src/closure.c (print_firsts): Display of the symbol tags.
15692 (bitmatrix_print): Move to...
15693 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
15694 here.
15695 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
15696
15697 2002-05-06 Akim Demaille <akim@epita.fr>
15698
15699 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
15700 hash_do_for_each.
15701
15702 2002-05-06 Akim Demaille <akim@epita.fr>
15703
15704 * src/LR0.c (new_state, get_state): Instead of using the global
15705 `kernel_size' and `kernel_base', have two new arguments:
15706 `core_size' and `core'.
15707 Adjust callers.
15708
15709 2002-05-06 Akim Demaille <akim@epita.fr>
15710
15711 * src/reader.c (packgram): No longer end `ritem' with a 0
15712 sentinel: it is not used.
15713
15714 2002-05-05 Akim Demaille <akim@epita.fr>
15715
15716 New experimental feature: display the lookaheads in the report and
15717 graph.
15718
15719 * src/print (print_core): When --trace-flag, display the rules
15720 lookaheads.
15721 * src/print_graph.c (print_core): Likewise.
15722 Swap the arguments.
15723 Adjust caller.
15724
15725 2002-05-05 Akim Demaille <akim@epita.fr>
15726
15727 * tests/torture.at (Many lookaheads): New test.
15728
15729 2002-05-05 Akim Demaille <akim@epita.fr>
15730
15731 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
15732 (GENERATE_MUSCLE_INSERT_TABLE): this.
15733 (output_int_table, output_unsigned_int_table, output_short_table)
15734 (output_token_number_table, output_item_number_table): Replace with...
15735 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
15736 (muscle_insert_short_table, muscle_insert_token_number_table)
15737 (muscle_insert_item_number_table): these.
15738 Adjust all callers.
15739 (prepare_tokens): Don't free `translations', since...
15740 * src/reader.h, src/reader.c (grammar_free): do it.
15741 Move to...
15742 * src/gram.h, src/gram.c (grammar_free): here.
15743 * data/bison.simple, data/bison.c++: b4_token_number_max is now
15744 b4_translate_max.
15745
15746 2002-05-05 Akim Demaille <akim@epita.fr>
15747
15748 * src/output.c (output_unsigned_int_table): New.
15749 (prepare_rules): `i' is unsigned.
15750 `prhs', `rline', `r2' are unsigned int.
15751 Rename muscle `rhs_number_max' as `rhs_max'.
15752 Output muscles `prhs_max', `rline_max', and `r2_max'.
15753 Free rline and r1.
15754 * data/bison.simple, data/bison.c++: Adjust to use these muscles
15755 to compute types instead of constant types.
15756 * tests/regression.at (Web2c Actions): Adjust.
15757
15758 2002-05-04 Akim Demaille <akim@epita.fr>
15759
15760 * src/symtab.h (SALIAS, SUNDEF): Rename as...
15761 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
15762 Adjust dependencies.
15763 * src/output.c (token_definitions_output): Be sure not to output a
15764 `#define 'a'' when fed with `%token 'a' "a"'.
15765 * tests/regression.at (Token definitions): New.
15766
15767 2002-05-03 Paul Eggert <eggert@twinsun.com>
15768
15769 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
15770 for K&R C.
15771
15772 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
15773
15774 * Makefile.am (SUBDIRS): Remove intl.
15775 (EXTRA_DIST): Add config/config.rpath.
15776
15777 2002-05-03 Akim Demaille <akim@epita.fr>
15778
15779 * data/bison.simple (m4_if): Don't output empty enums.
15780 And actually, output valid enum definitions :(.
15781
15782 2002-05-03 Akim Demaille <akim@epita.fr>
15783
15784 * configure.bat: Remove, completely obsolete.
15785 * Makefile.am (EXTRA_DIST): Adjust.
15786 Don't distribute config.rpath...
15787 * config/Makefile.am (EXTRA_DIST): Do it.
15788
15789 2002-05-03 Akim Demaille <akim@epita.fr>
15790
15791 * configure.in (GETTEXT_VERSION): New.
15792 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
15793
15794 2002-05-03 Akim Demaille <akim@epita.fr>
15795
15796 * data/bison.simple (b4_token_enum): New.
15797 (b4_token_defines): Use it to output tokens both as #define and
15798 enums.
15799 Suggested by Paul Eggert.
15800 * src/output.c (token_definitions_output): Don't output spurious
15801 white spaces.
15802
15803 2002-05-03 Akim Demaille <akim@epita.fr>
15804
15805 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
15806
15807 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
15808
15809 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
15810 Update the stack class, give a try to deque as the default container.
15811
15812 2002-05-02 Akim Demaille <akim@epita.fr>
15813
15814 * data/bison.simple (yyparse): Do not implement @$ = @1.
15815 (YYLLOC_DEFAULT): Adjust to do it.
15816 * doc/bison.texinfo (Location Default Action): Fix.
15817
15818 2002-05-02 Akim Demaille <akim@epita.fr>
15819
15820 * src/reader.c (parse_braces): Merge into...
15821 (parse_action): this.
15822
15823 2002-05-02 Akim Demaille <akim@epita.fr>
15824
15825 * configure.in (ALL_LINGUAS): Remove.
15826 * po/LINGUAS, hr.po: New.
15827
15828 2002-05-02 Akim Demaille <akim@epita.fr>
15829
15830 Remove the so called hairy (semantic) parsers.
15831
15832 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
15833 * src/gram.h, src/gram.c (semantic_parser): Remove.
15834 (rule_t): Remove the guard and guard_line members.
15835 * src/lex.h (token_t): remove tok_guard.
15836 * src/options.c (option_table): Remove %guard and %semantic_parser
15837 support.
15838 * src/output.c, src/output.h (guards_output): Remove.
15839 (prepare): Adjust.
15840 (token_definitions_output): Don't output the `T'
15841 tokens (???).
15842 (output_skeleton): Don't output the guards.
15843 * src/files.c, src/files.c (attrsfile): Remove.
15844 * src/reader.c (symbol_list): Remove the guard and guard_line
15845 members.
15846 Adjust dependencies.
15847 (parse_guard): Remove.
15848 * data/bison.hairy: Remove.
15849 * doc/bison.texinfo (Environment Variables): Remove occurrences of
15850 BISON_HAIRY.
15851
15852 2002-05-02 Akim Demaille <akim@epita.fr>
15853
15854 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
15855 (parse_guard): Rename the formal argument `stack_offset' as
15856 `rule_length', which is more readable.
15857 Adjust callers.
15858 (copy_at, copy_dollar): Instead of outputting the hard coded
15859 values of $$, $n and so forth, output invocation to b4_lhs_value,
15860 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
15861 Note: this patch partially drops `semantic-parser' support: it
15862 always does `rule_length - n', where semantic parsers ought to
15863 always use `-n'.
15864 * data/bison.simple, data/bison.c++ (b4_lhs_value)
15865 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
15866
15867 2002-05-02 Akim Demaille <akim@epita.fr>
15868
15869 * configure.in (AC_INIT): Bump to 1.49b.
15870 (AM_INIT_AUTOMAKE): Short invocation.
15871
15872 2002-05-02 Akim Demaille <akim@epita.fr>
15873
15874 Version 1.49a.
15875
15876 2002-05-01 Akim Demaille <akim@epita.fr>
15877
15878 * src/skeleton.h: Remove.
15879
15880 2002-05-01 Akim Demaille <akim@epita.fr>
15881
15882 * src/skeleton.h: Fix the #endif.
15883 Reported by Magnus Fromreide.
15884
15885 2002-04-26 Paul Eggert <eggert@twinsun.com>
15886
15887 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
15888 Define if we define YYSTYPE and YYLTYPE, respectively.
15889 (YYCOPY): Fix [] quoting problem in the non-GCC case.
15890
15891 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
15892
15893 * src/scan-skel.l: Postprocess quadrigraphs.
15894
15895 * src/reader.c (copy_character): New function, used to output
15896 single characters while replacing `[' and `]' with quadrigraphs, to
15897 avoid troubles with M4 quotes.
15898 (copy_comment): Output characters with copy_character.
15899 (read_additionnal_code): Likewise.
15900 (copy_string2): Likewise.
15901 (copy_definition): Likewise.
15902
15903 * tests/calc.at: Exercise M4 quoting.
15904
15905 2002-04-25 Akim Demaille <akim@epita.fr>
15906
15907 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
15908 between `!' and the command.
15909 Reported by Paul Eggert.
15910
15911 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
15912
15913 * tests/calc.at: Exercise prologue splitting.
15914
15915 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
15916 `b4_post_prologue' instead of `b4_prologue'.
15917
15918 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
15919 muscles.
15920 (output): Free pre_prologue_obstack and post_prologue_obstack.
15921 * src/files.h, src/files.c (attrs_obstack): Remove.
15922 (pre_prologue_obstack, post_prologue_obstack): New.
15923 * src/reader.c (copy_definition): Add a parameter to specify the
15924 obstack to fill, instead of using attrs_obstack unconditionally.
15925 (read_declarations): Pass pre_prologue_obstack to copy_definition if
15926 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
15927
15928 2002-04-23 Paul Eggert <eggert@twinsun.com>
15929
15930 * data/bison.simple: Remove unnecessary commentary and white
15931 space differences from 1_29-branch.
15932 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
15933
15934 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
15935 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
15936 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
15937 constructors or destructors.
15938
15939 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
15940
15941 2002-04-23 Akim Demaille <akim@epita.fr>
15942
15943 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
15944 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
15945 location with columns.
15946 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
15947 All reported by Paul Eggert.
15948
15949 2002-04-22 Akim Demaille <akim@epita.fr>
15950
15951 * src/reduce.c (dump_grammar): Move to...
15952 * src/gram.h, src/gram.c (grammar_dump): here.
15953 Be sure to separate long item numbers.
15954 Don't read the members of a rule's prec if its nil.
15955
15956 2002-04-22 Akim Demaille <akim@epita.fr>
15957
15958 * src/output.c (table_size, table_grow): New.
15959 (MAXTABLE): Remove, replace uses with table_size.
15960 (pack_vector): Instead of dying when the table is too big, grow it.
15961
15962 2002-04-22 Akim Demaille <akim@epita.fr>
15963
15964 * data/bison.simple (yyr1): Its type is that of a token number.
15965 * data/bison.c++ (r1_): Likewise.
15966 * tests/regression.at (Web2c Actions): Adjust.
15967
15968 2002-04-22 Akim Demaille <akim@epita.fr>
15969
15970 * src/reader.c (token_translations_init): 256 is now the default
15971 value for the error token, i.e., it will be assigned another
15972 number if the user assigned 256 to one of her tokens.
15973 (reader): Don't force 256 to error.
15974 * doc/bison.texinfo (Symbols): Adjust.
15975 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
15976 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
15977 etc. instead of 10, 20, 30 (which was used to `jump' over error
15978 (256) and undefined (2)).
15979
15980 2002-04-22 Akim Demaille <akim@epita.fr>
15981
15982 Propagate more token_number_t.
15983
15984 * src/gram.h (token_number_as_item_number)
15985 (item_number_as_token_number): New.
15986 * src/output.c (GENERATE_OUTPUT_TABLE): New.
15987 Use it to create output_item_number_table and
15988 output_token_number_table.
15989 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15990 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
15991 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
15992 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
15993
15994 2002-04-22 Akim Demaille <akim@epita.fr>
15995
15996 * src/output.h, src/output.c (get_lines_number): Remove.
15997
15998 2002-04-19 Akim Demaille <akim@epita.fr>
15999
16000 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
16001 as Lex/Flex'.
16002 (Debugging): More details about enabling the debugging features.
16003 (Table of Symbols): Describe $$, $n, @$, and @n.
16004 Suggested by Tim Josling.
16005
16006 2002-04-19 Akim Demaille <akim@epita.fr>
16007
16008 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
16009
16010 2002-04-10 Akim Demaille <akim@epita.fr>
16011
16012 * src/system.h: Rely on HAVE_LIMITS_H.
16013 Suggested by Paul Eggert.
16014
16015 2002-04-09 Akim Demaille <akim@epita.fr>
16016
16017 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
16018 full stderr, and strip it according to the bison options, instead
16019 of composing the error message from different bits.
16020 This makes it easier to check for several error messages.
16021 Adjust all the invocations.
16022 Add an invocation exercising the error token.
16023 Add an invocation demonstrating a stupid error message.
16024 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
16025 Adjust the tests.
16026 Error message are for stderr, not stdout.
16027
16028 2002-04-09 Akim Demaille <akim@epita.fr>
16029
16030 * src/gram.h, src/gram.c (error_token_number): Remove, use
16031 errtoken->number.
16032 * src/reader.c (reader): Don't specify the user token number (2)
16033 for $undefined, as it uselessly prevents using it.
16034 * src/gram.h (token_number_t): Move to...
16035 * src/symtab.h: here.
16036 (state_t.number): Is a token_number_t.
16037 * src/print.c, src/reader.c: Use undeftoken->number instead of
16038 hard coded 2.
16039 (Even though this 2 is not the same as above: the number of the
16040 undeftoken remains being 2, it is its user token number which
16041 might not be 2).
16042 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
16043 `user_token_number_max'.
16044 Output `undef_token_number'.
16045 * data/bison.simple, data/bison.c++: Use them.
16046 Be sure to map invalid yylex return values to
16047 `undef_token_number'. This saves us from gratuitous SEGV.
16048
16049 * tests/conflicts.at (Solved SR Conflicts)
16050 (Unresolved SR Conflicts): Adjust.
16051 * tests/regression.at (Web2c Actions): Adjust.
16052
16053 2002-04-08 Akim Demaille <akim@epita.fr>
16054
16055 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
16056 Adding #line.
16057 Remove the duplicate `typedefs'.
16058 (RhsNumberType): Fix the declaration and various other typos.
16059 Use __ofile__.
16060 * data/bison.simple: Use __ofile__.
16061 * src/scan-skel.l: Handle __ofile__.
16062
16063 2002-04-08 Akim Demaille <akim@epita.fr>
16064
16065 * src/gram.h (item_number_t): New, the type of item numbers in
16066 RITEM. Note that it must be able to code symbol numbers as
16067 positive number, and the negation of rule numbers as negative
16068 numbers.
16069 Adjust all dependencies (pretty many).
16070 * src/reduce.c (rule): Remove this `short *' pointer: use
16071 item_number_t.
16072 * src/system.h (MINSHORT, MAXSHORT): Remove.
16073 Include `limits.h'.
16074 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
16075 (shortcpy): Remove.
16076 (MAXTABLE): Move to...
16077 * src/output.c (MAXTABLE): here.
16078 (prepare_rules): Use output_int_table to output rhs.
16079 * data/bison.simple, data/bison.c++: Adjust.
16080 * tests/torture.at (Big triangle): Move the limit from 254 to
16081 500.
16082 * tests/regression.at (Web2c Actions): Ajust.
16083
16084 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
16085 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
16086 passes, but produces negative #line number, once fixed, GCC is
16087 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
16088 C), it passes.
16089 * src/state.h (state_h): Code input lines on ints, not shorts.
16090
16091 2002-04-08 Akim Demaille <akim@epita.fr>
16092
16093 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
16094 and then the grammar.
16095
16096 2002-04-08 Akim Demaille <akim@epita.fr>
16097
16098 * src/system.h: No longer using strndup.
16099
16100 2002-04-07 Akim Demaille <akim@epita.fr>
16101
16102 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
16103 * src/output.c (output_table_data): Return the longest number.
16104 (prepare_tokens): Output `token_number_max').
16105 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
16106 New.
16107 Use them to define yy_token_number_type/TokenNumberType.
16108 Use this type for yytranslate.
16109 * tests/torture.at (Big triangle): Push the limit from 124 to
16110 253.
16111 * tests/regression.at (Web2c Actions): Adjust.
16112
16113 2002-04-07 Akim Demaille <akim@epita.fr>
16114
16115 * tests/torture.at (Big triangle): New.
16116 (GNU AWK Grammar, GNU Cim Grammar): Move to...
16117 * tests/existing.at: here.
16118
16119 2002-04-07 Akim Demaille <akim@epita.fr>
16120
16121 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
16122 nritems.
16123 Adjust dependencies.
16124
16125 2002-04-07 Akim Demaille <akim@epita.fr>
16126
16127 * src/reader.c: Normalize increments to prefix form.
16128
16129 2002-04-07 Akim Demaille <akim@epita.fr>
16130
16131 * src/reader.c, symtab.c: Remove debugging code.
16132
16133 2002-04-07 Akim Demaille <akim@epita.fr>
16134
16135 Rename all the `bucket's as `symbol_t'.
16136
16137 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
16138 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
16139 * src/symtab.c, src/symtab.h (bucket): Rename as...
16140 (symbol_t): this.
16141 (symbol_list_new, bucket_check_defined, bucket_make_alias)
16142 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
16143 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16144 (buckets_new, buckets_free, buckets_do): Rename as...
16145 (symbol_list_new, symbol_check_defined, symbol_make_alias)
16146 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16147 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
16148 (symbols_new, symbols_free, symbols_do): these.
16149
16150 2002-04-07 Akim Demaille <akim@epita.fr>
16151
16152 Use lib/hash for the symbol table.
16153
16154 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
16155 EOF.
16156 * src/lex.c (lex): Set the `number' member of new terminals.
16157 * src/reader.c (bucket_check_defined, bucket_make_alias)
16158 (bucket_check_alias_consistence, bucket_translation): New.
16159 (reader, grammar_free, readgram, token_translations_init)
16160 (packsymbols): Adjust.
16161 (reader): Number the predefined tokens.
16162 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
16163 for predefined tokens.
16164 * src/symtab.h (bucket): Remove all the hash table related
16165 members.
16166 * src/symtab.c (symtab): Replace by...
16167 (bucket_table): this.
16168 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16169 (buckets_new, buckets_do): New.
16170
16171 2002-04-07 Akim Demaille <akim@epita.fr>
16172
16173 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
16174 (start_symbol, max_user_token_number, semantic_parser)
16175 (error_token_number): Initialize.
16176 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
16177 Initialize.
16178 (reader): Don't.
16179 (errtoken, eoftoken, undeftoken, axiom): Extern.
16180
16181 2002-04-07 Akim Demaille <akim@epita.fr>
16182
16183 * src/gram.h (rule_s): prec and precsym are now pointers
16184 to the bucket giving the priority/associativity.
16185 Member `associativity' removed: useless.
16186 * src/reduce.c, src/conflicts.c: Adjust.
16187
16188 2002-04-07 Akim Demaille <akim@epita.fr>
16189
16190 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
16191 Properly escape the symbols' TAG when outputting them.
16192
16193 2002-04-07 Akim Demaille <akim@epita.fr>
16194
16195 * src/lalr.h (LA): Is a bitsetv, not bitset*.
16196
16197 2002-04-07 Akim Demaille <akim@epita.fr>
16198
16199 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
16200 (LArule): this, which is an array to rule_t*.
16201 * src/print.c, src/conflicts.c: Adjust.
16202
16203 2002-04-07 Akim Demaille <akim@epita.fr>
16204
16205 * src/gram.h (rule_t): Rename `number' as `user_number'.
16206 `number' is a new member.
16207 Adjust dependencies.
16208 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
16209
16210 2002-04-07 Akim Demaille <akim@epita.fr>
16211
16212 As a result of the previous patch, it is no longer needed
16213 to reorder ritem itself.
16214
16215 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
16216
16217 2002-04-07 Akim Demaille <akim@epita.fr>
16218
16219 Be sure never to walk through RITEMS, but use only data related to
16220 the rules themselves. RITEMS should be banished.
16221
16222 * src/output.c (output_token_translations): Rename as...
16223 (prepare_tokens): this.
16224 In addition to `translate', prepare the muscles `tname' and
16225 `toknum', which were handled by...
16226 (output_rule_data): this.
16227 Remove, and move the remainder of its outputs into...
16228 (prepare_rules): this new routines, which also merges content from
16229 (output_gram): this.
16230 (prepare_rules): Be sure never to walk through RITEMS.
16231 (output_stos): Rename as...
16232 (prepare_stos): this.
16233 (output): Always invoke prepare_states, after all, just don't use it
16234 in the output if you don't need it.
16235
16236 2002-04-07 Akim Demaille <akim@epita.fr>
16237
16238 * src/LR0.c (new_state): Display `nstates' as the name of the
16239 newly created state.
16240 Adjust to initialize first_state and last_state if needed.
16241 Be sure to distinguish the initial from the final state.
16242 (new_states): Create the itemset of the initial state, and use
16243 new_state.
16244 * src/closure.c (closure): Now that the initial state has its
16245 items properly set, there is no need for a special case when
16246 creating `ruleset'.
16247
16248 As a result, now the rule 0, reducing to $axiom, is visible in the
16249 outputs. Adjust the test suite.
16250
16251 * tests/conflicts.at (Solved SR Conflicts)
16252 (Unresolved SR Conflicts): Adjust.
16253 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
16254 * tests/conflicts.at (S/R in initial): New.
16255
16256 2002-04-07 Akim Demaille <akim@epita.fr>
16257
16258 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
16259 the RHS of the rules.
16260 * src/output.c (output_gram): Likewise.
16261
16262 2002-04-07 Akim Demaille <akim@epita.fr>
16263
16264 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
16265 bucket.
16266 Adjust all dependencies.
16267 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
16268 `number' of the buckets too.
16269 * src/gram.h: Include `symtab.h'.
16270 (associativity): Move to...
16271 * src/symtab.h: here.
16272 No longer include `gram.h'.
16273
16274 2002-04-07 Akim Demaille <akim@epita.fr>
16275
16276 * src/gram.h, src/gram.c (rules_rhs_length): New.
16277 (ritem_longest_rhs): Use it.
16278 * src/gram.h (rule_t): `number' is a new member.
16279 * src/reader.c (packgram): Set it.
16280 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
16281 the end of `rules', and count them out of `nrules'.
16282 (reduce_output, dump_grammar): Adjust.
16283 * src/print.c (print_grammar): It is no longer needed to check for
16284 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
16285 * tests/reduce.at (Reduced Automaton): New test.
16286
16287 2002-04-07 Akim Demaille <akim@epita.fr>
16288
16289 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
16290 lacking `+ 1' to nrules, Bison reported as useless a token if it
16291 was used solely to set the precedence of the last rule...
16292
16293 2002-04-07 Akim Demaille <akim@epita.fr>
16294
16295 * data/bison.c++, data/bison.simple: Don't output the current file
16296 name in #line, to avoid useless diffs between two identical
16297 outputs under different names.
16298
16299 2002-04-07 Akim Demaille <akim@epita.fr>
16300
16301 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
16302 Normalize loops to using `< nrules + 1', not `<= nrules'.
16303
16304 2002-04-07 Akim Demaille <akim@epita.fr>
16305
16306 * TODO: Update.
16307
16308 2002-04-07 Akim Demaille <akim@epita.fr>
16309
16310 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
16311 bucket.value as bucket.number.
16312
16313 2002-04-07 Akim Demaille <akim@epita.fr>
16314
16315 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
16316 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16317 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
16318 RHS, instead of being an index in RITEMS.
16319
16320 2002-04-04 Paul Eggert <eggert@twinsun.com>
16321
16322 * doc/bison.texinfo: Update copyright date.
16323 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
16324 (Symbols): Warn about running Bison in one character set,
16325 but compiling and/or running in an incompatible one.
16326 Warn about character code 256, too.
16327
16328 2002-04-03 Paul Eggert <eggert@twinsun.com>
16329
16330 * src/bison.data (YYSTACK_ALLOC): Depend on whether
16331 YYERROR_VERBOSE is nonzero, not whether it is defined.
16332
16333 Merge changes from bison-1_29-branch.
16334
16335 2002-03-20 Paul Eggert <eggert@twinsun.com>
16336
16337 Merge fixes from Debian bison_1.34-1.diff.
16338
16339 * configure.in (AC_PREREQ): 2.53.
16340
16341 2002-03-20 Akim Demaille <akim@epita.fr>
16342
16343 * src/conflicts.c (log_resolution): Argument `resolution' is const.
16344
16345 2002-03-19 Paul Eggert <eggert@twinsun.com>
16346
16347 * src/bison.simple (YYCOPY): New macro.
16348 (YYSTACK_RELOCATE): Use it.
16349 Remove Type arg; no longer needed. All callers changed.
16350 (yymemcpy): Remove; no longer needed.
16351
16352 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
16353 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16354
16355 2002-03-19 Akim Demaille <akim@epita.fr>
16356
16357 Test and fix the #line outputs.
16358
16359 * tests/atlocal.at (GCC): New.
16360 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
16361 (Prologue synch line, %union synch line, Postprologue synch line)
16362 (Action synch line, Epilogue synch line): New tests.
16363 * src/reader.c (parse_union_decl): Define the muscle stype_line.
16364 * data/bison.simple, data/bison.c++: Use it.
16365
16366 2002-03-19 Akim Demaille <akim@epita.fr>
16367
16368 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
16369 (Solved SR Conflicts, %expect not enough, %expect right)
16370 (%expect too much): Move to...
16371 * tests/conflicts.at: this new file.
16372
16373 2002-03-19 Akim Demaille <akim@epita.fr>
16374
16375 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16376 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
16377 that we can move to enums for instance.
16378 * src/output.c (token_definitions_output): Output a list of
16379 `token-name, token-number' instead of the #define.
16380 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
16381
16382 2002-03-14 Akim Demaille <akim@epita.fr>
16383
16384 Use Gettext 0.11.1.
16385
16386 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
16387
16388 * data/bison.c++: Make the user able to add members to the generated
16389 parser by subclassing.
16390
16391 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
16392
16393 * src/reader.c (read_additionnal_code): `c' should be an integer, not
16394 a character.
16395 Reported by Nicolas Tisserand and Nicolas Burrus.
16396
16397 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
16398
16399 * src/reader.c: Warn about lacking semi-colons, do not complain.
16400
16401 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
16402
16403 * data/bison.c++: Remove a debug line.
16404
16405 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
16406
16407 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
16408 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
16409 provide a default implementation.
16410
16411 2002-03-04 Akim Demaille <akim@epita.fr>
16412
16413 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
16414 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
16415 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
16416 * tests/semantic.at (Parsing Guards): Similarly.
16417 * src/reader.at (readgram): Complain if the last rule is not ended
16418 with a semi-colon.
16419
16420 2002-03-04 Akim Demaille <akim@epita.fr>
16421
16422 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
16423 * src/closure.c: here.
16424 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
16425 RTC.
16426 * src/warshall.h, src/warshall.c: Remove.
16427 * tests/sets.at (Broken Closure): Adjust.
16428
16429 2002-03-04 Akim Demaille <akim@epita.fr>
16430
16431 * src/output.c (output_skeleton): tempdir is const.
16432 bytes_read is unused.
16433
16434 2002-03-04 Akim Demaille <akim@epita.fr>
16435
16436 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16437 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
16438 Update.
16439 From Michael Hayes.
16440
16441 2002-03-04 Akim Demaille <akim@epita.fr>
16442
16443 * src/closure.c (closure): `r' is unused.
16444
16445 2002-03-04 Akim Demaille <akim@epita.fr>
16446
16447 * tests/sets.at (Broken Closure): Add the ending `;'.
16448 * src/reader.at (readgram): Complain if a rule is not ended with a
16449 semi-colon.
16450
16451 2002-03-04 Akim Demaille <akim@epita.fr>
16452
16453 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
16454 (count_sr_conflicts): Use bitset_count.
16455 * src/reduce.c (inaccessable_symbols): Ditto.
16456 (bits_size): Remove.
16457 * src/warshall.h, src/warshall.c: Convert to bitsetv.
16458
16459 2002-03-04 Akim Demaille <akim@epita.fr>
16460
16461 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
16462 * src/reduce.c: Remove the `bitset_zero's following the
16463 `bitset_create's, as now it is performed by the latter.
16464
16465 2002-03-04 Akim Demaille <akim@epita.fr>
16466
16467 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
16468 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
16469 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
16470 latest sources from Michael.
16471
16472 2002-03-04 Akim Demaille <akim@epita.fr>
16473
16474 * src/output.c (output): Don't free the grammar.
16475 * src/reader.c (grammar_free): New.
16476 * src/main.c (main): Call it and don't free symtab here.
16477
16478 2002-03-04 Akim Demaille <akim@epita.fr>
16479
16480 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
16481 before returning.
16482 Reported by Benoit Perrot.
16483
16484 2002-03-04 Akim Demaille <akim@epita.fr>
16485
16486 Use bitset operations when possible, not loops over bits.
16487
16488 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
16489 bitset_or.
16490 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
16491 * src/reduce.c (useless_nonterminals): Formatting changes.
16492 * src/warshall.c (TC): Use bitset_or.
16493
16494 2002-03-04 Akim Demaille <akim@epita.fr>
16495
16496 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
16497 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
16498 Ditto.
16499
16500 2002-03-04 Akim Demaille <akim@epita.fr>
16501
16502 * src/lalr.c (F): Now a bitset*.
16503 Adjust all dependencies.
16504
16505 2002-03-04 Akim Demaille <akim@epita.fr>
16506
16507 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
16508 Adjust all dependencies.
16509
16510 2002-03-04 Akim Demaille <akim@epita.fr>
16511
16512 * src/L0.c, src/LR0.h (nstates): Be size_t.
16513 Adjust comparisons (signed vs unsigned).
16514 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
16515 bitset*.
16516 Adjust all dependencies.
16517
16518 2002-03-04 Akim Demaille <akim@epita.fr>
16519
16520 * src/closure.c (firsts): Now, also a bitset.
16521 Adjust all dependencies.
16522 (varsetsize): Remove, now unused.
16523 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
16524
16525 2002-03-04 Akim Demaille <akim@epita.fr>
16526
16527 * src/print.c: Convert to use bitset.h, not hand coded iterations
16528 over ints.
16529
16530 2002-03-04 Akim Demaille <akim@epita.fr>
16531
16532 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
16533
16534 2002-03-04 Akim Demaille <akim@epita.fr>
16535
16536 * src/closure.c (ruleset): Be a bitset.
16537 (rulesetsize): Remove.
16538
16539 2002-03-04 Akim Demaille <akim@epita.fr>
16540
16541 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16542 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
16543 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
16544 * src/closure.c (fderives): Be an array of bitsets.
16545
16546 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
16547
16548 * data/bison.c++: Merge the two generated headers. Insert a copyright
16549 notice in each output file.
16550
16551 2002-02-28 Akim Demaille <akim@epita.fr>
16552
16553 * data/bison.c++: Copy the prologue of bison.simple to fetch
16554 useful M4 definitions, such as b4_header_guard.
16555
16556 2002-02-25 Akim Demaille <akim@epita.fr>
16557
16558 * src/getargs.c (version): Give the name of the authors, and use a
16559 translator friendly scheme for the bgr
16560 copyright notice.
16561
16562 2002-02-25 Akim Demaille <akim@epita.fr>
16563
16564 * src/output.c (header_output): Remove, now handled completely via
16565 M4.
16566
16567 2002-02-25 Akim Demaille <akim@epita.fr>
16568
16569 * m4/m4.m4: New, from CVS Autoconf.
16570 * configure.in: Invoke it.
16571 * src/output.c (output_skeleton): Use its result instead of the
16572 hard coded name.
16573
16574 2002-02-25 Akim Demaille <akim@epita.fr>
16575
16576 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
16577 Fileutils 4.1.5.
16578 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
16579 * src/output.c (output_skeleton): Use mkstemp to create a real
16580 temporary file.
16581 Move the filling of `skeleton' and its muscle to...
16582 (prepare): here.
16583 (output): Move the definition of the prologue muscle to...
16584 (prepare): here.
16585 * src/system.h (DEFAULT_TMPDIR): New.
16586
16587 2002-02-14 Paul Eggert <eggert@twinsun.com>
16588
16589 Remove the support for C++ namespace cleanliness; it was
16590 causing more problems than it was curing, since it didn't work
16591 properly on some nonstandard C++ compilers. This can wait
16592 for a proper C++ parser.
16593
16594 * NEWS: Document this.
16595 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
16596 of C++, as it's treated like C now.
16597 * src/bison.simple (YYSTD): Remove.
16598 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
16599 Treat C++ just like Standard C instead of trying to support
16600 namespace cleanliness.
16601
16602 2002-02-14 Akim Demaille <akim@epita.fr>
16603
16604 * tests/regression.at (else): Adjust to Andreas' change.
16605
16606 2002-02-14 Akim Demaille <akim@epita.fr>
16607
16608 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
16609
16610 2002-02-13 Andreas Schwab <schwab@suse.de>
16611
16612 * src/output.c (output_rule_data): Don't output NULL, it might
16613 not be defined yet.
16614
16615 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
16616
16617 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
16618 (Copyright notice): Update.
16619
16620 2002-02-11 Akim Demaille <akim@epita.fr>
16621
16622 * tests/regression.at (%nonassoc and eof): Don't include
16623 nonportable headers.
16624
16625 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
16626
16627 * data/bison.c++: Correct error recovery. Make the user able to
16628 initialize the starting location.
16629
16630 2002-02-07 Akim Demaille <akim@epita.fr>
16631
16632 * tests/input.at: New.
16633
16634 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16635
16636 * data/bison.c++: Replace some direct m4 expansions by constants. Be
16637 more consistent when naming methods and variables. Put preprocessor
16638 directives around tables only needed for debugging.
16639
16640 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16641
16642 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
16643 C++ parsers.
16644 (yy::b4_name::parse): Use print_.
16645
16646 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16647
16648 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
16649
16650 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16651
16652 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
16653 C++ parsers.
16654 (yy::b4_name::parse): Build verbose error messages, and use error_.
16655
16656 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
16657
16658 * data/bison.c++: Fix m4 quoting in comments.
16659
16660 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
16661
16662 * data/bison.c++: Adjust the parser code. Fix some muscles that were
16663 not expanded by m4.
16664
16665 2002-02-05 Akim Demaille <akim@epita.fr>
16666
16667 * data/bison.c++: Adjust to the M4 back end.
16668 More is certainly needed.
16669
16670 2002-02-05 Akim Demaille <akim@epita.fr>
16671
16672 Give a try to M4 as a back end.
16673
16674 * lib/readpipe.c: New, from wdiff.
16675 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
16676 BISON_HAIRY.
16677 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
16678 specific values. Now it is m4 that performs the lookup.
16679 * src/parse-skel.y: Remove.
16680 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
16681 * src/output.c (actions_output, guards_output)
16682 (token_definitions_output): No longer keeps track of the output
16683 line number, hence remove the second argument.
16684 (guards_output): Check against the guard member of a rule, not the
16685 action member.
16686 Adjust callers.
16687 (output_skeleton): Don't look for the skeleton location, let m4 do
16688 that.
16689 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
16690 file will be used.
16691 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
16692 (prepare): Given that for the time being changesyntax is not
16693 usable in M4, rename the muscles using `-' to `_'.
16694 Define `defines_flag', `output_parser_name' and `output_header_name'.
16695 * src/output.h (actions_output, guards_output)
16696 (token_definitions_output): Adjust prototypes.
16697 * src/scan-skel.l: Instead of scanning the skeletons, it now
16698 processes the output of m4: `__oline__' and `#output'.
16699 * data/bison.simple: Adjust to be used by M4(sugar).
16700 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
16701 to date.
16702 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
16703 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
16704 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
16705 shamelessly stolen from CVS Autoconf.
16706
16707 2002-02-05 Akim Demaille <akim@epita.fr>
16708
16709 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
16710 * configure.in: Check for the declarations of free and malloc.
16711 * src/muscle_tab.c: Adjust.
16712
16713 2002-02-05 Akim Demaille <akim@epita.fr>
16714
16715 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
16716 which have no values.
16717
16718 2002-02-05 Akim Demaille <akim@epita.fr>
16719
16720 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
16721 * data/: here.
16722
16723 2002-01-29 Paul Eggert <eggert@twinsun.com>
16724
16725 * src/bison.simple (YYSIZE_T): Do not define merely because
16726 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
16727 On some platforms, <alloca.h> does not declare YYSTD (size_t).
16728
16729 2002-01-27 Akim Demaille <akim@epita.fr>
16730
16731 Fix `%nonassoc and eof'.
16732
16733 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
16734 which were not properly copied! Replace
16735 memcpy (res->errs, src->errs, src->nerrs);
16736 with
16737 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
16738 !!!
16739 * tests/regression.at (%nonassoc and eof): Adjust to newest
16740 Autotest: `.' is not in the PATH.
16741
16742 2002-01-27 Akim Demaille <akim@epita.fr>
16743
16744 * tests/sets.at (AT_EXTRACT_SETS): New.
16745 (Nullable): Use it.
16746 (Firsts): New.
16747
16748 2002-01-26 Akim Demaille <akim@epita.fr>
16749
16750 * tests/actions.at, tests/calc.at, tests/headers.at,
16751 * tests/torture.at: Adjust to the newest Autotest which no longer
16752 forces `.' in the PATH.
16753
16754 2002-01-25 Akim Demaille <akim@epita.fr>
16755
16756 * tests/regression.at (%nonassoc and eof): New.
16757 Suggested by Robert Anisko.
16758
16759 2002-01-24 Akim Demaille <akim@epita.fr>
16760
16761 Bison dumps core when trying to complain about broken input files.
16762 Reported by Cris van Pelt.
16763
16764 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
16765 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
16766 into...
16767 (Invalid inputs): Strengthen: exercise parse_percent_token.
16768
16769 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
16770
16771 * src/Makefile.am: Add bison.c++.
16772 * src/bison.c++: New skeleton.
16773
16774 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
16775
16776 * po/it.po: New.
16777
16778 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
16779
16780 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
16781
16782 2002-01-20 Marc Autret <marc@gnu.org>
16783
16784 * src/files.c (compute_output_file_names): Fix
16785
16786 2002-01-20 Marc Autret <marc@gnu.org>
16787
16788 * tests/output.at: New test.
16789 * src/files.c (compute_base_names): Don't map extensions when
16790 the YACC flag is set, use defaults.
16791 Reported by Evgeny Stambulchik.
16792
16793 2002-01-20 Marc Autret <marc@gnu.org>
16794
16795 * src/system.h: Need to define __attribute__ away for non-GCC
16796 compilers as well (i.e., the vendor C compiler).
16797 Suggested by Albert Chin-A-Young.
16798
16799 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
16800
16801 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
16802 canonical definition.
16803 * src/system.h: Use the canonical definition for PARAMS (avoids
16804 a conflict with the macro from lib/hash.h).
16805
16806 2002-01-11 Akim Demaille <akim@epita.fr>
16807
16808 * configure.in: Use AC_FUNC_STRNLEN.
16809 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
16810
16811 2002-01-09 Akim Demaille <akim@epita.fr>
16812
16813 * src/files.c, src/files.h (output_infix): New.
16814 (tab_extension): Remove.
16815 (compute_base_names): Compute the former, drop the latter.
16816 * src/output.c (prepare): Insert the muscles `output-infix', and
16817 `output-suffix'.
16818 * src/parse-skel.y (string, string.1): New.
16819 (section.header): Use it.
16820 (section.yacc): Remove.
16821 (prefix): Remove too.
16822 * src/scan-skel.l: Adjust.
16823 * src/bison.simple, src/bison.hairy: Adjust.
16824
16825 2002-01-09 Akim Demaille <akim@epita.fr>
16826
16827 * configure.in (WERROR_CFLAGS): Compute it.
16828 * src/Makefile.am (CFLAGS): Pass it.
16829 * tests/atlocal.in (CFLAGS): Idem.
16830 * src/files.c: Fix a few warnings.
16831 (get_extension_index): Remove, unused.
16832
16833 2002-01-08 Akim Demaille <akim@epita.fr>
16834
16835 * src/getargs.c (AS_FILE_NAME): New.
16836 (getargs): Use it to convert DOSish file names.
16837 * src/files.c (base_name): Rename as full_base_name to avoid
16838 clashes with `base_name ()'.
16839 (filename_split): New.
16840 (compute_base_names): N-th rewrite, using filename_split.
16841
16842 2002-01-08 Akim Demaille <akim@epita.fr>
16843
16844 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
16845 New, stolen from the Fileutils 4.1.
16846 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16847 * configure.in: Check for the presence of memrchr, and of its
16848 prototype.
16849
16850 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
16851
16852 * lib/hash.h (__P): Added definition for this macro.
16853 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
16854 BUILT_SOURCES, to ensure they are generated first.
16855 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
16856 %error-verbose to allow bootstrapping with bison 1.30x.
16857
16858 2002-01-06 Akim Demaille <akim@epita.fr>
16859
16860 * src/reader.c (parse_braces): Don't fetch the next char, the
16861 convention is to fetch on entry.
16862 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
16863 'switch' without a following semicolon.
16864 * tests/regression.at (braces parsing): New.
16865
16866 2002-01-06 Akim Demaille <akim@epita.fr>
16867
16868 Bison is dead wrong in its RR conflict reports.
16869
16870 * tests/torture.at (GNU Cim Grammar): New.
16871 * src/conflicts.c (count_rr_conflicts): Fix.
16872
16873 2002-01-06 Akim Demaille <akim@epita.fr>
16874
16875 Creating package.m4 from configure.ac causes too many problems.
16876
16877 * tests/Makefile.am (package.m4): Create it by hand,
16878 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
16879
16880 2002-01-06 Akim Demaille <akim@epita.fr>
16881
16882 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
16883 skeleton.h.
16884
16885 2002-01-04 Paul Eggert <eggert@twinsun.com>
16886
16887 * doc/bison.texinfo (Debugging):
16888 Remove YYSTDERR; it's no longer defined or used.
16889 Also, s/cstdio.h/cstdio/.
16890
16891 2002-01-03 Akim Demaille <akim@epita.fr>
16892
16893 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
16894
16895 2002-01-03 Akim Demaille <akim@epita.fr>
16896
16897 * src/parse-skel.y (process_skeleton): Don't bind the parser's
16898 tracing code to --trace, wait for a better --trace option, with
16899 args.
16900
16901 2002-01-03 Akim Demaille <akim@epita.fr>
16902
16903 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
16904 The ISO C++ standard is extremely clear about it: stderr is
16905 considered a macro, not a regular symbol (see table 94 `Header
16906 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
16907 Therefore std:: does not apply to it. It still does with fprintf.
16908 Also, s/cstdio.h/cstdio/.
16909
16910 2002-01-03 Akim Demaille <akim@epita.fr>
16911
16912 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
16913 for non system headers.
16914
16915 2002-01-02 Akim Demaille <akim@epita.fr>
16916
16917 Equip the skeleton chain with location tracking, runtime trace,
16918 pure parser and scanner.
16919
16920 * src/parse-skel.y: Request a pure parser, locations, and prefix
16921 renaming.
16922 (%union): Having several members with the same type does not help
16923 type mismatches, simplify.
16924 (YYPRINT, yyprint): New.
16925 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
16926 (skel_error): this.
16927 Handle locations.
16928 * src/scan-skel.l: Adjust to these changes.
16929 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
16930 (LOCATION_PRINT, skel_control_t): New.
16931
16932 2001-12-30 Akim Demaille <akim@epita.fr>
16933
16934 * src/parse-skel.y: Get rid of the shift/reduce conflict:
16935 replace `gb' with BLANKS.
16936 * src/scan-skel.l: Adjust.
16937
16938 2001-12-30 Akim Demaille <akim@epita.fr>
16939
16940 * src/system.h: We don't need nor want bcopy.
16941 Throw away MS-DOS crap: we don't need getpid.
16942 * configure.in: We don't need strndup. It was even causing
16943 problems: because Flex includes the headers *before* us,
16944 _GNU_SOURCE is not defined by config.h, and therefore strndup was
16945 not visible.
16946 * lib/xstrndup.c: New.
16947 * src/scan-skel.l: Use it.
16948 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
16949 * src/parse-skel.y: Use %directives instead of #defines.
16950
16951 2001-12-30 Akim Demaille <akim@epita.fr>
16952
16953 * src/skeleton.h: New.
16954 * src/output.c (output_parser, output_master_parser): Remove, dead
16955 code.
16956 * src/output.h (get_lines_number, actions_output, guards_output)
16957 (token_definitions_output): Prototype them.
16958 * src/parse-skel.y: Add the license notice.
16959 Include output.h and skeleton.h.
16960 (process_skeleton): Returns void, and takes a single parameter.
16961 * src/scan-skel.l: Add the license notice.
16962 Include skeleton.h.
16963 Don't use %option yylineno: it seems that then Flex imagines
16964 REJECT has been used, and therefore it won't reallocate its
16965 buffers (which makes no other sense to me than a bug). It results
16966 in warnings for `unused: yy_flex_realloc'.
16967
16968 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
16969
16970 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
16971 (MUSCLE_INSERT_PREFIX): ...to there.
16972 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
16973 (MUSCLE_INSERT_PREFIX): Move from here...
16974
16975 * src/bison.hairy: Add a section directive. Put braces around muscle
16976 names. This parser skeleton is still broken, but Bison should not
16977 choke on a bad muscle 'syntax'.
16978 * src/bison.simple: Add a section directive. Put braces around muscle
16979 names.
16980
16981 * src/files.h (strsuffix, stringappend): Add declarations.
16982 (tab_extension): Add declaration.
16983 (short_base_name): Add declaration.
16984
16985 * src/files.c (strsuffix, stringappend): No longer static. These
16986 functions are used in the skeleton parser.
16987 (tab_extension): New.
16988 (compute_base_names): Use the computations done in this function
16989 to guess if the generated parsers should have '.tab' in their
16990 names.
16991 (short_base_name): No longer static.
16992
16993 * src/output.c (output_skeleton): New.
16994 (output): Disable call to output_master_parser, and give a try to
16995 a new skeleton handling system.
16996 (guards_output, actions_output): No longer static.
16997 (token_definitions_output, get_lines_number): No longer static.
16998
16999 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
17000
17001 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
17002 parse-skel.y.
17003
17004 * src/parse-skel.y: New file.
17005 * src/scan-skel.l: New file.
17006
17007 2001-12-29 Akim Demaille <akim@epita.fr>
17008
17009 %name-prefix is broken.
17010
17011 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
17012 Adjust all dependencies.
17013 * tests/headers.at (export YYLTYPE): Strengthen this test: use
17014 %name-prefix.
17015
17016 Renaming yylval but not yylloc is not consistent. Now we do.
17017
17018 * src/bison.simple: Prefix yylloc if used.
17019 * doc/bison.texinfo (Decl Summary): Document that.
17020
17021 2001-12-29 Akim Demaille <akim@epita.fr>
17022
17023 * doc/bison.texinfo: Promote `%long-directive' over
17024 `%long_directive'.
17025 Remove all references to fixed-output-files, yacc is enough.
17026
17027 2001-12-29 Akim Demaille <akim@epita.fr>
17028
17029 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
17030 user prologue. These are defaults.
17031 * tests/actions.at (Mid-rule actions): Make sure the user can
17032 define YYDEBUG and YYERROR_VERBOSE.
17033
17034 2001-12-29 Akim Demaille <akim@epita.fr>
17035
17036 * src/output.c (header_output): Don't forget to export YYLTYPE and
17037 yylloc.
17038 * tests/headers.at (export YYLTYPE): New, make sure it does.
17039 * tests/regression.at (%union and --defines, Invalid CPP headers):
17040 Move to...
17041 * tests/headers.at: here.
17042
17043 2001-12-29 Akim Demaille <akim@epita.fr>
17044
17045 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
17046
17047 2001-12-29 Akim Demaille <akim@epita.fr>
17048
17049 * tests/actions.at (Mid-rule actions): Output on a single line
17050 instead of several.
17051
17052 2001-12-29 Akim Demaille <akim@epita.fr>
17053
17054 * doc/bison.texinfo: Formatting changes.
17055
17056 2001-12-29 Akim Demaille <akim@epita.fr>
17057
17058 Don't store the token defs in a muscle, just be ready to output it
17059 on command. Now possible via `symbols'. Fixes a memory leak.
17060
17061 * src/output.c (token_definitions_output): New.
17062 (output_parser, header_output): Use it.
17063 * src/reader.c (symbols_save): Remove.
17064
17065 2001-12-29 Akim Demaille <akim@epita.fr>
17066
17067 * src/bison.simple: Do not provide a default for YYSTYPE and
17068 YYLTYPE before the user's prologue. Otherwise it's hardly... a
17069 default.
17070
17071 2001-12-29 Akim Demaille <akim@epita.fr>
17072
17073 Mid-rule actions are simply... ignored!
17074
17075 * src/reader.c (readgram): Be sure to attach mid-rule actions to
17076 the empty-rule associated to the dummy symbol, not to the host
17077 rule.
17078 * tests/actions.at (Mid-rule actions): New.
17079
17080 2001-12-29 Akim Demaille <akim@epita.fr>
17081
17082 Memory leak.
17083
17084 * src/reader.c (reader): Free grammar.
17085
17086 2001-12-29 Akim Demaille <akim@epita.fr>
17087
17088 Memory leak.
17089
17090 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
17091 since it allocates it for each state, although only one is needed.
17092 (allocate_storage): Do it here.
17093
17094 2001-12-29 Akim Demaille <akim@epita.fr>
17095
17096 * src/options.h, src/options.c (create_long_option_table): Rename
17097 as...
17098 (long_option_table_new): this, with a clearer prototype.
17099 (percent_table): Remove, unused,
17100 * src/getargs.c (getargs): Adjust.
17101
17102 2001-12-29 Akim Demaille <akim@epita.fr>
17103
17104 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
17105 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
17106 as states.
17107
17108 2001-12-29 Akim Demaille <akim@epita.fr>
17109
17110 * src/lalr.c (build_relations): Rename `states' as `states1'.
17111 Sorry, I don't understand exactly what it is, no better name...
17112
17113 2001-12-29 Akim Demaille <akim@epita.fr>
17114
17115 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
17116 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
17117 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
17118 as rules.
17119
17120 2001-12-29 Akim Demaille <akim@epita.fr>
17121
17122 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
17123 ago.
17124
17125 2001-12-29 Akim Demaille <akim@epita.fr>
17126
17127 * src/reader.c, src/reader.h (user_toknums): Remove.
17128 Adjust all users to use symbols[i]->user_token_number.
17129
17130 2001-12-29 Akim Demaille <akim@epita.fr>
17131
17132 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
17133 Adjust all users to use symbols[i]->prec or ->assoc.
17134
17135 2001-12-29 Akim Demaille <akim@epita.fr>
17136
17137 * src/reader.c, src/reader.h (tags): Remove.
17138 Adjust all users to use symbols[i]->tag.
17139
17140 2001-12-29 Akim Demaille <akim@epita.fr>
17141
17142 * src/gram.h, src/gram.c (symbols): New, similar to state_table
17143 and rule_table.
17144 * src/reader.c (packsymbols): Fill this table.
17145 Drop sprec.
17146 * src/conflicts.c (resolve_sr_conflict): Adjust.
17147 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
17148 single table.
17149 Use symbols[i]->tag instead of tags[i].
17150
17151 2001-12-29 Akim Demaille <akim@epita.fr>
17152
17153 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
17154 In addition, put a comment in there, to replace...
17155 * tests/regression.at (%union and C comments): Remove.
17156
17157 2001-12-29 Akim Demaille <akim@epita.fr>
17158
17159 * tests/regression.at (Web2c Actions): Blindly move the actual
17160 output as expected output. The contents *seem* right to me, but I
17161 can't pretend reading perfectly parser tables... Nonetheless, all
17162 the other tests pass correctly, the table look OK, even though the
17163 presence of `$axiom' is to be noted: AFAICS it is useless (but
17164 harmless).
17165
17166 2001-12-29 Akim Demaille <akim@epita.fr>
17167
17168 * src/reader.c (readgram): Don't add the rule 0 if there were no
17169 rules read. In other words, add it _after_ having performed
17170 grammar sanity checks.
17171 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
17172
17173 2001-12-29 Akim Demaille <akim@epita.fr>
17174
17175 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
17176 visible, and some states have now a different number.
17177
17178 2001-12-29 Akim Demaille <akim@epita.fr>
17179
17180 * src/reader.c (readgram): Bind the initial rule's lineno to that
17181 of the first rule.
17182 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
17183 (Solved SR Conflicts): Adjust rule 0's line number.
17184
17185 2001-12-29 Akim Demaille <akim@epita.fr>
17186
17187 Fix the `GAWK Grammar' failure.
17188
17189 * src/LR0.c (final_state): Initialize to -1 so that we do compute
17190 the reductions of the first state which was mistakenly confused
17191 with the final state because precisely final_state was initialized
17192 to 0.
17193 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
17194 now noticed by Bison.
17195 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
17196 have a reduction on $default.
17197
17198 2001-12-29 Akim Demaille <akim@epita.fr>
17199
17200 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
17201 rule line numbers.
17202 * src/closure.c (print_closure): Likewise.
17203 * src/derives.c (print_derives): Likewise.
17204 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
17205 now.
17206
17207 2001-12-29 Akim Demaille <akim@epita.fr>
17208
17209 * src/lalr.c (lookaheads_print): New.
17210 (lalr): Call it when --trace-flag.
17211 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
17212 are dumped.
17213
17214 2001-12-29 Akim Demaille <akim@epita.fr>
17215
17216 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
17217 when walking through ritem, even via rule->rhs.
17218 * src/reduce.c (dump_grammar, useful_production, reduce_output)
17219 (useful_production, useless_nonterminals): Likewise.
17220 (reduce_grammar_tables): Likewise, plus update nritems.
17221 * src/nullable.c (set_nullable): Likewise.
17222 * src/lalr.c (build_relations): Likewise.
17223 * tests/sets.at (Nullable): Adjust.
17224 Fortunately, now, the $axiom is no longer nullable.
17225
17226 2001-12-29 Akim Demaille <akim@epita.fr>
17227
17228 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
17229 the 0-sentinel.
17230 * src/gram.c (ritem_longest_rhs): Likewise.
17231 * src/reduce.c (nonterminals_reduce): Likewise.
17232 * src/print_graph.c (print_graph): Likewise.
17233 * src/output.c (output_rule_data): Likewise.
17234 * src/nullable.c (set_nullable): Likewise.
17235
17236 2001-12-29 Akim Demaille <akim@epita.fr>
17237
17238 * src/output.c: Comment changes.
17239
17240 2001-12-27 Paul Eggert <eggert@twinsun.com>
17241
17242 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
17243 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
17244 Sparc, as they were causing more porting problems than the
17245 (minor) performance improvement was worth.
17246
17247 Also, catch up with 1.31's YYSTD.
17248
17249 2001-12-27 Akim Demaille <akim@epita.fr>
17250
17251 * src/output.c (output_gram): Rely on nritems, not the
17252 0-sentinel. See below.
17253 Use -1 as separator, not 0.
17254 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
17255 Rely on -1 as separator in yyrhs, instead of 0.
17256 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
17257 twice `Now at end of input', therefore there are two lines less to
17258 expect.
17259
17260 2001-12-27 Akim Demaille <akim@epita.fr>
17261
17262 * tests/regression.at (Unresolved SR Conflicts):
17263 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
17264 below.
17265
17266 2001-12-27 Akim Demaille <akim@epita.fr>
17267
17268 * src/LR0.c (new_state): Recognize the final state by the fact it
17269 is reached by eoftoken.
17270 (insert_start_shifting_state, insert_eof_shifting_state)
17271 (insert_accepting_state, augment_automaton): Remove, since now
17272 these states are automatically computed from the initial state.
17273 (generate_states): Adjust.
17274 * src/print.c: When reporting a rule number to the user, substract
17275 1, so that the axiom rule is rule 0, and the first user rule is 1.
17276 * src/reduce.c: Likewise.
17277 * src/print_graph.c (print_core): For the time being, just as for
17278 the report, depend upon --trace-flags to dump the full set of
17279 items.
17280 * src/reader.c (readgram): Once the grammar read, insert the rule
17281 0: `$axiom: START-SYMBOL $'.
17282 * tests/set.at: Adjust: rule 0 is now displayed, and since the
17283 number of the states has changed (the final state is no longer
17284 necessarily the last), catch up.
17285
17286 2001-12-27 Akim Demaille <akim@epita.fr>
17287
17288 Try to make the use of the eoftoken valid. Given that its value
17289 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
17290 is used instead of > 0 where appropriate, (ii), depend upon nritems
17291 instead of the 0-sentinel.
17292
17293 * src/gram.h, src/gram.c (nritems): New.
17294 Expected to be duplication of nitems, but for the time being...
17295 * src/reader.c (packgram): Assert nritems and nitems are equal.
17296 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
17297 * src/closure.c (print_closure, print_fderives): Likewise.
17298 * src/gram.c (ritem_print): Likewise.
17299 * src/print.c (print_core, print_grammar): Likewise.
17300 * src/print_graph.c: Likewise.
17301
17302 2001-12-27 Akim Demaille <akim@epita.fr>
17303
17304 * src/main.c (main): If there are complains after grammar
17305 reductions, then output the report anyway if requested, then die.
17306 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
17307 * src/reader.c (eoftoken): New.
17308 (parse_token_decl): If the token being defined has value `0', it
17309 is the eoftoken.
17310 (packsymbols): No longer hack `tags' to insert `$' by hand.
17311 Be sure to preserve the value of the eoftoken.
17312 (reader): Make sure eoftoken is defined.
17313 Initialize nsyms to 0: now eoftoken is created just like the others.
17314 * src/print.c (print_grammar): Don't special case the eof token.
17315 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
17316 lie anyway, albeit pleasant.
17317 * tests/calc.at: Exercise error messages with eoftoken.
17318 Change the grammar so that empty input is invalid.
17319 Adjust expectations.
17320 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
17321
17322 2001-12-27 Akim Demaille <akim@epita.fr>
17323
17324 * configure.in: Check the protos of strchr ans strspn.
17325 Replace strchr if needed.
17326 * src/system.h: Provide the protos of strchr, strspn and memchr if
17327 missing.
17328 * lib/strchr.c: New.
17329 * src/reader.c (symbols_save): Use strchr.
17330
17331 2001-12-27 Akim Demaille <akim@epita.fr>
17332
17333 * src/print.c, src/print_graph.c (escape): New.
17334 Use it to quote the TAGS outputs.
17335 * src/print_graph.c (print_state): Now errors are in red, and
17336 reductions in green.
17337 Prefer high to wide: output the state number on a line of its own.
17338
17339 2001-12-27 Akim Demaille <akim@epita.fr>
17340
17341 * src/state.h, src/state.c (reductions_new): New.
17342 * src/LR0.c (set_state_table): Let all the states have a
17343 `reductions', even if reduced to 0.
17344 (save_reductions): Adjust.
17345 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
17346 * src/print.c (print_reductions, print_actions): Adjust.
17347 * src/output.c (action_row): Adjust.
17348
17349 2001-12-27 Akim Demaille <akim@epita.fr>
17350
17351 * src/state.h, src/state.c (errs_new, errs_dup): New.
17352 * src/LR0.c (set_state_table): Let all the states have an errs,
17353 even if reduced to 0.
17354 * src/print.c (print_errs, print_reductions): Adjust.
17355 * src/output.c (output_actions, action_row): Adjust.
17356 * src/conflicts.c (resolve_sr_conflict): Adjust.
17357
17358 2001-12-27 Akim Demaille <akim@epita.fr>
17359
17360 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
17361
17362 2001-12-27 Akim Demaille <akim@epita.fr>
17363
17364 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
17365 * src/print.c: here.
17366 (lookaheadset, shiftset): New, used as additional storage by
17367 print_reductions.
17368 (print_results): Adjust.
17369 (print_shifts, print_gotos, print_errs): New, extracted from...
17370 (print_actions): here.
17371 * src/print_graph.c (print_actions): Remove dead code.
17372
17373 2001-12-27 Akim Demaille <akim@epita.fr>
17374
17375 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
17376 `$n' and `@n'.
17377
17378 2001-12-27 Akim Demaille <akim@epita.fr>
17379
17380 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
17381 (build_relations): Adjust.
17382
17383 2001-12-27 Akim Demaille <akim@epita.fr>
17384
17385 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
17386 duplication.
17387
17388 2001-12-27 Akim Demaille <akim@epita.fr>
17389
17390 * src/reader.c (packgram): Catch nitems overflows.
17391
17392 2001-12-27 Akim Demaille <akim@epita.fr>
17393
17394 * src/files.c, src/files.h (guard_obstack): Remove.
17395 * src/output.c (output): Adjust.
17396 * src/reader.c (parse_braces): New, factoring...
17397 (copy_action, copy_guard): these two which are renamed as...
17398 (parse_action, parse_guard): these.
17399 As a voluntary consequence, using braces around guards is now
17400 mandatory.
17401
17402 2001-12-27 Akim Demaille <akim@epita.fr>
17403
17404 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
17405 * src/reader.c (symbol_list): `guard' and `guard_line' are new
17406 members.
17407 (symbol_list_new): Adjust.
17408 (copy_action): action_line is the first line, not the last.
17409 (copy_guard): Just as for actions, store the `action' only, not
17410 the switch/case/break flesh.
17411 Don't parse the user action that might follow the guard, let...
17412 (readgram): do it, i.e., now, there can be an action after a
17413 guard.
17414 In other words the guard is just explicitly optional.
17415 (packgram): Adjust.
17416 * src/output.c (guards_output): New.
17417 (output_parser): Call it when needed.
17418 (output): Also free the guard and attrs obstacks.
17419 * src/files.c, src/files.h (obstack_save): Remove.
17420 (output_files): Remove.
17421 As a result, if one needs the former `.act' file, using an
17422 appropriate skeleton which requires actions and guards is now
17423 required.
17424 * src/main.c (main): Adjust.
17425 * tests/semantic.at: New.
17426 * tests/regression.at: Use `input.y' as input file name.
17427 Avoid 8+3 problems by requiring input.c when the test needs the
17428 parser.
17429
17430 2001-12-27 Akim Demaille <akim@epita.fr>
17431
17432 * src/reader.c (symbol_list_new): Be sure to initialize all the
17433 fields.
17434
17435 2001-12-27 Akim Demaille <akim@epita.fr>
17436
17437 All the hacks using a final pseudo state are now useless.
17438
17439 * src/LR0.c (set_state_table): state_table holds exactly nstates.
17440 * src/lalr.c (nLA): New.
17441 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
17442 instead of lookaheadsp from the pseudo state (nstate + 1).
17443
17444 2001-12-27 Akim Demaille <akim@epita.fr>
17445
17446 * src/output.c (action_row, token_actions): Use a state_t instead
17447 of a integer, and nlookaheads instead of the following state's
17448 lookaheadsp.
17449
17450 2001-12-27 Akim Demaille <akim@epita.fr>
17451
17452 * src/conflicts.c (log_resolution, flush_shift)
17453 (resolve_sr_conflict, set_conflicts, solve_conflicts)
17454 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
17455 (conflicts_print, print_reductions): Use a state_t instead of an
17456 integer when referring to a state.
17457 As much as possible, depend upon nlookaheads, instead of the
17458 `lookaheadsp' member of the following state (since lookaheads of
17459 successive states are successive, the difference between state n + 1
17460 and n served as the number of lookaheads for state n).
17461 * src/lalr.c (add_lookback_edge): Likewise.
17462 * src/print.c (print_core, print_actions, print_state)
17463 (print_results): Likewise.
17464 * src/print_graph.c (print_core, print_actions, print_state)
17465 (print_graph): Likewise.
17466 * src/conflicts.h: Adjust.
17467
17468 2001-12-27 Akim Demaille <akim@epita.fr>
17469
17470 * src/bison.hairy: Formatting/comment changes.
17471 ANSIfy.
17472 Remove `register' indications.
17473 Add plenty of `static'.
17474
17475 2001-12-27 Akim Demaille <akim@epita.fr>
17476
17477 * src/output.c (prepare): Drop the muscle `ntbase' which
17478 duplicates ntokens.
17479 * src/bison.simple: Formatting/comment changes.
17480 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
17481 is an undocumented synonym.
17482
17483 2001-12-22 Akim Demaille <akim@epita.fr>
17484
17485 * src/output.c (output_table_data): Change the prototype to use
17486 `int' for array ranges: some invocations do pass an int, not a
17487 short.
17488 Reported by Wayne Green.
17489
17490 2001-12-22 Akim Demaille <akim@epita.fr>
17491
17492 Some actions of web2c.y are improperly triggered.
17493 Reported by Mike Castle.
17494
17495 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
17496 * tests/regression.at (Web2c): Rename as...
17497 (Web2c Report): this.
17498 (Web2c Actions): New.
17499
17500 2001-12-22 Akim Demaille <akim@epita.fr>
17501
17502 Reductions in web2c.y are improperly reported.
17503 Reported by Mike Castle.
17504
17505 * src/conflicts.c (print_reductions): Fix.
17506 * tests/regression.at (Web2c): New.
17507
17508 2001-12-18 Akim Demaille <akim@epita.fr>
17509
17510 Some host fail on `assert (!"foo")', which expands to
17511 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
17512 Reported by Nelson Beebee.
17513
17514 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
17515 `#define it_succeeded 0' and `assert (it_succeeded)'.
17516
17517 2001-12-17 Marc Autret <autret_m@epita.fr>
17518
17519 * src/bison.simple: Don't hard code the skeleton line and filename.
17520 * src/output.c (output_parser): Rename 'line' as 'output_line'.
17521 New line counter 'skeleton_line' (skeleton-line muscle).
17522
17523 2001-12-17 Paul Eggert <eggert@twinsun.com>
17524
17525 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
17526 YYDEBUG must be defined to a nonzero value.
17527
17528 * src/bison.simple (yytname): Do not assume that the user defines
17529 YYDEBUG to a properly parenthesized expression.
17530
17531 2001-12-17 Akim Demaille <akim@epita.fr>
17532
17533 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
17534 nlookaheads is a new member.
17535 Adjust all users.
17536 * src/lalr.h (nlookaheads): Remove this orphan declaration.
17537 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
17538 state.
17539
17540 2001-12-17 Akim Demaille <akim@epita.fr>
17541
17542 * src/files.h, src/files.c (open_files, close_files): Remove.
17543 * src/main.c (main): Don't open/close files, nor invoke lex_free,
17544 let...
17545 * src/reader.c (reader): Do it.
17546
17547 2001-12-17 Akim Demaille <akim@epita.fr>
17548
17549 * src/conflicts.c (print_reductions): Formatting changes.
17550
17551 2001-12-17 Akim Demaille <akim@epita.fr>
17552
17553 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
17554 (flush_reduce): New.
17555 (resolve_sr_conflict): Adjust.
17556
17557 2001-12-17 Akim Demaille <akim@epita.fr>
17558
17559 * src/output.c (output_obstack): Be static and rename as...
17560 (format_obstack): this, to avoid any confusion with files.c's
17561 output_obstack.
17562 * src/reader.h (muscle_obstack): Move to...
17563 * src/output.h: here, since it's defined in output.c.
17564
17565 2001-12-17 Akim Demaille <akim@epita.fr>
17566
17567 * src/output.c (action_row, save_column, default_goto)
17568 (sort_actions, matching_state, pack_vector): Better variable
17569 locality.
17570
17571 2001-12-17 Akim Demaille <akim@epita.fr>
17572
17573 * src/output.c: Various formatting changes.
17574
17575 2001-12-17 Akim Demaille <akim@epita.fr>
17576
17577 * src/files.c (output_files): Free the output_obstack.
17578 * src/main.c (main): Call print and print_graph conditionally.
17579 * src/print.c (print): Work unconditionally.
17580 * src/print_graph.c (print_graph): Work unconditionally.
17581 * src/conflicts.c (log_resolution): Output only if verbose_flag.
17582
17583 2001-12-16 Marc Autret <autret_m@epita.fr>
17584
17585 * src/output.c (actions_output): Fix. When we use %no-lines,
17586 there is one less line per action.
17587
17588 2001-12-16 Marc Autret <autret_m@epita.fr>
17589
17590 * src/bison.simple: Remove a useless #line directive.
17591 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
17592 * src/output.c (get_lines_number): New.
17593 (output_parser): Adjust, now takes care about the lines of a
17594 output muscles.
17595 Fix line numbering.
17596 (actions_output): Computes the number of lines taken by actions.
17597 (output_master_parser): Insert new skeleton which is the name of
17598 the output parser file name.
17599
17600 2001-12-15 Marc Autret <autret_m@epita.fr>
17601
17602 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
17603
17604 2001-12-15 Marc Autret <autret_m@epita.fr>
17605
17606 * src/output.c (output_gram): Keep track of the hairy one.
17607
17608 2001-12-15 Akim Demaille <akim@epita.fr>
17609
17610 Make `make distcheck' work.
17611
17612 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
17613 system.h which uses libgettext.h.
17614
17615 2001-12-15 Akim Demaille <akim@epita.fr>
17616
17617 * src/nullable.c (set_nullable): Useless rules must be skipped,
17618 otherwise, since we range over their symbols, we might look at a
17619 nonterminal which no longer ``exists'', i.e., it is not counted in
17620 `nvars', hence we overflow our arrays.
17621
17622 2001-12-15 Akim Demaille <akim@epita.fr>
17623
17624 The header can also be produced directly, without any obstack!
17625 Yahoo!
17626
17627 * src/files.c, src/files.h (defines_obstack): Remove.
17628 (compute_header_macro): Global.
17629 (defines_obstack_save): Remove.
17630 * src/reader.c (parse_union_decl): No longer output to
17631 defines_obstack: its content can be found in the `stype' muscle
17632 anyway.
17633 (output_token_translations): Merge into...
17634 (symbols_output): this.
17635 Rename as...
17636 (symbols_save): this.
17637 (reader): Adjust.
17638 * src/output.c (header_output): New.
17639 (output): Call it.
17640
17641 2001-12-15 Akim Demaille <akim@epita.fr>
17642
17643 * src/reader.c (parse_union_decl): Instead of handling two obstack
17644 simultaneously, use one to define the `stype' muscle, and use the
17645 value of the latter to fill defines_obstack.
17646 (copy_comment): Remove.
17647 (copy_comment2): Work for a single obstack.
17648 Rename as...
17649 (copy_comment): this.
17650
17651 2001-12-15 Akim Demaille <akim@epita.fr>
17652
17653 * src/lex.c, src/lex.h (xgetc): No longer static.
17654 * src/reader.c (parse_union_decl): Revamp.
17655
17656 2001-12-15 Akim Demaille <akim@epita.fr>
17657
17658 Still making progress in separating Bison into (i) input, (ii)
17659 process, (iii) output: now we can directly output the parser file
17660 without using table_obstack at all.
17661
17662 * src/files.c, src/files.h (table_obstack): Bye bye.
17663 (parser_file_name): New.
17664 * src/files.c (compute_output_file_names): Compute it.
17665 * src/output.c (actions_output, output_parser)
17666 (output_master_parser): To a file instead of an obstack.
17667
17668 2001-12-15 Akim Demaille <akim@epita.fr>
17669
17670 Attach actions to rules, instead of pre-outputting them to
17671 actions_obstack.
17672
17673 * src/gram.h (rule_t): action and action_line are new members.
17674 * src/reader.c (symbol_list): Likewise.
17675 (copy_action): Save the actions within the rule.
17676 (packgram): Save them in rule_table.
17677 * src/output.c (actions_output): New.
17678 (output_parser): Use it on `%%actions'.
17679 (output_rule_data): Don't free rule_table.
17680 (output): Do it.
17681 (prepare): Don't save the `action' muscle.
17682 * src/bison.simple: s/%%action/%%actions/.
17683
17684 2001-12-15 Akim Demaille <akim@epita.fr>
17685
17686 * src/reader.c (copy_action): When --yacc, don't append a `;'
17687 to the user action: let it fail if lacking.
17688 Suggested by Arnold Robbins and Tom Tromey.
17689
17690 2001-12-14 Akim Demaille <akim@epita.fr>
17691
17692 * src/lex.c (literalchar): Simply return the char you decoded, non
17693 longer mess around with obstacks and int pointers.
17694 Adjust all callers.
17695
17696 2001-12-14 Akim Demaille <akim@epita.fr>
17697
17698 * src/lex.c (literalchar): Don't escape the special characters,
17699 just decode them, and keep them as char (before, eol was output as
17700 the 2 char string `\n' etc.).
17701 * src/output.c (output_rule_data): Use quotearg to output the
17702 token strings.
17703
17704 2001-12-13 Paul Eggert <eggert@twinsun.com>
17705
17706 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
17707 Do not infringe on the global user namespace when using C++.
17708 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
17709 All uses of `fprintf' and `stderr' changed.
17710
17711 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
17712
17713 2001-12-13 Akim Demaille <akim@epita.fr>
17714
17715 The computation of nullable is broken: it doesn't handle empty
17716 RHS's properly.
17717
17718 * tests/torture.at (GNU AWK Grammar): New.
17719 * tests/sets.at (Nullable): New.
17720 * src/nullable.c (set_nullable): Instead of blindly looping over
17721 `ritems', loop over the rules, and then over their rhs's.
17722
17723 Work around Autotest bugs.
17724
17725 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
17726 frame, because Autotest understand lines starting with a `+' as
17727 traces from the shell. Then, they are not processed properly.
17728 Admittedly an Autotest bug, but we don't have time to wait for
17729 Autotest to catch up.
17730 * tests/regression.at (Broken Closure): Adjust to the new table
17731 frames.
17732 Move to...
17733 * tests/sets.at: here.
17734
17735 2001-12-13 Akim Demaille <akim@epita.fr>
17736
17737 * src/closure.c (closure): Use nrules instead of playing tricks
17738 with BITS_PER_WORD.
17739
17740 2001-12-13 Akim Demaille <akim@epita.fr>
17741
17742 * src/print.c (print_actions): Output the handling of `$' as the
17743 traces do: shifting the token EOF. Before EOF was treated as a
17744 nonterminal.
17745 * tests/regression.at: Adjust some tests.
17746 * src/print_graph.c (print_core): Complete the set of items via
17747 closure. The next-to-final and final states are still unsatisfying,
17748 but that's to be addressed elsewhere.
17749 No longer output the rule numbers, but do output the state number.
17750 A single loop for the shifts + gotos is enough, but picked a
17751 distinct color for each.
17752 (print_graph): Initialize and finalize closure.
17753
17754 2001-12-13 Akim Demaille <akim@epita.fr>
17755
17756 * src/reader.c (readgram): Remove dead code, an strip useless
17757 braces.
17758 (get_type): Remove, unused.
17759
17760 2001-12-12 Akim Demaille <akim@epita.fr>
17761
17762 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
17763 on that of lib/error.c.
17764
17765 2001-12-12 Akim Demaille <akim@epita.fr>
17766
17767 Some hosts don't like `/' in includes.
17768
17769 * src/system.h: Include libgettext.h without qualifying the path.
17770 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
17771 $(top_srcdir).
17772
17773 2001-12-11 Marc Autret <autret_m@epita.fr>
17774
17775 * src/output.c (output_parser): Remove useless muscle.
17776
17777 2001-12-11 Marc Autret <autret_m@epita.fr>
17778
17779 * src/bison.simple: Remove #line just before %%epilogue. It
17780 is now handled in ...
17781 * src/reader.c (read_additionnal_code): Add the output of a
17782 #line for the epilogue.
17783
17784 2001-12-10 Marc Autret <autret_m@epita.fr>
17785
17786 * src/reader.c (copy_definition): Re-use CPP-outed code which
17787 replace precedent remove.
17788 * src/bison.simple: Remove #line before %%prologue because
17789 %%input-line is wrong at this time.
17790
17791 2001-12-10 Marc Autret <autret_m@epita.fr>
17792
17793 * src/reader.c (symbols_output): Clean up.
17794 * src/output.c (output_gram, output): Clean up.
17795
17796 2001-12-10 Akim Demaille <akim@epita.fr>
17797
17798 * src/lalr.c (initialize_lookaheads): New. Extracted from...
17799 * src/LR0.c (set_state_table): here.
17800 * src/lalr.c (lalr): Call it.
17801
17802 2001-12-10 Akim Demaille <akim@epita.fr>
17803
17804 * src/state.h (shifts): Remove the `number' member: shifts are
17805 attached to state, hence no longer need to be labelled with a
17806 state number.
17807
17808 2001-12-10 Akim Demaille <akim@epita.fr>
17809
17810 Now that states have a complete set of members, the linked list of
17811 shifts is useless: just fill directly the state's shifts member.
17812
17813 * src/state.h (shifts): Remove the `next' member.
17814 * src/LR0.c (first_state, last_state): Remove.
17815 Adjust the callers.
17816 (augment_automaton): Don't look for the shifts that must be added
17817 a shift on EOF: it is those of the state we looked for! But now,
17818 since shifts are attached, it is no longer needed to looking
17819 merely by its id: its number.
17820
17821 2001-12-10 Akim Demaille <akim@epita.fr>
17822
17823 * src/LR0.c (augment_automaton): Better variable locality.
17824 Remove an impossible branch: if there is a state corresponding to
17825 the start symbol being shifted, then there is shift for the start
17826 symbol from the initial state.
17827
17828 2001-12-10 Akim Demaille <akim@epita.fr>
17829
17830 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
17831 only when appropriate: when insert_start_shifting_state' is not
17832 invoked.
17833 * tests/regression.at (Rule Line Numbers): Adjust.
17834
17835 2001-12-10 Akim Demaille <akim@epita.fr>
17836
17837 * src/LR0.c (augment_automaton): Now that all states have shifts,
17838 merge the two cases addition shifts to the initial state.
17839
17840 2001-12-10 Akim Demaille <akim@epita.fr>
17841
17842 * src/lalr.c (set_state_table): Move to...
17843 * src/LR0.c: here.
17844 * src/lalr.c (lalr): Don't call it...
17845 * src/LR0.c (generate_states): do it.
17846 * src/LR0.h (first_state): Remove, only the table is used.
17847
17848 2001-12-10 Akim Demaille <akim@epita.fr>
17849
17850 * src/LR0.h (first_shift, first_reduction): Remove.
17851 * src/lalr.c: Don't use first_shift: find shifts through the
17852 states.
17853
17854 2001-12-10 Akim Demaille <akim@epita.fr>
17855
17856 * src/LR0.c: Attach shifts to states as soon as they are
17857 computed.
17858 * src/lalr.c (set_state_table): Instead of assigning shifts to
17859 state, just assert that the mapping was properly done.
17860
17861 2001-12-10 Akim Demaille <akim@epita.fr>
17862
17863 * src/LR0.c (insert_start_shift): Rename as...
17864 (insert_start_shifting_state): this.
17865 (insert_eof_shifting_state, insert_accepting_state): New.
17866 (augment_automaton): Adjust.
17867 Better locality of the variables.
17868 When looking if the start_symbol is shifted from the initial
17869 state, using `while (... symbol != start_symbol ...)' sounds
17870 better than `while (... symbol < start_symbol ...)': If fail
17871 to see how the order between symbols could be relevant!
17872
17873 2001-12-10 Akim Demaille <akim@epita.fr>
17874
17875 * src/getargs.h: Don't declare `spec_name_prefix' and
17876 `spec_file_prefix', declared by src/files.h.
17877 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
17878 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
17879 * src/output.c (prepare): Adjust.
17880 * src/reader.c (symbols_output): Likewise.
17881 * src/vmsgetargs.c: Vaguely adjust, but who cares?
17882
17883 2001-12-10 Akim Demaille <akim@epita.fr>
17884
17885 * src/muscle_tab.c (muscle_init): NULL is a better default than
17886 `"0"'.
17887
17888 2001-12-10 Akim Demaille <akim@epita.fr>
17889
17890 * src/reader.c (reader): Calling symbols_output once is enough.
17891
17892 2001-12-10 Akim Demaille <akim@epita.fr>
17893
17894 Now that states have a complete set of members, the linked list of
17895 reductions is useless: just fill directly the state's reductions
17896 member.
17897
17898 * src/state.h (struct reductions): Remove member `number' and
17899 `next'.
17900 * src/LR0.c (first_reduction, last_reduction): Remove.
17901 (save_reductions): Don't link the new reductions, store them in
17902 this_state.
17903 * src/lalr.c (set_state_table): No need to attach reductions to
17904 states, it's already done.
17905 * src/output.c (output_actions): No longer free the shifts, then
17906 the reductions, then the states: free all the states and their
17907 members.
17908
17909 2001-12-10 Akim Demaille <akim@epita.fr>
17910
17911 * src/options.c (OPTN, DRTV, BOTH): New.
17912 (option_table): Use them.
17913
17914 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
17915 the job of system.h.
17916 * src/options.c: Don't include stdio.h and xalloc.h for the same
17917 reasons.
17918
17919 2001-12-10 Akim Demaille <akim@epita.fr>
17920
17921 * src/output.c (output, prepare): Make sure the values of the
17922 muscles `action' and `prologue' are 0-terminated.
17923
17924 2001-12-10 Akim Demaille <akim@epita.fr>
17925
17926 Clean up GCC warnings.
17927
17928 * src/reader.c (copy_action): `buf' is not used.
17929 (parse_skel_decl): Be static.
17930 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
17931 * src/options.h (create_long_option_table): Have a real prototype.
17932 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
17933 (hash_delete_at): Return const void *.
17934 Adjust casts to preserve the const.
17935
17936 2001-12-10 Akim Demaille <akim@epita.fr>
17937
17938 * configure.in: Require 2.52g.
17939 M4 is not needed, but AUTOM4TE is.
17940 * m4/m4.m4: Remove.
17941 * tests/Makefile.am: Adjust.
17942
17943 2001-12-10 Akim Demaille <akim@epita.fr>
17944
17945 One structure for states is enough, even though theoretically
17946 there are LR(0) states and LALR(1) states.
17947
17948 * src/lalr.h (state_t): Remove.
17949 (state_table): Be state_t **, not state_t *.
17950 * src/state.h (core, CORE_ALLOC): Rename as...
17951 (state_t, STATE_ALLOC): this.
17952 Add the LALR(1) members: shifts, reductions, errs.
17953 * src/LR0.c (state_table): Rename as...
17954 (state_hash): this, to avoid name clashes with the global
17955 `state_table'.
17956 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
17957 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
17958
17959 2001-12-10 Akim Demaille <akim@epita.fr>
17960
17961 Bison dumps core on bash.y.
17962 Reported by Pascal Bart.
17963
17964 * src/warshall.c (bitmatrix_print): New.
17965 (TC): Use it.
17966 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
17967 j must be the outer loop.
17968 * tests/regression.at (Broken Closure): New.
17969
17970 2001-12-05 Akim Demaille <akim@epita.fr>
17971
17972 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
17973 its argument.
17974 Reported by Peter Hamorsky.
17975
17976 2001-12-05 Akim Demaille <akim@epita.fr>
17977
17978 * src/conflicts.c (err_table): Remove.
17979 (resolve_sr_conflict): Adjust.
17980 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
17981 Rename as...
17982 (state_t.reductions, state_t.shifts): this.
17983
17984 2001-12-05 Akim Demaille <akim@epita.fr>
17985
17986 * src/reduce.c (reduce_grammar_tables): No longer disable the
17987 removal of useless rules via CPP but via `if (0)', so that the
17988 compiler still check the code is valid.
17989 For instance, it should have noticed `rline' no longer exists: use
17990 the `line' member of rule_t.
17991 * src/gram.c (dummy, rline): Remove, unused.
17992
17993 2001-12-05 Akim Demaille <akim@epita.fr>
17994
17995 * src/output.c (pack_vector): Use assert, not berror.
17996 * src/main.c (berror): Remove, unused.
17997
17998 2001-12-05 Akim Demaille <akim@epita.fr>
17999
18000 New experimental feature: if --verbose --trace output all the
18001 items of a state, not only its kernel.
18002
18003 * src/print.c (print_core): If `trace_flag', then invoke closure
18004 before outputting the items of the state (print_core is no longer
18005 a correct name them).
18006 (print_results): Invoke new_closure/free_closure if needed.
18007
18008 2001-12-05 Akim Demaille <akim@epita.fr>
18009
18010 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
18011 * src/closure.c, src/closure.h (itemsetsize): Rename as...
18012 (nitemset): for consistency with the rest of the project.
18013
18014 2001-12-05 Akim Demaille <akim@epita.fr>
18015
18016 * src/closure.c (print_closure): Improve.
18017 (closure): Use it for printing input and output.
18018
18019 2001-12-05 Akim Demaille <akim@epita.fr>
18020
18021 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
18022 indexed by nonterminals.
18023
18024 2001-12-05 Akim Demaille <akim@epita.fr>
18025
18026 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
18027 what it was!).
18028 * src/warshall.h: Remove accidental duplication of the content.
18029
18030 2001-12-05 Akim Demaille <akim@epita.fr>
18031
18032 * src/closure.c (set_fderives): De-obfuscate.
18033
18034 2001-12-05 Akim Demaille <akim@epita.fr>
18035
18036 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
18037
18038 2001-12-05 Akim Demaille <akim@epita.fr>
18039
18040 * src/closure.c (set_firsts): De-obfuscate.
18041
18042 2001-12-05 Akim Demaille <akim@epita.fr>
18043
18044 * src/output.c (action_row): De-obfuscate
18045 using the good o' techniques: arrays not pointers, variable
18046 locality, BITISSET, RESETBIT etc.
18047
18048 2001-12-05 Akim Demaille <akim@epita.fr>
18049
18050 Pessimize the code to simplify it: from now on, all the states
18051 have a valid SHIFTS, which NSHIFTS is possibly 0.
18052
18053 * src/LR0.c (shifts_new): Be global and move to..
18054 * src/state.c, src/state.h: here.
18055 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
18056 * src/print_graph: Adjust.
18057
18058 2001-12-05 Akim Demaille <akim@epita.fr>
18059
18060 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
18061 * src/conflicts.c: Use it.
18062 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
18063 incorrectly ``simplified''.
18064
18065 2001-12-05 Akim Demaille <akim@epita.fr>
18066
18067 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
18068 using the good o' techniques: arrays not pointers, variable
18069 locality, BITISSET, RESETBIT etc.
18070
18071 2001-12-05 Akim Demaille <akim@epita.fr>
18072
18073 * src/state.h (SHIFT_SYMBOL): New.
18074 * src/conflicts.c: Use it to deobfuscate.
18075
18076 2001-12-05 Akim Demaille <akim@epita.fr>
18077
18078 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
18079 (print_reductions): De-obfuscate using the good o' techniques:
18080 arrays not pointers, variable locality, BITISSET.
18081
18082 2001-12-05 Akim Demaille <akim@epita.fr>
18083
18084 * src/conflicts.c (print_reductions): Arrays, not pointers.
18085 Use BITISSET.
18086
18087 2001-12-05 Akim Demaille <akim@epita.fr>
18088
18089 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18090
18091 2001-12-05 Akim Demaille <akim@epita.fr>
18092
18093 * src/conflicts.c (print_reductions): Improve variable locality.
18094
18095 2001-12-05 Akim Demaille <akim@epita.fr>
18096
18097 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18098
18099 2001-12-05 Akim Demaille <akim@epita.fr>
18100
18101 * src/conflicts.c (print_reductions): Improve variable locality.
18102
18103 2001-12-05 Akim Demaille <akim@epita.fr>
18104
18105 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
18106 * src/lalr.c: Use them.
18107
18108 2001-12-05 Akim Demaille <akim@epita.fr>
18109
18110 * src/LR0.c (augment_automaton): Formatting changes.
18111 Better variable locality.
18112
18113 2001-12-05 Akim Demaille <akim@epita.fr>
18114
18115 * src/lalr.c (matrix_print): New.
18116 (transpose): Use it.
18117 Use arrays instead of pointers.
18118
18119 2001-12-05 Akim Demaille <akim@epita.fr>
18120
18121 * src/lalr.c (maxrhs): Move to...
18122 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
18123 * src/lalr.c (build_relations): Adjust.
18124
18125 2001-12-05 Akim Demaille <akim@epita.fr>
18126
18127 * src/lalr.c (transpose): Free the memory allocated to the
18128 argument, as it is replaced by the results by the unique caller.
18129 (build_relations): Merely invoke transpose: it handles the memory
18130 deallocation.
18131 Improve variable locality.
18132 Avoid variables used as mere abbreviations.
18133 (compute_lookaheads): Use arrays instead of pointers.
18134
18135 2001-12-05 Akim Demaille <akim@epita.fr>
18136
18137 * src/lalr.c (initialize_F): Improve variable locality.
18138 Avoid variables used as mere abbreviations.
18139
18140 2001-12-05 Akim Demaille <akim@epita.fr>
18141
18142 * src/derives.c (print_derives): Display the ruleno.
18143 * src/lalr.c (initialize_F, transpose): Better variable locality
18144 to improve readability.
18145 Avoid variables used as mere abbreviations.
18146
18147 2001-12-05 Akim Demaille <akim@epita.fr>
18148
18149 * src/lalr.c (traverse): Use arrays instead of pointers.
18150
18151 2001-12-05 Akim Demaille <akim@epita.fr>
18152
18153 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
18154 the handling of squeue.
18155 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18156
18157 2001-12-05 Akim Demaille <akim@epita.fr>
18158
18159 Because useless nonterminals are now kept alive (instead of being
18160 `destroyed'), we now sometimes examine them, and store information
18161 related to them. Hence we need to know their number, and adjust
18162 memory allocations.
18163
18164 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
18165 static.
18166 * src/LR0.c (allocate_itemsets): The memory allocated to
18167 `symbol_count' was used for two different purpose: once to count
18168 the number of occurrences of each symbol, and later reassigned to
18169 `shift_symbol', containing the symbol that can be shifted from a
18170 given state.
18171 Deobfuscate, i.e., allocate, use and free `symbol_count' here
18172 only, and...
18173 (new_itemsets): Allocate `shift_symbol' here.
18174 (allocate_itemsets): symbol_count includes useless nonterminals.
18175 Make room for them.
18176 (free_storage): Use `free', not `XFREE', for pointers that cannot
18177 be null.
18178
18179 2001-12-05 Akim Demaille <akim@epita.fr>
18180
18181 * src/nullable.c (set_nullable): Deobfuscate the handling of
18182 ritem.
18183 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18184
18185 2001-12-05 Akim Demaille <akim@epita.fr>
18186
18187 * src/gram.c, src/gram.h (ritem_print): New.
18188 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
18189 (This useless function was defined only to work around VMS linkers
18190 that can't handle compilation units with variables only).
18191 * src/reduce.c (dump_grammar): Use it to trace the construction of
18192 ritem.
18193
18194 2001-12-04 Paul Eggert <eggert@twinsun.com>
18195
18196 * src/bison.simple (union yyalloc): Change member names
18197 to be the same as the stack names.
18198 (yyparse): yyptr is now union yyalloc *, not char *.
18199 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
18200 and may generate better code on some machines.
18201 (yystpcpy): Use prototype if __STDC__ is defined, not just
18202 if __cplusplus is defined.
18203
18204 2001-11-30 Akim Demaille <akim@epita.fr>
18205
18206 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
18207 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
18208 Gettext doesn't compile cleanly, and dies with -Werror.
18209 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
18210 Include WARNING_CFLAGS here.
18211 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
18212 before being defined.
18213
18214 2001-11-27 Paul Eggert <eggert@twinsun.com>
18215
18216 * lib/quotearg.h (quotearg_n, quotearg_n_style):
18217 First arg is int, not unsigned.
18218 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
18219 (SIZE_MAX, UINT_MAX): New macros.
18220 (quotearg_n_options): Abort if N is negative.
18221 Avoid overflow check on hosts where size_t is 64 bits and int
18222 is 32 bits, as overflow is impossible there.
18223 Fix off-by-one typo that caused unnecessary reallocation.
18224
18225 2001-11-29 Paul Eggert <eggert@twinsun.com>
18226
18227 Name space cleanup in generated parser.
18228
18229 * doc/bison.texinfo (Bison Parser): Discuss system headers
18230 and their effect on the user name space.
18231
18232 * src/bison.simple:
18233 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
18234 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
18235 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
18236
18237 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
18238 on user names when possible.
18239
18240 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
18241 Simplify test for whather <alloca.h> exists.
18242
18243 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
18244
18245 (<stdio.h>): Include if YYDEBUG.
18246
18247 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
18248 ! defined (yyoverflow) && ! defined (yymemcpy).
18249
18250 (yymemcpy, yyparse): Rename local variables as needed so that
18251 they all begin with 'yy'.
18252
18253 (yystrlen, yystpcpy): New functions.
18254
18255 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
18256 All uses changed.
18257
18258 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
18259 instead of relying on string.h functions. Use YYSTACK_ALLOC
18260 and YYSTACK_FREE instead of malloc and free.
18261
18262 2001-11-30 Akim Demaille <akim@epita.fr>
18263
18264 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
18265 before their first uses.
18266 (YYBISON, YYPURE): Move to the top of the output.
18267
18268 2001-11-30 Akim Demaille <akim@epita.fr>
18269
18270 * tests/reduce.at (Useless Nonterminals): Fix.
18271
18272 2001-11-30 Akim Demaille <akim@epita.fr>
18273
18274 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
18275 if body instead of `;' to pacify GCC's warnings.
18276
18277 2001-11-30 Akim Demaille <akim@epita.fr>
18278
18279 Instead of mapping the LHS of unused rules to -1, keep the LHS
18280 valid, but flag the rules as invalid.
18281
18282 * src/gram.h (rule_t): `useful' is a new member.
18283 * src/print.c (print_grammar): Adjust.
18284 * src/derives.c (set_derives): Likewise.
18285 * src/reader.c (packgram, reduce_output): Likewise.
18286 * src/reduce.c (reduce_grammar_tables): Likewise.
18287 * tests/reduce.at (Underivable Rules, Useless Rules): New.
18288
18289 2001-11-30 Akim Demaille <akim@epita.fr>
18290
18291 * src/reduce.c (reduce_output): Formatting changes.
18292 * src/print.c (print_results, print_grammar): Likewise.
18293 * tests/regression.at (Rule Line Numbers)
18294 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
18295
18296 2001-11-30 Akim Demaille <akim@epita.fr>
18297
18298 * src/reduce.c (nonterminals_reduce): Instead of throwing away
18299 useless nonterminals, move them at the end of the symbol arrays.
18300 (reduce_output): Adjust.
18301 * tests/reduce.at (Useless Nonterminals): Adjust.
18302
18303 2001-11-30 Akim Demaille <akim@epita.fr>
18304
18305 * src/reduce.c: Various comment/formatting changes.
18306 (nonterminals_reduce): New, extracted from...
18307 (reduce_grammar_tables): here.
18308 (reduce_grammar): Call nonterminals_reduce.
18309
18310 2001-11-29 Paul Eggert <eggert@twinsun.com>
18311
18312 * src/bison.simple (YYSTACK_REALLOC): Remove.
18313 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
18314 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
18315 New macros.
18316 (union yyalloc): New type.
18317 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
18318 an arbitrary restriction on hosts where size_t is wider than int.
18319
18320 (yyparse): Don't dump core if alloca or malloc fails; instead, report
18321 a parser stack overflow. Allocate just one block of memory for all
18322 three stacks, instead of allocating three blocks; this typically is
18323 faster and reduces fragmentation.
18324
18325 Do not limit the number of items in the stack to a value that fits
18326 in 'int', as this is an arbitrary limit on hosts with 64-bit
18327 size_t and 32-bit int.
18328
18329 2001-11-29 Marc Autret <autret_m@epita.fr>
18330
18331 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
18332 of defining YYERROR_VERBOSE.
18333 [AT_DATA]: $4 is now out of C declarations in the prologue.
18334
18335 2001-11-28 Marc Autret <autret_m@epita.fr>
18336
18337 * src/reader.c (parse_dquoted_param): New.
18338 (parse_skel_decl): Use it.
18339 * src/lex.h: Add its prototype.
18340 * src/lex.c (literalchar): Become not static.
18341
18342 2001-11-28 Marc Autret <autret_m@epita.fr>
18343
18344 * src/output.h: And put its extern declaration here.
18345 * src/output.c (error_verbose): Define here.
18346 (prepare): Echo name modification.
18347 * src/getargs.h: Clean its extern declaration.
18348 * src/getargs.c (error_verbose_flag): Remove.
18349 (getargs): Remove case 'e'.
18350 * src/options.c (option_table): 'error-verbose' is now seen as simple
18351 percent option.
18352 Include output.h.
18353
18354 * src/reader.c (read_declarations): Remove case tok_include.
18355 (parse_include_decl): Remove.
18356 * src/lex.h (token_t): Remove tok_include.
18357 * src/options.c (option_table): 'include' is now a simple command line
18358 option.
18359
18360 2001-11-28 Marc Autret <autret_m@epita.fr>
18361
18362 * src/bison.simple: Adjust muscle names.
18363 * src/muscle_tab.c (muscle_init): Also rename the muscles.
18364 * src/output.c (prepare): s/_/-/ for the muscles names.
18365 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
18366
18367 2001-11-28 Marc Autret <autret_m@epita.fr>
18368
18369 * src/bison.simple: Fix debug.
18370 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
18371
18372 2001-11-28 Akim Demaille <akim@epita.fr>
18373
18374 * src/LR0.c (shifts_new): New.
18375 (save_shifts, insert_start_shift, augment_automaton): Use it.
18376
18377 2001-11-28 Akim Demaille <akim@epita.fr>
18378
18379 * src/closure.c (closure): `b' and `ruleno' denote the same value:
18380 keep ruleno only.
18381
18382 2001-11-28 Akim Demaille <akim@epita.fr>
18383
18384 * src/closure.c (closure): Instead of looping over word in array
18385 then bits in words, loop over bits in array.
18386
18387 2001-11-28 Akim Demaille <akim@epita.fr>
18388
18389 * src/closure.c (closure): No longer optimize the special case
18390 where all the bits of `ruleset[r]' are set to 0, to make the code
18391 clearer.
18392
18393 2001-11-28 Akim Demaille <akim@epita.fr>
18394
18395 * src/closure.c (closure): `r' and `c' are new variables, used to
18396 de-obfuscate accesses to RULESET and CORE.
18397
18398 2001-11-28 Akim Demaille <akim@epita.fr>
18399
18400 * src/reduce.c (reduce_print): Use ngettext.
18401 (dump_grammar): Improve the trace accuracy.
18402
18403 2001-11-28 Akim Demaille <akim@epita.fr>
18404
18405 * src/reduce.c (dump_grammar): Don't translate trace messages.
18406
18407 2001-11-28 Akim Demaille <akim@epita.fr>
18408
18409 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
18410 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
18411 as all tags are free'ed afterwards.
18412 From Enrico Scholz.
18413
18414 2001-11-27 Paul Eggert <eggert@twinsun.com>
18415
18416 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
18417 use alloca when we didn't want to, and vice versa.
18418
18419 2001-11-27 Marc Autret <autret_m@epita.fr>
18420
18421 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
18422 initialization.
18423 * src/output.c (prepare): Remove its update.
18424
18425 2001-11-27 Marc Autret <autret_m@epita.fr>
18426
18427 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
18428 Use %error-verbose.
18429
18430 2001-11-27 Marc Autret <autret_m@epita.fr>
18431
18432 * src/bison.simple: Remove YYERROR_VERBOSE using.
18433 Use %%error_verbose.
18434 (yyparse): Likewise.
18435 * src/output.c (prepare): Give its final value.
18436 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
18437 * src/getargs.h: Add its extern declaration.
18438 * src/getargs.c (error_verbose_flag): New int.
18439 (getargs): Update to catch new case.
18440 * src/options.c (option_table): 'error-verbose' is a new option.
18441 (shortopts): Update.
18442
18443 2001-11-27 Akim Demaille <akim@epita.fr>
18444
18445 * src/system.h: Use intl/libgettext.h.
18446 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
18447
18448 2001-11-27 Akim Demaille <akim@epita.fr>
18449
18450 * tests/torture.at (Exploding the Stack Size with Malloc):
18451 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
18452
18453 2001-11-27 Akim Demaille <akim@epita.fr>
18454
18455 * src/files.c: Include error.h.
18456 Reported by Hans Aberg.
18457
18458 2001-11-26 Marc Autret <autret_m@epita.fr>
18459
18460 * src/reader.c (parse_include_decl): New, not yet implemented.
18461 (read_declarations): Add case tok_include.
18462 * src/getargs.h (include): Add its extern definition.
18463 * src/getargs.c (include): New const char *.
18464 (getargs): Add case '-I'.
18465 * src/options.c (option_table): Add include as command line and
18466 percent option.
18467 * src/lex.h (token_t): Add tok_include.
18468
18469 2001-11-26 Akim Demaille <akim@epita.fr>
18470
18471 * src/reader.c (readgram): Make sure rules for mid-rule actions
18472 have a lineno equal to that of their host rule.
18473 Reported by Hans Aberg.
18474 * tests/regression.at (Rule Line Numbers): New.
18475
18476 2001-11-26 Akim Demaille <akim@epita.fr>
18477
18478 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
18479 size_ts.
18480
18481 2001-11-26 Akim Demaille <akim@epita.fr>
18482
18483 * src/complain.c, src/complain.h (error): Remove, provided by
18484 lib/error.[ch].
18485
18486 2001-11-26 Akim Demaille <akim@epita.fr>
18487
18488 * src/reader.c (read_declarations): Don't abort on tok_illegal,
18489 issue an error message.
18490 * tests/regression.at (Invalid %directive): New.
18491 Reported by Hans Aberg.
18492
18493 2001-11-26 Akim Demaille <akim@epita.fr>
18494
18495 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
18496 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18497
18498 2001-11-26 Akim Demaille <akim@epita.fr>
18499
18500 * src/conflicts.c (conflicts_print): Don't complain at all when
18501 there are no reduce/reduce conflicts, and as many shift/reduce
18502 conflicts as expected.
18503 * tests/regression.at (%expect right): Adjust.
18504
18505 2001-11-23 Akim Demaille <akim@epita.fr>
18506
18507 * lib/alloca.c: Update, from fileutils.
18508
18509 2001-11-23 Akim Demaille <akim@epita.fr>
18510
18511 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
18512
18513 2001-11-23 Akim Demaille <akim@epita.fr>
18514
18515 * src/system.h: Include alloca.h.
18516 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
18517
18518 2001-11-23 Akim Demaille <akim@epita.fr>
18519
18520 * src/print_graph.c (print_actions): Remove `rule', unused.
18521 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
18522 pacify GCC's signed < unsigned warnings.
18523 * src/closure.c (itemsetsize): Likewise.
18524 * src/reader.c (symbol_list_new): Static.
18525
18526 2001-11-23 Akim Demaille <akim@epita.fr>
18527
18528 Attaching lineno to buckets is stupid, since only one copy of each
18529 symbol is kept, only the line of the first occurrence is kept too.
18530
18531 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
18532 * src/reader.c (rline_allocated): Remove, unused.
18533 (symbol_list): Have a `line' member.
18534 (symbol_list_new): New.
18535 (readgram): Use it.
18536 * src/print.c (print_grammar): Output the rule line numbers.
18537 * tests/regression.at (Solved SR Conflicts)
18538 (Unresolved SR Conflicts): Adjust.
18539 Reported by Hans Aberg.
18540
18541 2001-11-22 Marc Autret <autret_m@epita.fr>
18542
18543 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
18544
18545 2001-11-22 Marc Autret <autret_m@epita.fr>
18546
18547 * src/muscle_tab.c (muscle_init): Remove initialization of
18548 skeleton muscle.
18549 * src/output.c (output_master_parser): Do it here.
18550
18551 2001-11-20 Akim Demaille <akim@epita.fr>
18552
18553 * po/sv.po: New.
18554 * configure.in (ALL_LINGUAS): Adjust.
18555 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
18556 longer contains strings to translate.
18557
18558 2001-11-19 Akim Demaille <akim@epita.fr>
18559
18560 * src/conflicts.c (conflicts_print): Add a missing \n.
18561
18562 2001-11-19 Akim Demaille <akim@epita.fr>
18563
18564 * src/nullable.c (nullable_print): New.
18565 (set_nullable): Call it when tracing.
18566 Better locality of variables.
18567
18568 2001-11-19 Akim Demaille <akim@epita.fr>
18569
18570 * src/print.c (print_actions): Better locality of variables.
18571
18572 2001-11-19 Akim Demaille <akim@epita.fr>
18573
18574 * src/derives.c (print_derives): Fix and enrich.
18575 * src/closure.c (print_fderives): Likewise.
18576
18577 2001-11-19 Akim Demaille <akim@epita.fr>
18578
18579 * src/closure.c (itemsetend): Remove, replaced with...
18580 (itemsetsize): new.
18581
18582 2001-11-19 Akim Demaille <akim@epita.fr>
18583
18584 * src/LR0.c (kernel_end): Remove, replaced with...
18585 (kernel_size): new.
18586
18587 2001-11-19 Akim Demaille <akim@epita.fr>
18588
18589 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
18590 to clarify.
18591
18592 2001-11-19 Akim Demaille <akim@epita.fr>
18593
18594 * src/closure.c (closure): Use arrays instead of pointers to clarify.
18595
18596 2001-11-19 Akim Demaille <akim@epita.fr>
18597
18598 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
18599 trace messages.
18600 * src/LR0.c: Likewise.
18601 (allocate_itemsets): Use arrays instead of pointers to clarify.
18602
18603 2001-11-19 Akim Demaille <akim@epita.fr>
18604
18605 * src/getargs.c (statistics_flag): Replace with...
18606 (trace_flag): New.
18607 (longopts): Accept --trace instead of --statistics.
18608 * src/getargs.h, src/options.c: Adjust.
18609 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
18610 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
18611
18612 2001-11-19 Akim Demaille <akim@epita.fr>
18613
18614 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
18615 pointers to clarify the code.
18616 (save_reductions, save_shifts): Factor common parts of alternatives.
18617
18618 2001-11-19 Akim Demaille <akim@epita.fr>
18619
18620 * src/LR0.c (new_state, get_state): Complete TRACE code.
18621 * src/closure.c: Include `reader.h' to get `tags', needed by the
18622 trace code.
18623 Rename the conditional DEBUG as TRACE.
18624 Output consistently TRACEs to stderr, not stdout.
18625 * src/derives.c: Likewise.
18626 * src/reduce.c: (inaccessable_symbols): Using if is better style
18627 than goto.
18628 Use `#if TRACE' instead of `#if 0' for tracing code.
18629
18630 2001-11-19 Akim Demaille <akim@epita.fr>
18631
18632 * src/system.h (LIST_FREE, shortcpy): New.
18633 * src/LR0.c: Use them.
18634 * src/output.c (free_itemsets, free_reductions, free_shifts):
18635 Remove, replaced by LIST_FREE.
18636
18637 2001-11-19 Akim Demaille <akim@epita.fr>
18638
18639 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
18640 (REDUCTIONS_ALLOC): New.
18641 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
18642 allocation.
18643
18644 2001-11-19 Akim Demaille <akim@epita.fr>
18645
18646 * src/LR0.c (new_state): Complete trace code.
18647 * src/nullable.c (set_nullable): Don't translate traces.
18648
18649 2001-11-19 Akim Demaille <akim@epita.fr>
18650
18651 * src/print_graph.c (print_core): Better locality of variables.
18652 * src/print.c (print_core): Likewise.
18653
18654 2001-11-19 Akim Demaille <akim@epita.fr>
18655
18656 * src/vcg.c: You do the output, so you are responsible of the
18657 handling of VCG syntax, in particular: use quotearg.
18658 * src/print_graph.c: Don't.
18659 (print_actions): Don't output the actions as part of the nodes,
18660 since that's the job of the edges.
18661 (print_state): Don't output by hand: fill the node description,
18662 and ask for its output.
18663
18664 2001-11-19 Akim Demaille <akim@epita.fr>
18665
18666 * src/bison.simple (yyparse): When verbosely reporting an error,
18667 no longer put additional quotes around token names.
18668 * tests/calc.at: Adjust.
18669
18670 2001-11-19 Akim Demaille <akim@epita.fr>
18671
18672 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
18673 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
18674 * src/output.c: Adjust.
18675
18676 2001-11-19 Akim Demaille <akim@epita.fr>
18677
18678 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
18679 (rule_t): this.
18680 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
18681
18682 2001-11-19 Akim Demaille <akim@epita.fr>
18683
18684 * src/gram.h (rule_t): New.
18685 (rule_table): New.
18686 (rrhs, rlhs): Remove, part of state_t.
18687 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
18688 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18689 * src/reader.c, src/reduce.c: Adjust.
18690
18691 2001-11-19 Akim Demaille <akim@epita.fr>
18692
18693 * src/reader.c (symbols_output): New, extracted from...
18694 (packsymbols): Here.
18695 (reader): Call it.
18696
18697 2001-11-19 Akim Demaille <akim@epita.fr>
18698
18699 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
18700 (maxrhs): this new function.
18701
18702 2001-11-19 Akim Demaille <akim@epita.fr>
18703
18704 * src/lalr.c (F): New macro to access the variable F.
18705 Adjust.
18706
18707 2001-11-19 Akim Demaille <akim@epita.fr>
18708
18709 * src/lalr.h (LA): New macro to access the variable LA.
18710 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18711 * src/lalr.c: Adjust.
18712
18713 2001-11-19 Akim Demaille <akim@epita.fr>
18714
18715 * src/lalr.c (initialize_LA): Only initialize LA. Let...
18716 (set_state_table): handle the `lookaheads' members.
18717
18718 2001-11-19 Akim Demaille <akim@epita.fr>
18719
18720 * src/lalr.h (lookaheads): Removed array, whose contents is now
18721 a member of...
18722 (state_t): this structure.
18723 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18724 Adjust.
18725
18726 2001-11-19 Akim Demaille <akim@epita.fr>
18727
18728 * src/lalr.h (consistent): Removed array, whose contents is now
18729 a member of...
18730 (state_t): this structure.
18731 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18732 Adjust.
18733
18734 2001-11-19 Akim Demaille <akim@epita.fr>
18735
18736 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
18737 contents are now members of...
18738 (state_t): this structure.
18739 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18740 Adjust.
18741
18742 2001-11-19 Akim Demaille <akim@epita.fr>
18743
18744 * src/lalr.h (state_t): New.
18745 (state_table): Be a state_t * instead of a core **.
18746 (accessing_symbol): Remove, part of state_t.
18747 * src/lalr.c: Adjust.
18748 (set_accessing_symbol): Merge into...
18749 (set_state_table): this.
18750 * src/print_graph.c, src/conflicts.c: Adjust.
18751
18752 2001-11-14 Akim Demaille <akim@epita.fr>
18753
18754 * tests/calc.at, tests/output.at, tests/regression.at,
18755 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
18756 now the tests are run in private dirs, therefore AC_CLEANUP and
18757 family can be simplified to 0-ary.
18758 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
18759 use abs. path to find config.h.
18760 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
18761 stderr, there can be way too much random noise.
18762 Instead pass -Werror to GCC and rely on the exit status.
18763 Reported by Wolfram Wagner.
18764
18765 2001-11-14 Akim Demaille <akim@epita.fr>
18766
18767 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
18768 defined only if yyoverflow is defined, to avoid `warning: unused
18769 variable `yyvs1''.
18770 Reported by The Test Suite.
18771
18772 2001-11-14 Akim Demaille <akim@epita.fr>
18773
18774 * src/print.c: Include reduce.h.
18775 Reported by Hans Aberg.
18776
18777 2001-11-14 Akim Demaille <akim@epita.fr>
18778
18779 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
18780 Revert a previous patch: these are really const.
18781 * src/conflicts.c (conflict_report): Additional useless pair of
18782 braces to pacify GCC's warnings for `if () if () {} else {}'.
18783 * src/lex.c (parse_percent_token): Replace equal_offset with
18784 arg_offset.
18785 arg is const.
18786 Be sure to strdup `arg' when used, since there is no reason for
18787 token_buffer not to change.
18788
18789 2001-11-14 Akim Demaille <akim@epita.fr>
18790
18791 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
18792 definition.
18793 * src/main.c (main): Use them.
18794 Suggested by Hans Aberg.
18795
18796 2001-11-12 Akim Demaille <akim@epita.fr>
18797
18798 * src/system.h (ngettext): Now that we use ngettext, be sure to
18799 provide a default definition when NLS are not used.
18800
18801 2001-11-12 Akim Demaille <akim@epita.fr>
18802
18803 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
18804 Use @kbd to denote user input.
18805 (Language and Grammar): ANSIfy the example.
18806 Adjust its layout for info/notinfo.
18807 (Location Tracking Calc): Output error messages to stderr.
18808 Output locations in a more GNUtically correct way.
18809 Fix a couple of Englishos.
18810 Adjust @group/@end group pairs.
18811
18812 2001-11-12 Akim Demaille <akim@epita.fr>
18813
18814 %expect was not functioning at all.
18815
18816 * src/conflicts.c (expected_conflicts): Set to -1.
18817 (conflict_report): Use ngettext.
18818 (conflicts_print): Check %expect and make its violation an error.
18819 * doc/bison.texinfo (Expect Decl): Adjust.
18820 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
18821 * tests/regression.at (%expect not enough, %expect right)
18822 (%expect too much): New.
18823
18824 2001-11-12 Akim Demaille <akim@epita.fr>
18825
18826 * tests/regression.at (Conflicts): Rename as...
18827 (Unresolved SR Conflicts): this.
18828 (Solved SR Conflicts): New.
18829
18830 2001-11-12 Akim Demaille <akim@epita.fr>
18831
18832 * src/reduce.c (print_results): Rename as...
18833 (reduce_output): This.
18834 Output to OUT, passed as argument, instead of output_obstack.
18835 (dump_grammar): Likewise.
18836 (reduce_free): New.
18837 Also free V1.
18838 (reduce_grammar): No longer call reduce_output, since...
18839 * src/print.c (print_results): do it.
18840 * src/main.c (main): Call reduce_free;
18841
18842 2001-11-12 Akim Demaille <akim@epita.fr>
18843
18844 * src/conflicts.c (print_reductions): Accept OUT as argument.
18845 Output to it, not to output_obstack.
18846 * src/print.c (print_actions): Adjust.
18847
18848 2001-11-12 Akim Demaille <akim@epita.fr>
18849
18850 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
18851 the result instead of using...
18852 (src_total, rrc_total, src_count, rrc_count): Remove.
18853 (any_conflicts): Remove.
18854 (print_conflicts): Split into...
18855 (conflicts_print, conflicts_output): New.
18856 * src/conflicts.h: Adjust.
18857 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
18858 * src/print.c (print_grammar): Issue `\n' between two rules.
18859 * tests/regression.at (Conflicts): New.
18860 Reported by Tom Lane.
18861
18862 2001-11-12 Akim Demaille <akim@epita.fr>
18863
18864 * tests/regression.at (Invalid input): Remove, duplicate with
18865 ``Invalid input: 1''.
18866
18867 2001-11-12 Akim Demaille <akim@epita.fr>
18868
18869 * tests/torture.at (AT_DATA_STACK_TORTURE)
18870 (Exploding the Stack Size with Alloca)
18871 (Exploding the Stack Size with Malloc): New.
18872
18873 2001-11-12 Akim Demaille <akim@epita.fr>
18874
18875 * src/bison.simple (YYSTACK_REALLOC): New.
18876 (yyparse) [!yyoverflow]: Use it and free the old stack.
18877 Reported by Per Allansson.
18878
18879 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
18880
18881 * src/bison.simple: Define type yystype instead of YYSTYPE, and
18882 define CPP macro, which substitute YYSTYPE by yystype.
18883 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
18884 with yyltype/YYLTYPE. This allows inclusion of the generated
18885 header within the parser if the compiler, such as GGC, accepts
18886 multiple equivalent #defines.
18887 From Akim.
18888
18889 2001-11-05 Akim Demaille <akim@epita.fr>
18890
18891 * src/reader.c (symbols_output): New, extracted from...
18892 (packsymbols): here.
18893 (reader): Adjust.
18894
18895 2001-11-05 Akim Demaille <akim@epita.fr>
18896
18897 * src/lex.c (parse_percent_token): s/quotearg/quote/.
18898
18899 2001-11-05 Akim Demaille <akim@epita.fr>
18900
18901 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
18902 pattern.
18903
18904 2001-11-05 Akim Demaille <akim@epita.fr>
18905
18906 * src/options.h (struct option_table_struct): set_flags is void*.
18907 * src/options.c (longopts): Support `--output' and `%output'.
18908 (usage): Adjust.
18909 * src/lex.h (tok_setopt): Remove, replaced with...
18910 (tok_intopt, tok_stropt): these new guys.
18911 * src/lex.c (getopt.h): Not needed.
18912 (token_buffer, unlexed_token_buffer): Not const.
18913 (percent_table): Promote `-' over `_' in directive names.
18914 Active `%name-prefix', `file-prefix', and `output'.
18915 (parse_percent_token): Accept possible arguments to directives.
18916 Promote `-' over `_' in directive names.
18917
18918 2001-11-04 Akim Demaille <akim@epita.fr>
18919
18920 * doc/bison.texinfo (Decl Summary): Split the list into
18921 `directives for grammars' and `directives for bison'.
18922 Sort'em.
18923 Add description of `%name-prefix', `file-prefix', and `output'.
18924 Promote `-' over `_' in directive names.
18925 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
18926 Simplify the description of `--name-prefix'.
18927 Promote `-' over `_' in directive names.
18928 Promote `--output' over `--output-file'.
18929 Fix the description of `--defines'.
18930 * tests/output.at: Exercise %file-prefix and %output.
18931
18932 2001-11-02 Akim Demaille <akim@epita.fr>
18933
18934 * doc/refcard.tex: Update.
18935
18936 2001-11-02 Akim Demaille <akim@epita.fr>
18937
18938 * src/symtab.h (SUNDEF): New.
18939 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
18940 stand for `uninitialized', instead of 0.
18941 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
18942 * src/lex.c (lex): Adjust.
18943
18944 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
18945 Number it 0.
18946 Let yylex return it instead of a plain 0.
18947 Reported by Dick Streefland.
18948
18949 2001-11-02 Akim Demaille <akim@epita.fr>
18950
18951 * tests/regression.at (Mixing %token styles): New test.
18952
18953 2001-11-02 Akim Demaille <akim@epita.fr>
18954
18955 * src/reader.c (parse_thong_decl): Formatting changes.
18956 (token_translations_init): New, extracted from...
18957 (packsymbols): Here.
18958 Adjust.
18959
18960 2001-11-01 Akim Demaille <akim@epita.fr>
18961
18962 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
18963 Check that `9foo.y' produces correct cpp guards.
18964 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
18965 guards.
18966 Reported by Wwp.
18967
18968 2001-11-01 Akim Demaille <akim@epita.fr>
18969
18970 * tests/regression.at (Invalid input: 2): New.
18971 * src/lex.c (unlexed_token_buffer): New.
18972 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
18973 too.
18974 Reported by Wwp.
18975
18976 2001-11-01 Akim Demaille <akim@epita.fr>
18977
18978 * tests/calc.at: Catch up with 1.30.
18979 * configure.in: Bump to 1.49a.
18980 Adjust to newer Autotest.
18981
18982 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
18983
18984 * src/conflicts.c: Move global variables rrc_total and src_total ...
18985 (print_conflicts): here.
18986 * src/output.c (output): Free global variable user_toknums.
18987 * src/lex.c (token_obstack): Become static.
18988
18989 2001-10-18 Akim Demaille <akim@epita.fr>
18990
18991 * tests/atlocal.in (GCC): Add.
18992 * tests/calc.at: s/m4_match/m4_bmatch/.
18993 s/m4_patsubst/m4_bpatsubst/.
18994 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
18995 * configure.in: AC_SUBST(GCC).
18996
18997 2001-10-14 Marc Autret <autret_m@epita.fr>
18998
18999 * src/options.c (create_long_option_table): Fix.
19000
19001 2001-10-10 Akim Demaille <akim@epita.fr>
19002
19003 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
19004
19005 2001-10-04 Akim Demaille <akim@epita.fr>
19006
19007 * src/reader.c (parse_union_decl): Push the caracters in
19008 union_obstack, not attrs_obstack.
19009
19010 2001-10-04 Akim Demaille <akim@epita.fr>
19011
19012 Merge in the branch 1.29.
19013
19014 * src/reader.c (packsymbols): Use a temporary obstack for
19015 `%%tokendef', since output_stack is already used elsewhere.
19016
19017 2001-10-02 Akim Demaille <akim@epita.fr>
19018
19019 Bump 1.29d.
19020
19021 2001-10-02 Akim Demaille <akim@epita.fr>
19022
19023 Version 1.29c.
19024
19025 2001-10-02 Akim Demaille <akim@epita.fr>
19026
19027 * tests/regression.at (Invalid CPP headers): New.
19028 From Alexander Belopolsky.
19029 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
19030
19031 2001-10-02 Akim Demaille <akim@epita.fr>
19032
19033 * tests/regression.at (Invalid input): New.
19034 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
19035 Reported by Shura.
19036
19037 2001-10-02 Akim Demaille <akim@epita.fr>
19038
19039 * tests/calc.at: Now that --debug works, the tests must be adjusted.
19040
19041 2001-10-02 Akim Demaille <akim@epita.fr>
19042
19043 * src/output.c (output_parser): Assert `skeleton'.
19044 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
19045 systems.
19046 From Shura.
19047
19048 2001-10-01 Marc Autret <autret_m@epita.fr>
19049
19050 * src/lex.h: Echo modifications.
19051 * src/lex.c (unlex): Parameter is now token_t.
19052 From Hans Aberg.
19053
19054 2001-10-01 Marc Autret <autret_m@epita.fr>
19055
19056 * src/main.c: Include lex.h.
19057 From Hans Aberg.
19058
19059 2001-09-29 Akim Demaille <akim@epita.fr>
19060
19061 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
19062
19063 2001-09-28 Akim Demaille <akim@epita.fr>
19064
19065 * tests/testsuite.at: Update to newer Autotest.
19066 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
19067
19068 2001-09-27 Akim Demaille <akim@epita.fr>
19069
19070 Position independent wrapper.
19071
19072 * tests/bison: Remove.
19073 * tests/bison.in: New.
19074 * configure.in: Adjust.
19075
19076 2001-09-27 Paul Eggert <eggert@twinsun.com>
19077
19078 Port quotearg fixes from tar 1.13.24.
19079
19080 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
19081 tm to be declared.
19082 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
19083 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
19084
19085 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
19086 * m4/mbrtowc.m4: New file.
19087 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
19088 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
19089
19090 2001-09-27 Akim Demaille <akim@epita.fr>
19091
19092 Bump to 1.29c.
19093
19094 2001-09-27 Akim Demaille <akim@epita.fr>
19095
19096 Version 1.29b.
19097
19098 2001-09-25 Akim Demaille <akim@epita.fr>
19099
19100 * src/system.h: Include `xalloc.h'.
19101 Remove it from the C files.
19102 * src/files.c (output_files): Free the obstacks.
19103 * src/lex.c (init_lex): Rename as...
19104 (lex_init): this.
19105 (lex_free): New.
19106 * src/main.c (main): Use it.
19107
19108 2001-09-24 Marc Autret <autret_m@epita.fr>
19109
19110 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
19111 to output informations in fout (FILE*).
19112 (open_graph, close_graph): Likewise.
19113 (output_graph, output_edge, output_node): Likewise.
19114 * src/vcg.h: Update function prototypes.
19115 * src/print_graph.c (print_graph): Open output graph file.
19116 (print_actions): Adjust.
19117 * src/files.h: Remove extern declaration.
19118 * src/files.c: Remove graph_obstack declaration.
19119 (open_files): Remove graph_obstack initialization.
19120 (output_files): Remove graph_obstack saving.
19121
19122 2001-09-24 Marc Autret <autret_m@epita.fr>
19123
19124 * src/files.c (compute_output_file_names): Fix.
19125
19126 2001-09-24 Marc Autret <autret_m@epita.fr>,
19127 Akim Demaille <akim@epita.fr>
19128
19129 * src/reader.c (reader): Remove call to free_symtab ().
19130 * src/main.c (main): Call it here.
19131 Include symtab.h.
19132 * src/conflicts.c (initialize_conflicts): Rename as...
19133 (solve_conflicts): this.
19134 * src/print.c (print_core, print_actions, print_state)
19135 (print_grammar): Dump to a file instead a `output_obstack'.
19136 (print_results): Dump `output_obstack', and then proceed with the
19137 FILE *.
19138 * src/files.c (compute_output_file_names, close_files): New.
19139 (output_files): Adjust.
19140 * src/main.c (main): Adjust.
19141
19142 2001-09-23 Marc Autret <autret_m@epita.fr>
19143
19144 * src/files.c (compute_header_macro): Computes header macro name
19145 from spec_defines_file when given.
19146
19147 2001-09-23 Marc Autret <autret_m@epita.fr>
19148
19149 * src/files.c (output_files): Add default extensions.
19150
19151 2001-09-22 Akim Demaille <akim@epita.fr>
19152
19153 * src/conflicts.c (finalize_conflicts): Rename as...
19154 (free_conflicts): this.
19155
19156 2001-09-22 Akim Demaille <akim@epita.fr>
19157
19158 * src/gram.c (gram_free): Rename back as...
19159 (dummy): this.
19160 (output_token_translations): Free `token_translations'.
19161 * src/symtab.c (free_symtab): Free the tag field.
19162
19163 2001-09-22 Akim Demaille <akim@epita.fr>
19164
19165 Remove `translations' as it is always set to true.
19166
19167 * src/gram.h: Adjust.
19168 * src/reader.c (packsymbols, parse_token_decl): Adjust
19169 * src/print.c (print_grammar): Adjust.
19170 * src/output.c (output_token_translations): Adjust.
19171 * src/lex.c (lex): Adjust.
19172 * src/gram.c: Be sure the set pointers to NULL.
19173 (dummy): Rename as...
19174 (gram_free): this.
19175
19176 2001-09-22 Akim Demaille <akim@epita.fr>
19177
19178 * configure.in: Invoke AM_LIB_DMALLOC.
19179 * src/system.h: Use dmalloc.
19180 * src/LR0.c: Be sure to have pointers initialized to NULL.
19181 (allocate_itemsets): Allocate kernel_items only if needed.
19182
19183 2001-09-22 Akim Demaille <akim@epita.fr>
19184
19185 * configure.in: Bump to 1.29b.
19186 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
19187 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
19188 need xmalloc.c in calc.y.
19189 From Pascal Bart.
19190
19191 2001-09-21 Akim Demaille <akim@epita.fr>
19192
19193 Version 1.29a.
19194 * Makefile.maint, config/config.guess, config/config.sub,
19195 * config/missing: Update from masters.
19196 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
19197 upon package.m4.
19198 * configure.in (ALL_LINGUAS): Add `tr'.
19199
19200 2001-09-21 Akim Demaille <akim@epita.fr>
19201
19202 * tests/Makefile.am (package.m4): Move to...
19203 ($(srcdir)/$(TESTSUITE)): here.
19204
19205 2001-09-20 Akim Demaille <akim@epita.fr>
19206
19207 * src/complain.c: No longer try to be standalone: use system.h.
19208 Don't assume __STDC__ is defined to 1. Just test if it is defined.
19209 * src/complain.h: Likewise.
19210 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
19211 Remove the unused variable `n'.
19212 From Albert Chin-A-Young.
19213
19214 2001-09-18 Marc Autret <autret_m@epita.fr>
19215
19216 * doc/bison.1: Update.
19217 * doc/bison.texinfo (Bison Options): Update --defines and --graph
19218 descriptions.
19219 (Option Cross Key): Update.
19220 Add --graph.
19221
19222 2001-09-18 Marc Autret <autret_m@epita.fr>
19223
19224 * tests/regression.at: New test (comment in %union).
19225
19226 2001-09-18 Marc Autret <autret_m@epita.fr>
19227
19228 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
19229 do that.
19230 Reported by Keith Browne.
19231
19232 2001-09-18 Marc Autret <autret_m@epita.fr>
19233
19234 * tests/output.at: Add tests for --defines and --graph.
19235
19236 2001-09-18 Marc Autret <autret_m@epita.fr>
19237
19238 * tests/output.at: Removes tests of %{header,src}_extension features.
19239
19240 2001-09-18 Akim Demaille <akim@epita.fr>
19241
19242 * tests/Makefile.am (package.m4): New.
19243 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
19244 (_AT_CHECK_CALC_ERROR): Likewise.
19245 Factor the `, ' part of verbose error messages.
19246
19247 2001-09-18 Marc Autret <autret_m@epita.fr>
19248
19249 * src/getargs.c (longopts): Declare --defines and --graph as options
19250 with optional arguments.
19251 * src/files.h: Add extern declarations.
19252 * src/files.c (spec_graph_file, spec_defines_file): New.
19253 (output_files): Update.
19254 Remove CPP-outed code.
19255
19256 2001-09-18 Marc Autret <autret_m@epita.fr>
19257
19258 Turn off %{source,header}_extension feature.
19259
19260 * src/files.c (compute_exts_from_gf): Update.
19261 (compute_exts_from_src): Update.
19262 (output_files): CPP-out useless code.
19263 * src/files.h: Remove {header,source}_extension extern declarations.
19264 * src/reader.c (parse_dquoted_param): CPP-out.
19265 (parse_header_extension_decl): Remove.
19266 (parse_source_extension_decl): Remove.
19267 (read_declarations): Remove cases tok_{hdrext,srcext}.
19268 * src/lex.c (percent_table): Remove {header,source}_extension entries.
19269 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
19270
19271 2001-09-10 Akim Demaille <akim@epita.fr>
19272
19273 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
19274 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
19275 (AT_CHECK_OUTPUT): this.
19276 Merely check ls' exit status, its output is useless.
19277
19278 2001-09-10 Akim Demaille <akim@epita.fr>
19279
19280 * tests/calc.at: Use m4_match.
19281 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
19282
19283 2001-09-10 Marc Autret <autret_m@epita.fr>,
19284 Akim Demaille <akim@epita.fr>
19285
19286 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
19287 enum color_e.
19288 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
19289 to `normal'.
19290 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
19291 * src/lex.h: Adjust prototype.
19292 (token_t): Add `tok_undef'.
19293 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
19294 (parse_percent_token): Now returns token_t.
19295 Add default statement in switch.
19296 (lex): Separate `c' as an input variable, from the token_t result
19297 part.
19298 (unlexed): Is a token_t.
19299
19300 2001-09-10 Akim Demaille <akim@epita.fr>
19301
19302 * configure.in: Bump to 1.29a.
19303
19304 2001-09-07 Akim Demaille <akim@epita.fr>
19305
19306 Version 1.29.
19307
19308 2001-08-30 Akim Demaille <akim@epita.fr>
19309
19310 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
19311 * m4/atconfig.m4: Remove.
19312 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
19313 * tests/bison: New.
19314 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
19315 m4_if, m4_patsubst, and m4_regexp.
19316 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
19317 `input' file instead of echo.
19318
19319 2001-08-29 Akim Demaille <akim@epita.fr>
19320
19321 Bump to 1.28e.
19322
19323 2001-08-29 Akim Demaille <akim@epita.fr>
19324
19325 Version 1.28d.
19326
19327 2001-08-29 Paul Eggert <eggert@twinsun.com>
19328
19329 * src/bison.simple (yyparse): Don't take the address of an
19330 item before the start of an array, as that doesn't conform to
19331 the C Standard.
19332
19333 2001-08-29 Robert Anisko <anisko_r@epita.fr>
19334
19335 * doc/bison.texinfo (Location Tracking Calc): New node.
19336
19337 2001-08-29 Paul Eggert <eggert@twinsun.com>
19338
19339 * src/output.c (output): Do not define const, as this now
19340 causes more problems than it cures.
19341
19342 2001-08-29 Akim Demaille <akim@epita.fr>
19343
19344 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
19345 the nodes.
19346 Be sure to tag the `detailmenu'.
19347
19348 2001-08-29 Akim Demaille <akim@epita.fr>
19349
19350 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
19351 download in a tmp dir.
19352
19353 2001-08-28 Marc Autret <autret_m@epita.fr>
19354
19355 * config/depcomp: New file.
19356
19357 2001-08-28 Marc Autret <autret_m@epita.fr>
19358
19359 * doc/bison.1 (mandoc): Adjust.
19360 From Juan Manuel Guerrero.
19361
19362 2001-08-28 Marc Autret <autret_m@epita.fr>
19363
19364 * src/print_graph.c (print_state): Fix.
19365
19366 2001-08-27 Marc Autret <autret_m@epita.fr>
19367
19368 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
19369 char * members.
19370 Echo modifications to the functions prototypes.
19371 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
19372
19373 2001-08-27 Marc Autret <autret_m@epita.fr>
19374
19375 * src/vcg.c: Include `xalloc.h'.
19376 (add_colorentry): New.
19377 (add_classname): New.
19378 (add_infoname): New.
19379 * src/vcg.h: Add new prototypes.
19380
19381 2001-08-27 Akim Demaille <akim@epita.fr>
19382
19383 * Makefile.maint: Sync. again with CVS Autoconf.
19384
19385 2001-08-27 Akim Demaille <akim@epita.fr>
19386
19387 * Makefile.maint: Formatting changes.
19388 (po-update, cvs-update, update): New targets.
19389 (AMTAR): Remove.
19390
19391 2001-08-27 Akim Demaille <akim@epita.fr>
19392
19393 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19394 * Makefile.maint: Sync. with CVS Autoconf.
19395
19396 2001-08-27 Marc Autret <autret_m@epita.fr>
19397
19398 * src/vcg.h (struct infoname_s): New.
19399 (struct colorentry_s): New.
19400 (graph_s): New fields {vertical,horizontal}_order in structure.
19401 Add `infoname' field.
19402 Add `colorentry' field;
19403 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
19404 (G_HORIZONTAL_ORDER): New.
19405 (G_INFONAME): New.
19406 (G_COLORENTRY): New.
19407 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
19408 Add output of `infoname'.
19409 Add output of `colorentry'.
19410
19411 2001-08-27 Marc Autret <autret_m@epita.fr>
19412
19413 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
19414 This one shadowed a global parameter.
19415
19416 2001-08-24 Marc Autret <autret_m@epita.fr>
19417
19418 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
19419 instead of `unsigned'.
19420 (print_state): Do not call obstack_object_size () in obstack_grow ()
19421 to avoid macro variables shadowing.
19422
19423 2001-08-23 Marc Autret <autret_m@epita.fr>
19424
19425 * src/lex.c (percent_table): Typo: s/naem/name/.
19426 Add graph option.
19427 Normalize new options declarations.
19428
19429 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
19430
19431 * tests/suite.at: Exercise %header_extension and %source_extension.
19432
19433 2001-08-16 Marc Autret <autret_m@epita.fr>
19434
19435 * src/reader.c (parse_dquoted_param): New.
19436 (parse_header_extension_decl): Use it.
19437 (parse_source_extension_decl): Likewise.
19438
19439 2001-08-16 Marc Autret <autret_m@epita.fr>
19440
19441 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
19442 (get_xxxx_str): Use assert () instead of complain ().
19443 Remove return invokations in default cases.
19444 (get_decision_str): Modify default behaviour. Remove second argument.
19445 Echo modifications on calls.
19446 (output_graph): Fix.
19447
19448 2001-08-16 Marc Autret <autret_m@epita.fr>
19449
19450 * src/getargs.c (usage): Update with ``-g, --graph''.
19451
19452 2001-08-16 Marc Autret <autret_m@epita.fr>
19453
19454 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
19455 (Option Cross Key): Likewise.
19456 * doc/bison.1: Update.
19457
19458 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
19459
19460 * src/output.c (output_master_parser): Don't finish action_obstack.
19461 (output_parser): Don't care about the muscle action, here.
19462 (prepare): Copy the action_obstack in the action muscle.
19463 (output): Free action_obstack.
19464
19465 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
19466
19467 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
19468 will contain `%union' declaration.
19469 (parse_union_decl): Delete #line directive output.
19470 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
19471 informations about %union.
19472 (parse_union_decl): Copy the union_obstack in the muscle stype.
19473 * src/bison.simple: Add new #line directive.
19474 Add typdef %%stype YYSTYPE.
19475
19476 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
19477
19478 * src/bison.simple: Add new `#line' directive.
19479
19480 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
19481
19482 * src/bison.simple: New `#line' directive.
19483 * src/output.c (output_parser): Support new dynamic muscle input_line.
19484
19485 2001-09-22 Marc Autret <autret_m@epita.fr>
19486
19487 * src/output.c (output_master_parser): New.
19488 (output_parser): Be more re-entrant.
19489
19490 2001-09-21 Marc Autret <autret_m@epita.fr>
19491
19492 * src/reader.c (copy_definition, parse_union_decl): Update and use
19493 `linef' muscle.
19494 (copy_action): Likewise.
19495 Use obstack_1grow ().
19496 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
19497
19498 2001-09-21 Marc Autret <autret_m@epita.fr>
19499
19500 * src/options.c (option_table): Adjust.
19501 * src/lex.c (parse_percent_token): Fix.
19502
19503 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
19504
19505 * src/options.c (symtab.h): Include it, need by lex.h.
19506
19507 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
19508
19509 * src/lex.c (parse_percent_token): Change type of variable `tx', which
19510 is now an option_table_struct*.
19511 (option_strcmp): New function option_strcmp.
19512 (parse_percent_token): Call option_strcmp.
19513 * src/getargs.c (xalloc.h, options.h): Include it.
19514 (getargs): Call create_long_option_table.
19515 (getargs): Free longopts at the end of the function.
19516 (shortopts): Move in options.c.
19517 * src/options.c (create_long_option_table): New function. Convert
19518 information from option_table to option structure.
19519 * src/reader.c (options.h): Include it.
19520
19521 * src/Makefile.am: Adjust.
19522 * src/options.c (option_table): Create from longopts and percent_table.
19523 * src/getargs.c (longopts): Delete.
19524 * src/lex.c (struct percent_table_struct): Delete.
19525 (percent_table): Delete.
19526 (options.h): Include it.
19527 * src/options.c: Create.
19528 * src/options.h: Create.
19529 Declare enum opt_access_e.
19530 Define struct option_table_struct.
19531
19532 2001-09-20 Marc Autret <autret_m@epita.fr>
19533
19534 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
19535 sections of Bison.
19536
19537 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
19538
19539 * src/bison.simple: s/%%filename/%%skeleton.
19540 * src/muscle_tab.c (getargs.h): Include it.
19541 (muscle_init): Insert new muscle skeleton.
19542
19543 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
19544
19545 * src/output.c (output_parser): Delete unused variable actions_dumped.
19546
19547 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
19548
19549 * src/output.c (output): Delete call to reader_output_yylsp.
19550 * src/reader.c (reader): Likewise.
19551 * src/reader.h: Delete declaration of reader_output_yylsp.
19552
19553 2001-09-02 Marc Autret <autret_m@epita.fr>
19554
19555 * src/reader.c: Include muscle_tab.h.
19556 (parse_union_decl): Update.
19557 (parse_macro_decl): Rename parse_muscle_decl.
19558 Update to use renamed functions and variable.
19559 (read_declarations, copy_action, read_additionnal_code, : Updated
19560 with correct variables and functions names.
19561 (packsymbols, reader): Likewise.
19562
19563 * src/reader.h (muscle_obstack): Extern declaration update.
19564
19565 * src/output.c: Include muscle_tab.h
19566 In all functions using macro_insert, change by using muscle_insert ().
19567 (macro_obstack): Rename muscle_obstack.
19568 Echo modifications in the whole file.
19569 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
19570 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
19571 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
19572
19573 * src/muscle_tab.h: Update double inclusion macros.
19574 (macro_entry_s): Rename muscle_entry_s.
19575 Update prototypes.
19576
19577 * src/muscle_tab.c: Include muscle_tab.h.
19578 Rename macro_tabble to muscle_table.
19579 (mhash1, mhash2, mcmp): Use muscle_entry.
19580 (macro_init): Rename muscle_init. Update.
19581 (macro_insert): Rename muscle_insert. Update.
19582 (macro_find): Rename muscle_find. Update.
19583
19584 * src/main.c: Include muscle_tab.h.
19585 (main): Call muscle_init ().
19586 * src/Makefile.am (bison_SOURCES): Echo modifications.
19587
19588 2001-09-02 Marc Autret <autret_m@epita.fr>
19589
19590 Now the files macro_tab.[ch] are named muscle_tab.[ch].
19591
19592 * src/muscle_tab.c, src/muscle_tab.h: Add files.
19593
19594 2001-09-02 Marc Autret <autret_m@epita.fr>
19595
19596 * src/macrotab.c, src/macrotab.h: Remove.
19597
19598 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
19599
19600 * src/reader.c (copy_guard): Use muscle to specify the `#line'
19601 filename.
19602
19603 2001-09-01 Marc Autret <autret_m@epita.fr>
19604
19605 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
19606 to an explicit value to activate the feature. We do it here.
19607
19608 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19609
19610 * src/output.c (prepare): Delete the `filename' muscule insertion.
19611 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
19612 (parse_union_decl): Likewise.
19613 * src/macrotab.c (macro_init): Initialize filename by infile.
19614
19615 2001-08-31 Marc Autret <autret_m@epita.fr>
19616
19617 * src/bison.simple (YYLSP_NEEDED): New definition.
19618 * src/output.c (prepare): Add macro insertion of `locations_flag'
19619
19620 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19621
19622 * src/output.c (prepare): Delete insertion of previous muscles,
19623 and insert the `prefix' muscles.
19624 * src/macrotab.c (macro_init): Likewise.
19625 (macro_init): Initialization prefix directive by `yy'.
19626 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
19627 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
19628 yylval, yydebug, yyerror, yynerrs and yyparse.
19629 New directive `#define' to substitute yydebug, ... with option
19630 name_prefix.
19631
19632 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19633
19634 * src/main.c (main): Standardize.
19635 * src/output.c (output_table_data, output_parser): Likewise.
19636 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
19637
19638 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
19639
19640 * src/reader.c (read_additionnal_code): Rename %%user_code to
19641 %%epilogue.
19642 * src/output.c (output): Rename %%declarations to %%prologue.
19643 * src/bison.simple: Echo modifications.
19644
19645 2001-08-31 Marc Autret <autret_m@epita.fr>
19646
19647 * src/reader.c (readgram): CleanUp.
19648 (output_token_defines): Likewise.
19649 (packsymbols): Likewise.
19650 (reader): Likewise.
19651 * src/output.c (output): CPP-out useless code.
19652
19653 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19654
19655 * src/reader.c (reader): Delete obsolete call to function
19656 output_trailers and output_headers.
19657 * src/output.h: Remove obsolete functions prototypes of output_headers
19658 and output_trailers.
19659
19660 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
19661
19662 * src/main.c: Include macrotab.h.
19663 * src/macrotab.h (macro_entry_s): Constify fields.
19664 Adjust functions prototypes.
19665 * src/macrotab.c (macro_insert): Constify key and value.
19666 (macro_find): Constify key.
19667 (macro_insert): Include 'xalloc.h'
19668 (macro_insert): Use XMALLOC.
19669 (macro_find): Constify return value.
19670 * src/output.c (output_table_data): Rename table to table_data.
19671 (output_parser): Constify macro_key, macro_value.
19672
19673 2001-08-30 Marc Autret <autret_m@epita.fr>
19674
19675 * src/reader.c (parse_skel_decl): New.
19676 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
19677 * src/lex.h (token_t): New token `tok_skel'.
19678 * src/lex.c (percent_table): Add skeleton option entry.
19679 Standardize.
19680
19681 2001-08-29 Marc Autret <autret_m@epita.fr>
19682
19683 * src/bison.simple: Add %%user_code directive at the end.
19684 * src/reader.c (read_additionnal_code): New.
19685 (reader): Use it.
19686 * src/output.c (output_program): Remove.
19687 (output): Update.
19688
19689 2001-08-28 Marc Autret <autret_m@epita.fr>
19690
19691 * src/output.c (output_actions): Clean up.
19692 (output_gram): CPP-out useless code.
19693 * src/reader.c (reader): Clean up, CPP-out useless code.
19694
19695 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
19696
19697 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
19698 directive.
19699 * src/bison.simple: Add `%%definitions'.
19700
19701 2001-08-28 Marc Autret <autret_m@epita.fr>
19702
19703 * config/depcomp: New file.
19704
19705 2001-08-27 Paul Eggert <eggert@twinsun.com>
19706
19707 * src/bison.simple (yyparse): Don't take the address of an
19708 item before the start of an array, as that doesn't conform to
19709 the C Standard.
19710
19711 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
19712
19713 * src/output.c (output): Remove the initialization of the macro
19714 obstack. It was done too late here.
19715
19716 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
19717 completely wrong.
19718 (reader): Initialize the macro obstack here, since we need it to grow
19719 '%define' directives.
19720
19721 * src/reader.h: Declare the macro obstack as extern.
19722
19723 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
19724
19725 * src/output.c (output_parser): Fix. Store single '%' characters in
19726 the output obstack instead of throwing them away.
19727
19728 2001-08-27 Akim Demaille <akim@epita.fr>
19729
19730 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19731
19732 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19733
19734 * lib/Makefile.am: Adjust.
19735
19736 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19737
19738 * src/bison.simple: Update and add '%%' directives.
19739
19740 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19741
19742 * src/reader.c (reader): Remove calls to 'output_headers' and
19743 'output_trailers'. Remove some C output.
19744 (readgram): Disable a piece of code that was writing a default
19745 definition for 'YYSTYPE'.
19746 (reader_output_yylsp): Remove.
19747 (packsymbols): Output token defintions to a macro.
19748 (copy_definition): Disable C output.
19749
19750 * src/reader.c (parse_macro_decl): New function used to parse macro
19751 declarations.
19752 (copy_string2): Put the body of copy_string into this new function.
19753 Add a parameter to let the caller choose whether he wants to copy the
19754 string delimiters or not.
19755 (copy_string): Be a simple call to copy_string2 with the last argument
19756 bound to true.
19757 (read_declarations): Add case for macro definition.
19758 (copy_identifier): New.
19759 (parse_macro_decl): Read macro identifiers using copy_identifier
19760 rather than lex.
19761
19762 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19763
19764 * src/output.c (prepare): Add prefixed names.
19765 (output_parser): Output semantic actions.
19766 (output_parser): Fix bug on '%%line' directives.
19767
19768 * src/output.c (output_headers): Remove. The C code printed by this
19769 function should now be in the skeletons.
19770 (output_trailers): Remove.
19771 (output): Disable call to 'reader_output_yylsp'.
19772 (output_rule_data): Do not output tables to the table obstack.
19773
19774 * src/output.c: Remove some C dedicated output.
19775 Improve the use of macro and output obstacks.
19776 (output_defines): Remove.
19777
19778 * src/output.c (output_token_translations): Associate 'translate'
19779 table with a macro. No output to the table obstack.
19780 (output_gram): Same for 'rhs' and 'prhs'.
19781 (output_stos): Same for 'stos'.
19782 (output_rule_data): Same for 'r1' and 'r2'.
19783 (token_actions): Same for 'defact'.
19784 (goto_actions): Same for 'defgoto'.
19785 (output_base): Same for 'pact' and 'pgoto'.
19786 (output_table): Same for 'table'.
19787 (output_check): Same for 'check'.
19788
19789 * src/output.c (output_table_data): New function.
19790 (output_short_table): Remove.
19791 (output_short_or_char_table): Remove.
19792
19793 * src/output.c (output_parser): Replace most of the skeleton copy code
19794 with something new. Skeletons are now processed character by character
19795 rather than line by line, and Bison looks for '%%' macros. This is the
19796 first step in making Bison's output process (a lot) more flexible.
19797 (output_parser): Use the macro table.
19798
19799 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19800
19801 * src/main.c (main): Initialize the macro table.
19802
19803 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19804
19805 * src/lex.c (percent_table): Add tok_define.
19806 * src/lex.h: Add tok_define.
19807
19808 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19809
19810 * src/macrotab.c: New file.
19811 * src/macrotab.h: New file.
19812 * src/Makefile.am: Update.
19813
19814 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19815
19816 * lib/hash.c: New file.
19817 * lib/hash.h: New file.
19818 * lib/Makefile.am: Update.
19819
19820 2001-08-15 Akim Demaille <akim@epita.fr>
19821
19822 Version 1.28c.
19823
19824 2001-08-15 Marc Autret <autret_m@epita.fr>
19825
19826 * src/reader.c (readgram): Indent output macro YYSTYPE.
19827 (packsymbols): Likewise.
19828 (output_token_defines): Likewise.
19829 * src/files.c: Standardize.
19830 (compute_header_macro): New.
19831 (defines_obstack_save): New. Use compute_header_macro.
19832 (output_files): Update. Use defines_obstack_save.
19833
19834 2001-08-15 Akim Demaille <akim@epita.fr>
19835
19836 * doc/bison.texinfo (Table of Symbols): Document
19837 YYSTACK_USE_ALLOCA.
19838
19839 2001-08-15 Akim Demaille <akim@epita.fr>
19840
19841 * missing: Update from CVS Automake.
19842 * config/config.guess, config/config.sub, config/texinfo.tex:
19843 Update from gnu.org.
19844
19845 2001-08-15 Akim Demaille <akim@epita.fr>
19846
19847 * Makefile.maint: Sync with CVS Autoconf.
19848
19849 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
19850
19851 * doc/bison.texinfo: Include GNU Free Documentation License from
19852 `fdl.texi'.
19853 * doc/fdl.texi: Add to package.
19854
19855 2001-08-14 Marc Autret <autret_m@epita.fr>
19856
19857 Turn on %{source,header}_extension features.
19858
19859 * src/lex.c (percent_table): Un-CPP out header_extension and
19860 source_extension.
19861 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
19862 (compute_exts_from_src): Remove conditions. It restores priorities
19863 between options.
19864
19865 2001-08-14 Marc Autret <autret_m@epita.fr>
19866
19867 * src/files.c (compute_base_names): Add extensions computing when
19868 `--file-prefix' used.
19869 Standardize function calls.
19870
19871 2001-08-13 Marc Autret <autret_m@epita.fr>
19872
19873 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
19874 defining it (defined but null disables alloca).
19875
19876 2001-08-13 Marc Autret <autret_m@epita.fr>
19877
19878 * src/bison.simple (_yy_memcpy): CPP reformat.
19879
19880 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
19881
19882 * tests/atconfig.in (CPPFLAGS): Fix.
19883
19884 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
19885
19886 * doc/bison.texinfo: Include GNU General Public License from
19887 `gpl.texi'.
19888 * doc/gpl.texi: Add to package.
19889
19890 2001-08-10 Marc Autret <autret_m@epita.fr>
19891
19892 * src/print_graph.h: Fix.
19893 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
19894
19895 2001-08-10 Akim Demaille <akim@epita.fr>
19896
19897 * src/system.h: Provide default declarations for stpcpy, strndup,
19898 and strnlen.
19899
19900 2001-08-10 Robert Anisko <anisko_r@epita.fr>
19901
19902 * doc/bison.texinfo (Locations): Update @$ stuff.
19903
19904 2001-08-09 Robert Anisko <anisko_r@epita.fr>
19905
19906 * src/bison.simple (YYLLOC_DEFAULT): Update.
19907 (yyparse): Adjust.
19908
19909 2001-08-08 Marc Autret <autret_m@epita.fr>
19910
19911 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
19912 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
19913 Reported by Fabrice Bauzac.
19914
19915 2001-08-08 Marc Autret <autret_m@epita.fr>
19916
19917 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
19918 * src/vcg.c (output_node): Fix.
19919 * src/vcg.h: Cleanup.
19920 * src/print_graph.c: Add comments.
19921 (node_output_size): New global variable. Simplify the formatting of
19922 the VCG graph output.
19923 (print_actions): Unused code is now used. It notifies the final state
19924 and no action states in the VCG graph. It also give the reduce actions.
19925 The `shift and goto' edges are red and the `go to state' edges are
19926 blue.
19927 Get the current node name and node_obstack by argument.
19928 (node_obstack): New variable.
19929 (print_state): Manage node_obstack.
19930 (print_core): Use node_obstack given by argument.
19931 A node is not only computed here but in print_actions also.
19932 (print_graph): CPP out useless code instead of commenting it.
19933
19934 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
19935
19936 * tests/atconfig.in (CPPFLAGS): Fix.
19937
19938 2001-08-07 Akim Demaille <akim@epita.fr>
19939
19940 * src/print_graph.c (quote): New.
19941 (print_core): Use it.
19942
19943 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
19944
19945 * src/vcg.c (complain.h): Include it.
19946 Unepitaize `return' invocations.
19947 [NDEBUG] (main): Remove.
19948 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
19949 * src/files.c (open_files): Initialize graph_obstack.
19950 * src/print_graph.c (print_actions): CPP out useless code.
19951 (print_core): Don't output the last `\n' in labels.
19952 Use `quote'.
19953 * src/files.c (output_files): Output the VCG file.
19954 * src/main.c (main): Invoke print_graph ();
19955
19956 2001-08-06 Marc Autret <autret_m@epita.fr>
19957
19958 Automaton VCG graph output.
19959 Using option ``-g'' or long option ``--graph'', you can generate
19960 a gram_filename.vcg file containing a VCG description of the LALR (1)
19961 automaton of your grammar.
19962
19963 * src/main.c: Call to print_graph() function.
19964 * src/getargs.h: Update.
19965 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
19966 (graph_flag): New flag.
19967 (longopts): Update.
19968 (getargs): Add case `g'.
19969 * src/files.c (graph_obstack): New obstack struct.
19970 (open_files): Initialize new obstack.
19971 (output_files): Saves graph_obstack if required.
19972 * src/files.h (graph_obstack): New extern declaration.
19973 * src/Makefile.am: Add new source files.
19974
19975 2001-08-06 Marc Autret <autret_m@epita.fr>
19976
19977 * src/print_graph.c, src/print_graph.h (graph): New.
19978 * src/vcg.h: New file.
19979 * src/vcg.c: New file, VCG graph handling.
19980
19981 2001-08-06 Marc Autret <autret_m@epita.fr>
19982
19983 Add of %source_extension and %header_extension which specify
19984 the source or/and the header output file extension.
19985
19986 * src/files.c (compute_base_names): Remove initialisation of
19987 src_extension and header_extension.
19988 (compute_exts_from_gf): Update.
19989 (compute_exts_from_src): Update.
19990 (output_files): Update.
19991 * src/reader.c (parse_header_extension_decl): New.
19992 (parse_source_extension_decl): New.
19993 (read_declarations): New case statements for the new tokens.
19994 * src/lex.c (percent_table): Add entries for %source_extension
19995 and %header_extension.
19996 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
19997
19998 2001-08-06 Marc Autret <autret_m@epita.fr>
19999
20000 * configure.in: Bump to 1.28c.
20001 * doc/bison.texinfo: Texinfo thingies.
20002
20003 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
20004
20005 * tests/atconfig.in (CPPFLAGS): Add.
20006 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
20007
20008 2001-08-03 Akim Demaille <akim@epita.fr>
20009
20010 Version 1.28b.
20011
20012 2001-08-03 Akim Demaille <akim@epita.fr>
20013
20014 * tests/Makefile.am (check-local): Ship testsuite.
20015 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
20016 Include `string.h'.
20017
20018 2001-08-03 Akim Demaille <akim@epita.fr>
20019
20020 * configure.in: Try using -Wformat when compiling.
20021
20022 2001-08-03 Akim Demaille <akim@epita.fr>
20023
20024 * configure.in: Bump to 1.28b.
20025
20026 2001-08-03 Akim Demaille <akim@epita.fr>
20027
20028 * src/complain.c: Adjust strerror_r portability issues.
20029
20030 2001-08-03 Akim Demaille <akim@epita.fr>
20031
20032 Version 1.28a.
20033
20034 2001-08-03 Akim Demaille <akim@epita.fr>
20035
20036 * src/getargs.c, src/getarg.h (skeleton)): Constify.
20037 * src/lex.c (literalchar): Avoid name clashes on `buf'.
20038 * src/getargs.c: Include complain.h.
20039 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
20040 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
20041
20042 2001-08-03 Akim Demaille <akim@epita.fr>
20043
20044 * src/reader.c (readgram): Display hidden chars in error messages.
20045
20046 2001-08-03 Akim Demaille <akim@epita.fr>
20047
20048 Update to gettext 0.10.39.
20049
20050 2001-08-03 Akim Demaille <akim@epita.fr>
20051
20052 * lib/strspn.c: New.
20053
20054 2001-08-01 Marc Autret <autret_m@epita.fr>
20055
20056 * doc/bison.texinfo: Update.
20057 * doc/bison.1 (mandoc): Update.
20058 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
20059 * src/files.c: Support output files extensions computing.
20060 (src_extension): New static variable.
20061 (header_extension): New static variable.
20062 (tr): New function.
20063 (get_extension_index): New function, gets the index of an extension
20064 filename in a string.
20065 (compute_exts_from_gf): New function, computes extensions from the
20066 grammar file extension.
20067 (compute_exts_from_src): New functions, computes extensions from the
20068 C source file extension, file given by ``-o'' option.
20069 (compute_base_names): Update.
20070 (output_files): Update.
20071
20072 2001-08-01 Robert Anisko <anisko_r@epita.fr>
20073
20074 * doc/bison.texi: Document @$.
20075 (Locations): New section.
20076
20077 2001-07-18 Akim Demaille <akim@epita.fr>
20078
20079 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
20080 * config/prev-version.txt, config/move-if-change: New.
20081 * Makefile.am: Adjust.
20082
20083 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
20084
20085 * src/bison.simple (yyparse): Suppress warning `comparaison
20086 between signed and unsigned'.
20087
20088 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
20089
20090 * src/getargs.h (raw_flag): Remove.
20091 * src/getargs.c: Die on `-r'/`--raw'.
20092 * src/lex.c (parse_percent_token): Die on `%raw'.
20093 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
20094 * tests/calc.at: Suppress test with option `--raw'.
20095
20096 2001-07-14 Akim Demaille <akim@epita.fr>
20097
20098 * config/: New.
20099 * configure.in: Require Autoconf 2.50.
20100 Update to gettext 0.10.38.
20101
20102 2001-03-16 Akim Demaille <akim@epita.fr>
20103
20104 * doc/bison.texinfo: ANSIfy the examples.
20105
20106 2001-03-16 Akim Demaille <akim@epita.fr>
20107
20108 * getargs.c (skeleton): New variable.
20109 (longopts): --skeleton is a new option.
20110 (shortopts, getargs): -S is a new option.
20111 * getargs.h: Declare skeleton.
20112 * output.c (output_parser): Use it.
20113
20114 2001-03-16 Akim Demaille <akim@epita.fr>
20115
20116 * m4/strerror_r.m4: New.
20117 * m4/error.m4: Run AC_FUNC_STRERROR_R.
20118 * lib/error.h, lib/error.c: Update.
20119
20120 2001-03-16 Akim Demaille <akim@epita.fr>
20121
20122 * src/getargs.c (longopts): Clean up.
20123
20124 2001-02-21 Akim Demaille <akim@epita.fr>
20125
20126 * src/reader.c (gensym): `gensym_count' is your own.
20127 Use a static buf to create the symbol name, as token_buffer is no
20128 longer a buffer.
20129
20130 2001-02-08 Akim Demaille <akim@epita.fr>
20131
20132 * src/conflicts.c (conflict_report): Be sure not to append to res
20133 between two calls, which could happen if both first sprintf were
20134 skipped, but not the first cp += strlen.
20135
20136 2001-02-08 Akim Demaille <akim@epita.fr>
20137
20138 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
20139 New, from fileutils 4.0.37.
20140 * configure.in: Require Autoconf 2.49c. I took some time before
20141 making this decision. This is the only way out for portability
20142 issues in Bison, it would mean way too much duplicate effort to
20143 import in Bison features implemented in 2.49c since 2.13.
20144 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
20145
20146 2001-02-02 Akim Demaille <akim@epita.fr>
20147
20148 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
20149 * lib/xalloc.h, lib/xmalloc.c: Update.
20150
20151 2001-01-19 Akim Demaille <akim@epita.fr>
20152
20153 Get rid of the ad hoc handling of token_buffer in the scanner: use
20154 the obstacks.
20155
20156 * src/lex.c (token_obstack): New.
20157 (init_lex): Initialize it. No longer call...
20158 (grow_token_buffer): this. Remove it.
20159 Adjust all the places which used it to use the obstack.
20160
20161 2001-01-19 Akim Demaille <akim@epita.fr>
20162
20163 * src/lex.h: Rename all the tokens:
20164 s/\bENDFILE\b/tok_eof/g;
20165 s/\bIDENTIFIER\b/tok_identifier/g;
20166 etc.
20167 Let them be enums, not #define, to ease debugging.
20168 Adjust all the code.
20169
20170 2001-01-18 Akim Demaille <akim@epita.fr>
20171
20172 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
20173 * src/lex.c (maxtoken, grow_token_buffer): Static.
20174
20175 2001-01-18 Akim Demaille <akim@epita.fr>
20176
20177 Since we now use obstacks, more % directives can be enabled.
20178
20179 * src/lex.c (percent_table): Also accept `%yacc',
20180 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
20181 `%debug'.
20182 Handle the actions for `%semantic_parser' and `%pure_parser' here,
20183 instead of returning a token.
20184 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
20185 * src/reader.c (read_declarations): Adjust.
20186 * src/files.c (open_files): Don't call `compute_base_names', don't
20187 compute `attrsfile' since they depend upon data which might be
20188 *in* the input file now.
20189 (output_files): Do it here.
20190 * src/output.c (output_headers): Document the fact that this patch
20191 introduces a guaranteed SEGV for semantic parsers.
20192 * doc/bison.texinfo: Document them.
20193 * tests/suite.at: Exercise these %options.
20194
20195 2000-12-20 Akim Demaille <akim@epita.fr>
20196
20197 Also handle the output file (--verbose) with obstacks.
20198
20199 * files.c (foutput): Remove.
20200 (output_obstack): New.
20201 Adjust all dependencies.
20202 * src/conflicts.c: Return a string.
20203 * src/system.h (obstack_grow_string): Rename as...
20204 (obstack_sgrow): this. Be ready to work with non literals.
20205 (obstack_fgrow4): New.
20206
20207 2000-12-20 Akim Demaille <akim@epita.fr>
20208
20209 * src/files.c (open_files): Fix the computation of short_base_name
20210 in the case of `-o foo.tab.c'.
20211
20212 2000-12-20 Akim Demaille <akim@epita.fr>
20213
20214 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
20215 (copy_dollar): Now that everything uses obstacks, get rid of the
20216 FILE * parameters.
20217
20218 2000-12-20 Akim Demaille <akim@epita.fr>
20219
20220 * src/files.c (open_files): Actually the `.output' file is based
20221 on the short_base_name, not base_name.
20222 * tests/suite.at (Checking output file names): Adjust.
20223
20224 2000-12-20 Akim Demaille <akim@epita.fr>
20225
20226 * src/bison.s1: Remove, we now use directly...
20227 * src/bison.simple: this.
20228 * src/Makefile.am: Use pkgdata instead of data.
20229
20230 2000-12-20 Akim Demaille <akim@epita.fr>
20231
20232 * src/files.c (guard_obstack): New.
20233 (open_files): Initialize it.
20234 (output_files): Dump it...
20235 * src/files.h: Export it.
20236 * src/reader.c (copy_guard): Use it.
20237
20238 2000-12-19 Akim Demaille <akim@epita.fr>
20239
20240 * src/files.c (outfile, defsfile, actfile): Removed as global
20241 vars.
20242 (open_files): Don't compute them.
20243 (output_files): Adjust.
20244 (base_name, short_base_name): Be global.
20245 Adjust dependencies.
20246
20247 2000-12-19 Akim Demaille <akim@epita.fr>
20248
20249 * src/files.c (strsuffix): New.
20250 (stringappend): Be just like strcat but allocate.
20251 (base_names): Eve out from open_files.
20252 Try to simplify the rather hairy computation of base_name and
20253 short_base_name.
20254 (open_files): Use it.
20255 * tests/suite.at (Checking output file names): New test.
20256
20257 2000-12-19 Akim Demaille <akim@epita.fr>
20258
20259 * src/system.h (obstack_grow_literal_string): Rename as...
20260 (obstack_grow_string): this.
20261 * src/output.c (output_parser): Recognize `%% actions' instead of
20262 `$'.
20263 * src/bison.s1: s/$/%% actions/.
20264 * src/bison.hairy: Likewise.
20265
20266 2000-12-19 Akim Demaille <akim@epita.fr>
20267
20268 * src/output.c (output_parser): Compute the `#line' lines when
20269 there are.
20270 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
20271 Suggested by Hans Aberg.
20272
20273 2000-12-19 Akim Demaille <akim@epita.fr>
20274
20275 Let the handling of the skeleton files be local to the procedures
20276 that use it.
20277
20278 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
20279 longer static.
20280 (fparser, open_extra_files): Remove.
20281 (open_files, output_files): Don't take care of fparser.
20282 * src/files.h: Adjust.
20283 * src/output.c (output_parser): Open and close the file to the
20284 skeleton.
20285 * src/reader.c (read_declarations): When %semantic_parser, open
20286 fguard.
20287
20288 2000-12-19 Akim Demaille <akim@epita.fr>
20289
20290 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
20291 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
20292
20293 2000-12-19 Akim Demaille <akim@epita.fr>
20294
20295 * src/files.c (open_files): Yipee! We no longer need all the code
20296 looking for `/tmp' since we have no tmp file.
20297
20298 2000-12-19 Akim Demaille <akim@epita.fr>
20299
20300 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
20301 New macros.
20302 * src/files.c (open_files): Less dependency on MSDOS etc.
20303
20304 2000-12-14 Akim Demaille <akim@epita.fr>
20305
20306 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
20307 Provide a default definition.
20308 Use it when executing the default @ action.
20309 * src/reader.c (reader_output_yylsp): No longer include
20310 `timestamp' and `text' in the default YYLTYPE.
20311
20312 2000-12-12 Akim Demaille <akim@epita.fr>
20313
20314 * src/reader.c (copy_definition, parse_union_decl, copy_action)
20315 (copy_guard): Quote the file names.
20316 Reported by Laurent Mascherpa.
20317
20318 2000-12-12 Akim Demaille <akim@epita.fr>
20319
20320 * src/output.c (output_headers, output_program, output): Be sure
20321 to escape special characters when outputting filenames.
20322 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
20323 (output_headers): Don't depend on them, Use ACTSTR.
20324
20325 2000-11-17 Akim Demaille <akim@epita.fr>
20326
20327 * lib/obstack.h: Formatting changes.
20328 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
20329 prevents type checking.
20330 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
20331 cast the value to (void *): assigning a `foo *' to a `void *'
20332 variable is valid.
20333 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
20334 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
20335 append characters.
20336
20337 2000-11-17 Akim Demaille <akim@epita.fr>
20338
20339 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
20340 as...
20341 (suite.m4, regression.m4, calc.m4): these.
20342 * tests/atgeneral.m4: Update from CVS Autoconf.
20343
20344 2000-11-17 Akim Demaille <akim@epita.fr>
20345
20346 * tests/regression.m4 (%union and --defines): New test,
20347 demonstrating a current bug in the obstack implementation.
20348
20349 2000-11-17 Akim Demaille <akim@epita.fr>
20350
20351 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
20352 macros.
20353 Use them to declare the variables which are global or local to
20354 `yyparse'.
20355
20356 2000-11-17 Akim Demaille <akim@epita.fr>
20357
20358 * acconfig.h: Remove, no longer used.
20359
20360 2000-11-07 Akim Demaille <akim@epita.fr>
20361
20362 * src: s/Copyright (C)/Copyright/g.
20363
20364 2000-11-07 Akim Demaille <akim@epita.fr>
20365
20366 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
20367 defining.
20368 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
20369
20370 2000-11-07 Akim Demaille <akim@epita.fr>
20371
20372 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
20373 Merge in a single CPP if/else.
20374
20375 2000-11-07 Akim Demaille <akim@epita.fr>
20376
20377 * src/output.c (output): Remove useless variables.
20378 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
20379 argument `data' for consistency with the prototypes.
20380 Qualify it `const'.
20381 (obstack_copy, obstack_copy0): Rename the second argument as
20382 `address' for consistency. Qualify it `const'.
20383 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
20384 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
20385 `const' their input argument (`data' or `address').
20386 Adjust the corresponding macros to include `const' in casts.
20387
20388 2000-11-03 Akim Demaille <akim@epita.fr>
20389
20390 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
20391 s/PFILE1/BISON_HAIRY/.
20392 Adjust dependencies.
20393
20394 2000-11-03 Akim Demaille <akim@epita.fr>
20395
20396 For some reason, this was not applied.
20397
20398 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20399 `unlink': it's no longer used.
20400
20401 2000-11-03 Akim Demaille <akim@epita.fr>
20402
20403 * src/files.c (skeleton_find): New function, eved out of...
20404 (open_files, open_extra_files): here.
20405
20406 2000-11-03 Akim Demaille <akim@epita.fr>
20407
20408 Don't use `atexit'.
20409
20410 * src/files.c (obstack_save): New function.
20411 (done): Rename as...
20412 (output_files): this.
20413 Use `obstack_save'.
20414 * src/main.c (main): Don't use `atexit' to register `done', since
20415 it no longer has to remove tmp files, just call `output_files'
20416 when there are no errors.
20417
20418 2000-11-02 Akim Demaille <akim@epita.fr>
20419
20420 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20421 `unlink': it's no longer used.
20422 * src/files.h: Formatting changes.
20423
20424 2000-11-02 Akim Demaille <akim@epita.fr>
20425
20426 Remove the last uses of mktemp and unlink/delete.
20427
20428 * src/files.c (fdefines, ftable): Removed.
20429 (defines_ostack, table_obstack): New.
20430 Adjust dependencies of the former into uses of the latter.
20431 * src/output.c (output_short_or_char_table, output_short_table):
20432 Convert to using obstacks.
20433 * src/reader.c (copy_comment2): Accept one FILE * and two
20434 obstacks.
20435 (output_token_defines, reader_output_yylsp): Use obstacks.
20436 * src/system.h (obstack_fgrow3): New.
20437 * po/POTFILES.in: Adjust.
20438
20439 2000-11-01 Akim Demaille <akim@epita.fr>
20440
20441 Change each use of `fattrs' into a use of `attrs_obstack'.
20442
20443 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
20444 * src/files.c (fattrs): Remove.
20445 (attrs_obstack): New.
20446 Adjust all dependencies.
20447 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
20448
20449 2000-11-01 Akim Demaille <akim@epita.fr>
20450
20451 Introduce obstacks.
20452 Change each use of `faction' into a use of `action_obstack'.
20453
20454 * lib/obstack.h, lib/obstack.c: New files.
20455 * src/files.c (faction): Remove.
20456 (action_obstack): New.
20457 Adjust all dependencies.
20458
20459 2000-10-20 Akim Demaille <akim@epita.fr>
20460
20461 * lib/quote.h (PARAMS): New macro. Use it.
20462
20463 2000-10-16 Akim Demaille <akim@epita.fr>
20464
20465 * src/output.c (output_short_or_char_table): New function.
20466 (output_short_table, output_token_translations): Use it.
20467 (goto_actions): Use output_short_table.
20468
20469 2000-10-16 Akim Demaille <akim@epita.fr>
20470
20471 * src/symtab.c (bucket_new): New function.
20472 (getsym): Use it.
20473
20474 * src/output.c (output_short_table): New argument to display the
20475 comment associated with the table.
20476 Adjust dependencies.
20477 (output_gram): Use it.
20478 (output_rule_data): Nicer output layout for YYTNAME.
20479
20480 2000-10-16 Akim Demaille <akim@epita.fr>
20481
20482 * src/lex.c (read_typename): New function.
20483 (lex): Use it.
20484 * src/reader.c (copy_dollar): Likewise.
20485
20486 2000-10-16 Akim Demaille <akim@epita.fr>
20487
20488 * src/reader.c (copy_comment2): Expect the input stream to be on
20489 the `/' which is suspected to open a comment, instead of being
20490 called after `//' or `/*' was read.
20491 (copy_comment, copy_definition, parse_union_decl, copy_action)
20492 (copy_guard): Adjust.
20493
20494 2000-10-16 Akim Demaille <akim@epita.fr>
20495
20496 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
20497 `read_signed_integer'.
20498
20499 2000-10-16 Akim Demaille <akim@epita.fr>
20500
20501 * src/reader.c (copy_dollar): New function.
20502 (copy_guard, copy_action): Use it.
20503
20504 2000-10-16 Akim Demaille <akim@epita.fr>
20505
20506 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
20507 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
20508 New files, from Fileutils 4.0.27.
20509 * src/main.c (printable_version): Remove.
20510 * src/lex.c, src/reader.c: Use `quote'.
20511
20512 2000-10-04 Akim Demaille <akim@epita.fr>
20513
20514 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
20515
20516 2000-10-04 Akim Demaille <akim@epita.fr>
20517
20518 * doc/bison.texinfo: Various typos spotted by Neil Booth.
20519
20520 2000-10-04 Akim Demaille <akim@epita.fr>
20521
20522 When a literal string is used to define two different tokens,
20523 `bison -v' segfaults.
20524 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
20525
20526 * tests/regression.m4: New file.
20527 Include the core of the sample provided by Piotr Gackiewicz.
20528 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
20529 properly.
20530
20531 2000-10-04 Akim Demaille <akim@epita.fr>
20532
20533 * src/reader.c (parse_expect_decl): Keep `count' within the size
20534 of `buffer'.
20535 From Neil Booth.
20536
20537 2000-10-02 Paul Eggert <eggert@twinsun.com>
20538
20539 * bison.s1 (yyparse): Assign the default value
20540 unconditionally, to avoid a GCC warning and make the parser a
20541 tad smaller.
20542
20543 2000-10-02 Akim Demaille <akim@epita.fr>
20544
20545 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
20546 options.
20547
20548 2000-10-02 Akim Demaille <akim@epita.fr>
20549
20550 * src/derives.c, src/print.c, src/reduce.c: To ease the
20551 translation, move some `\n' out of the translated strings.
20552
20553 2000-10-02 Akim Demaille <akim@epita.fr>
20554
20555 The location tracking mechanism is precious for parse error
20556 messages. Nevertheless, it is enabled only when `@n' is used in
20557 the grammar, which is a different issue (you can use it in error
20558 message, but not in the grammar per se). Therefore, there should
20559 be another means to enable it.
20560
20561 * src/getargs.c (getargs): Support `--locations'.
20562 (usage): Report it.
20563 * src/getargs.h (locationsflag): Export it.
20564 * src/lex.c (percent_table): Support `%locations'.
20565 * src/reader.c (yylsp_needed): Remove this variable, now replaced
20566 with `locationsflag'.
20567 * doc/bison.texinfo: Document `--locations' and `%locations'.
20568 Sort the options.
20569 * tests/calc.m4: Test it.
20570
20571 For regularity of the names, replace each
20572 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
20573 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
20574 In addition replace each `flag' with `_flag'.
20575
20576 2000-10-02 Akim Demaille <akim@epita.fr>
20577
20578 Also test parse error messages, including with YYERROR_VERBOSE.
20579
20580 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
20581 associative).
20582 Use it to check the computations.
20583 Use it to check `nonassoc' is honored.
20584 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
20585 `--yyerror-verbose'.
20586 (_AT_CHECK_CALC): Adjust to this option.
20587 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
20588
20589 2000-10-02 Akim Demaille <akim@epita.fr>
20590
20591 Test also `--verbose', `--defines' and `--name-prefix'. Testing
20592 the latter demonstrates a flaw in the handling of non debugging
20593 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
20594 was used in order to simplify:
20595
20596 #if YYDEBUG
20597 if (yydebug)
20598 {
20599 ...
20600 }
20601 #endif
20602
20603 into
20604
20605 if (yydebug)
20606 {
20607 ...
20608 }
20609
20610 unfortunately this leads to a CPP conflict when
20611 `--name-prefix=foo' is used since it produces `#define yydebug
20612 foodebug'.
20613
20614 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
20615 (YYDPRINTF): New macro.
20616 Spread its use.
20617 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
20618 the bison options.
20619 Also test `--verbose', `--defines' and `--name-prefix'.
20620
20621 2000-10-02 Akim Demaille <akim@epita.fr>
20622
20623 Improve the readability of the produced parsers.
20624
20625 * src/bison.s1: Formatting changes.
20626 Improve the comment related to the `$' mark.
20627 (yydefault): Don't fall through to `yyresume': `goto' there.
20628 * src/output.c (output_parser): When the `$' is met, skip the end
20629 of its line.
20630 New variable, `number_of_dollar_signs', to check there's exactly
20631 one `$' in the parser skeleton.
20632
20633 2000-10-02 Akim Demaille <akim@epita.fr>
20634
20635 * lib/xstrdup.c: New file, from the fileutils.
20636 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
20637 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
20638 instead of strlen + xmalloc + strcpy.
20639 * src/symtab.c (copys): Remove, use xstrdup instead.
20640
20641 2000-10-02 Akim Demaille <akim@epita.fr>
20642
20643 * src/gram.h (associativity): New enum type which replaces the
20644 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
20645 `right_assoc', `left_assoc' and `non_assoc'.
20646 Adjust all dependencies.
20647 * src/reader.c: Formatting changes.
20648 (LTYPESTR): Don't define it, use it as a literal in
20649 `reader_output_yylsp'.
20650 * src/symtab.h (symbol_class): New enum type which replaces the
20651 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
20652 `sunknown', `stoken and `snterm'.
20653
20654 2000-10-02 Akim Demaille <akim@epita.fr>
20655
20656 * src/getargs.c (fixed_outfiles): Rename as...
20657 (yaccflag): for consistency and accuracy.
20658 Adjust dependencies.
20659
20660 2000-10-02 Akim Demaille <akim@epita.fr>
20661
20662 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
20663 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
20664 difficult and introduced a lot of core dump. It turns out that
20665 Bison used an implementation of `xmalloc' based on `calloc', and
20666 at various places it does depend upon the initialization to 0. I
20667 have not tried to isolate the pertinent places, and all the former
20668 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
20669 someone should address this issue.
20670
20671 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
20672 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
20673 files.
20674 Adjust dependencies.
20675 * src/warshall.h: New file.
20676 Propagate.
20677
20678 2000-10-02 Akim Demaille <akim@epita.fr>
20679
20680 Various anti-`extern in *.c' changes.
20681
20682 * src/system.h: Include `assert.h'.
20683
20684 2000-10-02 Akim Demaille <akim@epita.fr>
20685
20686 * src/state.h (nstates, final_state, first_state, first_shift)
20687 (first_reduction): Move their exportation from here...
20688 * src/LR0.h: to here.
20689 Adjust dependencies.
20690 * src/getargs.c (statisticsflag): New variable.
20691 Add support for `--statistics'.
20692 Adjust dependencies.
20693
20694 Remove a lot of now useless `extern' statements in most files.
20695
20696 2000-10-02 Akim Demaille <akim@epita.fr>
20697
20698 * src/LR0.h: New file.
20699 Propagate its use.
20700
20701 2000-10-02 Akim Demaille <akim@epita.fr>
20702
20703 * src/print.h: New file.
20704 Propagate its use.
20705 * src/print.c: Formatting and ordering changes.
20706 (verbose, terse): Replace with...
20707 (print_results): this new function.
20708 Adjust dependencies.
20709
20710 2000-10-02 Akim Demaille <akim@epita.fr>
20711
20712 * src/conflicts.c (conflict_report): New function.
20713 (conflict_log, verbose_conflict_log): Replace with...
20714 (print_conflicts): this function.
20715 Adjust dependencies.
20716 * src/conflicts.h: New file.
20717 Propagate its inclusion.
20718
20719 2000-10-02 Akim Demaille <akim@epita.fr>
20720
20721 * src/nullable.h: New file.
20722 Propagate its inclusion.
20723 * src/nullable.c: Formatting changes.
20724
20725 2000-10-02 Akim Demaille <akim@epita.fr>
20726
20727 * src/reduce.h: New file.
20728 Propagate its inclusion.
20729 * src/reduce.c: Topological sort and other formatting changes.
20730 (bool, TRUE, FALSE): Move their definition to...
20731 * src/system.h: here.
20732
20733 2000-10-02 Akim Demaille <akim@epita.fr>
20734
20735 * src/files.c: Formatting changes.
20736 (tryopen, tryclose, openfiles): Rename as...
20737 (xfopen, xfclose, open_files): this.
20738 (stringappend): static.
20739 * src/files.h: Complete the list of exported symbols.
20740 Propagate its use.
20741
20742 2000-10-02 Akim Demaille <akim@epita.fr>
20743
20744 * src/reader.h: New file.
20745 Propagate its use instead of tedious list of `extern' and
20746 prototypes.
20747 * src/reader.c: Formatting changes, topological sort,
20748 s/register//.
20749
20750 2000-10-02 Akim Demaille <akim@epita.fr>
20751
20752 * src/lex.h: Prototype `lex.c' exported functions.
20753 * src/reader.c: Adjust.
20754 * src/lex.c: Formatting changes.
20755 (safegetc): Rename as...
20756 (xgetc): this.
20757
20758 2000-10-02 Akim Demaille <akim@epita.fr>
20759
20760 * src/lalr.h: New file.
20761 Propagate its inclusion instead of prototypes and `extern'.
20762 * src/lalr.c: Formatting changes, topological sorting etc.
20763
20764 2000-10-02 Akim Demaille <akim@epita.fr>
20765
20766 * src/output.c (token_actions): Introduce a temporary array,
20767 YYDEFACT, that makes it possible for this function to use
20768 output_short_table.
20769
20770 2000-10-02 Akim Demaille <akim@epita.fr>
20771
20772 `user_toknums' is output as a `short[]' in `output.c', while it is
20773 defined as a `int[]' in `reader.c'. For consistency with the
20774 other output tables, `user_toknums' is now defined as a table of
20775 shorts.
20776
20777 * src/reader.c (user_toknums): Be a short table instead of an int
20778 table.
20779 Adjust dependencies.
20780
20781 Factor the short table outputs.
20782
20783 * src/output.c (output_short_table): New function.
20784 * src/output.c (output_gram, output_stos, output_rule_data)
20785 (output_base, output_table, output_check): Use it.
20786
20787 2000-10-02 Akim Demaille <akim@epita.fr>
20788
20789 * src/output.c (output): Topological sort of the functions, in
20790 order to get rid of the `static' prototypes.
20791 No longer use `register'.
20792 * src/output.h: New file.
20793 Propagate its inclusion in files explicitly prototyping functions
20794 from output.c.
20795
20796 2000-09-21 Akim Demaille <akim@epita.fr>
20797
20798 * src/atgeneral.m4: Update from Autoconf.
20799
20800 2000-09-21 Akim Demaille <akim@epita.fr>
20801
20802 * src/closure.h: New file.
20803 * src/closure.c: Formatting changes, topological sort over the
20804 functions, use of closure.h.
20805 (initialize_closure, finalize_closure): Rename as...
20806 (new_closure, free_closure): these. Adjust dependencies.
20807 * src/LR0.c: Formatting changes, topological sort, use of
20808 cloture.h.
20809 (initialize_states): Rename as...
20810 (new_states): this.
20811 * src/Makefile.am (noinst_HEADERS): Adjust.
20812
20813 2000-09-20 Akim Demaille <akim@epita.fr>
20814
20815 * src/acconfig.h: Don't protect config.h against multiple
20816 inclusion.
20817 Don't define PARAMS.
20818 * src/system.h: Define PARAMS.
20819 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
20820 purpose of config.h. system.h must not try to fix wrong
20821 definitions in config.h.
20822
20823 2000-09-20 Akim Demaille <akim@epita.fr>
20824
20825 * src/derives.h: New file.
20826 * src/main.c, src/derives.h: Use it.
20827 Formatting changes.
20828 * src/Makefile.am (noinst_HEADERS): Adjust.
20829
20830 2000-09-20 Akim Demaille <akim@epita.fr>
20831
20832 * tests/atgeneral.m4: Update from Autoconf.
20833 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
20834 (AT_CHECK_CALC): New macros.
20835 Use these macros to test bison with options `', `--raw',
20836 `--debug', `--yacc', `--yacc --debug'.
20837
20838 2000-09-19 Akim Demaille <akim@epita.fr>
20839
20840 * src/output.c: Formatting changes.
20841 * src/machine.h: Remove, leaving its contents in...
20842 * src/system.h: here.
20843 Include stdio.h.
20844 Adjust all dependencies on stdio.h and machine.h.
20845 * src/getargs.h: New file.
20846 Let all `extern' declarations about getargs.c be replaced with
20847 inclusion of `getargs.h'.
20848 * src/Makefile.am (noinst_HEADERS): Adjust.
20849
20850 * tests/calc.m4 (yyin): Be initialized in main, not on the global
20851 scope.
20852 (yyerror): Returns void, not int.
20853 * doc/bison.texinfo: Formatting changes.
20854
20855 2000-09-19 Akim Demaille <akim@epita.fr>
20856
20857 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
20858 portable.
20859
20860 2000-09-18 Akim Demaille <akim@epita.fr>
20861
20862 * configure.in: Append WARNING_CFLAGS to CFLAGS.
20863 * src/Makefile.am (INCLUDES): Don't.
20864 Be ready to fetch headers in lib/.
20865
20866 2000-09-18 Akim Demaille <akim@epita.fr>
20867
20868 * doc/bison.texinfo: Update the copyright.
20869 ANSIfy and GNUify the examples.
20870 Remove the old menu.
20871
20872 2000-09-18 Akim Demaille <akim@epita.fr>
20873
20874 First set of tests: use the `calc' example from the documentation.
20875
20876 * src/bison.s1 (yyparse): Condition the code using `yytname' which
20877 is defined only when YYDEBUG is.
20878 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
20879 * src/files.c (tryopen, tryclose): Formatting changes.
20880 Move to the top and be static.
20881 * src/reader.c (read_signed_integer): Likewise.
20882 * tests/calc.m4: New file.
20883 * Makefile.am, suite.m4: Adjust.
20884 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
20885
20886 2000-09-18 Akim Demaille <akim@epita.fr>
20887
20888 Add support for an Autotest test suite for Bison.
20889
20890 * m4/m4.m4, m4/atconfig.m4: New files.
20891 * m4/Makefile.am (EXTRA_DIST): Adjust.
20892 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
20893 files.
20894 * src/getargs.c: Display a more standard --version message.
20895 * src/reader.c (reader): Formatting changes.
20896 No longer depend upon VERSION_STRING.
20897 * configure.in: No longer use `dnl'.
20898 Set up the test suite and the new directory `tests/.
20899 (VERSION_STRING): Remove.
20900
20901 2000-04-14 Akim Demaille <akim@epita.fr>
20902
20903 * src/reader.c (copy_comment2): New function, same as former
20904 `copy_comment', but outputs into two FILE *.
20905 (copy_comment): Use it.
20906 (parse_union_decl): Use it.
20907 (get_type, parse_start_decl): Use the same `invalid' message.
20908 (parse_start_decl, parse_union_decl): Use the same `multiple'
20909 message.
20910 (parse_union_decl, copy_guard, copy_action): Use the same
20911 `unmatched' message.
20912 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
20913
20914 2000-03-31 Akim Demaille <akim@epita.fr>
20915
20916 * src/files.c (tryopen, tryclose): Move to the top.
20917 Be static.
20918
20919 2000-03-31 Akim Demaille <akim@epita.fr>
20920
20921 * src/main.c (main): Don't call `done', exit does it.
20922
20923 2000-03-31 Akim Demaille <akim@epita.fr>
20924
20925 * allocate.c: s/return (foo)/return foo/.
20926 * lalr.c: Likewise.
20927 * LR0.c: Likewise.
20928 * output.c: Likewise.
20929 * reader.c: Likewise.
20930 * symtab.c: Likewise.
20931 * vmsgetargs.c: Likewise.
20932
20933 2000-03-31 Akim Demaille <akim@epita.fr>
20934
20935 Clean up the error reporting functions.
20936
20937 * src/report.c: New file.
20938 * src/report.h: Likewise.
20939 * src/Makefile.am: Adjust.
20940 * m4/error.m4: New file.
20941 * m4/Makefile.am: Adjust.
20942 * configure.in (jm_PREREQ_ERROR): Call it.
20943 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
20944 Remove.
20945 (fatal, fatals): Remove. All callers use complain.c::fatal.
20946 (warn, warni, warns, warnss, warnss): Remove. All callers use
20947 complain.c::complain.
20948 (toomany): Remove, use fatal instead.
20949 * src/files.c (done): No argument, use complain_message_count.
20950 * src/main.c (main): Register `done' to `atexit'.
20951
20952 * src/getargs.c (usage): More `fputs', less `fprintf'.
20953
20954 2000-03-28 Akim Demaille <akim@epita.fr>
20955
20956 * lib/: New directory.
20957 * Makefile.am (SUBDIRS): Adjust.
20958 * configure.in: Adjust.
20959 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
20960 useless.
20961 * src/alloca.c: Moved to lib/.
20962 * src/getopt.c: Likewise.
20963 * src/getopt1.c: Likewise.
20964 * src/getopt.h: Likewise.
20965 * src/ansi2knr.c: Likewise.
20966 * src/ansi2knr.1: Likewise.
20967 * src/Makefile.am: Adjust.
20968 * lib/Makefile.am: New file.
20969
20970 2000-03-28 Akim Demaille <akim@epita.fr>
20971
20972 * src/getargs.c (usage): Refresh the help message.
20973
20974 2000-03-17 Akim Demaille <akim@epita.fr>
20975
20976 * src/getopt1.c: Updated from textutils 2.0e
20977 * src/getopt.c: Likewise.
20978 * src/getopt.h: Likewise.
20979
20980 2000-03-17 Akim Demaille <akim@epita.fr>
20981
20982 * src/Makefile.am (bison.simple): Fix the awk program: quote only
20983 the file name, not the whole `#line LINE FILE'.
20984
20985 2000-03-17 Akim Demaille <akim@epita.fr>
20986
20987 On syntax errors, report the token on which we choked.
20988
20989 * src/bison.s1 (yyparse): In the label yyerrlab, when
20990 YYERROR_VERBOSE, add yychar in msg.
20991
20992 2000-03-17 Akim Demaille <akim@epita.fr>
20993
20994 * src/reader.c (copy_at): New function.
20995 (copy_guard): Use it.
20996 (copy_action): Use it.
20997
20998 2000-03-17 Akim Demaille <akim@epita.fr>
20999
21000 Be kind to translators, save some useless translations.
21001
21002 * src/main.c (banner): New function.
21003 (fatal_banner): Use it.
21004 (warn_banner): Use it.
21005
21006 2000-03-17 Akim Demaille <akim@epita.fr>
21007
21008 * src/reader.c (copy_definition): Use copy_string and
21009 copy_comment. Removed now unused `match', `ended',
21010 `cplus_comment'.
21011 (copy_comment, copy_string): Moved, to be visible from
21012 copy_definition.
21013
21014 2000-03-17 Akim Demaille <akim@epita.fr>
21015
21016 * src/reader.c (copy_string): Declare `static inline'. No
21017 problems with inline, since it is checked by configure.
21018 (copy_comment): Likewise.
21019
21020 2000-03-17 Akim Demaille <akim@epita.fr>
21021
21022 * src/reader.c (packsymbols): Formatting changes.
21023
21024 2000-03-17 Akim Demaille <akim@epita.fr>
21025
21026 * src/reader.c (copy_comment): New function, factored out from:
21027 (copy_action): Use it. Removed now unused `match', `ended',
21028 `cplus_comment'.
21029 (copy_guard): Likewise.
21030
21031 2000-03-17 Akim Demaille <akim@epita.fr>
21032
21033 * src/reader.c (copy_string): New function, factored out from:
21034 (copy_action): Use it.
21035 (copy_guard): Likewise.
21036
21037 2000-03-17 Akim Demaille <akim@epita.fr>
21038
21039 Change the handling of @s so that they behave exactly like $s.
21040 There is now a pseudo variable @$ (readble and writable), location
21041 of the lhs of the rule (by default ranging from the location of
21042 the first symbol of the rhs, to the location of the last symbol,
21043 or, if the rhs is empty, YYLLOC).
21044
21045 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
21046 yyval.
21047 (yyparse): When providing a default semantic action, provide a
21048 default location action.
21049 (after the $): No longer change `*YYLSP', just stack YYLOC the
21050 same way you stack YYVAL.
21051 * src/reader.c (read_declarations): Use warns.
21052 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
21053 (copy_action, case '@'): Likewise.
21054 Use a standard error message, to save useless work from
21055 translators.
21056
21057 2000-03-17 Akim Demaille <akim@epita.fr>
21058
21059 * src/bison.s1: Formatting and cosmetics changes.
21060 * src/reader.c: Likewise.
21061 Update the Copyright notice.
21062
21063 2000-03-17 Akim Demaille <akim@epita.fr>
21064
21065 * src/bison.s1 (#line): All set to `#line' only, since the
21066 Makefile now handles them.
21067
21068 2000-03-16 Akim Demaille <akim@epita.fr>
21069
21070 * src/output.c (output_rule_data): Output the documentation of
21071 some of the tables.
21072 (Copyright notice): Update.
21073 Formatting changes.
21074
21075 2000-03-16 Akim Demaille <akim@epita.fr>
21076
21077 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
21078 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
21079 One `#if YYDEBUG' remains, since it uses variables which are
21080 defined only if `YYDEBUG != 0'.
21081
21082 2000-03-16 Akim Demaille <akim@epita.fr>
21083
21084 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
21085 and related variables so that the similarities are highlighted.
21086
21087 2000-03-16 Akim Demaille <akim@epita.fr>
21088
21089 * src/bison.s1: Properly indent CPP directives.
21090
21091 2000-03-16 Akim Demaille <akim@epita.fr>
21092
21093 * src/bison.s1: Properly indent the `alloca' CPP section.
21094
21095 2000-03-16 Akim Demaille <akim@epita.fr>
21096
21097 Do not hard code values of directories in `configure.in'.
21098 Update the `configure' tool chain.
21099
21100 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
21101 src/makefile.am.
21102 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
21103 (AC_OUTPUT): Add m4/Makefile.
21104 Bump to bison 1.28a, 1.29 has never been released.
21105 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
21106 handled via src/Makefile.am.
21107 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
21108 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
21109 autoheader.
21110 * Makefile.am (SUBDIRS): Add m4.
21111 (ACLOCAL_AM_FLAGS): New variable.
21112 (AUTOMAKE_OPTIONS): Add check-news.
21113 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
21114 the proper line number and file name.
21115 (DEFS): Propagate the location of bison library files and of the
21116 locale files.
21117 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
21118 builddir.
21119 * acinclude.m4: Remove, replaced by the directory m4.
21120 * m4/Makefile.am (EXTRA_DIST): New variable.
21121 * m4/gettext.m4: New file, from the fileutils.
21122 * m4/lcmessage.m4: Likewise
21123 * m4/progtest.m4: Likewise.
21124 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
21125
21126 2000-03-10 Akim Demaille <akim@epita.fr>
21127
21128 * src/closure.c:
21129 Formatting changes of various comments.
21130 Respect the GNU coding standards at various places.
21131 Don't use `_()' when no translation is needed.
21132
21133 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21134
21135 * src/files.c:
21136 OS/2 honors TMPDIR environment variable.
21137
21138 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21139
21140 * doc/bison.texinfo: Tweaked spelling and grammar.
21141 Updated ISBN.
21142 Removed reference to price of printed copy.
21143 Mention BISON_SIMPLE and BISON_HAIRY.
21144
21145 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21146
21147 * configure.in, NEWS:
21148 Bison 1.29 released.
21149
21150 1999-10-27 Jesse Thilo <jthilo@gnu.org>
21151
21152 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
21153 Added reference card.
21154
21155 1999-07-26 Jesse Thilo <jthilo@gnu.org>
21156
21157 * po/ru.po: Added Russian translation.
21158
21159 1999-07-26 Jesse Thilo <jthilo@gnu.org>
21160
21161 * configure.in: Added Russian translation.
21162
21163 1999-07-06 Jesse Thilo <jthilo@gnu.org>
21164
21165 * configure.in, NEWS, README:
21166 Released version 1.28.
21167
21168 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21169
21170 * src/system.h:
21171 Squashed redefinition warning on some systems.
21172
21173 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
21174 Have configure build version string instead of relying on ANSI string
21175 concatentation.
21176
21177 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21178
21179 * po/POTFILES.in: Got rid of version.c.
21180
21181 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21182
21183 * acconfig.h, configure.in:
21184 Have configure build version string instead of relying on ANSI string
21185 concatentation.
21186
21187 1999-06-08 Jesse Thilo <jthilo@gnu.org>
21188
21189 * doc/bison.1:
21190 Dropped mention of `+' for long-named options.
21191
21192 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21193
21194 * src/files.c: Added <unistd.h> for unlink().
21195
21196 * src/Makefile.am, src/system.h:
21197 I18n fixes.
21198
21199 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21200
21201 * README: Added a FAQ list.
21202
21203 * configure.in, acconfig.h:
21204 I18n fixes.
21205
21206 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21207
21208 * doc/FAQ, doc/Makefile.am:
21209 Added a FAQ list.
21210
21211 1999-05-19 Jesse Thilo <jthilo@gnu.org>
21212
21213 * src/alloc.h, src/symtab.h, src/version.c:
21214 Protected inclusion of "config.h" with HAVE_CONFIG_H.
21215
21216 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21217
21218 * src/.cvsignore, src/Makefile.am:
21219 Reorganized: sources in `src', documentation in `doc'.
21220
21221 * src/lex.c (literalchar):
21222 fixed the code for escaping double quotes (thanks
21223 Jonathan Czisny.)
21224
21225 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21226
21227 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
21228 Adjusted paths to reflect directory reorganization.
21229
21230 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21231
21232 * doc/.cvsignore, doc/Makefile.am:
21233 Reorganized: sources in `src', documentation in `doc'.
21234
21235 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21236
21237 * configure.in:
21238 Updated AC_INIT file to reflect directory reorganization.
21239
21240 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
21241 Reorganized: sources in `src', documentation in `doc'.
21242
21243 1999-04-13 Jesse Thilo <jthilo@gnu.org>
21244
21245 * src/allocate.c:
21246 Don't declare calloc() and realloc() if not necessary.
21247
21248 1999-04-13 Jesse Thilo <jthilo@gnu.org>
21249
21250 * configure.in, acconfig.h, acinclude.m4:
21251 Don't declare calloc() and realloc() if not necessary.
21252
21253 1999-03-23 Jesse Thilo <jthilo@gnu.org>
21254
21255 * po/.cvsignore: Added i18n support.
21256
21257 1999-03-23 Jesse Thilo <jthilo@gnu.org>
21258
21259 * acconfig.h, configure.in, Makefile.am:
21260 Added i18n support.
21261
21262 1999-03-22 Jesse Thilo <jthilo@gnu.org>
21263
21264 * src/bison.s1: Fixed #line numbers.
21265
21266 1999-03-15 Jesse Thilo <jthilo@gnu.org>
21267
21268 * po/es.po, po/fr.po, po/nl.po, po/de.po:
21269 Added PO files from Translation Project.
21270
21271 1999-03-03 Jesse Thilo <jthilo@gnu.org>
21272
21273 * Makefile.am:
21274 Added support for non-ANSI compilers (ansi2knr).
21275
21276 1999-02-16 Jesse Thilo <jthilo@gnu.org>
21277
21278 * configure.in: Bumped version number to 1.27.
21279
21280 * Makefile.am:
21281 Added `bison.simple' to list of files removed by `make distclean'.
21282
21283 1999-02-12 Jesse Thilo <jthilo@gnu.org>
21284
21285 * src/files.c, src/files.h:
21286 Defined locations of parser files in config.h instead of Makefile.
21287
21288 1999-02-12 Jesse Thilo <jthilo@gnu.org>
21289
21290 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
21291 Defined locations of parser files in config.h instead of Makefile.
21292
21293 1999-02-09 Jesse Thilo <jthilo@gnu.org>
21294
21295 * Makefile.am:
21296 Removed inappropriate use of $< macro.
21297
21298 1999-02-05 Jesse Thilo <jthilo@gnu.org>
21299
21300 * po/Makefile.in.in, po/POTFILES.in:
21301 Add `po' directory skeleton.
21302
21303 1999-01-27 Jesse Thilo <jthilo@gnu.org>
21304
21305 * README: Document help-bison list.
21306
21307 * configure.in: Add check for mkstemp().
21308
21309 1999-01-20 Jesse Thilo <jthilo@gnu.org>
21310
21311 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
21312 Hush a few compiler warnings.
21313
21314 * src/files.c:
21315 Add tryclose(), which verifies that fclose was successful.
21316 Hush a couple of compiler warnings.
21317
21318 1999-01-20 Jesse Thilo <jthilo@gnu.org>
21319
21320 * Makefile.am, OChangeLog:
21321 ChangeLog is now automatically generated. Include the old version as
21322 OChangeLog.
21323
21324 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21325
21326 * 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:
21327 Update FSF address.
21328
21329 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21330
21331 * doc/bison.texinfo: Fix formatting glitch.
21332
21333 * doc/bison.texinfo: Update FSF address.
21334
21335 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21336
21337 * acconfig.h: Update FSF address.
21338
21339 1999-01-08 Jesse Thilo <jthilo@gnu.org>
21340
21341 * src/system.h:
21342 Don't define PACKAGE here, since config.h defines it.
21343
21344 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21345
21346 * src/reader.c: Update copyright date.
21347
21348 * src/main.c:
21349 Ditch sprintf to statically-sized buffers in fatal/warn functions in
21350 favor of output directly to stderr (avoids buffer overruns).
21351
21352 * src/reader.c: Some checks for premature EOF.
21353
21354 * 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:
21355 Use prototypes if the compiler understands them.
21356
21357 * src/files.c: Honor TMPDIR on Unix hosts.
21358 Use prototypes if the compiler understands them.
21359
21360 * src/reader.c:
21361 Fix a couple of buffer overrun bugs.
21362 Use prototypes if the compiler understands them.
21363
21364 * src/system.h: Include unistd.h and ctype.h.
21365 Use #ifdef instead of #if for NLS symbols.
21366
21367 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21368
21369 * doc/bison.texinfo:
21370 Delete comment "consider using @set for edition number, etc..." since
21371 we now are doing so.
21372
21373 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21374
21375 * configure.in:
21376 Use prototypes if the compiler understands them.
21377
21378 * NEWS: Document 1.26 highlights.
21379
21380 * Makefile.am: Require Automake 1.3 or later.
21381
21382 * acconfig.h:
21383 Use prototypes if the compiler understands them.
21384
21385 1998-12-29 Jesse Thilo <jthilo@gnu.org>
21386
21387 * src/version.c:
21388 Use VERSION symbol from automake for version number.
21389
21390 1998-12-29 Jesse Thilo <jthilo@gnu.org>
21391
21392 * acconfig.h, configure.in, version.cin:
21393 Use VERSION symbol from automake for version number.
21394
21395 1998-11-28 Jesse Thilo <jthilo@gnu.org>
21396
21397 * Makefile.am:
21398 Distribute original version of simple parser (bison.s1), not built
21399 version (bison.simple).
21400
21401 1998-11-28 Jesse Thilo <jthilo@gnu.org>
21402
21403 * doc/bison.texinfo: Add info dir entry.
21404
21405 * doc/bison.texinfo:
21406 Let automake put version number into documentation.
21407
21408 1998-11-26 Jesse Thilo <jthilo@gnu.org>
21409
21410 * src/bison.cld, src/build.com, src/vmshlp.mar:
21411 Add non-RCS files from /gd/gnu/bison.
21412
21413 1998-11-26 Jesse Thilo <jthilo@gnu.org>
21414
21415 * doc/bison.1:
21416 Document the BISON_HAIRY and BISON_SIMPLE variables.
21417
21418 1998-11-25 Jesse Thilo <jthilo@gnu.org>
21419
21420 * src/version.c: Build version.c automatically.
21421
21422 * src/reader.c:
21423 Fix token numbering (used to start at 258, not 257).
21424
21425 * src/system.h: Include config.h.
21426
21427 * src/getargs.c: Update bug report address.
21428
21429 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
21430 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
21431
21432 1998-11-25 Jesse Thilo <jthilo@gnu.org>
21433
21434 * Makefile.am:
21435 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21436
21437 * configure.in, version.cin:
21438 Build version.c automatically.
21439
21440 * AUTHORS: Add AUTHORS file.
21441
21442 * README: Update bug report address.
21443
21444 * bison.simple:
21445 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21446
21447 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
21448 Add automake stuff.
21449
21450 1998-11-25 Jesse Thilo <jthilo@gnu.org>
21451
21452 * doc/bison.texinfo: Clean up some formatting.
21453
21454 1998-05-05 Richard Stallman <rms@gnu.org>
21455
21456 * doc/bison.texinfo:
21457 Explain better why to make a pure parser.
21458
21459 1998-01-05 Richard Stallman <rms@gnu.org>
21460
21461 * src/files.c (openfiles):
21462 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
21463 find a temporary directory, if possible. Do not unlink files while
21464 they are open.
21465
21466 1997-08-25 Richard Stallman <rms@gnu.org>
21467
21468 * src/reader.c (stack_offset;):
21469 Change some warni to warns.
21470
21471 * src/lex.c (literalchar): Use warns, not warni.
21472
21473 1997-06-28 Richard Stallman <rms@gnu.org>
21474
21475 * src/bison.s1: Add a Bison version comment.
21476
21477 * src/main.c (fatal, warn, berror):
21478 Use program_name.
21479
21480 1997-06-28 Richard Stallman <rms@gnu.org>
21481
21482 * Makefile.in (bison_version): New variable.
21483 (dist): Use that variable.
21484 (bison.s1): Substitute the Bison version into bison.simple.
21485
21486 * bison.simple: Add a Bison version comment.
21487
21488 1997-06-18 Richard Stallman <rms@gnu.org>
21489
21490 * src/main.c (fatal, warn, berror):
21491 Make error messages standard.
21492 (toomany): Improve error message text.
21493
21494 * 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:
21495 new.h renamed to alloc.h.
21496
21497 1997-06-18 Richard Stallman <rms@gnu.org>
21498
21499 * Makefile.in: new.h renamed to alloc.h.
21500
21501 1997-05-24 Richard Stallman <rms@gnu.org>
21502
21503 * src/lex.c (literalchar):
21504 Fix the code for escaping \, " and '.
21505
21506 (lex): Avoid trouble when there are many chars
21507 to discard in a char literal with just several chars in it.
21508
21509 1997-05-17 Richard Stallman <rms@gnu.org>
21510
21511 * src/bison.s1:
21512 Use malloc, if using alloca is troublesome.
21513 (YYSTACK_USE_ALLOCA): New flag macro.
21514 Define it for some systems and compilers.
21515 (YYSTACK_ALLOC): New macro.
21516 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21517 If it was malloc'd, free it.
21518
21519 1997-05-17 Richard Stallman <rms@gnu.org>
21520
21521 * bison.simple:
21522 Use malloc, if using alloca is troublesome.
21523 (YYSTACK_USE_ALLOCA): New flag macro.
21524 Define it for some systems and compilers.
21525 (YYSTACK_ALLOC): New macro.
21526 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21527 If it was malloc'd, free it.
21528
21529 1997-04-23 Richard Stallman <rms@gnu.org>
21530
21531 * src/bison.s1:
21532 (alloca) [__hpux]: Always define as __builtin_alloca.
21533
21534 1997-04-23 Richard Stallman <rms@gnu.org>
21535
21536 * bison.simple:
21537 (alloca) [__hpux]: Always define as __builtin_alloca.
21538
21539 1997-04-22 Richard Stallman <rms@gnu.org>
21540
21541 * src/bison.s1:
21542 [__hpux]: Include alloca.h (right for HPUX 10)
21543 instead of declaring alloca (right for HPUX 9).
21544
21545 * src/bison.s1 (__yy_memcpy):
21546 Declare arg `count' as unsigned int.
21547 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21548
21549 1997-04-22 Richard Stallman <rms@gnu.org>
21550
21551 * bison.simple:
21552 [__hpux]: Include alloca.h (right for HPUX 10)
21553 instead of declaring alloca (right for HPUX 9).
21554
21555 * bison.simple (__yy_memcpy):
21556 Declare arg `count' as unsigned int.
21557 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21558
21559 1997-01-03 Richard Stallman <rms@gnu.org>
21560
21561 * src/allocate.c: [__STDC__ or _MSC_VER]:
21562 Declare calloc and realloc to return void *.
21563
21564 1997-01-02 Richard Stallman <rms@gnu.org>
21565
21566 * src/system.h:
21567 [_MSC_VER]: Include stdlib.h and process.h.
21568 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
21569
21570 * src/main.c (main): Return FAILURE as a value.
21571 (printable_version): Declare arg as int, not char.
21572
21573 1997-01-02 Richard Stallman <rms@gnu.org>
21574
21575 * Makefile.in (dist):
21576 Explicitly check for symlinks, and copy them.
21577
21578 1996-12-19 Richard Stallman <rms@gnu.org>
21579
21580 * src/files.c:
21581 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
21582
21583 1996-12-18 Paul Eggert <eggert@gnu.org>
21584
21585 * src/bison.s1 (yyparse):
21586 If __GNUC__ and YYPARSE_PARAM are both defined,
21587 declare yyparse to have a void * argument.
21588
21589 1996-12-18 Paul Eggert <eggert@gnu.org>
21590
21591 * bison.simple (yyparse):
21592 If __GNUC__ and YYPARSE_PARAM are both defined,
21593 declare yyparse to have a void * argument.
21594
21595 1996-12-17 Richard Stallman <rms@gnu.org>
21596
21597 * src/reduce.c (nbits): Add some casts.
21598
21599 1996-08-12 Richard Stallman <rms@gnu.org>
21600
21601 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
21602
21603 1996-08-12 Richard Stallman <rms@gnu.org>
21604
21605 * bison.simple: Test _MSDOS as well as _MSDOS_.
21606
21607 1996-07-31 Richard Stallman <rms@gnu.org>
21608
21609 * src/bison.s1:
21610 [__sun && __i386]: Include alloca.h.
21611
21612 1996-07-31 Richard Stallman <rms@gnu.org>
21613
21614 * bison.simple:
21615 [__sun && __i386]: Include alloca.h.
21616
21617 1996-07-30 Richard Stallman <rms@gnu.org>
21618
21619 * src/bison.s1: Comment change.
21620
21621 * src/bison.s1: Test _MSDOS_, not MSDOS.
21622
21623 1996-07-30 Richard Stallman <rms@gnu.org>
21624
21625 * bison.simple: Comment change.
21626
21627 * bison.simple: Test _MSDOS_, not MSDOS.
21628
21629 1996-06-01 Richard Stallman <rms@gnu.org>
21630
21631 * 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:
21632 Insert `_' macro around many string constants.
21633
21634 * src/main.c:
21635 Insert `_' macro around many string constants.
21636
21637 (main): Call setlocale, bindtextdomain and textdomain.
21638
21639 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
21640 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
21641 [ENABLE_NLS]: Include libintl.h.
21642 [ENABLE_NLS] (gettext): Define.
21643 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
21644 (N_, PACKAGE, LOCALEDIR): New macros.
21645
21646 1996-06-01 Richard Stallman <rms@gnu.org>
21647
21648 * POTFILES.in: New file.
21649
21650 * Makefile.in (allocate.o):
21651 Define target explicitly.
21652
21653 * Makefile.in (CFLAGS): Set to @CFLAGS@.
21654 (LDFLAGS): Set to @LDFLAGS@.
21655 (configure): Run autoconf only if preceding `cd' succeeds.
21656 (bison.s1): Redirect output to temporary file then move the
21657 temporary to the target, rather than redirecting directly to bison.s1.
21658 (clean): Remove config.status and config.log.
21659 (distclean): Don't remove config.status here.
21660
21661 1996-05-12 Richard Stallman <rms@gnu.org>
21662
21663 * src/bison.s1:
21664 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21665
21666 1996-05-12 Richard Stallman <rms@gnu.org>
21667
21668 * bison.simple:
21669 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21670
21671 1996-05-11 Richard Stallman <rms@gnu.org>
21672
21673 * src/bison.s1 (__yy_memcpy):
21674 Really reorder the args, as was supposedly done on Feb 14 1995.
21675 (yyparse): Calls changed accordingly.
21676
21677 1996-05-11 Richard Stallman <rms@gnu.org>
21678
21679 * Makefile.in (dist): Don't use $(srcdir).
21680
21681 * bison.simple (__yy_memcpy):
21682 Really reorder the args, as was supposedly done on Feb 14 1995.
21683 (yyparse): Calls changed accordingly.
21684
21685 1996-01-27 Richard Stallman <rms@gnu.org>
21686
21687 * src/output.c (output_rule_data):
21688 Test YYERROR_VERBOSE in the conditional
21689 around the definition of ttyname.
21690
21691 1995-12-29 Richard Stallman <rms@gnu.org>
21692
21693 * src/bison.s1:
21694 Fix line numbers in #line commands.
21695
21696 1995-12-29 Richard Stallman <rms@gnu.org>
21697
21698 * bison.simple:
21699 Fix line numbers in #line commands.
21700
21701 1995-12-27 Richard Stallman <rms@gnu.org>
21702
21703 * src/bison.s1 (YYPARSE_PARAM_DECL):
21704 In C++, make it always null.
21705 (YYPARSE_PARAM_ARG): New macro.
21706 (yyparse): Use YYPARSE_PARAM_ARG.
21707
21708 1995-12-27 Richard Stallman <rms@gnu.org>
21709
21710 * bison.simple (YYPARSE_PARAM_DECL):
21711 In C++, make it always null.
21712 (YYPARSE_PARAM_ARG): New macro.
21713 (yyparse): Use YYPARSE_PARAM_ARG.
21714
21715 1995-11-29 Richard Stallman <rms@gnu.org>
21716
21717 * doc/bison.texinfo:
21718 Describe literal string tokens, %raw, %no_lines, %token_table.
21719
21720 1995-11-29 Daniel Hagerty <hag@gnu.org>
21721
21722 * doc/bison.texinfo: Fixed update date
21723
21724 1995-10-16 Richard Stallman <rms@gnu.org>
21725
21726 * src/version.c: Version 1.25.
21727
21728 1995-10-16 Richard Stallman <rms@gnu.org>
21729
21730 * NEWS: *** empty log message ***
21731
21732 1995-10-16 Richard Stallman <rms@gnu.org>
21733
21734 * doc/bison.1, doc/bison.rnh:
21735 Add new options.
21736
21737 1995-10-15 Richard Stallman <rms@gnu.org>
21738
21739 * src/vmsgetargs.c, src/getargs.c:
21740 Added -n, -k, and -raw switches.
21741 (noparserflag, toknumflag, rawtoknumflag): New variables.
21742
21743 * src/symtab.h (SALIAS):
21744 New #define for adding aliases to %token.
21745 (struct bucket): Added `alias' field.
21746
21747 * src/reduce.c (reduce_grammar):
21748 Revise error message.
21749 (print_notices): Remove final `.' from error message.
21750
21751 * src/reader.c (reader_output_yylsp):
21752 New function.
21753 (readgram): Use `#if 0' around code that accepted %command
21754 inside grammar rules: The documentation doesn't allow it,
21755 and it will fail since the %command processors scan for the next %.
21756 (parse_token_decl): Extended the %token
21757 declaration to allow a multi-character symbol as an alias.
21758 (parse_thong_decl): New function.
21759 (read_declarations): Added %thong declarations.
21760 (read_declarations): Handle NOOP to deal with allowing
21761 % declarations as another means to specify the flags.
21762 (readgram): Allow %prec prior to semantics embedded in a rule.
21763 (skip_to_char, read_declarations, copy_definition)
21764 (parse_token_decl, parse_start_decl, parse_type_decl)
21765 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
21766 (get_type_name, copy_guard, copy_action, readgram)
21767 (get_type, packsymbols): Revised most error messages.
21768 Changed `fatal' to `warnxxx' to avoid aborting for error.
21769 Revised and use multiple warnxxx functions to avoid using VARARGS1.
21770 (read_declarations): Improve the error message for
21771 an invalid character. Do not abort.
21772 (read_declarations, copy_guard, copy_action): Use
21773 printable_version to avoid unprintable characters in printed output.
21774 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
21775 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
21776 Allow the type of a non-terminal can be given
21777 more than once, as long as all specifications give the same type.
21778
21779 * src/output.c:
21780 (output_headers, output_trailers, output, output_gram)
21781 (output_rule_data): Implement noparserflag variable.
21782 Implement toknumflag variable.
21783 (output): Call reader_output_yylsp to output LTYPESTR.
21784
21785 * src/main.c (main):
21786 If reader sees an error, don't process the grammar.
21787 (fatals): Updated to not use VARARGS1.
21788 (printable_version, int_to_string, warn, warni, warns, warnss)
21789 (warnsss): New error reporting functions. Avoid abort for error.
21790
21791 * src/lex.h:
21792 Added THONG and NOOP for alias processing.
21793 Added SETOPT for the new code that allows setting options with %flags.
21794
21795 * src/lex.c:
21796 Include getopt.h. Add some extern decls.
21797 (safegetc): New function to deal with EOF gracefully.
21798 (literalchar); new function to deal with reading \ escapes.
21799 (lex): Use literalchar.
21800 (lex): Implemented "..." tokens.
21801 (literalchar, lex, parse_percent_token): Made tokenbuffer
21802 always contain the token. This includes growing the token
21803 buffer while reading an integer.
21804 (parse_percent_token): Replaced if-else statement with percent_table.
21805 (parse_percent_token): Added % declarations as another
21806 way to specify the flags -n, -l, and -r. Also added hooks for
21807 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
21808 major changes to files.c.
21809 (lex) Retain in the incoming stream a character following
21810 an incorrect '/'.
21811 (skip_white_space, lex): Revised most error messages
21812 and changed fatal to warn to avoid aborting.
21813 (percent_table): Added %thong declarations.
21814
21815 * src/gram.h: Comment changes.
21816
21817 * src/files.c (openfiles, open_extra_files, done):
21818 Add faction flag
21819 and actfile file. Handle noparserflag. Both for -n switch.
21820
21821 * src/conflicts.c (resolve_sr_conflict):
21822 Remove use of alloca.
21823
21824 1995-06-01 Jim Meyering <meyering@gnu.org>
21825
21826 * doc/bison.texinfo: *** empty log message ***
21827
21828 1995-05-06 Richard Stallman <rms@gnu.org>
21829
21830 * src/bison.s1: Comment change.
21831
21832 1995-05-06 Richard Stallman <rms@gnu.org>
21833
21834 * bison.simple: Comment change.
21835
21836 1995-05-03 Richard Stallman <rms@gnu.org>
21837
21838 * src/version.c: Version now 1.24.
21839
21840 * src/bison.s1: Change distribution terms.
21841
21842 * src/version.c: Version now 1.23.
21843
21844 1995-05-03 Richard Stallman <rms@gnu.org>
21845
21846 * doc/bison.texinfo:
21847 Rewrite "Conditions for Using Bison".
21848 Update version to 1.24.
21849
21850 1995-05-03 Richard Stallman <rms@gnu.org>
21851
21852 * bison.simple: Change distribution terms.
21853
21854 1995-02-23 Richard Stallman <rms@gnu.org>
21855
21856 * src/files.c: Test __VMS_POSIX as well as VMS.
21857
21858 1995-02-14 Jim Meyering <meyering@gnu.org>
21859
21860 * src/bison.s1 (__yy_memcpy):
21861 Renamed from __yy_bcopy to avoid
21862 confusion. Reverse FROM and TO arguments to be consistent with
21863 those of memcpy.
21864
21865 1995-02-14 Jim Meyering <meyering@gnu.org>
21866
21867 * bison.simple (__yy_memcpy):
21868 Renamed from __yy_bcopy to avoid
21869 confusion. Reverse FROM and TO arguments to be consistent with
21870 those of memcpy.
21871
21872 1994-11-10 David J. MacKenzie <djm@gnu.org>
21873
21874 * NEWS: reformat
21875
21876 * NEWS: New file.
21877
21878 * Makefile.in (DISTFILES): Include NEWS.
21879
21880 * Makefile.in (DISTFILES):
21881 Include install-sh, not install.sh.
21882
21883 * configure.in: Update to Autoconf v2 macro names.
21884
21885 1994-10-05 David J. MacKenzie <djm@gnu.org>
21886
21887 * Makefile.in: fix typo
21888
21889 * Makefile.in (prefix, exec_prefix):
21890 Let configure set them.
21891
21892 1994-09-28 David J. MacKenzie <djm@gnu.org>
21893
21894 * Makefile.in: Set datadir to $(prefix)/share.
21895
21896 1994-09-15 Richard Stallman <rms@gnu.org>
21897
21898 * src/bison.s1:
21899 Update copyright notice and GPL version.
21900
21901 1994-09-15 Richard Stallman <rms@gnu.org>
21902
21903 * bison.simple:
21904 Update copyright notice and GPL version.
21905
21906 1994-07-12 Richard Stallman <rms@gnu.org>
21907
21908 * src/reduce.c, src/reader.c:
21909 entered into RCS
21910
21911 1994-05-05 David J. MacKenzie <djm@gnu.org>
21912
21913 * Makefile.in: entered into RCS
21914
21915 1994-03-26 Richard Stallman <rms@gnu.org>
21916
21917 * src/bison.s1: entered into RCS
21918
21919 1994-03-26 Richard Stallman <rms@gnu.org>
21920
21921 * bison.simple: entered into RCS
21922
21923 1994-03-25 Richard Stallman <rms@gnu.org>
21924
21925 * src/main.c: entered into RCS
21926
21927 1994-03-24 Richard Stallman <rms@gnu.org>
21928
21929 * src/conflicts.c: entered into RCS
21930
21931 1994-01-02 Richard Stallman <rms@gnu.org>
21932
21933 * Makefile.in: *** empty log message ***
21934
21935 1993-11-21 Richard Stallman <rms@gnu.org>
21936
21937 * src/bison.s1: *** empty log message ***
21938
21939 1993-11-21 Richard Stallman <rms@gnu.org>
21940
21941 * doc/bison.texinfo: entered into RCS
21942
21943 * doc/bison.texinfo: *** empty log message ***
21944
21945 1993-11-21 Richard Stallman <rms@gnu.org>
21946
21947 * bison.simple: *** empty log message ***
21948
21949 1993-10-25 David J. MacKenzie <djm@gnu.org>
21950
21951 * doc/bison.texinfo: *** empty log message ***
21952
21953 1993-10-19 Richard Stallman <rms@gnu.org>
21954
21955 * src/bison.s1: *** empty log message ***
21956
21957 1993-10-19 Richard Stallman <rms@gnu.org>
21958
21959 * bison.simple: *** empty log message ***
21960
21961 1993-10-14 Richard Stallman <rms@gnu.org>
21962
21963 * src/bison.s1: *** empty log message ***
21964
21965 1993-10-14 Richard Stallman <rms@gnu.org>
21966
21967 * bison.simple: *** empty log message ***
21968
21969 1993-09-14 David J. MacKenzie <djm@gnu.org>
21970
21971 * doc/bison.texinfo: *** empty log message ***
21972
21973 1993-09-13 Noah Friedman <friedman@gnu.org>
21974
21975 * Makefile.in: *** empty log message ***
21976
21977 1993-09-10 Richard Stallman <rms@gnu.org>
21978
21979 * src/conflicts.c: *** empty log message ***
21980
21981 * src/system.h: entered into RCS
21982
21983 1993-09-10 Richard Stallman <rms@gnu.org>
21984
21985 * doc/bison.1: entered into RCS
21986
21987 1993-09-06 Noah Friedman <friedman@gnu.org>
21988
21989 * src/version.c: entered into RCS
21990
21991 1993-09-06 Noah Friedman <friedman@gnu.org>
21992
21993 * Makefile.in: *** empty log message ***
21994
21995 1993-07-30 David J. MacKenzie <djm@gnu.org>
21996
21997 * Makefile.in: *** empty log message ***
21998
21999 1993-07-24 Richard Stallman <rms@gnu.org>
22000
22001 * src/bison.s1: *** empty log message ***
22002
22003 1993-07-24 Richard Stallman <rms@gnu.org>
22004
22005 * bison.simple: *** empty log message ***
22006
22007 1993-07-08 David J. MacKenzie <djm@gnu.org>
22008
22009 * Makefile.in: *** empty log message ***
22010
22011 1993-07-04 Richard Stallman <rms@gnu.org>
22012
22013 * src/bison.s1: *** empty log message ***
22014
22015 1993-07-04 Richard Stallman <rms@gnu.org>
22016
22017 * bison.simple: *** empty log message ***
22018
22019 1993-06-26 David J. MacKenzie <djm@gnu.org>
22020
22021 * src/getargs.c: entered into RCS
22022
22023 1993-06-26 David J. MacKenzie <djm@gnu.org>
22024
22025 * doc/bison.texinfo: *** empty log message ***
22026
22027 * doc/bison.1: New file.
22028
22029 1993-06-25 Richard Stallman <rms@gnu.org>
22030
22031 * src/getargs.c: New file.
22032
22033 1993-06-16 Richard Stallman <rms@gnu.org>
22034
22035 * src/bison.s1: *** empty log message ***
22036
22037 1993-06-16 Richard Stallman <rms@gnu.org>
22038
22039 * bison.simple: *** empty log message ***
22040
22041 1993-06-03 Richard Stallman <rms@gnu.org>
22042
22043 * src/bison.s1: New file.
22044
22045 1993-06-03 Richard Stallman <rms@gnu.org>
22046
22047 * doc/bison.texinfo: *** empty log message ***
22048
22049 1993-06-03 Richard Stallman <rms@gnu.org>
22050
22051 * bison.simple: New file.
22052
22053 1993-05-19 Richard Stallman <rms@gnu.org>
22054
22055 * doc/bison.texinfo: New file.
22056
22057 1993-05-07 Noah Friedman <friedman@gnu.org>
22058
22059 * Makefile.in: *** empty log message ***
22060
22061 1993-04-28 Noah Friedman <friedman@gnu.org>
22062
22063 * src/reader.c: *** empty log message ***
22064
22065 1993-04-23 Noah Friedman <friedman@gnu.org>
22066
22067 * src/alloc.h: entered into RCS
22068
22069 1993-04-20 David J. MacKenzie <djm@gnu.org>
22070
22071 * src/version.c: *** empty log message ***
22072
22073 * src/files.c, src/allocate.c:
22074 entered into RCS
22075
22076 * src/reader.c: *** empty log message ***
22077
22078 * src/lex.c: entered into RCS
22079
22080 * src/conflicts.c: New file.
22081
22082 * src/symtab.c: entered into RCS
22083
22084 * src/alloc.h: New file.
22085
22086 * src/LR0.c: entered into RCS
22087
22088 1993-04-18 Noah Friedman <friedman@gnu.org>
22089
22090 * src/reader.c: New file.
22091
22092 * src/version.c: *** empty log message ***
22093
22094 1993-04-18 Noah Friedman <friedman@gnu.org>
22095
22096 * Makefile.in: *** empty log message ***
22097
22098 1993-04-17 Noah Friedman <friedman@gnu.org>
22099
22100 * Makefile.in: *** empty log message ***
22101
22102 1993-04-15 Richard Stallman <rms@gnu.org>
22103
22104 * src/main.c, src/files.c:
22105 New file.
22106
22107 1993-04-15 Noah Friedman <friedman@gnu.org>
22108
22109 * configure.in: entered into RCS
22110
22111 * configure.in: *** empty log message ***
22112
22113 * configure.in: New file.
22114
22115 1993-04-14 Richard Stallman <rms@gnu.org>
22116
22117 * Makefile.in: New file.
22118
22119 1993-04-13 Richard Stallman <rms@gnu.org>
22120
22121 * src/version.c: New file.
22122
22123 1993-03-25 Richard Stallman <rms@gnu.org>
22124
22125 * src/output.c: entered into RCS
22126
22127 1992-09-25 Richard Stallman <rms@gnu.org>
22128
22129 * configure.bat: entered into RCS
22130
22131 1992-06-22 Richard Stallman <rms@gnu.org>
22132
22133 * src/vmsgetargs.c: entered into RCS
22134
22135 1992-06-22 Richard Stallman <rms@gnu.org>
22136
22137 * doc/bison.rnh: entered into RCS
22138
22139 1992-04-20 David J. MacKenzie <djm@gnu.org>
22140
22141 * README: entered into RCS
22142
22143 1992-01-22 Richard Stallman <rms@gnu.org>
22144
22145 * src/machine.h: entered into RCS
22146
22147 1991-12-21 Richard Stallman <rms@gnu.org>
22148
22149 * src/lalr.c, src/closure.c:
22150 entered into RCS
22151
22152 1991-12-20 Richard Stallman <rms@gnu.org>
22153
22154 * src/state.h: entered into RCS
22155
22156 1991-12-18 Richard Stallman <rms@gnu.org>
22157
22158 * src/print.c, src/nullable.c, src/derives.c:
22159 entered into RCS
22160
22161 1991-11-03 David J. MacKenzie <djm@gnu.org>
22162
22163 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
22164 entered into RCS
22165
22166 1988-09-09 Richard Stallman <rms@gnu.org>
22167
22168 * src/bison.hairy: entered into RCS
22169
22170 1987-12-16 Richard Stallman <rms@gnu.org>
22171
22172 * REFERENCES: entered into RCS
22173
22174
22175 -----
22176
22177 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
22178 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
22179 2007, 2008, 2009 Free Software Foundation, Inc.
22180
22181 Copying and distribution of this file, with or without
22182 modification, are permitted provided the copyright notice and this
22183 notice are preserved.