]> git.saurik.com Git - bison.git/blob - ChangeLog
Actually handle the yytable zero value correctly this time.
[bison.git] / ChangeLog
1 2009-08-26 Joel E. Denny <jdenny@clemson.edu>
2
3 Actually handle the yytable zero value correctly this time.
4 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Don't
5 mention zero values in the YYTABLE comments.
6 * data/glr.c (yytable_value_is_error): Don't check for zero
7 value.
8 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
9 * data/yacc.c (yytable_value_is_error): Likewise.
10 * data/lalr1.java (yy_table_value_is_error_): Likewise.
11 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
12 * src/tables.h: In header comments, explain why it's useless to
13 check for a zero value in yytable.
14
15 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
16
17 More fixes related to last two patches.
18 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
19 defined.
20 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Fix
21 yytable comments: zero indicates syntax error not default
22 action.
23 * data/glr.c (yyis_pact_ninf): Rename to...
24 (yypact_value_is_default): ... this.
25 (yyisDefaultedState): Update for rename.
26 (yyis_table_ninf): Rename to...
27 (yytable_value_is_error): ... this, and check for value zero
28 besides just YYTABLE_NINF.
29 (yygetLRActions): Check for default value from yypact. It
30 appears that this check is always performed before this function
31 is invoked, and so adding the check here is probably redundant.
32 However, the code may evolve after this subtlety is forgotten.
33 Also, update for rename to yytable_value_is_error. Because that
34 macro now checks for zero, a different but equivalent branch of
35 the if-then-else here is evaluated.
36 (yyreportSyntaxError): Update for rename to
37 yytable_value_is_error. The zero condition was mishandled
38 before.
39 (yyrecoverSyntaxError): Update for renames. No behavioral
40 changes.
41 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
42 New function.
43 (yy_table_value_is_error_): New function.
44 (parse): Use new functions where possible. No behavioral
45 changes.
46 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
47 The zero condition was mishandled before.
48 * data/yacc.c (yyis_pact_ninf): Rename to...
49 (yypact_value_is_default): ... this.
50 (yyis_table_ninf): Rename to...
51 (yytable_value_is_error): ... this, and check for value zero
52 besides just YYTABLE_NINF.
53 (yysyntax_error): Update for rename to yytable_value_is_error.
54 The zero condition was mishandled before.
55 (yyparse): Update for renames. No behavioral changes.
56 * src/tables.h: Improve comments about yypact, yytable, etc.
57 more. Most importantly, say yytable value of zero means syntax
58 error not default action.
59
60 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
61
62 Fix %error-verbose for conflicts resolved by %nonassoc.
63 * NEWS (2.5): Document.
64 * data/glr.c (yyreportSyntaxError): Fix this by checking
65 yyis_table_ninf.
66 * data/yacc.c (yysyntax_error): Likewise.
67 * data/lalr1.cc (yysyntax_error_): Fix this by checking
68 yytable_ninf_.
69 * data/lalr1.java (yysyntax_error): Likewise.
70 * tests/conflicts.at (%nonassoc and eof): Update expected output
71 and remove FIXME.
72
73 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
74
75 Some code and documentation improvements.
76 * data/c.m4 (b4_table_value_equals): New macro to capture
77 some repeated code.
78 * data/glr.c (yyis_pact_ninf): Use it here.
79 (yyis_table_ninf): Likewise.
80 (yyreportSyntaxError): Improve internal comments.
81 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
82 Use it everywhere possible.
83 (yyis_table_ninf): Likewise.
84 (yysyntax_error): Improve internal comments.
85 * data/lalr1.cc (yysyntax_error_): Likewise.
86 * data/lalr1.java (yysyntax_error): Likewise.
87 * src/tables.h: Improve comments about yypact, yytable, etc.
88
89 2009-08-21 Joel E. Denny <jdenny@clemson.edu>
90
91 Use locale when quoting.
92 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
93 quote rather than implementing quoting here.
94
95 2009-08-20 Eric Blake <ebb9@byu.net>
96
97 Make previous patch more robust.
98 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
99 argmatch.h.
100 (output_skeleton): Use it.
101 Suggested by Akim Demaille.
102
103 Import latest m4/m4.m4.
104 * submodules/autoconf: Update to autoconf 2.64.
105 * configure.ac (M4_GNU_OPTION): New define.
106 * src/output.c (output_skeleton): Use it to resolve FIXME.
107 * NEWS: Mention this.
108
109 2009-08-19 Joel E. Denny <jdenny@clemson.edu>
110
111 Fix complaints about escape sequences.
112 Discussed starting at
113 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
114 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
115 For a \0 and similar escape sequences meaning the null
116 character, report an invalid escape sequence instead of an
117 invalid null character because the latter does not actually
118 appear in the user's input.
119 In all escape sequence complaints, don't escape the initial
120 backslash, and don't quote when the sequence appears at the end
121 of the complaint line unless there's whitespace that quotearg
122 won't escape.
123 Consistently say "invalid" not "unrecognized".
124 Consistently prefer "empty character literal" over "extra
125 characters in character literal" warning for invalid escape
126 sequences; that is, consistently discard those sequences.
127 * tests/input.at (Bad escapes in literals): New.
128
129 2009-08-19 Akim Demaille <demaille@gostai.com>
130
131 doc: fixes.
132 * doc/bison.texinfo: Fix minor Texinfo errors.
133
134 2009-08-19 Akim Demaille <demaille@gostai.com>
135
136 doc: %initial-action to initialize yylloc.
137 Reported by Bill Allombert.
138 * doc/bison.texinfo: Set fill-column to 76.
139 (Location Type): Document the use of %initial-action to initialize
140 yylloc.
141
142 2009-08-18 Joel E. Denny <jdenny@clemson.edu>
143
144 maint: update for gnulib's recent update-copyright changes
145 * gnulib: Update.
146 * .x-update-copyright (COPYING): Add as it's no longer implied
147 when .x-update-copyright is present.
148 * cfg.mk (update-copyright-local): Remove, now ignored.
149 (update-copyright): Declare update-b4-copyright as a dependency.
150
151 2009-08-17 Akim Demaille <demaille@gostai.com>
152
153 build: require gettext 0.17.
154
155 Suggested by Bruno Haible.
156 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
157 * configure.ac: require gettext 0.17 to ensure compatibility with
158 gnulib.
159
160 2009-08-17 Akim Demaille <demaille@gostai.com>
161
162 build: lower gettext requirements.
163
164 Bison was uselessly requiring the formatstring macros from
165 gettext, which resulted in mo files not being installed on systems
166 that perfectly supported Bison mo files. Lower the requirement.
167 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
168
169 * configure.ac: Require need-ngettext instead of
170 need-formatstring-macros.
171 Reported by Martin Jabocs.
172 Suggested by Bruno Haible.
173 * INSTALL: Restructure.
174 (Internationalization): New.
175
176 2009-08-14 Joel E. Denny <jdenny@clemson.edu>
177
178 maint: fix use of copyright year intervals.
179 * gnulib: Update.
180 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
181 as now recommended in gnulib/NEWS.
182 * build-aux/update-b4-copyright: Fix.
183 * cfg.mk (update-copyright-env): Configure update-copyright.
184
185 2009-08-13 Joel E. Denny <jdenny@clemson.edu>
186
187 Make it easier to write deterministic tests.
188 Continues Akim's work from his 2009-06-10 commits.
189 * src/reader.c (check_and_convert_grammar): Don't add any
190 symbols after the first symbols_do invocation.
191 * src/symtab.c (symbols_sorted): New static global.
192 (user_token_number_redeclaration): Update comments.
193 (symbol_from_uniqstr): If a new symbol is being created, assert
194 that symbols_sorted hasn't been allocated yet.
195 (symbols_free): Free symbols_sorted.
196 (symbols_cmp, symbols_cmp_qsort): New functions.
197 (symbols_do): Sort symbol_table into symbols_sorted on first
198 invocation.
199 * tests/input.at (Numbered tokens): Recombine tests now that the
200 output should be deterministic across multiple numbers.
201
202 2009-08-12 Akim Demaille <demaille@gostai.com>
203
204 distcheck: fix.
205
206 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
207
208 2009-08-10 Joel E. Denny <jdenny@clemson.edu>
209
210 * tests/Makefile.am (TESTSUITE_AT): Add named-refs.at.
211
212 2009-08-10 Joel E. Denny <jdenny@clemson.edu>
213
214 Miscellaneous code readability improvements.
215
216 * src/reader.c (reader): Move %define front-end variable
217 defaults and checking into...
218 (prepare_percent_define_front_end_variables): ... this new
219 function.
220
221 * src/scan-gram.l (INITIAL): For consistency with string
222 literals, don't store open quote on character literal. It's
223 discarded before returning anyway.
224 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
225 Make length test more readable, and make the character stored
226 for an empty literal more obvious while consistent with the
227 previous behavior.
228
229 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
230 USER_NUMBER_HAS_STRING_ALIAS throughout.
231 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
232 that is repeated in symtab.h. Improve argument names to make it
233 clear which side of the symbol-string alias pair is which.
234 (symbol_check_alias_consistency): Improve local variable names
235 for the same purpose.
236 * src/symtab.h (struct symbol): Make comments about aliases
237 clearer.
238 (symbol_make_alias): Improve comments and argument name.
239 * src/output.c (token_definitions_output): Update for rename to
240 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
241
242 2009-08-08 Alex Rozenman <rozenman@gmail.com>
243
244 Convert "misleading reference" messages to warnings.
245 * src/scan-code.l: New function 'show_sub_messages', more
246 factoring.
247 * tests/named-ref.at: Adjust tests.
248
249 2009-08-06 Joel E. Denny <jdenny@clemson.edu>
250
251 maint: run "make update-copyright"
252
253 2009-08-06 Joel E. Denny <jdenny@clemson.edu>
254
255 maint: make update-b4-copyright easier to use
256 * build-aux/update-b4-copyright: In warnings, report line
257 numbers rather than character positions.
258 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
259 that update-copyright runs it.
260 * gnulib: Update.
261
262 2009-08-05 Joel E. Denny <jdenny@clemson.edu>
263
264 maint: clean up update-b4-copyright code
265 * build-aux/update-b4-copyright: Do not accept 2-digit
266 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
267 Don't accept a `[' in a b4_copyright argument.
268 Format code more consistently.
269 Don't assume b4*copyright never occurs.
270
271 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
272
273 maint: automate b4_copyright updates.
274 * Makefile.am (update-b4-copyright): New target rule.
275 * build-aux/Makefile.am (EXTRA_DIST): Add update-b4-copyright.
276 * build-aux/update-b4-copyright: New.
277 * data/yacc.c: Remove stray characters around b4_copyright
278 invocations.
279
280 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
281
282 maint: automate annual package-wide copyright-year update.
283 * .x-update-copyright: New.
284 * Makefile.am (EXTRA_DIST): Remove maint.mk.
285 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
286 update-copyright. Remove gnumakefile, which is implied by
287 maintainer-makefile.
288 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
289 * gnulib: Update.
290 * maint.mk: Remove, now copied from gnulib.
291 * examples/extexi: Add missing "(C)" in copyright statement so
292 update-copyright can recognize it.
293 * src/LR0.h: Likewise.
294 * src/print.h: Likewise.
295 * src/print_graph.h: Likewise.
296 * src/gram.c: Add missing comma in copyright statement.
297 * src/gram.h: Likewise.
298
299 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
300
301 Fix "make distcheck".
302 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
303 of just calc.stamp.
304
305 2009-08-01 Joel E. Denny <jdenny@clemson.edu>
306
307 Pacify "gcc -Wunused" for the input function from Flex.
308 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
309 and later.
310 * src/scan-code.l: Add "%option noinput", which I cannot find in
311 the Flex manual, but which Flex has supported since at least as
312 far back as 2.5.4. However, if any of our developers still use
313 Flex 2.5.4, they'll need to stop configuring with
314 --enable-gcc-warnings because "%option noinput" didn't work
315 correctly until Flex 2.5.6.
316 * src/scan-gram.l: Likewise.
317 * src/scan-skel.l: Likewise.
318
319 2009-07-31 Alex Rozenman <rozenman@gmail.com>
320
321 Fix --enable-gcc-warnings problems.
322 * src/reader.c: Adjust variable names.
323 * src/scan-code.l: Fix prototypes and adjust names.
324 * src/named-ref.c: Remove redundant "if".
325
326 2009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
327
328 Fix a --enable-gcc-warnings problem.
329 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
330 variable.
331
332 2009-07-24 Alex Rozenman <rozenman@gmail.com>
333
334 Fix some memory leaks.
335 * src/named-ref.c: Add a pointer check (named_ref_free).
336 * src/scan-code.l: New function (variant_table_free). Called in
337 code_scanner_free.
338 * src/symlist.c: Call to named_ref_free (symbol_list_free).
339
340 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
341
342 Warn about character literals not of length one.
343 * NEWS (2.5): Document.
344 * src/scan-gram.l (INITIAL): Remove comment that we don't check
345 the length.
346 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
347 * tests/input.at (Bad character literals): New test group.
348
349 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
350
351 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
352
353 2009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
354
355 Some M4 cleanup in the testsuite.
356 Suggested by Eric Blake at
357 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
358 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
359 complicate the code by distinguishing between a missing value
360 and an empty string value for an optional argument. This fix is
361 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
362 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
363 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
364 arguments are not needed because of the following changes.
365 Fix stale comments.
366 Bison developers should use GNU M4 and should not use
367 POSIXLY_CORRECT when building the test suite, so do not
368 complicate the code by avoiding $10 and above.
369 Do not quote an empty string value for an optional argument, and
370 do not distinguish between a missing value and an empty string
371 value.
372
373 2009-07-21 Joel E. Denny <jdenny@ces.clemson.edu>
374
375 * m4/m4.m4: Make it a sym link to submodules/autoconf/m4/m4.m4.
376
377 2009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
378
379 Revert unnecessary column realignment in --help output.
380 Reported by Akim Demaille at
381 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
382 * src/getargs.c (usage): Here.
383
384 2009-07-04 Alex Rozenman <rozenman@gmail.com>
385
386 Alphabetical order in src/Makefile.am.
387 * src/Makefile.am: Adjust.
388
389 2009-07-04 Alex Rozenman <rozenman@gmail.com>
390
391 Style changes and factoring.
392 * src/named-ref.h: Add comments.
393 * src/parse-gram.y: Readability and style changes.
394 * src/reader.c: Factoring: assign_named_ref function.
395 * src/scan-code.l: Factoring and style changes. Rename
396 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
397 Use "unsigned" type for variant index. Improve readablity.
398 * src/scan-gram.l: Change error messages and add comments.
399 * src/symlist.h: symbol_list_null: New function decl.
400 * src/symlist.c: symbol_list_null: Implement here.
401 * tests/named-refs.at: Adjust for new error messages.
402
403 2009-06-29 Eric Blake <ebb9@byu.net>
404
405 scan-code: avoid compiler warnings
406 * src/scan-code.l (parse_named_ref): Use correct specifiers.
407
408 2009-06-29 Akim Demaille <demaille@gostai.com>
409
410 build: avoid concurrent extraction of calc++.
411 * examples/calc++/Makefile.am (calc.stamp): New.
412 Depend on it to create the sources of calc++ so that concurrent
413 builds don't launch several "extexi" in parallel.
414 Not only this is inefficient, this also builds incorrect sources
415 with several extractions mixed together.
416
417 2009-06-27 Alex Rozenman <rozenman@gmail.com>
418
419 Implement support for named symbol references.
420 * src/parse-gram.y: Add new syntax (named_ref.opt).
421 * src/reader.c: Store named refs in symbol lists.
422 * src/reader.h: New argument for symbol_append and
423 action_append functions.
424 * src/scan-code.h: Add new field (named_ref) into
425 code_props data structure. Keeps named ref of midrule
426 actions.
427 * src/scan-code.l: Support for named refs in semantic
428 action code. New function 'parse_named_ref'.
429 * src/scan-gram.l: Support bracketed id.
430 * src/symlist.c: Store named refs in symbol lists.
431 * src/symlist.h: New field in symbol list: named_ref.
432 * src/named-ref.h: New file, a struct for named_ref.
433 * src/named-ref.cp: New file, named_ref_new function.
434 * src/local.mk: Add two new files.
435 * tests/testsuite.at: Include new test group:
436 * tests/named-refs.at: this new file.
437
438 2009-06-25 Akim Demaille <demaille@gostai.com>
439
440 hash: check insertion for memory exhaustion.
441 * src/uniqstr.c (uniqstr_new): New.
442
443 2009-06-11 Akim Demaille <demaille@gostai.com>
444
445 style changes.
446 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
447 * src/print-xml.c: Style changes.
448 * tests/conflicts.at: Comment changes.
449
450 2009-06-11 Akim Demaille <demaille@gostai.com>
451
452 xml: beware of user strings used to give a %prec to rules.
453 * tests/conflicts.at (%prec with user strings): New.
454 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
455 XML output.
456
457 2009-06-11 Akim Demaille <demaille@gostai.com>
458
459 hash: check insertion for memory exhaustion.
460 * src/muscle-tab.c (muscle_insert, muscle_grow)
461 * src/state.c (state_hash_insert): Check the return value of
462 hash_insert.
463
464 2009-06-10 Akim Demaille <demaille@gostai.com>
465
466 deterministic test suite.
467 Some consistency checks on symbols are performed after all the
468 symbols were read, by an iteration over the symbol table. This
469 traversal is nondeterministic, which can be a problem for test
470 cases.
471 Avoid this.
472 Addresses another form of nondeterminism reported by Joel E. Denny.
473 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
474
475 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
476 test in two.
477 Use different file names for the three tests to make the
478 maintenance easier.
479
480 2009-06-10 Akim Demaille <demaille@gostai.com>
481
482 deterministic user-token-number redeclaration errors.
483 Address nondeterminism reported by Joel E. Denny.
484 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
485
486 * src/uniqstr.h: Comment changes.
487 * src/location.h (boundary_cmp, location_cmp): New.
488 * src/symtab.c (user_token_number_redeclaration): New.
489 (symbol_translation): Use it.
490 * tests/input.at (Numbered tokens): Adjust the expected output.
491
492 2009-05-25 Akim Demaille <demaille@gostai.com>
493
494 gnulib: update.
495 * gnulib: Update to latest.
496 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
497 * m4/.gitignore: Regen.
498 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
499 Call xalloc_die on hash_insert failures.
500 Requested by the new __warn_unused_result__ attribute of
501 hash_insert.
502
503 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
504
505 Convert multiple variable definition warnings to complaints.
506 * NEWS (2.5): Add a new entry for that change.
507 * doc/bison.texinfo (Decl Summary): Update %define entry.
508 (Bison Options): Update -D/--define/-F/--force-define entry.
509 * src/muscle_tab.c (muscle_percent_define_insert): Implement.
510 * src/muscle_tab.h (muscle_percent_define_insert): Update
511 comments.
512 * tests/input.at (`%define errors'): Update.
513 (`%define, --define, --force-define'): Update.
514
515 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
516
517 -F/--force-define and relative %define/-D/--define priorities.
518 * NEWS (2.5): Add documentation to -D/--define entry.
519 * build-aux/cross-options.pl: Hard-code association of
520 --force-define with %define.
521 * doc/bison.texinfo (Decl Summary): In %define entry,
522 cross-reference command-line options.
523 (Bison Options): Add documentation to -D/--define entry.
524 (Option Cross Key): Widen column for --force-define row.
525 * src/getargs.c (usage): Document -F/--force-define. Realign
526 options in output.
527 (short_options, long_options, getargs): Parse -F/--force-define,
528 and update muscle_percent_define_insert invocation.
529 * src/muscle_tab.h (muscle_percent_define_how): New enum type.
530 (muscle_percent_define_insert): Add argument with that type.
531 * src/muscle_tab.c (muscle_percent_define_insert): Implement
532 -F/--force-define behavior and priorities.
533 * src/parse-gram.y (prologue_declaration): Update
534 muscle_percent_define_insert invocations.
535 * tests/input.at (`%define, --define'): Rename to...
536 (`%define, --define, --force-define'): ... this and extend.
537
538 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
539
540 Update some comments to make sense for -D.
541 * data/bison.m4 (b4_check_user_names): In header comments, say
542 "user occurrence" instead of "grammar occurrence".
543 * src/muscle_tab.h (muscle_percent_define_insert): Likewise.
544 (muscle_percent_code_grow): Likewise just for consistency.
545
546 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
547
548 * data/c++.m4: Update copyright year.
549
550 2009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
551
552 * data/c++.m4 (b4_namespace_close): Simplify slightly.
553
554 2009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
555
556 Handle a trailing `:' in a user-supplied C++ namespace better.
557 * data/c++.m4 (b4_namespace_close): Don't let it be printed
558 among the closing braces here. This fix might make the
559 generated code easier to debug, but otherwise it should be
560 insignificant because a trailing `:' is a C++ error already.
561
562 2009-05-19 Akim Demaille <demaille@gostai.com>
563
564 remove useless variable.
565 * src/getargs.c (skeleton_arg): Remove now useless variable.
566 Should help the compiler see that this printf-like call is sane.
567
568 2009-05-11 Akim Demaille <demaille@gostai.com>
569
570 doc: use C++ headers.
571 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
572 headers.
573
574 2009-05-05 Akim Demaille <demaille@gostai.com>
575
576 fix hexadecimal token number support.
577 * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers.
578
579 2009-05-05 Akim Demaille <demaille@gostai.com>
580
581 tests: check token numbers.
582 * tests/input.at (Numbered tokens): New.
583
584 2009-05-04 Akim Demaille <demaille@gostai.com>
585
586 bison: catch bad symbol names.
587 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
588 * tests/input.at: Adjust.
589
590 2009-05-04 Akim Demaille <demaille@gostai.com>
591
592 space changes.
593 * src/scan-gram.l: Untabify to be robust to zealous editors.
594
595 2009-05-04 Akim Demaille <demaille@gostai.com>
596
597 identifiers: dashes are letters.
598 Dashes can now start identifiers (symbols and directives).
599
600 * src/scan-gram.l ({letter}): Add dash.
601 ({id}): Remove it.
602 * tests/input.at (Symbols): Adjust.
603 Remove stray comment.
604 * tests/regression.at (Invalid inputs): Adjust error message.
605 * doc/bison.texinfo (Symbols): Update.
606
607 2009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
608
609 Declare %code to be a permanent feature.
610 * NEWS (2.4.2): Here.
611 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
612 experimental.
613 (Decl Summary): Likewise.
614
615 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
616
617 Convert underscores to dashes in some %define variable names.
618 For now, just api.push-pull and lr.keep-unreachable-states.
619 Maintain old names for backward compatibility.
620 * NEWS (2.5): Document.
621 * data/c.m4 (b4_identification): Update comment.
622 * data/yacc.c: Update access.
623 * doc/bison.texinfo: Update.
624 * etc/bench.pl.in (bench_grammar): Update use.
625 * src/files.c (tr): Move to...
626 * src/getargs.c, src/getargs.h (tr): ... here because I can't
627 think of a better place to expose it. My logic is that, for all
628 uses of tr so far, command-line arguments can be involved, and
629 getargs.h is already included.
630 * src/main.c (main): Update access.
631 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
632 variable names to new variable names before assigning value.
633 * src/reader.c (reader): Update setting default.
634 * tests/calc.at: Update uses.
635 * tests/conflicts.at (Unreachable States After Conflict
636 Resolution): Update use.
637 * tests/input.at (%define enum variables): Update use.
638 (%define backward compatibility): New test group.
639 * tests/push.at: Update uses.
640 * tests/reduce.at: Update uses.
641 * tests/torture.at: Update uses.
642
643 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
644
645 Set all front-end %define defaults in one place.
646 * src/main.c (main): Move lr.keep_unreachable_states default...
647 * src/reader.c (reader): ... to here.
648
649 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
650
651 Rename lr.default_reductions to lr.default-reductions.
652 * NEWS (2.5): Here.
653 * doc/bison.texinfo: Here.
654 * src/lalr.c (initialize_LA): Here.
655 * src/print.c (print_reductions): Here.
656 * src/reader.c (reader): Here.
657 * src/tables.c (action_row): Here.
658 * tests/input.at (%define enum variables): Here.
659 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
660
661 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
662
663 Pacify ./configure --enable-gcc-warnings.
664 * tests/input.at (Symbols): Prototype yyerror and yylex.
665
666 2009-04-21 Akim Demaille <demaille@gostai.com>
667
668 tests: check the use of dashes and periods in symbols.
669 * tests/input.at (Symbol): New test group.
670
671 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
672
673 Document how `%define "var" "value"' is not M4-friendly.
674 * src/parse-gram.y (variable): In comments here.
675
676 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
677
678 Add copyright updates missed during previous cherry pick.
679 * src/output.c: Here.
680 * src/parse-gram.y: Here.
681 * src/scan-gram.l: Here.
682
683 2009-04-20 Akim Demaille <demaille@gostai.com>
684
685 variables: accept dashes.
686 * src/scan-gram.l ({id}): Also accept dashes after the initial
687 letter.
688 ({directive}): Use {id}.
689 * src/parse-gram.y: Comment and formatting changes.
690 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
691 symbols.
692 * src/complain.h, src/complain.c (yacc_at): New.
693 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
694 symbol names.
695 * src/output.c (token_definitions_output): Do not #define token
696 names with dashes.
697
698 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
699
700 Clean up recent patches a little.
701 Reported by Akim Demaille.
702 * doc/bison.texinfo (Understanding): Fix typos.
703 * src/print.c (print_reductions): Don't use negated variable.
704
705 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
706
707 List accepted values for a %define enum variable with an invalid value.
708 Suggested by Akim Demaille at
709 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
710 * data/bison.m4 (_b4_percent_define_check_values): Implement.
711 * src/muscle_tab.c (muscle_percent_define_check_values): Implement.
712 * tests/input.at (%define lr.default_reductions invalid values): Merge
713 into...
714 (%define enum variables): ... here, and update output.
715
716 2009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
717
718 Rename "default rule" to "default reduction".
719 This includes changing variable names in code, changing
720 comments, and renaming %define lr.default_rules to %define
721 lr.default_reductions.
722 * NEWS (2.5): Update IELR documentation.
723 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c:
724 Adjust YYDEFACT and yydefact_ documentation.
725 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
726 and lr.type documentation. Make some other wording
727 improvements.
728 (Glossary): Adjust cross-references and Default Reduction
729 definition.
730 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
731 Remove a confusing comment pointed out by Akim Demaille.
732 (initialize_LA): Adjust code.
733 * src/print-xml.c (print_reductions): Adjust code.
734 * src/print.c (print_reductions): Adjust code.
735 * src/reader.c (reader): Adjust code.
736 * src/tables.c (action_row): Adjust code.
737 (token_actions): Adjust code.
738 * src/tables.h: Adjust YYDEFACT documentation.
739 * tests/input.at (%define lr.default_rules invalid values):
740 Rename test group to...
741 (%define lr.default_reductions invalid values): ... this, and
742 update grammar file and expected output.
743 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
744 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
745
746 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
747
748 Document %define lr.type and lr.default_rules.
749 * NEWS (2.5): Add an entry.
750 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
751 besides just LALR(1) and GLR(1).
752 * doc/bison.texinfo (Introduction): Likewise.
753 (Language and Grammar): Bison is no longer limited to LALR(1)
754 restrictions.
755 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
756 when trying to distinguish from GLR. Talk about LR(1) grammars
757 rather than LALR(1) grammars.
758 (Decl Summary): In %define api.push_pull entry, say it applies
759 to deterministic parsers in C rather than LALR(1) parsers in C.
760 Add lr.default_rules entry.
761 Add lr.type entry.
762 (Mystery Conflicts): Bison is no longer limited to LALR(1)
763 restrictions.
764 (Generalized LR Parsing): Same changes as for the previous GLR
765 section.
766 (Memory Management): Say deterministic rather than LALR(1).
767 (Understanding): Correct some bison output.
768 Index discussion of "accepting state".
769 Say deterministic rather than LALR(1).
770 (Bison Options): In --yacc entry, say deterministic rather than
771 LALR(1).
772 In --report, --graph, and --xml entries, just don't mention
773 LALR(1).
774 (C++ Parsers): Say deterministic rather than LALR(1).
775 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
776 (Glossary): Add Accepting State, Consistent State, Default Rule,
777 and IELR(1) definitions.
778 In Generalized LR (GLR) definition, make same changes as in
779 previous GLR sections.
780 In LALR(1) definition, say Bison uses LALR(1) by default rather
781 than implying Bison is limited to LALR(1).
782 (LocalWords): Add IELR.
783
784 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
785
786 Finish implementing %define lr.type.
787 Its value can be "LALR", "IELR", or "canonical LR".
788 * lib/timevar.def (TV_IELR_PHASE1): New var.
789 (TV_IELR_PHASE2): New var.
790 (TV_IELR_PHASE3): New var.
791 (TV_IELR_PHASE4): New var.
792 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
793 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
794 Sbitset.h, ielr.h, and ielr.c.
795 * src/getargs.h, src/getargs.c (enum trace, trace_args,
796 trace_types): Add trace_ielr.
797 * src/lalr.h, src/lalr.c (ngotos): Export it.
798 (F): Rename to...
799 (goto_follows): ... this, update all uses, and export it.
800 (set_goto_map): Export it.
801 (map_goto): Export it.
802 (compute_lookahead_tokens): Don't free goto_follows yet. Now
803 handled in ielr.
804 (initialize_LA): Export it. Move lookback allocation to...
805 (lalr): ... here because, for canonical LR, initialize_LA must
806 be invoked but lookback and much of the rest of LALR isn't
807 needed.
808 * main.c (main): Instead of lalr, invoke ielr, which invokes
809 lalr.
810 * src/reader.c (reader): Default lr.type to "LALR".
811 Default lr.default_rules to "accepting" if lr.type is "canonical
812 LR". Leave the default as "all" otherwise.
813 Check for a valid lr.type value.
814 * src/state.h, src/state.c (struct state_list): Add state_list
815 member.
816 (state_new): Initialize state_list member to NULL.
817 (state_new_isocore): New function, exported.
818 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
819 exercises all values of lr.type.
820 (GNU AWK Grammar): Rename test group to...
821 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
822 AT_TEST_EXISTING_GRAMMAR.
823 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
824 (GNU pic Grammar): Rename test group to...
825 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
826 AT_TEST_EXISTING_GRAMMAR.
827 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
828 all values of lr.type.
829 (Single State Split): New test groups using AT_TEST_LR_TYPE.
830 (Lane Split): Likewise.
831 (Complex Lane Split): Likewise.
832 (Split During Added Lookahead Propagation): Likewise.
833
834 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
835
836 Add new files for IELR and canonical LR implementation.
837 * src/AnnotationList.c: New.
838 * src/AnnotationList.h: New.
839 * src/InadequacyList.c: New.
840 * src/InadequacyList.h: New.
841 * src/Sbitset.c: New.
842 * src/Sbitset.h: New.
843 * src/ielr.c: New.
844 * src/ielr.h: New.
845
846 2009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
847
848 Implement %define lr.default_rules.
849 Its value describes the states that are permitted to contain
850 default rules: "all", "consistent", or "accepting".
851 * src/reader.c (reader): Default lr.default_rules to "all".
852 Check for a valid lr.default_rules value.
853 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
854 is "accepting", then only mark the accepting state as
855 consistent.
856 (initialize_LA): Tell state_lookahead_tokens_count whether
857 lr.default_rules is "accepting".
858 * src/tables.c (action_row): If lr.default_rules is not "all",
859 then disable default rules in inconsistent states.
860 * src/print.c (print_reductions): Use this opportunity to
861 perform some assertions about whether lr.default_rules was
862 obeyed correctly.
863 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
864 helps with checking the parser tables for a grammar.
865 * tests/input.at (%define lr.default_rules invalid values): New
866 test group.
867 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
868 AT_TEST_TABLES_AND_PARSE.
869 (`no %define lr.default_rules'): New test group generated by
870 AT_TEST_LR_DEFAULT_RULES.
871 (`%define lr.default_rules "all"'): Likewise.
872 (`%define lr.default_rules "consistent"'): Likewise.
873 (`%define lr.default_rules "accepting"'): Likewise.
874
875 2009-04-20 Akim Demaille <demaille@gostai.com>
876
877 Consistently refer to Yacc, not YACC.
878 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
879
880 2009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
881
882 Pacify make maintainer-check-posix.
883 * tests/input.at (%define, --define): Move bison command-line
884 options before grammar file name.
885
886 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
887
888 Document semicolon warnings.
889 * NEWS (2.5): Here.
890
891 2008-12-08 Akim Demaille <demaille@gostai.com>
892
893 Fix portability issue in the test suite.
894 * tests/local.at (AT_MATCHES_CHECK): New.
895 Based on Perl instead of Sed. Sed has too many portability
896 pitfalls, not ever Sed is GNU Sed.
897 * tests/actions.at (Fix user actions without a trailing semicolon):
898 Use it.
899
900 2008-12-07 Di-an Jan <dianj@freeshell.org>
901
902 Implement the FIXME that ends an user action with a semicolon
903 if it seems necessary.
904 * src/scan-code.l (flex rules section): Flag cpp directive from
905 any `#' to the first unescaped end-of-line. Semicolon is not
906 needed after `;', `{', '}', or cpp directives and is needed after
907 any other token (whitespaces and comments have no effect).
908 * tests/actions.at (Fix user actions without a trailing semicolon):
909 New test.
910 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
911 to make user actions complete statements.
912 Adjust column numbers in error messages.
913 * tests/regression.at (Fix user actions without a trailing semicolon):
914 Remove. Covered by new test.
915
916 2009-04-14 Akim Demaille <demaille@gostai.com>
917
918 doc: minor fixes.
919 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
920 (Table of Symbols): Remove duplicate entry for %debug.
921
922 2009-04-10 Eric Blake <ebb9@byu.net>
923
924 submodules: update to latest
925 * submodules/autoconf: Use latest upstream Autoconf.
926
927 2009-04-06 Eric Blake <ebb9@byu.net>
928
929 Work around autoconf 2.63b bug in testsuite.
930 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
931 autoconf bug related to # in test.
932
933 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
934
935 * NEWS (2.5): Describe new -D/--define feature.
936
937 2008-11-10 Akim Demaille <demaille@gostai.com>
938
939 --trace=muscles
940 * src/getargs.h, src/getargs.c (trace_muscle): New.
941 (trace_types, trace_args): Support it.
942 * src/output.c (output_skeleton): Use it.
943
944 2008-11-10 Akim Demaille <demaille@gostai.com>
945
946 muscles_output.
947 * src/output.c (muscles_output): New, extracted from...
948 (output_skeleton): here.
949 Adjust.
950
951 2008-11-21 Akim Demaille <demaille@gostai.com>
952
953 Display the changes in cross-options.texi.
954 * build-aux/cross-options.pl ($sep): New, to separate items.
955 * doc/Makefile.am ($(srcdir)/cross-options.texi): Use diff to display
956 the changes.
957
958 2008-11-20 Di-an Jan <dianj@freeshell.org>
959
960 Improves options in the manual.
961 * doc/bison.texinfo (-g, -x): Add space before argument.
962 (Option Cross Key): Implement FIXME: listing directives also.
963 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
964 (Short Option): Special case -d. Put arguments inside @option.
965 (Bison Directive): Add column, automatically extracted from
966 src/scan-gram.l (actual name passed as the first argument)
967 with special case for %define.
968 * doc/Makefile.am (doc/cross-options.texi): Pass src/scan-gram.l
969 to build-aux/cross-options.pl.
970 * src/getargs.c (usage): Document limitations of cross-options.pl.
971 * src/scan-gram.l: Likewise.
972
973 2009-02-25 Akim Demaille <demaille@gostai.com>
974
975 Copyright years.
976 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
977
978 2008-12-08 Akim Demaille <demaille@gostai.com>
979
980 Install autoconf as a submodule to get m4sugar.
981 * .gitmodules: Add submodules/autoconf.
982 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
983 submodules/autoconf.
984
985 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
986
987 Simplify last patch slightly.
988 * src/getargs.c (getargs): Here.
989
990 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
991
992 Fix last warning from --enable-gcc-warnings.
993 * src/getargs.c (getargs): Don't assign const address to non-const
994 pointer.
995
996 2008-11-17 Di-an Jan <dianj@freeshell.org>
997
998 Handle --enable-gcc-warnings.
999 * src/getargs.c (command_line_location): Set parameters to void.
1000
1001 2008-11-11 Akim Demaille <demaille@gostai.com>
1002
1003 AT_FULL_COMPILE.
1004 * tests/actions.at, tests/regression.at: Use it.
1005
1006 2008-11-07 Akim Demaille <demaille@gostai.com>
1007
1008 Pass command line location to skeleton_arg and language_argmatch.
1009 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
1010 The location argument is now mandatory.
1011 Adjust all dependencies.
1012 (getargs): Use command_line_location.
1013
1014 2008-11-07 Akim Demaille <demaille@gostai.com>
1015
1016 -D, --define.
1017 * src/getargs.c (usage): Document -D.
1018 Fix help string for --locations.
1019 (command_line_location): New.
1020 (short_options, long_options, getargs): Support -D, --define.
1021 (getargs): Move -d support at the right place.
1022 * doc/bison.texinfo (Bison Options): Update.
1023 * tests/input.at (%define, --define): New.
1024
1025 2008-11-07 Akim Demaille <demaille@gostai.com>
1026
1027 Initialize the muscle table before parsing the command line.
1028 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
1029 (getargs): Define file_name.
1030 * src/main.c (main): Initialize muscle_tab before calling
1031 getargs.
1032 * src/muscle_tab.c (muscle_init): No longer define file_name, as
1033 its value is not available yet.
1034
1035 2008-11-09 Akim Demaille <demaille@gostai.com>
1036
1037 Require the generation of parse-gram.output.
1038 * src/Makefile.am (YACC): Pass --report=all.
1039
1040 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1041
1042 * NEWS (2.5): New stub.
1043
1044 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1045
1046 Fix options documentation.
1047 * build-aux/cross-options.pl: As in --help output, write optional
1048 arguments as [=ARG] not =[ARG].
1049 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
1050
1051 2008-11-07 Akim Demaille <demaille@gostai.com>
1052
1053 Fix --help.
1054 * src/getargs.c (usage): Fix help string for -W.
1055
1056 2008-11-07 Akim Demaille <demaille@gostai.com>
1057
1058 Handle more general types of option arguments.
1059 * build-aux/cross-options.pl: The argument ends at the first
1060 space, not the first non-symbol character.
1061 Use @var for each word appearing the argument description.
1062
1063 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1064
1065 Remove spurious initial empty lines.
1066 * data/location.cc: End the @output lines with an @.
1067
1068 2008-11-04 Akim Demaille <demaille@gostai.com>
1069
1070 Remove spurious initial empty lines.
1071 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1072 * data/yacc.c: End the @output lines with an @.
1073
1074 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1075
1076 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
1077 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
1078 requirements for a correct m4 are stricter.
1079 * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
1080 * configure.ac: Update to use AC_PROG_GNU_M4.
1081 Reported by Eric Blake.
1082
1083 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1084
1085 Help with updating web manual.
1086 * HACKING: Incorporate instructions from gnulib/doc/README.
1087 * bootstrap.conf (gnulib_modules): Add gendocs.
1088
1089 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1090
1091 Fix strange %define locations for default values.
1092 Reported by Akim Demaille at
1093 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
1094 and discussed again starting at
1095 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
1096 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
1097 because location information is bogus.
1098 Use angle brackets to delimit fake file name because square brackets
1099 look like underexpanded m4. Choose a better fake file name.
1100 Use negative line numbers.
1101 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
1102 * src/location.c (location_print): If line for a boundary is negative,
1103 only print that boundary's file name.
1104 * src/location.h: Document that.
1105 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1106 defaults): Update output.
1107
1108 2008-11-07 Akim Demaille <demaille@gostai.com>
1109
1110 Locations without columns for command line arguments.
1111 * src/location.c (location_print): Don't display negative columns.
1112 * src/location.h: Document this.
1113
1114 2009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
1115
1116 Add reminder about uploading public key to keys.gnupg.net.
1117 * HACKING (Release Procedure): Here.
1118
1119 2009-03-31 Akim Demaille <demaille@gostai.com>
1120
1121 bootstrap: --help to stdout.
1122 * bootstrap (usage): Don't send --help to stderr.
1123 Use a here doc instead of a long string.
1124
1125 2009-03-31 Akim Demaille <demaille@gostai.com>
1126
1127 bootstrap: README-hacking no longer exists
1128 * bootstrap (checkout_only_file): Set to HACKING.
1129
1130 2009-03-26 Akim Demaille <demaille@gostai.com>
1131
1132 doc: merge HACKING and README-hacking.
1133 Two files is confusing.
1134 Reported by Alexandre Duret-Lutz.
1135
1136 * README-hacking: Merge into...
1137 * HACKING (Working from the repository): here.
1138
1139 2009-03-26 Akim Demaille <demaille@gostai.com>
1140
1141 doc: update README-hacking.
1142 * README-hacking: We now use git and git submodules.
1143 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
1144
1145 2009-03-26 Akim Demaille <demaille@gostai.com>
1146
1147 lalr1.cc: avoid GCC 4.3 warnings.
1148 GCC 4.3 now warns about "a || b && c" and asks for explicit
1149 parentheses.
1150 Reported by Alexandre Duret-Lutz.
1151 * data/location.cc: Update copyright years.
1152 (Position::operator==): Use parens to make precedence explicit.
1153 Compare lines and columns first, as they are more likely to be
1154 different, and they are faster to compare.
1155
1156 2009-03-26 Akim Demaille <demaille@gostai.com>
1157
1158 gnulib: update.
1159 * gnulib: Update to latest.
1160 * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so
1161 use +=.
1162
1163 2009-01-08 Akim Demaille <demaille@gostai.com>
1164
1165 Fix grep portability issues.
1166 Grep on Solaris does not support -q.
1167 Reported by Summum Bonum.
1168
1169 * NEWS: Add a stub for 2.4.2.
1170 * THANKS: Add Summum Bonum.
1171 * tests/atlocal.in (EGREP): New.
1172 (CC, CXX, XSLTPROC): Make it possible to override them via
1173 envvars.
1174 * tests/java.at: Use $EGREP instead of egrep.
1175 Use AT_CHECK's ignore instead of grep's -q.
1176
1177 2008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1178
1179 Version 2.4.1.
1180 * NEWS: Set version and date.
1181 * lib/Makefile.am: Update copyright year.
1182 * tests/atlocal.in: Update copyright year.
1183
1184 2008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1185
1186 Semicolon feature removal is not about future language support.
1187 * NEWS: The semicolon feature is no longer active for newer languages,
1188 so don't claim that it causes trouble for them.
1189
1190 2008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1191
1192 * gnulib: Update submodule to HEAD.
1193
1194 2008-12-09 Akim Demaille <demaille@gostai.com>
1195
1196 Update data/README.
1197 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
1198
1199 2008-12-05 Eric Blake <ebb9@byu.net>
1200
1201 Build testsuite with newer autoconf.
1202 * tests/output.at (m4_expand): Don't override in newer autoconf,
1203 where the underlying implementation changed.
1204 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
1205 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
1206 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
1207 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
1208 since some of them contain unbalanced ')'.
1209
1210 2008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1211
1212 * NEWS: Clarify a little.
1213
1214 2008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1215
1216 * NEWS: Update for recent changes.
1217
1218 2008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1219
1220 Fix unexpanded macros in GLR defines file.
1221 Reported by Csaba Raduly at
1222 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
1223 * THANKS (Csaba Raduly): Add.
1224 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
1225 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
1226 lexer in a separate module that includes the defines file.
1227 (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
1228 source.
1229 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
1230 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
1231 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
1232 (AT_DATA_SOURCE_PROLOGUE): New.
1233 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
1234 (AT_DATA_SOURCE): New.
1235 (AT_FULL_COMPILE): New, copied from master branch and extended to
1236 support an additional source file.
1237
1238 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1239
1240 Don't let maintainer-*-check targets force a version update.
1241 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
1242 handled.
1243
1244 2008-11-17 Di-an Jan <dianj@freeshell.org>
1245
1246 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
1247 Align menus. Adjust word wrapping. Use node names for menu names.
1248 (Examples): Don't abbreviate node names.
1249 (LocalWords): Remove abbreviations.
1250 (Copying): Make description a sentence.
1251 (Java Action Features): Remove period to match the rest of menu.
1252
1253 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
1254
1255 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
1256 * configure.ac: Adjust usage.
1257 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1258 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1259 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
1260
1261 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1262
1263 Don't add a semicolon to actions for %skeleton or %language.
1264 It breaks Java test cases as reported by Akim Demaille.
1265 * src/scan-code.l: Implement.
1266
1267 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1268
1269 Clean up %skeleton and %language priority implementation.
1270 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
1271 remove static qualifier because others will soon need to see it.
1272 (language_prio): Likewise.
1273 (getargs): Use command_line_prio rather than 0.
1274 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
1275 enum fields.
1276 (skeleton_prio): Extern it.
1277 (language_prio): Extern it.
1278 * src/parse-gram.y: Use grammar_prio rather than 1.
1279
1280 2008-11-04 Akim Demaille <demaille@gostai.com>
1281
1282 * NEWS: Mention the trailing semicolon in action.
1283
1284 2008-11-04 Akim Demaille <demaille@gostai.com>
1285
1286 Reformat NEWS.
1287 * NEWS: Use more outline-mode markup.
1288 Suggested by Jim Meyering.
1289
1290 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
1291
1292 Fix user actions without a trailing semicolon.
1293 Reported by Sergei Steshenko at
1294 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
1295 * THANKS (Sergei Steshenko): Add.
1296 * src/scan-code.l (SC_RULE_ACTION): Fix it.
1297 * tests/regression.at (Fix user actions without a trailing semicolon):
1298 New test case.
1299
1300 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1301
1302 Initiate further development.
1303 * NEWS: Create an empty section for new entries.
1304 * gnulib: Update submodule to HEAD.
1305
1306 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1307
1308 * NEWS: Version 2.4.
1309
1310 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1311
1312 Prepare for next release.
1313 * NEWS: Briefly mention changes since 2.3b.
1314 * README: Say GNU m4 1.4.6, which we've been requiring in release
1315 announcements already, not 1.4.3, which breaks the build.
1316
1317 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1318
1319 Say %language is experimental.
1320 We're thinking of extending it's effect on output file naming. See the
1321 thread at
1322 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
1323 * NEWS: Say it's experimental.
1324 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
1325 recommend it over %skeleton for now.
1326 (Bison Options): Likewise.
1327 (C++ Bison Interface): Use %skeleton not %language.
1328 (Calc++ Parser): Use %skeleton not %language.
1329 * src/getargs.c (usage): Say it's experimental.
1330
1331 2008-11-01 Di-an Jan <dianj@freeshell.org>
1332 Paolo Bonzini <bonzini@gnu.org>
1333
1334 Support all Java parser class modifiers.
1335 * data/java.m4 (b4_percent_define_get3): New.
1336 (b4_final_if, b4_strictfp_if): New.
1337 * data/lalr1.java (final, strictfp, extends, implements): Support.
1338 * doc/bison.texinfo (final, strictfp, extends, implements): Add
1339 documentation.
1340 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
1341 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
1342 (AT_CHECK_JAVA_GREP): New.
1343 (Java parser class modifiers): New test.
1344 (Java parser class extends and implements): New test.
1345
1346 Model exception propagation better with throws and lex_throws.
1347 * data/java.m4 (b4_list2): New.
1348 (throws): Change default.
1349 * data/lalr1.java (yyaction): Add throws.
1350 (parse): Add lex_throws in addition to throws.
1351 * doc/bison.texinfo (throws, lex_throws): Add documentation.
1352 * tests/java.at (Java throws specifications): New test.
1353
1354 Improve documentation for Java parsers.
1355 * doc/bison.texinfo (Java Parsers): Add subsections.
1356 Don't quote first argument of %define.
1357 (Java Bison Interface): Document output files. Move documentation
1358 of parser class and merge into Java Parser Interface. Document
1359 features that error out. Document directives with no effect.
1360 Move note about Javadoc higher.
1361 (Java Semantic Values): Explicitly mention stype.
1362 Document that generic types cannot be used.
1363 (Java Location Values): Use @deftypeivar. Document constructors.
1364 Correct return value for toString.
1365 (Java Parser Interface): List undocumented constants/fields.
1366 Move documentation of fields added by %parse-param closer to list
1367 of members. Document that token names are added as fields.
1368 Document constructors accurately. Remove error method.
1369 (Java Scanner Interface): Move note on %pure-parser to Java Bison
1370 Interface. Describe %code lexer and yylex accutately.
1371 Remove documentation that does not match the code.
1372 (Java Action Features): New.
1373 (Java Differences): Add reference. Add item on semantic values.
1374 Add note about @{ ... @}. Clarify %% epilogue placement.
1375 (Java Declarations Summary): New.
1376
1377 Fix Java skeleton.
1378 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
1379 (b4_remove_comma): Quote test argument.
1380 (b4_identification): Remove "bison" field.
1381 * tests/java.at (Java parser class and package names): New test.
1382 (Java %parse-param and %lex-param): New test.
1383 (Java stype, position_class and location_class): New test.
1384
1385 2008-10-31 Di-an Jan <dianj@freeshell.org>
1386
1387 * data/lalr1.jave: Update copyright years.
1388 (YYParser): Correct name of "generated from" file in Javadoc:
1389 use b4_file_name instead of @ofile@.
1390 (Location constructor): Correct Javadoc parameter name.
1391 (yylloc): Add missing opening m4 quote after b4_location_if.
1392 This removes a stray [ in the Javadoc of Lexer.getStartPos.
1393 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
1394 (YYParser constructor): Correct Javadoc parameter name.
1395
1396 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
1397
1398 Always put auxiliary code files in the same dir as other output files.
1399 * src/files.c (compute_file_name_parts): When the user specifies
1400 --output but not --file-prefix, extract the directory prefix from the
1401 file prefix not from the grammar file name. This affects the location
1402 of files like location.hh generated by the C++ skeleton. The includes
1403 in the other output files require this fix.
1404 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
1405 for expected output files.
1406 (Output files): Add a test for the above.
1407
1408 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
1409
1410 * gnulib: Update submodule to HEAD.
1411
1412 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1413
1414 Update copyright year.
1415 * src/files.c: Here.
1416
1417 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
1418
1419 Don't overwrite the input file.
1420 * src/files.c (output_file_name_check): Fatal error if using input file
1421 for output.
1422 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
1423 argument.
1424 (Conflicting output files): Add test.
1425
1426 2008-10-28 Akim Demaille <demaille@gostai.com>
1427
1428 Space changes.
1429 * data/lalr1.cc: Formatting changes.
1430
1431 2008-10-28 Akim Demaille <demaille@gostai.com>
1432
1433 Don't define debugging functions when !YYDEBUG.
1434 * data/lalr1.cc (debug_stream, set_debug_stream)
1435 (debug_level_type, debug_level, set_debug_level): Don't
1436 declare them when YYDEBUG is not defined.
1437 The implementation are already YYDEBUG-aware.
1438
1439 2008-10-28 Akim Demaille <demaille@gostai.com>
1440
1441 Prefer "continue" for empty loop bodies.
1442 * etc/bench.pl.in: Use "continue" instead of {}.
1443
1444 2008-10-28 Akim Demaille <demaille@gostai.com>
1445
1446 Space and comments changes.
1447 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
1448 * data/c.m4, data/lalr1.cc: Space changes.
1449
1450 2008-10-28 Akim Demaille <demaille@gostai.com>
1451
1452 Make gnulib a submodule.
1453 * gnulib: New.
1454 * .gitmodules (gnulib): New.
1455
1456 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1457
1458 Fix yyerror_range for user-defined location type in C++. Reported by
1459 Georg Sauthoff at
1460 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
1461 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
1462 * THANKS (Georg Sauthoff): Add.
1463
1464 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1465
1466 Update several administrative files mainly to facilitate releasing.
1467 * HACKING (Administrivia): Make the git-merge-changelog notes more
1468 helpful.
1469 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
1470 (Release Procedure): Update for git and add numerous details that were
1471 previously missing.
1472 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
1473 * maint.mk (announcement): Don't list bison as a bootstrap tool so
1474 that announcements don't claim we bootstrapped with whatever bison
1475 happened to be in PATH. Add flex as a bootstrap tool.
1476 * Makefile.maint: Remove, previously replaced by maint.mk.
1477 * Makefile.cfg: Remove, and migrate settings to...
1478 * cfg.mk: ... here for the sake of `make announcement'.
1479 * bootstrap.conf (gnulib_modules): Add announce-gen.
1480 * README: Say GNU Bison instead of just Bison. Suggested by Karl
1481 Berry.
1482
1483 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
1484
1485 Small but important bugfixes for the Java skeleton.
1486 * data/lalr1.java (yyerror): Change Location to b4_location_type.
1487 (yy_symbol_print): Call toString on yyvaluep.
1488
1489 2008-08-29 Akim Demaille <demaille@gostai.com>
1490
1491 Clarify UPDATED use.
1492 * doc/bison.texinfo: It refers to the last edition of this file,
1493 not to the release date of Bison.
1494 Reported by Joel E. Denny.
1495
1496 2008-08-29 Akim Demaille <demaille@gostai.com>
1497
1498 * README: Update FAQ pointer.
1499 Reported by Joel E. Denny.
1500
1501 2008-08-27 Eric Blake <ebb9@byu.net>
1502
1503 Resync m4sugar from autoconf.
1504 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
1505 (m4_init): Adjust to latest m4.git changes.
1506 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
1507 effects.
1508 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
1509 (_m4_list_cmp): Reduce side effects.
1510
1511 2008-08-27 Akim Demaille <demaille@gostai.com>
1512
1513 Check yyerrok in calc.at.
1514 * tests/calc.at (calc.y): Use yyerrok on "( error )".
1515 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
1516 expected.
1517
1518 2008-08-27 Akim Demaille <demaille@gostai.com>
1519
1520 Support yyerrok in lalr1.cc.
1521 YYBACKUP is still to import back into lalr1.cc.
1522 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
1523
1524 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1525
1526 For maintainer-check*, don't recompile for a $(VERSION) update.
1527 * cfg.mk: New file.
1528 (_is-dist-target): Override the one in GNUmakefile.
1529 * Makefile.am (EXTRA_DIST): Add cfg.mk.
1530
1531 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1532
1533 Update for recent change to gnulib.
1534 * src/parse-gram.y: Don't include strverscmp.h. It comes from
1535 string.h now.
1536
1537 2008-08-15 Eric Blake <ebb9@byu.net>
1538
1539 Remaining m4sugar merge from autoconf.
1540 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
1541 * data/m4sugar/foreach.m4: New file, copied from autoconf.
1542 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
1543 * src/output.c (output_skeleton): Tell m4 how to find it.
1544
1545 Partial m4sugar merge from autoconf: m4_map.
1546 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
1547 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
1548 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
1549 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
1550 for empty list.
1551 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
1552 Likewise.
1553 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
1554 declares it.
1555
1556 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
1557
1558 Keep .version and PACKAGE_VERSION in sync.
1559 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
1560 dependency, and add comments justifying this in more detail. Discussed
1561 starting at
1562 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
1563
1564 2008-08-06 Eric Blake <ebb9@byu.net>
1565
1566 Partial m4sugar merge from autoconf: m4_shiftn.
1567 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
1568 (m4_shift2, m4_shift3): New macros.
1569 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
1570 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
1571 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
1572 * data/java.m4 (b4_remove_comma): Likewise.
1573
1574 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
1575 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
1576 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
1577 (m4_init): Consolidate wrapped text into single m4_wrap.
1578 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
1579 in wrapped text.
1580
1581 2008-08-05 Eric Blake <ebb9@byu.net>
1582
1583 Partial m4sugar merge from autoconf: builtins, version.m4.
1584 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
1585 (m4_prepend): Remove, as it is unused and inherently quadratic,
1586 whereas m4_append is linear in newer m4.
1587 (m4_mkstemp): New builtin.
1588 (m4_symbols): Make rename conditional.
1589 (m4_version_prereq): Ensure fatal error if used in bison, which
1590 intentionally lacks version.m4.
1591
1592 Fix comments in m4sugar.
1593 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
1594
1595 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1596
1597 Update for recent .gitignore fix in Gnulib.
1598 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
1599 anchored .gitignore entries.
1600
1601 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1602
1603 Set gnu or gnits strictness.
1604 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
1605 development and gnits strictness for releases. Based on Eric Blake's
1606 suggestion at
1607 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
1608
1609 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
1610
1611 * NEWS: Clarify documentation of %language.
1612
1613 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
1614
1615 Support usage of git-merge-changelog.
1616 * .gitattributes: New.
1617 * HACKING: Document usage of git-merge-changelog.
1618 * bootstrap: Install git-merge-changelog entries in .git/config
1619 if appropriate.
1620
1621 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1622
1623 Remove remaining dependence on CVS Id keyword.
1624 * ChangeLog: For the sake of people still using CVS, don't use dollars
1625 when mentioning Id.
1626 * data/xslt/bison.xsl: Remove Id from header comments, where it was
1627 unusual anyway.
1628 * data/xslt/xml2dot.xsl: Likewise.
1629 * data/xslt/xml2text.xsl: Likewise.
1630 * data/xslt/xml2xhtml.xsl: Likewise.
1631 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
1632 * doc/Makefile.am (neutralize): Remove, no longer needed.
1633 (.x.1): Don't use neutralize.
1634 (edit): Don't substitute for ID.
1635 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
1636
1637 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1638
1639 Fix dependence on computed configure variables.
1640 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
1641 $(top_srcdir)/configure.ac so that changes to computed variables, such
1642 as PACKAGE_VERSION, are seen.
1643 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
1644
1645 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
1646
1647 Update copyright dates for recent changes.
1648 * Makefile.am: Here.
1649 * src/Makefile.am: Here.
1650 * src/reduce.c: Here.
1651 * tests/reduce.at: Here.
1652
1653 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
1654
1655 Use git-version-gen for version names between releases.
1656 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
1657 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
1658 * .prev-version: New.
1659 * .version.in: Remove.
1660 * ChangeLog: Remove the Id previously used for capturing the CVS
1661 revision.
1662 * GNUmakefile: Remove, now copied from Gnulib.
1663 * Makefile.am: Add code suggested by comments in
1664 build-aux/git-version-gen.
1665 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
1666 .prev-version, and .version.
1667 * NEWS (2.3b+): Rename to...
1668 (?.?): ... this because we're dropping the "+" version naming scheme,
1669 but, in general, we still can't be sure of our next release name.
1670 * bootstrap: Add a quick hack to remove from .gitignore the
1671 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
1672 entry. This should really be fixed in gnulib instead.
1673 * bootstrap.conf (gnulib_modules): Add gnumakefile.
1674 * configure.ac (AC_INIT): Set version name by invoking
1675 build-aux/git-version-gen.
1676 (AC_CONFIG_FILES): Remove .version, now generated by
1677 build-aux/git-version-gen.
1678 * maint.mk: New, copied from coreutils.
1679 * doc/.cvsignore (bison.1): Add.
1680 * doc/.gitignore (/bison.1): Add.
1681 * doc/bison.1: Remove, generated.
1682 * src/.cvsignore (revision.c): Remove.
1683 * src/.gitignore (/revision.c): Remove.
1684 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
1685 (BUILT_SOURCES): Remove revision.c.
1686 (revision.c): Remove.
1687 * src/getargs.c (version): Don't print revision after the VERSION.
1688 * src/revision.h: Remove.
1689
1690 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1691
1692 Fix untranslatable composition of sentences. Reported by Goran
1693 Uddeborg at
1694 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
1695 * THANKS (Goran Uddeborg): Add.
1696 * src/reduce.c (reduce_print): Report the number of nonterminals and
1697 rules useless in the grammar in separate sentences.
1698 * tests/reduce.at (Useless Rules): Update output.
1699 (Reduced Automaton): Likewise.
1700 (Underivable Rules): Likewise.
1701 (Empty Language): Likewise.
1702
1703 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1704
1705 Fix some .gitignore and .cvsignore problems.
1706 * bootstrap (insert_sorted_if_absent): Replace all uses with...
1707 (insert_vc_ignore): ... this new function, which prepends `/' to all
1708 .gitignore entries before passing them to insert_sorted_if_absent.
1709 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
1710 .cvsignore files are maintained even though Bison developers run
1711 bootstrap while using Git.
1712 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
1713 unneeded by Bison.
1714 (gnulib): Add.
1715 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
1716 unneeded. Reported by Eric Blake.
1717 * lib/.gitignore (/*~): Add.
1718 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
1719 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
1720 Blake.
1721 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
1722
1723 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1724
1725 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
1726 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
1727 * bootstrap.conf (gnulib_modules): Add unsetenv.
1728 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
1729 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
1730 (/setenv.m4): Add.
1731 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
1732 the first argument because it may become position-dependent, and unset
1733 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
1734 Add comments explaining these issues in more detail.
1735
1736 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
1737
1738 Add .gitignore everywhere based on .cvsignore.
1739 * .gitignore: New.
1740 * build-aux/.gitignore: New.
1741 * data/.gitignore: New.
1742 * doc/.gitignore: New.
1743 * etc/.gitignore: New.
1744 * examples/.gitignore: New.
1745 * examples/calc++/.gitignore: New.
1746 * lib/.gitignore: New.
1747 * m4/.gitignore: New.
1748 * po/.gitignore: New.
1749 * runtime-po/.gitignore: New.
1750 * src/.gitignore: New.
1751 * tests/.gitignore: New.
1752
1753 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1754
1755 * NEWS (2.3b+): New section, empty for now.
1756 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
1757
1758 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1759
1760 * NEWS (2.3b): Update release date since there has been a delay in
1761 getting the announcements and tarballs out.
1762
1763 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1764
1765 * NEWS: Version 2.3b.
1766 * configure.ac (AC_INIT): Likewise.
1767 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
1768
1769 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1770
1771 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
1772 been doing it for years.
1773 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
1774 (Release Procedure): Add FIXME about make alpha being unmaintained.
1775
1776 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
1777
1778 * data/yacc.c: Reformat m4 a little for readability.
1779 * src/lalr.c (build_relations): Correct comment.
1780
1781 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1782
1783 DJGPP specific issue.
1784 * djgpp/config.sed: Fixes required to run configure scripts generated
1785 by autoconf 2.62.
1786
1787 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1788
1789 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
1790 coordinator@translationproject.org.
1791
1792 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1793
1794 * THANKS: Add Eric Blake.
1795
1796 2008-04-23 Eric Blake <ebb9@byu.net>
1797
1798 Revert prior patch, by working around autoconf regression.
1799 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
1800 ("Output file name: ("): Uncomment test.
1801 ("Output file name: )"): Likewise.
1802 Based on an idea from Noah Misch.
1803
1804 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1805
1806 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
1807 2.61. Reported by Juan Manuel Guerrero at
1808 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
1809 * tests/output.at ("Output file name: ("): Comment out test case for
1810 now.
1811 ("Output file name: )"): Likewise.
1812
1813 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1814
1815 * GNUmakefile: Update git-version-gen invocation so make dist
1816 succeeds.
1817
1818 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1819
1820 Update to the current gnulib CVS repository, and fix trigraph handling
1821 in Bison.
1822 * bootstrap: Update gnulib CVS repository URL.
1823 (symlink_to_dir): Encapsulate the code that guarantees the destination
1824 directory exists into...
1825 (check_dst_dir): ... this new function, and...
1826 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
1827 fail when copying files into lib/uniwidth/.
1828 * src/output.c (prepare_symbols): When writing yytname muscles, where
1829 symbol names will be encoded in C-string literals, tell quotearg to
1830 escape trigraphs. This used to be the default in gnulib.
1831 * tests/regression.at (Token definitions): Because of the change in
1832 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
1833 escapes trigraphs in symbol names. Thus, yytname no longer has
1834 trigraphs unnecessarily doubly escaped. Update test case output.
1835 Extend test case to be sure Bison's own error messages will no longer
1836 have trigraphs in symbol names unnecessarily escaped once.
1837
1838 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1839
1840 Fix make dist infinite loop reported by Juan Manuel Guerrero at
1841 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
1842 * .cvsignore: Add .version.
1843 * .version.in: New.
1844 * bootstrap.conf (gnulib_modules): Add git-version-gen.
1845 * configure.ac (AC_CONFIG_FILES): Add .version.
1846 * build-aux/.cvsignore: Add git-version-gen.
1847
1848 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
1849
1850 * NEWS (2.3a+): Mention that -g now takes an argument.
1851 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
1852 consistency. Update the -g and -x entries now that they take
1853 arguments. Use brackets to indicate optional arguments.
1854 * src/getargs.c (usage): Explain the relationship between arguments of
1855 long and short options more completely. Document --defines and -d
1856 separately since the former takes an argument but, for POSIX Yacc, the
1857 latter does not.
1858 (short_options): Let -W take an optional argument like --warnings.
1859 (getargs): Sort cases.
1860
1861 2008-02-28 Akim Demaille <demaille@gostai.com>
1862
1863 * doc/bison.texinfo: Fix a few typos.
1864
1865 2008-02-28 Akim Demaille <akim@epita.fr>
1866
1867 * doc/bison.texinfo (Bison Options): Document -W.
1868 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
1869
1870 2008-02-28 Akim Demaille <akim@epita.fr>
1871
1872 * src/getargs.c (short_options): Split and sort for readability.
1873 -g and -x take optional arguments, just like their long options.
1874 * build-aux/cross-options.pl: Use /x to make the regexp easier to
1875 understand.
1876 Fix the handling of $opt which resulted in all the argument to be
1877 considered as optional.
1878
1879 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1880
1881 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
1882 say its interface is experimental.
1883 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1884 Java.
1885 (Bison Options): In the -L and --language entry, mention Java.
1886 (Java Bison Interface): Say the interface is experimental.
1887 * src/getargs.c (usage): Mention -L and --language.
1888
1889 * NEWS (2.3a+): Say the push parsing interface is experimental.
1890 * doc/bison.texinfo (Push Decl): Likewise.
1891 (Decl Summary): Likewise in the "%define api.push_pull" entry.
1892 (Push Parser Function): Likewise.
1893 (Pull Parser Function): Likewise.
1894 (Parser Create Function): Likewise.
1895 (Parser Delete Function): Likewise.
1896 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
1897 yypull_parse, and yypush_parse entries.
1898
1899 * NEWS (2.3a+): Mention XML support, and say the schema is
1900 experimental.
1901 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
1902 * src/getargs.c (usage): Say the XML schema is experimental.
1903
1904 * NEWS (2.3a+): Say option instead of flag.
1905
1906 2008-02-21 Wojciech Polak <polak@gnu.org>
1907
1908 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
1909 text.
1910
1911 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
1912
1913 Fix impure push parser compile error reported by Bob Rossi at
1914 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
1915 * data/yacc.c: Clean up whitespace in the output a little.
1916 (yypstate_allocated): Define for impure push parsers regardless of
1917 whether the pull interface is also requested.
1918 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
1919 check impure push parsers without the pull interface.
1920
1921 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
1922 yyerror takes arguments specified by %parse-param while yypstate_new
1923 does not.
1924 * doc/bison.texinfo (Parser Create Function): Document that
1925 yypstate_new returns 0 for multiple impure parser instances.
1926 * tests/push.at (Push Parsing: Multiple impure instances): Update
1927 expected stderr output.
1928
1929 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1930
1931 * runtime-po/POTFILES.in (push.c): Remove.
1932
1933 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1934
1935 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
1936 * data/push.c: Rename to...
1937 * data/yacc.c: ... this, overwriting it.
1938 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
1939 `%push-pull-parser' -> `%define api.push_pull "both"'.
1940 Remove old yacc.c tests, and update push.c tests to yacc.c.
1941
1942 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1943
1944 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
1945 `"%code top" blocks' instead of `%code "top" blocks'.
1946 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
1947 Clean up whitespace in the output a little.
1948
1949 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1950
1951 Fix documentation problems reported by Tim Josling at
1952 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
1953 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
1954 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
1955 integers. Explain the effect of literal string aliases on error
1956 messages. Copy token 0 documentation from the C++ skeleton
1957 documentation.
1958
1959 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1960
1961 Accept a token number in a %left, %right, or %nonassoc for POSIX
1962 conformance. Reported by Tim Josling at
1963 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
1964 * NEWS (2.3a+): Mention.
1965 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
1966 and code numbers are treated by precedence declarations.
1967 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
1968 of symbols.1.
1969 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
1970 of symbol.
1971 (symbol.prec): New, just like symbol but allows INT.
1972 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
1973 longer holds.
1974 * tests/regression.at (Token number in precedence declaration): New
1975 test case.
1976
1977 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1978
1979 DJGPP specific issues.
1980 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
1981 be changed. Copyright timestamp adjusted.
1982 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
1983 be changed. Copyright timestamp adjusted.
1984 * djgpp/config.site: Copyright timestamp adjusted.
1985 * djgpp/config_h.sed: Copyright timestamp adjusted.
1986 * djgpp/djunpack.bat: Copyright timestamp adjusted.
1987 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
1988 filename translation list.
1989 * djgpp/subpipe.c (init_subpipe): Check the environment variables
1990 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
1991 files shall be created. Before trying to use the temp dir where the
1992 environment variable points to check that the dir really exists. If
1993 not default to the cwd as temp dir. Copyright timestamp adjusted.
1994 * djgpp/subpipe.h: Copyright timestamp adjusted.
1995 * djgpp/testsuite.sed: Copyright timestamp adjusted.
1996
1997 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
1998
1999 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
2000
2001 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
2002
2003 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
2004 Problem reported by Claudio Saavedra in
2005 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
2006
2007 2008-01-05 Wojciech Polak <polak@gnu.org>
2008
2009 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
2010 document's title with the input grammar file name.
2011
2012 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
2013
2014 Automate regression testing of the XML/XSLT implementation. Discussed
2015 starting at
2016 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
2017 * configure.ac (XSLTPROC): New substitution.
2018 * Makefile.am (maintainer-xml-check): New phony target invoking...
2019 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
2020 invoking make maintainer-check with BISON_TEST_XML=1.
2021 * tests/atlocal.in (XSLTPROC): New.
2022 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
2023 not to report reachable memory when Bison is expected to have a
2024 non-zero exit status and (2) to compare XML/XSLT output with --graph
2025 and --report=all output for every working grammar when
2026 BISON_TEST_XML=1.
2027 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
2028 (AT_BISON_CHECK_XML): New.
2029 (AT_QUELL_VALGRIND): New.
2030 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
2031 (AT_CHECK): ... don't redefine this since this was the old way to
2032 quell Valgrind.
2033 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
2034 AT_BISON_CHECK invocations.
2035 * tests/c++.at: Likewise.
2036 * tests/calc.at: Likewise.
2037 * tests/conflicts.at: Likewise.
2038 * tests/cxx-type.at: Likewise.
2039 * tests/existing.at: Likewise.
2040 * tests/glr-regression.at: Likewise.
2041 * tests/headers.at: Likewise.
2042 * tests/input.at: Likewise.
2043 * tests/java.at: Likewise.
2044 * tests/output.at: Likewise.
2045 * tests/push.at: Likewise.
2046 * tests/reduce.at: Likewise.
2047 * tests/regression.at: Likewise.
2048 * tests/sets.at: Likewise.
2049 * tests/skeletons.at: Likewise.
2050 * tests/synclines.at: Likewise.
2051 * tests/torture.at: Likewise.
2052 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
2053 tends to hang xsltproc.
2054 (Big horizontal): Likewise.
2055
2056 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2057
2058 In XML output, remove redundant class attribute on symbol element.
2059 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
2060 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
2061 look up a symbol to determine whether it's a nonterminal or terminal.
2062 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
2063 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
2064
2065 Add prec/assoc information to XML output.
2066 * src/gram.c (grammar_rules_print_xml): For each rule that has a
2067 %prec, add a percent_prec attribute.
2068 * src/print-xml.c (print_grammar): For each terminal that has a
2069 precedence or associativity, add a prec or assoc attribute.
2070 (xml_indent): New.
2071 (xml_puts): Use xml_indent.
2072 (xml_printf): Use xml_indent.
2073 * src/print-xml.h (xml_indent): Prototype.
2074
2075 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
2076 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
2077
2078 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2079
2080 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
2081 (bison:ruleByNumber): ... this for clarity.
2082 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
2083 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
2084 (xsl:template match="reduction"): Update.
2085 (xsl:template match="item"): Update.
2086 (xsl:template match="reduction"): Update.
2087
2088 In the XML output, don't print the list of rules where symbols appear.
2089 Compute it in XSLT instead. Discussed at
2090 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
2091 * data/xslt/bison.xsl (bison:ruleByLhs): New.
2092 (bison:ruleByRhs): New.
2093 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
2094 bison:ruleByRhs.
2095 (xsl:template match="terminal/rule"): Remove.
2096 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2097 bison:ruleByRhs.
2098 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2099 Remove.
2100 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
2101 bison:ruleByRhs and mode="number-link" for rule template.
2102 (xsl:template match="terminal/rule"): Remove.
2103 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2104 bison:ruleByRhs and mode="number-link" for rule template.
2105 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2106 Rewrite as...
2107 (xsl:template match="rule" mode="number-link"): ... this.
2108 * src/print-xml.c (print_grammar): Don't print the list of rules.
2109
2110 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2111
2112 Don't let --report affect XML output; always print all information.
2113 Discussed at
2114 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
2115 * src/conflicts.c (log_resolution): Implement.
2116 * src/print-xml.c (print_core): Implement.
2117 (print_state): Implement.
2118 (print_xml): Implement.
2119
2120 * NEWS (2.3a+): Fix quotes.
2121 * src/parse-gram.y (prologue_declaration): For consistency with -v,
2122 don't let %verbose clear the list specified by --report.
2123
2124 2007-11-26 Akim Demaille <akim@epita.fr>
2125
2126 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
2127
2128 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
2129
2130 In the XML output, list useless and unused symbols and rules with the
2131 useful ones and add a "usefulness" attribute. Discussed starting at
2132 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
2133 * src/gram.c (grammar_rules_partial_print_xml): Remove.
2134 (grammar_rules_print_xml): Print all rules instead of just those
2135 useful in the grammar, and add a "usefulness" attribute.
2136 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
2137 * src/print-xml.c (print_rules_useless_in_parser): Remove.
2138 (print_grammar): Print all nonterminals instead of just useful ones,
2139 and add a "usefulness" attribute to nonterminals and terminals.
2140 (print_xml): Don't print a separate "reductions" or
2141 "rules-useless-in-parser" element.
2142 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
2143 (reduce_xml): Remove.
2144 (reduce_token_unused_in_grammar): New.
2145 (reduce_nonterminal_useless_in_grammar): New.
2146 * src/reduce.h (reduce_xml): Remove prototype.
2147 (reduce_token_unused_in_grammar): Add prototype.
2148 (reduce_nonterminal_useless_in_grammar): Add prototype.
2149 * data/xslt/xml2text.xsl: Update for XML changes.
2150 * data/xslt/xml2xhtml.xsl: Update for XML changes.
2151 * tests/reduce.at (Useless Terminals): Update output.
2152 (Useless Rules): Update output.
2153 (Reduced Automaton): Update output.
2154
2155 Say "Terminals unused in grammar" instead of "Unused terminals".
2156 * NEWS (2.3a+): Update.
2157 * doc/bison.texinfo (Understanding): Update example output.
2158 * src/reduce.c (reduce_output): Implement.
2159 * data/xslt/xml2text.xsl: Implement.
2160 * data/xslt/xml2xhtml.xsl: Implement.
2161
2162 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2163
2164 Accept --report-file=FILE to override the default `.output' filename.
2165 * NEWS (2.3a+): Mention.
2166 * doc/bison.texinfo (Bison Options): Add an entry.
2167 * src/files.c (compute_output_file_names): Don't override
2168 spec_verbose_file if already set.
2169 * src/getargs.c (usage): Document --report-file.
2170 (REPORT_FILE_OPTION): New anonymous enum member.
2171 (long_options): Add entry for it.
2172 (getargs): Add case for it setting spec_verbose_file.
2173
2174 * build-aux/cross-options.pl: Don't record a short option just because
2175 there's an arg.
2176 * doc/.cvsignore: Add yacc.1.
2177
2178 2007-11-14 Akim Demaille <akim@epita.fr>
2179
2180 * doc/yacc.1.in: New.
2181 * configure.ac, doc/Makefile.am: Adjust.
2182 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
2183 config.h symbol.
2184 Use AC_SUBST for assignments too.
2185 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
2186
2187 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2188
2189 * src/gram.c: Remove comments that duplicate comments in gram.h.
2190
2191 When reporting useless rules and nonterminals, say "useless in grammar"
2192 instead of "useless", and say "useless in parser" instead of "never
2193 reduced". Discussed starting at
2194 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
2195 * NEWS (2.3a+): Mention this change.
2196 * data/xslt/xml2text.xsl: Update output text and expected input XML
2197 element names to match changes below.
2198 * data/xslt/xml2xhtml.xsl: Likewise.
2199 (xsl:template match="bison-xml-report"): Add missing entry in Table of
2200 Contents: "Rules useless in parser due to conflicts".
2201 * doc/bison.texinfo (Decl Summary): Reword a little.
2202 (Understanding): Update example output for changes below.
2203 * src/gram.c: (rule_useful_p): Rename to...
2204 (rule_useful_in_grammar_p): ... this.
2205 (rule_useless_p): Rename to...
2206 (rule_useless_in_grammar_p): ... this.
2207 (rule_never_reduced_p): Rename to...
2208 (rule_useless_in_parser_p): ... this.
2209 (grammar_rules_print): Update for renames.
2210 (grammar_rules_print_xml): Update for renames.
2211 (grammar_rules_never_reduced_report): Rename to...
2212 (grammar_rules_useless_report): ... this since it is used for either
2213 kind of useless rule.
2214 * src/gram.h: Reword comments and update function names in prototypes.
2215 * src/main.c (main): Say "rule useless in parser due to conflicts".
2216 * src/print-xml.c (print_rules_never_reduced): Rename to...
2217 (print_rules_useless_in_parser): ... this, and rename output XML
2218 element "rules-never-reduced" to "rules-useless-in-parser".
2219 (print_xml): Update for rename.
2220 * src/print.c (print_results): Say "Rules useless in parser due to
2221 conflicts".
2222 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
2223 (nonterminals_reduce): Say "nonterminal useless in grammar".
2224 (reduce_output): Say "Nonterminals useless in grammar".
2225 Say "Rules useless in grammar".
2226 (reduce_xml): Rename output XML element "useless" to
2227 "useless-in-grammar".
2228 (reduce_print): Don't report the count of grammatically useless rules
2229 as "rules never reduced" just because %yacc is specified.
2230 In the correct report of this count, say nonterminal(s) and rule(s)
2231 "useless in grammar".
2232 * tests/conflicts.at (S/R in initial): Update expected output.
2233 (Defaulted Conflicted Reduction): Likewise.
2234 (Unreachable States After Conflict Resolution): Likewise.
2235 * tests/existing.at (GNU pic Grammar): Likewise.
2236 * tests/reduce.at (Useless Nonterminals): Likewise.
2237 (Useless Rules): Likewise.
2238 (Reduced Automaton): Likewise.
2239 (Underivable Rules): Likewise.
2240 (Empty Language): Likewise.
2241
2242 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2243
2244 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
2245 here document and before the EOF so that BSD's implementation of Bourne
2246 shell doesn't parse the delimiter as part of the here document.
2247 * doc/.cvsignore: Add cross-options.texi.
2248 * src/getargs.c (usage): Add a blank line after the warning categories.
2249
2250 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
2251
2252 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
2253
2254 2007-11-05 Akim Demaille <akim@epita.fr>
2255
2256 Remove Id: from bison.1.
2257 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
2258 (perl -0777 -pi -e 's/\.PP\nId): New.
2259 (.x.1): Use it to ignore the version control revision.
2260
2261 2007-11-05 Akim Demaille <demaille@gostai.com>
2262
2263 * build-aux/Makefile.am: Ship cross-options.pl.
2264 * doc/Makefile.am: Always refer to cross-options.texi with
2265 $(srcdir).
2266 (MAINTAINERCLEANFILES): Add it.
2267
2268 2007-11-04 Akim Demaille <demaille@gostai.com>
2269
2270 Generate the long/short option cross-table.
2271 * build-aux/cross-options.pl: New.
2272 * doc/Makefile.am (cross-options.texi): New.
2273 * doc/bison.texinfo: Use it.
2274
2275 2007-11-04 Akim Demaille <demaille@gostai.com>
2276
2277 Generate bison.1 using help2man.
2278 * doc/common.x, doc/bison.x: New.
2279 * doc/Makefile.am (bison.1, .x.1): New.
2280 The code is taken from autoconf-2.61/man/Makefile.am.
2281 * configure.ac: Look for help2man.
2282
2283 2007-11-04 Akim Demaille <demaille@gostai.com>
2284
2285 Complete --help.
2286 * src/getargs.c (usage): Document -W, make it clear that -d,
2287 -g and -x have optional arguments.
2288
2289 2007-11-04 Akim Demaille <demaille@gostai.com>
2290
2291 Find sha1sum when named gsha1sum.
2292 * bootstrap (find_tool): New.
2293 ($SHA1SUM): New.
2294
2295 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2296
2297 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
2298 at
2299 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
2300 * NEWS (2.3a+): Mention.
2301 * data/bison.m4 (b4_pure_if): Don't define it here.
2302 * data/c.m4 (b4_identification): Depend on individual skeletons to
2303 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
2304 values of the %define variables api.pure or api.push_pull. Define
2305 YYPURE, YYPUSH, and YYPULL accordingly.
2306 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
2307 glr.cc has already defined b4_pure_flag.
2308 * data/push.c: Define b4_pure_if based on `%define api.pure'.
2309 Remove YYPUSH and YYPULL since they're back in b4_identification again.
2310 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
2311 * doc/bison.texinfo (Pure Decl): Update.
2312 (Push Decl): Update.
2313 (Decl Summary): Add api.pure to %define entry.
2314 In %pure-parser entry, say it's deprecated and reference %define.
2315 (Pure Calling): Update.
2316 (Error Reporting): Update.
2317 (C++ Scanner Interface): Update.
2318 (How Can I Reset the Parser): Update.
2319 (Table of Symbols): In %pure-parser entry, say it's deprecated and
2320 reference %define.
2321 * src/getargs.c (pure_parser): Remove global variable.
2322 * src/getargs.h (pure_parser): Remove extern.
2323 * src/output.c (prepare): Don't define pure_flag muscle.
2324 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
2325 wrapper around `%define api.pure'.
2326 * tests/calc.at (Simple LALR Calculator): Update.
2327 (Simple GLR Calculator): Update.
2328 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
2329 Update.
2330 (GLR: Resolve ambiguity, pure, locations): Update.
2331 (GLR: Merge conflicting parses, pure, no locations): Update.
2332 (GLR: Merge conflicting parses, pure, locations): Update.
2333 * tests/glr-regression.at (Uninitialized location when reporting
2334 ambiguity): Update
2335 * tests/input.at (Unused %define api.pure): New test case.
2336 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
2337 AT_PURE_IF and AT_PURE_AND_LOC_IF.
2338 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2339
2340 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2341
2342 %define push_pull -> %define api.push_pull. Discussed starting at
2343 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
2344 * data/push.c: Expect the new name.
2345 * data/yacc.c: Likewise.
2346 * doc/bison.texinfo (Push Decl): Update.
2347 (Decl Summary): Update %define entry.
2348 (Push Parser Function): Update.
2349 (Pull Parser Function): Update.
2350 (Parser Create Function): Update.
2351 (Parser Delete Function): Update.
2352 * tests/calc.at (Simple LALR Calculator): Update.
2353 * tests/input.at (%define enum variables): Update.
2354 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2355 (Push Parsing: Multiple impure instances): Update.
2356 (Push Parsing: Unsupported Skeletons): Update.
2357 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
2358 (Exploding the Stack Size with Malloc): Update.
2359
2360 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
2361 other entries some.
2362
2363 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
2364
2365 For the XML output's terminal element, rename @number to @token-number,
2366 and add @symbol-number. In the nonterminal element, rename @number to
2367 @symbol-number. Discussed starting at
2368 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
2369 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
2370 renames.
2371 (xsl:template match="nonterminal"): Likewise.
2372 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
2373 (xsl:template match="nonterminal"): Likewise.
2374 * src/print-xml.c (print_grammar): Implement.
2375
2376 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2377
2378 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
2379 2007-10-11 change, the child elements here are items not rules.
2380 (xsl:template match="item"): New.
2381 (xsl:template match="rule"): Update for new reduced itemset.
2382 (xsl:template match="point"): Remove.
2383 (xsl:template match="empty"): For consistency with --graph, don't
2384 output "/* empty */".
2385 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
2386 line-wrap, don't pass a negative value as first-line-length since this
2387 won't work with the following changes.
2388 (xsl:template name="line-wrap"): Simplify slightly.
2389 (xsl:template name="ws-search"): Eliminate recursion.
2390 * src/print_graph.c (print_core): Don't print a reduction's lookahead
2391 set next to an item whose dot is not at the end of the RHS even if it
2392 happens to be associated with the same rule.
2393
2394 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2395
2396 Add %define lr.keep_unreachable_states.
2397 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
2398 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
2399 * src/main.c (main): Implement it.
2400 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2401 Extend to test it, and fix a typo.
2402
2403 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2404
2405 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
2406 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
2407 the example .output text.
2408 * tests/regression.at (Extra lookahead sets in report): Improve wording
2409 of comments.
2410
2411 2007-10-17 Wojciech Polak <polak@gnu.org>
2412
2413 * src/print-xml.c (print_grammar): Renamed
2414 <terminal> and <nonterminal> attributes:
2415 "type" to "number" and "symbol" to "name".
2416 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
2417 Use new attribute names.
2418 (xsl:template match="nonterminal"): Likewise.
2419 * data/xslt/xml2xhtml.xsl: Likewise.
2420
2421 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
2422
2423 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
2424 (Option Cross Key): Likewise.
2425
2426 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
2427 next to an item whose dot is not at the end of the RHS even if it
2428 happens to be associated with the same rule.
2429 * src/print.c (print_core): Likewise.
2430 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
2431 (Resolved SR Conflicts): Update output.
2432 * tests/regression.at (Extra lookahead sets in report): New test case.
2433
2434 2007-10-11 Wojciech Polak <polak@gnu.org>
2435
2436 * src/print-xml.c (print_core): Remove item set
2437 redundancy.
2438 * data/xslt/bison.xsl (bison:ruleNumber): New key.
2439 Improve processing time. Suggested by Joel E. Denny.
2440 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
2441 Write xsl:param "required" attribute as comment.
2442 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
2443 (xsl:template match="rule"): Support new reduced itemset.
2444 (xsl:template match="point"): Remove.
2445 * data/xslt/xml2xhtml.xsl: Likewise.
2446
2447 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2448
2449 * src/getargs.c (version): Update copyright year.
2450
2451 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2452
2453 Make xml2dot.xsl and --graph produce the same output.
2454 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
2455 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
2456 escaped later.
2457 (xsl:template name="output-node"): Use the new escape template instead
2458 of the string-replace template directly.
2459 (xsl:template name="output-edge"): Likewise.
2460 (xsl:template name="escape"): New, escapes backslashes and newlines in
2461 addition to quotation marks.
2462 * src/graphviz.c (start_graph, output_node, output_edge): Add
2463 whitespace to output for legibility.
2464
2465 Make xml2text.xsl and --report produce the same output, and remove the
2466 XML "conflicts" element since a conflict summary is easily extracted
2467 from the automaton.
2468 * data/xslt/bison.xsl: New.
2469 (xsl:template match="state" mode="bison:count-conflicts): New.
2470 * data/xslt/xml2text.xsl: Import bison.xsl.
2471 (xsl:template match="bison-xml-report"): Instead of styling the
2472 "conflicts" element, style the "automaton" element with mode
2473 "conflicts". Unlike the former, the latter lists S/R and R/R
2474 conflicts for a state on the same line.
2475 (xsl:template match="conflicts"): Remove.
2476 (xsl:template match="conflict"): Remove.
2477 (xsl:template match="terminal"): Line-wrap the list of rules in which
2478 the terminal is used.
2479 (xsl:template match="nonterminal"): Likewise for nonterminals.
2480 (xsl:template match="automaton" mode="conflicts"): New.
2481 (xsl:template match="state" mode="conflicts"): New.
2482 (xsl:template name="line-wrap"): New.
2483 (xsl:template name="ws-search"): New.
2484 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
2485 (xsl:template match="bison-xml-report"): Instead of styling the
2486 "conflicts" element, style the "automaton" element with mode
2487 "conflicts."
2488 (xsl:template match="conflicts"): Remove.
2489 (xsl:template match="conflict"): Remove.
2490 (xsl:template match="automaton" mode="conflicts"): New.
2491 (xsl:template match="state" mode="conflicts): New.
2492 * src/conflicts.c (conflicts_output_xml): Remove.
2493 * src/conflicts.h (conflicts_output_xml): Remove prototype.
2494 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
2495 * src/print.c (print_grammar): Consistently wrap at the 66th column so
2496 the corresponding XSLT is easier. Also, never wrap between a word and
2497 the comma that follows it.
2498
2499 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2500
2501 Improve C++ namespace support. Discussed starting at
2502 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
2503 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
2504 b4_namespace_close): New macros that interpret the %define variable
2505 "namespace" so its value can contain "::" to indicate nested
2506 namespaces.
2507 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
2508 the above macros.
2509 * data/lalr1.cc (b4_namespace): Likewise.
2510 * data/location.cc (b4_namespace): Likewise.
2511 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
2512 inside a new table in the general %define entry. Document `%define
2513 namespace' there as well. Point the %name-prefix entry to it since it
2514 explains it more completely in the case of C++.
2515 (C++ Bison Interface): Mention `%define namespace' instead of
2516 %name-prefix.
2517 (Table of Symbols): Remove the `%define push_pull' entry. The %define
2518 entry suffices.
2519 * tests/c++.at (Relative namespace references): New test case.
2520 (Absolute namespace references): New test case.
2521 (Syntactically invalid namespace references): New test case.
2522 * tests/input.at (C++ namespace reference errors): New test case.
2523
2524 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2525
2526 Add syncline support and location accessor to internal %define
2527 interfaces.
2528 * data/bison.m4 (b4_percent_define_get_loc): New.
2529 (b4_percent_define_get_syncline): New.
2530 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
2531 (b4_percent_define_default): Record defining location as line 1 rather
2532 than 0 for the sake of synchronizing #line's, and define
2533 b4_percent_define_syncline(VARIABLE).
2534 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
2535 * src/muscle_tab.c (muscle_syncline_grow): New.
2536 (muscle_code_grow): Use muscle_syncline_grow.
2537 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
2538 define b4_percent_define_syncline(VARIABLE).
2539 (muscle_percent_define_get_loc): New.
2540 (muscle_percent_define_get_syncline): New.
2541 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
2542 remove some unused variables.
2543 (muscle_percent_define_default): Record defining location as line 1
2544 rather than 0 for the sake of synchronizing #line's, and define
2545 b4_percent_define_syncline(VARIABLE).
2546 (muscle_percent_define_check_values): Use
2547 muscle_percent_define_get_loc.
2548 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
2549 (muscle_percent_define_get_syncline): Prototype.
2550 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2551 defaults): Update output for location change.
2552 (Complaining during macro argument expansion): Extend to test
2553 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
2554
2555 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
2556
2557 Fix some error-reporting macro bugs.
2558 * data/bison.m4 (b4_cat): New.
2559 (b4_error, b4_error_at): Use b4_cat to send error directives directly
2560 to stdout so they don't become arguments to other macros. Update
2561 comments and add examples.
2562 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
2563 add examples.
2564 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
2565 after printing the error directive so that M4 doesn't report subsequent
2566 problems that are induced by this problem.
2567 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
2568 instead of just in them. Recognize @\n in both places. Both expand to
2569 the empty string. Needed by b4_cat.
2570 * tests/skeletons.at (Complaining during macro argument expansion):
2571 New test case.
2572 (Fatal errors make M4 exit immediately): New test case.
2573
2574 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
2575
2576 Implement --print-datadir.
2577 * src/getargs.c (usage): Mention.
2578 (PRINT_DATADIR_OPTION): New anonymous enum member.
2579 (long_options): Add entry for it.
2580 (getargs): Add case for it calling compute_pkgdatadir.
2581 * src/output.c (output_skeleton): Encapsulate data directory
2582 computation from here...
2583 (prepare): ... and from here...
2584 (compute_pkgdatadir): ... into this new function.
2585 * src/output.h (compute_pkgdatadir): Prototype.
2586
2587 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
2588
2589 * src/print-xml.c (escape_bufs): New static global variable
2590 replacing...
2591 (xml_escape_n): ... the static local variable buf here.
2592 (print_xml): Free memory for escape_bufs.
2593 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
2594
2595 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
2596
2597 Replace `%push-parser' and `%push-pull-parser' with
2598 `%define push_pull "push"' and `%define push_pull "both"'.
2599 `%define push_pull "pull"' is the default.
2600 * doc/bison.texinfo (Push Decl, Push Parser Function,
2601 Pull Parser Function, Parser Create Function, Parser Delete Function):
2602 Update declarations.
2603 (Decl Summary, Table of Symbols): Replace %push-parser and
2604 %push-pull-parser entries with a %define push_pull entry.
2605 * data/bison.m4 (b4_percent_define_check_values): New macro.
2606 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
2607 definitions...
2608 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
2609 definitions...
2610 * data/push.c: ... to here and compute them from the value of the
2611 %define variable push_pull.
2612 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
2613 parsing requests here...
2614 * data/yacc.c: ... hack this to switch to push.c any time
2615 b4_use_push_pull_flag or the %define variable push_pull is set. This
2616 will go away when we mv push.c yacc.c.
2617 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
2618 push parsing is not supported since unused %define variables are
2619 reported anyway.
2620 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
2621 * src/muscle_tab.h (muscle_percent_define_check_values): Update
2622 comments for consistency with b4_percent_define_check_values.
2623 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
2624 muscles.
2625 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
2626 Remove.
2627 (prologue_declaration): Remove %push-parser and %push-pull-parser
2628 rules.
2629 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
2630 * tests/calc.at: Update declarations.
2631 * tests/input.at (%define enum variables): New test case.
2632 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
2633 declaration.
2634 (Push Parsing: Multiple impure instances): Update declaration.
2635 (Push Parsing: Unsupported Skeletons): New test case.
2636 * tests/torture.at (Exploding the Stack Size with Alloca): Update
2637 declaration.
2638 (Exploding the Stack Size with Malloc): Update declaration.
2639
2640 2007-09-24 Wojciech Polak <polak@gnu.org>
2641
2642 Add XSLT transformations.
2643
2644 * data/xslt/xml2dot.xsl: Transform XML into DOT.
2645 * data/xslt/xml2text.xsl: Transform XML into plain text.
2646 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
2647 * data/Makefile.am (xsltdir): New variable.
2648 (dist_xslt_DATA): Add xslt/*.xsl files.
2649
2650 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
2651
2652 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
2653 Problem reported by Wojciech Polak.
2654 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
2655 (xml_printf): Undo change I made on 21 September; that is,
2656 indent 2 spaces, not 1.
2657
2658 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
2659
2660 Pacify ./configure --enable-gcc-warnings.
2661 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
2662 `char const *' instead of `char *'.
2663 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
2664 local variable `sep'.
2665
2666 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2667
2668 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
2669 elsewhere.
2670 * src/print-xml.c: Prefer "const" after types; that's more consistent.
2671 (xml_printf): Indent just 1 space for level.
2672 (e_char, xlate_char): Remove.
2673 (xml_escape_string): Rewrite to avoid undefined behavior (used
2674 storage that was freed from the stack).
2675 (xml_escape_n): Don't bother checking for subscript error.
2676
2677 2007-09-21 Wojciech Polak <polak@gnu.org>
2678
2679 Add Bison XML Automaton Report.
2680
2681 Add support for an -x option to generate an XML report.
2682 It is not documented yet.
2683 * src/print-xml.c: New file.
2684 * src/print-xml.h: Likewise.
2685 * lib/timevar.def (TV_XML): New var.
2686 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
2687 * src/conflicts.c: Include print-xml.h.
2688 (solved_conflicts_xml_obstack): New var.
2689 (log_resolution, conflicts_solve, conflicts_free):
2690 Add support for XML report.
2691 (conflicts_output_val): New function.
2692 * src/conflicts.h (conflicts_output_val): New decl.
2693 * src/files.c (spec_xml_file): New var.
2694 (compute_output_file_names, output_file_names_free): Add XML support.
2695 * src/files.h (spec_xml_file): New decl.
2696 * src/getargs.c (xml_flag): New var.
2697 (usage, short_options, long_options, getargs): Add XML support.
2698 * src/getargs.h (xml_flag): New decl.
2699 * src/gram.c: Include print-xml.h.
2700 (rule_lhs_print_xml, rule_rhs_print_xml):
2701 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
2702 New functions.
2703 * src/gram.h: Declare external ones.
2704 * src/main.c: Include print-xml.h.
2705 (main): Add XML support.
2706 * src/reduce.c: Include print-xml.h.
2707 (reduce_xml): New function.
2708 * src/reduce.h: Declare it.
2709 * src/state.c: Include print-xml.h.
2710 (state_new): Add XML support.
2711 (state_rule_lookahead_tokens_print_xml): New function.
2712 * src/state.h: Declare it.
2713 (struct state): New member solved_conflicts_xml.
2714 * src/symtab.c (symbol_class_get_string): New function.
2715 * src/symtab.h: Declare it.
2716
2717 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2718
2719 * GNUmakefile: Switch to coreutils's version.
2720 * bootstrap: Likewise.
2721 * Makefile.cfg: Adjust to new GNUmakefile.
2722 * README-hacking: Likewise.
2723
2724 Import from gnulib:
2725
2726 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
2727 Bruno Haible <bruno@clisp.org>
2728
2729 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
2730 and is a script that invokes bison. Tighten the code. Add comments.
2731
2732 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
2733
2734 Spell "boolean" as "Boolean". Reported by Akim Demaille.
2735 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
2736 * doc/bison.texinfo (Decl Summary): Fix.
2737 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
2738 * tests/input.at (Boolean %define variables): Update output.
2739 * tests/skeletons.at (%define boolean variables: invalid skeleton
2740 defaults): Rename to...
2741 (%define Boolean variables: invalid skeleton defaults): ... this and
2742 update output.
2743
2744 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
2745
2746 In impure push mode, don't allow more than one yypstate to be allocated
2747 since multiple impure parsers would corrupt yynerrs.
2748 * data/push.c (yypstate_allocated): New static global variable
2749 initialized to 0.
2750 (yypull_parse): If yypstate_new returns 0, don't report it as memory
2751 exhaustion if yypstate_allocated is 1, but still return 2.
2752 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
2753 already 1. Otherwise, set it to 1.
2754 (yypstate_delete): Set it to 0.
2755 * tests/push.at (Push Parsing: Multiple impure instances): New test
2756 case.
2757
2758 2007-08-17 Bob Rossi <bob@brasko.net>
2759
2760 * doc/bison.texinfo (Push Decl): Document the push parser.
2761 (Table of Symbols): Ditto.
2762 (Pure Decl): Ditto.
2763 (Decl Summary): Ditto.
2764 (Multiple Parsers, Push Parser Function, Pull Parser Function,
2765 Parser Create Function, Parser Delete Function):
2766 Add new push parser symbols.
2767 (Table of Symbols): Document push-parser, push-pull-parser,
2768 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
2769
2770 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
2771
2772 Update to GPLv3.
2773 * doc/gpl-3.0.texi: New file.
2774 * doc/gpl.texi: Remove.
2775 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
2776 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
2777 * README-hacking, TODO, bootstrap, bootstrap.conf:
2778 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
2779 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
2780 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
2781 * data/lalr1.cc, data/lalr1.java, data/location.cc:
2782 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
2783 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
2784 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
2785 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
2786 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
2787 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
2788 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
2789 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
2790 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
2791 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
2792 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
2793 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
2794 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
2795 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
2796 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
2797 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
2798 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
2799 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
2800 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
2801 * src/complain.c, src/complain.h, src/conflicts.c:
2802 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
2803 * src/files.h, src/flex-scanner.h, src/getargs.c:
2804 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
2805 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
2806 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
2807 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
2808 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
2809 * src/print.c, src/print.h, src/print_graph.c:
2810 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
2811 * src/reduce.h, src/relation.c, src/relation.h:
2812 * src/revision.h, src/scan-code.h, src/scan-code.l:
2813 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
2814 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
2815 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
2816 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
2817 * tests/Makefile.am, tests/actions.at, tests/c++.at:
2818 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
2819 * tests/existing.at, tests/glr-regression.at:
2820 * tests/headers.at, tests/input.at, tests/java.at:
2821 * tests/local.at, tests/output.at, tests/push.at:
2822 * tests/reduce.at, tests/regression.at, tests/sets.at:
2823 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
2824 * tests/torture.at:
2825 Update to GPLv3.
2826
2827 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2828
2829 Get rid of broken %no-parser, -n, and --no-parser implementation and
2830 documentation.
2831 * TODO: Don't mention them.
2832 * doc/bison.1: Likewise.
2833 * doc/bison.texinfo (Decl Summary): Likewise.
2834 (Bison Options): Likewise.
2835 (Option Cross Key): Likewise.
2836 * src/getargs.c (no_parser_flag): Remove global variable.
2837 (usage): Don't print description of -n and --no-parser.
2838 (long_options): Remove --no-parser entry here.
2839 (getargs): Remove -n case in the switch here.
2840 * src/getargs.h (no_parser_flag): Remove extern.
2841 * tests/regression.at (Web2c Actions): Remove comment that mentions
2842 --no-parser.
2843
2844 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2845
2846 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
2847 name user variables starting with `yy'. Just pass NULL instead of a
2848 dummy local &yylval to yypush_parse.
2849 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
2850 starting with `yy'.
2851
2852 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
2853
2854 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
2855 true since it's then always used regardless of whether yyoverflow is
2856 defined. Reported by Christian Burger at
2857 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
2858 * THANKS: Add Christian Burger.
2859
2860 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
2861 node names: say "Decl Summary" not "Bison Declaration Summary".
2862
2863 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
2864
2865 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
2866 determine whether this function has already complained about an invalid
2867 value for a %define boolean variable, don't check whether Bison has
2868 ever examined the value. As written, the check was a tautology.
2869 Instead, record and check for this complaint using a separate muscle.
2870
2871 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2872
2873 Fix push parsing memory leak reported by Brandon Lucia at
2874 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
2875 * THANKS: Add Brandon Lucia.
2876 * data/push.c (yypstate_delete): Free the stack if it was reallocated
2877 but the parse never completed and thus freed it.
2878 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
2879 * tests/testsuite.at: Include push.at.
2880 * test/push.at: New.
2881 (Push Parsing: Memory Leak for Early Deletion): New test case.
2882
2883 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
2884
2885 Improve handling of multiple S/R conflicts in the same state and of S/R
2886 conflicts involving multiple reductions.
2887 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
2888 set for a state here or Bison will abort if it is reassigned on a
2889 later conflicted reduction in the same state.
2890 Similarly, don't finalize and assign the solved conflicts report here
2891 or it will be lost if it is reassigned on a later conflicted reduction
2892 in the same state.
2893 (set_conflicts): Instead, assign them both here after all S/R conflicts
2894 in the state have been fully examined.
2895 * src/print.c (shift_set): Rename to...
2896 (no_reduce_set): ... this.
2897 (print_reductions): Update for rename, and add %nonassoc error action
2898 tokens to no_reduce_set so that, when printing the first remaining
2899 reduction on an error action token, the reduction is enclosed in
2900 brackets.
2901 (print_results): Update for rename.
2902 * tests/conflicts.at (Solved conflicts report for multiple reductions
2903 in a state): New test case.
2904 (%nonassoc error actions for multiple reductions in a state): New test
2905 case.
2906
2907 * src/main.c (main): Don't depend on C99 features.
2908
2909 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2910
2911 * build-aux/.cvsignore: Add compile.
2912 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
2913 uniwidth.
2914
2915 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
2916
2917 * bootstrap (slurp): Create target directories that don't exist.
2918 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
2919
2920 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
2921
2922 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
2923 than item number.
2924 * closure.c (closure): Likewise.
2925 * state.h (reductions): Comment sorting of rules.
2926 (state): Comment sorting of items.
2927
2928 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
2929
2930 Fix C++ test cases after recent Gnulib changes. Discussed starting at
2931 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
2932 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
2933 definition in order to avoid Gnulib headers since we don't use config.h
2934 here.
2935 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
2936 rather than AT_DATA so that config.h is included.
2937
2938 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
2939
2940 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
2941 instead of fprintf. Guard these functions with #if YYDEBUG instead of
2942 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
2943 and so that YYFPRINTF is guaranteed to be defined here.
2944
2945 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2946
2947 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
2948 with...
2949 (muscle_percent_define_check_values): ... this more helpful function.
2950 Again, it's not used yet, but it will be.
2951 * src/muscle_tab.h: Likewise.
2952
2953 Improve some comments in parser table construction.
2954 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
2955 (generate_states): Don't mention ruleset, which is internal to closure.
2956 * src/closure.c (closure): Explain sorting of core and itemset, which
2957 is required for this function to behave correctly.
2958 * src/closure.h (closure): Mention sorting.
2959
2960 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
2961
2962 * src/lalr.c (state_lookahead_tokens_count): For code readability,
2963 move the check for disabled transitions to an aver since conflict
2964 resolution hasn't happened yet.
2965
2966 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
2967 labels a state as inconsistent just because it has error transitions.
2968 The original form of this check appeared in revision 1.1 of lalr.c,
2969 which was committed on 1991-12-21. Now (at least), changing the
2970 consistency label on such a state appears to have no useful effect in
2971 any of the places it is examined, which I enumerate below. The key
2972 point to understanding each item in this enumeration is that a state
2973 with an error transition is labelled consistent in the first place only
2974 if it has no rules, so the check cannot matter for states that have
2975 rules. (1) Labelling a state as inconsistent will cause set_conflicts
2976 to try to identify its conflicts, and a state must have *rules* to have
2977 conflicts. (2) Labelling a state as inconsistent will affect how
2978 action_row sets the default *rule* for the state. (3) Labelling a
2979 state as inconsistent will cause build_relations to add lookback edges
2980 to *rules* in that state.
2981 * src/state.h (struct state): Word the comment for member consistent
2982 more carefully.
2983
2984 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2985
2986 Don't depend on C99 features.
2987 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
2988 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
2989 * src/reader.c (check_and_convert_grammar): Fix for-loop.
2990 * src/state.c (state_mark_reachable_states): Fix for-loop.
2991 (state_remove_unreachable_states): Fix for-loop.
2992
2993 Don't widen struct state with member reachable just to temporarily
2994 record reachability. Instead, use a local bitset.
2995 * src/state.h (struct state): Remove member.
2996 * src/state.c (state_new): Don't initialize it.
2997 (state_mark_reachable_states): Rename to...
2998 (state_record_reachable_states): ... this, and use bitset.
2999 (state_remove_unreachable_states): Use bitset.
3000
3001 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
3002
3003 * src/Makefile.am (yacc): Quote target action commands properly so
3004 that the yacc script isn't corrupt. Reported by Hans Aberg at
3005 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
3006
3007 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
3008 the case of pure parsers. Reported by Frans Englich at
3009 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
3010 * THANKS: Add Frans Englich.
3011
3012 * NEWS (2.3a+): In the %code entry, reference section `Bison
3013 Declaration Summary' from the manual now since the %code summary has
3014 moved there.
3015 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
3016 in the rules section must be terminated by semicolons.
3017
3018 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
3019
3020 Extend the front-end API for %define variables to more completely
3021 mirror the back-end. This will be useful in the future.
3022 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
3023 Update comments to mention the new front-end counterparts of these
3024 macros.
3025 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
3026 for muscle_string_decode and muscle_location_decode.
3027 (muscle_string_decode): New static function.
3028 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
3029 (muscle_percent_define_get, muscle_percent_define_ifdef): New
3030 functions.
3031 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
3032 muscle_percent_define_get to mimic the b4_percent_define_flag_if
3033 implementation more closely.
3034 (muscle_percent_define_invalid_value): New function.
3035 * src/muscle_tab.h (muscle_percent_define_get,
3036 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
3037 Prototype.
3038
3039 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3040
3041 * NEWS (2.3a+): Mention yesterday's state-removal change.
3042 (2.3a): Remove the %language entry, which was added after 2.3a.
3043 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
3044 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
3045 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
3046 tests/existing.at: Update copyright date.
3047
3048 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3049
3050 If conflict resolution makes states unreachable, remove those states,
3051 report rules that are then unused, and don't report conflicts in those
3052 states.
3053 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
3054 New global function.
3055 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
3056 function.
3057 * src/main.c (main): After conflict resolution, remove the unreachable
3058 states and update all data structures that reference states by number.
3059 * src/state.c (state_new): Initialize each state's reachable member to
3060 false.
3061 (state_mark_reachable_states): New static function.
3062 (state_remove_unreachable_states): New global function.
3063 * src/state.h (struct state): Add member bool reachable.
3064 (state_remove_unreachable_states): Prototype.
3065 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3066 New test case.
3067 * tests/existing.at (GNU pic Grammar): Update test case output now that
3068 an unused rule is discovered.
3069
3070 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3071
3072 Minor code cleanup in parser table construction.
3073 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
3074 (new_itemsets, save_reductions): Update for rename to nitemset.
3075 * src/closure.c (nritemset): Rename to...
3076 (nitemset): ... this since the "r" appears to meaningless and isn't
3077 used in the comments.
3078 (closure): Update for rename.
3079 * src/closure.h (nritemset): Update extern to...
3080 (nitemset): ... this.
3081 * src/lalr.c (LA): Fix a typo in comments.
3082 * src/print.c (print_core): Update for rename to nitemset.
3083 * src/print_graph.c (print_graph): Likewise.
3084 * src/state.h: Fix some typos in header comments.
3085
3086 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
3087
3088 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
3089 still sticks to ASCII. Sorry!
3090
3091 * README-hacking: New file, taken mostly from coreutils, with changes
3092 for Bison. Contains much of the contents of:
3093 * README-cvs: Remove.
3094 * bootstrap: Sync from gnulib.
3095 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
3096 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
3097
3098 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
3099
3100 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
3101 Setzer.
3102 (Java Differences): Fix some typos.
3103 * THANKS: Add Sebastian Setzer.
3104
3105 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
3106
3107 * data/java.m4 (b4_single_class_if): Remove.
3108 (b4_abstract_if): Look at "%define abstract".
3109 (b4_lexer_if): New.
3110 (b4_union_name): Rename...
3111 (b4_yystype): ... to this. Map to "%define stype".
3112 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
3113 b4_maybe_throws): Fix quoting.
3114 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
3115 * data/lalr1.java (Lexer interface): Always define.
3116 (Lexer interface within parser class): Remove.
3117 (YYLexer class): New, used when "%code lexer" is present.
3118 (constructor): When "%code lexer" is used, pass %lex-param
3119 to the lexer constructor.
3120 (yylex, yyparse): Remove %lex-param from method invocations
3121 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
3122
3123 * doc/bison.texinfo (Java Bison Interface): Mention "%define
3124 abstract". Rename "%define union_name" to "%define stype".
3125 Rename method names according to previous patch.
3126 (Java Scanner Interface): Describe "%code lexer" instead of
3127 "%pure-parser" and "%define single_class".
3128 (Java Differences): Mention "%code lexer".
3129
3130 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
3131 Include scanner here, using macros from tests/local.at.
3132 (AT_DATA_CALC_Y): Remove final argument.
3133 (_AT_CHECK_JAVA_CALC): Likewise.
3134 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
3135 of %locations and %error-verbose.
3136 (main): Test with and without %lex-param.
3137 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
3138 (AT_BISON_OPTION_POPDEFS): Pop it.
3139
3140 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3141
3142 DJGPP spefic issue. Inhibit the use of disallowed characters for
3143 file name genertion on Win98, WinXP, etc. These are |<>":?*\
3144 and concern testsuite case 46.
3145 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
3146 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
3147 * djgpp/config.bat: Inhibit the use of disallowed characters.
3148
3149 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3150
3151 Miscellaneous %define and %code cleanup.
3152 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
3153 values are interpreted.
3154 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
3155 documentation a little more.
3156 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
3157 muscle_percent_define_insert, muscle_percent_code_grow): New
3158 functions/macros.
3159 * src/muscle_tab.h (muscle_percent_define_insert,
3160 muscle_percent_code_grow): Prototype.
3161 * src/parse-gram.y (prologue_declaration): Use
3162 muscle_percent_define_insert and muscle_percent_code_grow when parsing
3163 %define and %code directives.
3164
3165 Make it easy to share %define boolean variables between the front-end
3166 and back-end. Though not used yet, this will be useful in the future.
3167 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
3168 Bison uses of names rather than just skeleton uses of names.
3169 (b4_percent_define_get, b4_percent_define_ifdef): Rename
3170 b4_percent_define_skeleton_variables(VARIABLE) to
3171 b4_percent_define_bison_variables(VARIABLE).
3172 (b4_percent_code_get, b4_percent_code_ifdef): Rename
3173 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
3174 b4_percent_code_bison_qualifiers(QUALIFIER).
3175 (b4_check_user_names_wrap): Update for renames.
3176 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
3177 muscle_percent_define_default): New functions mimicking
3178 b4_percent_define_flag_if and b4_percent_define_default.
3179
3180 For %define variables, report locations for invalid values and
3181 redefinitions.
3182 * data/bison.m4 (b4_percent_define_flag_if): Read
3183 b4_percent_define_loc(VARIABLE) to report the location of an invalid
3184 value for VARIABLE.
3185 (b4_percent_define_default): Save a special location in
3186 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
3187 must later be reported as invalid.
3188 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
3189 functions.
3190 (muscle_percent_define_insert): Record the location of VARIABLE in
3191 muscle percent_define_loc(VARIABLE), and use it to report the previous
3192 location for a redefinition.
3193 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
3194 (muscle_percent_define_default): Update like b4_percent_define_default.
3195 (muscle_grow_user_name_list): Rename to...
3196 (muscle_user_name_list_grow): ... this for consistency and use
3197 muscle_location_grow.
3198 * src/muscle_tab.h (muscle_location_grow): Prototype.
3199 * tests/input.at (%define errors): Update expected output.
3200 * tests/skeletons.at (%define boolean variables: invalid skeleton
3201 defaults): New test case.
3202
3203 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
3204
3205 * src/print.c (lookahead_set, state_default_rule): Remove.
3206 (print_reductions): Replace state_default_rule invocation with
3207 equivalent use of yydefact, which was computed in token_actions in
3208 tables.c.
3209 (print_results): Don't allocate lookahead_set.
3210
3211 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
3212
3213 * data/lalr1.java: Prefix all private members with yy.
3214
3215 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
3216
3217 Use YYFPRINTF instead of fprintf where appropriate. Reported by
3218 Sebastien Fricker at
3219 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
3220 * THANKS: Add Sebastien Fricker.
3221 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
3222 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
3223 accept a variable number of arguments.
3224
3225 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3226
3227 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
3228
3229 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3230
3231 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
3232 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
3233 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
3234
3235 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
3236
3237 Undo my 2007-02-07 change, switching back to the c-strcase module
3238 introduced in the 2007-02-03 change. Bruno Haible reported that
3239 the 2007-02-07 change would be dangerous in Turkish if we add a
3240 language whose name contains "i", since "i" is not lowercase "I"
3241 in Turkish.
3242 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
3243 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
3244 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
3245 * m4/.cvsignore: Remove strcase.m4.
3246 * src/getargs.c: Revert 2007-02-07 change, as follows.
3247 Include c-strcase.h.
3248 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
3249
3250 2007-02-11 Bruno Haible <bruno@clisp.org>
3251
3252 Enable the Java related testsuite tests when the only Java compiler
3253 found is a gcj < 4.3. Discussed at
3254 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
3255 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
3256
3257 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
3258
3259 * data/Makefile.am: Update copyright date.
3260 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
3261 yypstate_new returns NULL.
3262 (yypstate_new): Return NULL if malloc does.
3263 * src/reader.c (packgram): Move translation of rule actions from the
3264 beginning of packgram to...
3265 (check_and_convert_grammar): ... here right before packgram is invoked
3266 so it's easier to write more complete comments, and remove redundant
3267 code.
3268
3269 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
3270
3271 As in semantic actions, make @$ in %initial-action, %destructor, and
3272 %printer imply %locations.
3273 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
3274 scanning @$.
3275 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
3276 (@$ in %initial-action implies %locations,
3277 @$ in %destructor implies %locations,
3278 @$ in %printer implies %locations): ... these new test cases.
3279
3280 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
3281
3282 Undo most of the 2007-02-03 change, switching to the strcase module
3283 now that gnulib strcase has been fixed.
3284 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
3285 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
3286 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
3287 * m4/.cvsignore: Add strcase.m4.
3288 * src/getargs.c: Revert 2007-02-03 change, as follows.
3289 Don't include c-strcase.h.
3290 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
3291 strcasecmp has "unspecified behavior" outside the POSIX locale,
3292 but it works fine in practice if at least one argument is ASCII,
3293 as is the case in Bison.
3294
3295 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
3296
3297 * tests/java.at: Skip tests if only one of javac/java is present.
3298 Reported by Joel E. Denny.
3299 * tests/atlocal.in: Adjust copyright years.
3300
3301 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
3302
3303 * data/lalr1.java (Stack): Work around old verifiers that disallow
3304 access to the private fields of an inner class, from the outer class.
3305 We can make Stack's fields public because user code doesn't have access
3306 to the instance of Stack used by parse(). Reported by Paul Eggert.
3307
3308 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
3309
3310 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
3311 the right spot for these files?
3312 * bootstrap.conf (gnulib_modules): Add c-strcase.
3313 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
3314 c-strncasecmp.c.
3315 * src/getargs.c: Include c-strcase.h.
3316 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
3317 to avoid unspecified behavior.
3318
3319 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
3320
3321 * doc/bison.texinfo (Decl Summary): Correct typo.
3322
3323 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
3324
3325 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
3326 Complain if the value does not match empty, "true" or "false".
3327 * data/c++.m4: Adjust default definitions of %define variables.
3328 * data/java.m4: Adjust default definitions of %define variables.
3329 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
3330 to above behavior.
3331 * tests/input.at (Boolean %define variables): Test new behavior.
3332
3333 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
3334
3335 * NEWS: Mention java.
3336 * TODO: Remove things that are done.
3337 * bootstrap.conf: Add javacomp-script and javaexec-script.
3338 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
3339
3340 * data/Makefile.am: Add new files.
3341 * data/java-skel.m4: New.
3342 * data/java.m4: New.
3343 * data/lalr1.java: New.
3344
3345 * doc/bison.texinfo: Put "A Complete C++ Example" under
3346 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
3347 under Other Languages.
3348
3349 * src/getargs.c (valid_languages): Add Java.
3350 * src/getargs.h (struct bison_language): Update size of string fields.
3351
3352 * tests/Makefile.am: Add java.at.
3353 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
3354 * tests/java.at: New.
3355 * tests/testsuite.at: Include it.
3356
3357 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
3358
3359 Clean up.
3360 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
3361 at_directive_argv arguments so these no longer have to be global
3362 variables. Also, update the implementation for the following changes.
3363 (fail_for_at_directive_too_many_args,
3364 fail_for_at_directive_too_few_args): Add at_directive_name argument.
3365 (at_directive_name): Remove as at_directive_argv[0] will be used for
3366 this now.
3367 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
3368 for the directive name.
3369 (at_directive_argc, at_directive_argv): Make these local within
3370 skel_lex instead of global.
3371 (INITIAL): Update directive start action for above changes.
3372 (SC_AT_DIRECTIVE_ARG): Rename to...
3373 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
3374 (SC_AT_DIRECTIVE_SKIP_WS): Update.
3375 (scan_skel): Move yylex_destroy to...
3376 (skel_scanner_free): ... here.
3377 * tests/skeletons.at (installed skeleton file name): Rename to...
3378 (installed skeleton file names): ... this.
3379
3380 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
3381
3382 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3383 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
3384 Summary" not "Directives".
3385 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
3386 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
3387 since the former is now the more complete one.
3388 (Prologue Alternatives): Likewise and do the same for %defines.
3389 (Table of Symbols): Add summary of %code, add summary of %define, and
3390 move full %code documentation to...
3391 (Decl Summary): ... here for consistency with other entries in these
3392 sections.
3393 Move %define entry in order to keep this list alphabetized.
3394 Reword %define entry a little to put less emphasis on the skeleton
3395 concept, which most users shouldn't have to think about.
3396
3397 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
3398
3399 Adjust to recent gnulib changes.
3400 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
3401 Add string.h, string_.h, unistd_.h, wchar_.h.
3402 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
3403 * src/system.h: Don't include <stpcpy.h>; this is now done by
3404 <string.h>.
3405
3406 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
3407
3408 Simplify implementation of unqualified %code, implement macros for
3409 uniform treatment of boolean %define flags. Document %define.
3410 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
3411 b4_percent_code_ifdef): New.
3412 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
3413 * data/c++.m4: Define default value for global_tokens_and_yystype.
3414 * data/glr.cc: Likewise.
3415 * data/location.cc: Use b4_percent_define_flag_if.
3416
3417 * doc/bison.texinfo (Decl Summary): Document %define.
3418
3419 * src/parse-gram.y (Unqualified %code): Change muscle name to
3420 b4_percent_code().
3421 (content.opt): Default to empty.
3422
3423 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3424
3425 Implement support for relative and absolute skeleton file names.
3426 Discussed starting at
3427 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
3428 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
3429 (Bison Options): Document in --skeleton entry.
3430 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
3431 full_skeleton can't necessarily hold all of pkgdatadir.
3432 If the specified skeleton file name contains a `/', don't prepend
3433 pkgdatadir.
3434 * src/parse-gram.y (prologue_declaration): If the specified skeleton
3435 file name contains a `/', prepend the grammar file directory.
3436 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
3437 * skeletons.at: New file.
3438 (relative skeleton file names): New test case.
3439 (installed skeleton file names): New test case.
3440 * tests/testsuite.at: Include skeletons.at.
3441
3442 * bootstrap: Update copyright to 2007.
3443
3444 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
3445
3446 * bootstrap: Remove occurrences of .#bootmp from the files.
3447
3448 2007-01-17 Akim Demaille <akim@epita.fr>
3449
3450 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
3451 nonterminals.
3452 Use per-type %printer.
3453
3454 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3455
3456 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
3457 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3458 djgpp/config.site, src/files.c, src/files.h, src/main.c,
3459 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
3460 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
3461 tests/glr-regression.at, tests/input.at, tests/local.at,
3462 tests/output.at, tests/torture.at: Update copyright to 2007.
3463
3464 2007-01-16 Akim Demaille <akim@epita.fr>
3465
3466 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
3467 error code.
3468 (Calc++ Scanner): Exit with failure if we can't open the input
3469 file.
3470 Accept "-" standing for stdin.
3471 (Calc++ Top Level): Print the result only if the parsing was
3472 successful.
3473
3474 2007-01-16 Akim Demaille <akim@epita.fr>
3475
3476 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
3477
3478 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
3479 and Joel E. Denny <jdenny@ces.clemson.edu>
3480
3481 Clean up %define and %code implementation in M4 some. Most
3482 importantly, rename all related macros to be in the b4_percent_define
3483 and b4_percent_code namespaces. Also, complete support for `.' in
3484 %define variable names and %code qualifiers.
3485 * data/bison.m4 (b4_check_user_names): Check for special
3486 "SKELETON-NAMESPACE(name)" macros instead of using two nested
3487 m4_foreach loops.
3488 (b4_get_percent_define, b4_get_percent_code): Rename to...
3489 (b4_percent_define_get, b4_percent_code_get): ... these.
3490 Extend documentation with examples.
3491 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
3492 b4_percent_define_skeleton_variables and
3493 b4_percent_code_skeleton_qualifiers.
3494 Expect any value for the %define variable `foo' to be stored in the
3495 macro named `b4_percent_define(foo)'; expect any %code blocks for the
3496 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
3497 expect any unqualified %code blocks to be stored in a macro named
3498 `b4_percent_code_unqualified'.
3499 Use m4_indir so that %define variable names and %code qualifiers can
3500 contain `.', which is allowed by the grammar parser.
3501 (b4_percent_define_default): New macro to set a default value for a
3502 %define variable.
3503 (m4_wrap): Update wrapped code, and fix some underquoting.
3504 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
3505 Expect grammar uses of %define variables and %code qualifiers to be
3506 defined in b4_percent_define_user_variables and
3507 b4_percent_code_user_qualifiers.
3508 * data/c++.m4: Use b4_percent_define_default rather than
3509 m4_define_default. Fix some underquoting. Skeleton usage of %define
3510 variable define_location_comparison now implies skeleton usage of
3511 %define variable filename_type.
3512 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3513 data/push.c, data/yacc.c: Update macro names.
3514 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
3515 muscle names.
3516
3517 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3518
3519 DJGPP specific issues.
3520
3521 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
3522 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
3523
3524 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3525
3526 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
3527 run parsers in all tests so that Valgrind is invoked during
3528 maintainer-check-valgrind.
3529 (Duplicate representation of merged trees): Free all semantic values.
3530 (Duplicated user destructor for lookahead): Likewise.
3531
3532 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3533
3534 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
3535 command-line prefix.
3536 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
3537 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
3538 miss Valgrind messages.
3539 (Exploding the Stack Size with Malloc): Likewise.
3540
3541 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3542
3543 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
3544 locals. Reported by Juan Manuel Guerrero at
3545 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
3546 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
3547 Fix some indentation also.
3548 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
3549 explaining this issue.
3550
3551 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
3552 and Joel E. Denny <jdenny@ces.clemson.edu>
3553
3554 Simplify union and prologue handling, and escape union and lex/parse
3555 params with digraphs.
3556 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
3557 values to the empty string since these are no longer guaranteed
3558 initialized by the front-end.
3559 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
3560 braces around b4_user_stype since this is no longer done by the
3561 front-end.
3562 * src/files.c, src/files.h (pre_prologue_obstack,
3563 post_prologue_obstack): Remove.
3564 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
3565 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
3566 with digraphs. This fixes lex params and parse params.
3567 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
3568 * src/output.c (prepare): Remove muscle insertion of the prologues.
3569 (output): Remove freeing of pre_prologue_obstack and
3570 post_prologue_obstack.
3571 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
3572 than prologue_augment for prologue parsing so you don't need prologue
3573 obstacks.
3574 (grammar_declaration): For %union RHS, use `braceless' instead of
3575 "{...}" so that braces are already stripped and code is escaped with
3576 digraphs.
3577 * src/reader.c (prologue_augment): Remove.
3578 (reader): Remove initialization of pre_prologue_obstack and
3579 post_prologue_obstack.
3580 * src/reader.h (prologue_augment): Remove.
3581
3582 * data/c.m4: Remove stray parenthesis.
3583
3584 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3585
3586 Remove quotes from variables names in %define directives and from
3587 qualifiers in %code directives, and restrict the characters that are
3588 allowed in them to M4-friendly ones. For %define, continue to support
3589 the quoted form as a deprecated feature. Discussed starting at
3590 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
3591 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
3592 %code.
3593 * doc/bison.texinfo (Prologue Alternatives): Update.
3594 (Decl Summary): In %defines entry, update mention of `%code requires'
3595 and `%code provides'.
3596 (C++ Location Values): Update %define uses.
3597 (Calc++ Parser Interface): Likewise.
3598 (Calc++ Parser): Likewise, and update `%code requires' uses.
3599 (Table of Symbols): Update %code documentation.
3600 * src/parse-gram.y (prologue_declaration): For %define variables, use
3601 `variable' instead of `STRING'.
3602 (grammar_declaration): For %code qualifiers, use `ID' instead of
3603 `STRING'.
3604 (variable): New nonterminal that takes an `ID' or a `STRING'.
3605 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
3606 and %define uses.
3607 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
3608 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
3609 (%define errors): Update %define uses.
3610
3611 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3612
3613 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
3614 instead of muscle_insert for %define values so that M4-special
3615 characters are replaced with digraphs.
3616 * tests/input.at (%define errors): Extend to check weird values.
3617
3618 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3619
3620 Instead of having skeletons declare all valid %define variables and
3621 %code qualifiers, provide macros that retrieve the associated values
3622 and build these lists automatically. Thus Bison will now warn when a
3623 variable or qualifier is not used by the skeleton in the current
3624 invocation regardless of whether it might sometimes be used by that
3625 skeleton in other invocations. Also, move all %define value macros to
3626 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
3627 form, which is replaced by %code.
3628 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
3629 (b4_check_user_names): ... this, and change the series of valid name
3630 arguments to a single list argument for names used in the skeleton
3631 similar to the existing list argument for names used in the grammar.
3632 Warn instead of complaining.
3633 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
3634 values and %code code, to format %code code properly, and to build
3635 lists of all %define variables and %code qualifiers used in the
3636 skeleton: b4_skeleton_percent_define_variables and
3637 b4_skeleton_percent_code_qualifiers.
3638 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
3639 Remove, and...
3640 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
3641 the skeleton names lists can finish building first. In place of
3642 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
3643 expect the lists b4_user_percent_define_variables and
3644 b4_user_percent_code_qualifiers.
3645 * data/c++.m4: Where setting default values for b4_parser_class_name,
3646 b4_location_type, b4_filename_type, b4_namespace, and
3647 b4_define_location_comparison, update their names to the
3648 b4_percent_define_ namespace.
3649 * data/glr.c: Don't use b4_check_percent_define_variables and
3650 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3651 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
3652 (b4_parser_class_name, b4_namespace): Define these using
3653 b4_get_percent_define for parser_class_name and namespace.
3654 * data/location.cc: Use b4_get_percent_define.
3655 * data/push.c: Don't use b4_check_percent_define_variables and
3656 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3657 * data/yacc.c: Likewise, and don't call m4_exit in
3658 b4_use_push_for_pull_if or m4_wrap code will never execute.
3659 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
3660 Rename to...
3661 (muscle_grow_user_name_list): ... this for consistency with the
3662 terminology used in bison.m4.
3663 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
3664 %define variable names, and rename muscle used_percent_define_variables
3665 to user_percent_define_variables.
3666 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
3667 user_percent_code_qualifiers.
3668 (content): Remove.
3669 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
3670 {CODE} form is no longer accepted.
3671 * tests/input.at (Reject bad %code qualifiers): Rename to...
3672 (Reject unused %code qualifiers): ... this, and update test output.
3673 (%define error): Update test output.
3674
3675 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
3676
3677 Check for unrecognized %define variables similar to checking for
3678 unrecognized %code qualifiers. Check for redefined %define variables.
3679 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
3680 generalizes...
3681 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
3682 (b4_check_percent_define_variables): New, also wraps it.
3683 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
3684 variables using b4_check_percent_define_variables.
3685 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
3686 all those exercised in the test suite and all those listed in the
3687 `Default values' section of c++.m4. Are there others?
3688 * data/push.c, data/yacc.c: Declare no valid %define variables.
3689 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
3690 similar to muscle_find, but it works even when the muscle stores a
3691 const value.
3692 (muscle_grow_used_name_list): New function for constructing the used
3693 name list muscles that b4_check_for_unrecognized_names requires.
3694 * src/parse-gram.y (prologue_declaration): Warn if a variable is
3695 %define'd more than once. Define the b4_used_percent_define_variables
3696 muscle with muscle_grow_used_name_list.
3697 (grammar_declaration): Abbreviate %code code with
3698 muscle_grow_used_name_list.
3699 * tests/input.at (%define errors): New.
3700
3701 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3702
3703 Provide warn_at, complain_at, and fatal_at function callbacks to the
3704 skeletons, and use this for %code qualifier complaints.
3705 * data/bison.m4 (b4_error_at): New, invoked by...
3706 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
3707 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
3708 @fatal_at(...@) directives.
3709 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
3710 qualifiers in b4_used_percent_code_qualifiers and to use
3711 b4_complain_at.
3712 * src/location.c, src/location.h (boundary_set_from_string): New global
3713 function.
3714 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
3715 function.
3716 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
3717 to b4_used_percent_code_qualifiers.
3718 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
3719 function.
3720 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
3721 (lineno): Rename to...
3722 (out_lineno): ... this so I don't misunderstand it again.
3723 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
3724 here; these newlines are in the input but not the output file.
3725 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
3726 (at_directive_perform): ... this new static function, and add handling
3727 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
3728 directives.
3729 * tests/input.at (Reject bad %code qualifiers): Update test output with
3730 locations and extend.
3731
3732 * tests/output.at (Output file name: [, Output file name: ]): Remove
3733 bogus comment about these tests failing.
3734
3735 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3736
3737 Clean up b4_check_percent_code_qualifiers a little.
3738 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
3739 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
3740 documentation and add examples.
3741 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
3742 qualifiers here.
3743
3744 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3745
3746 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
3747 unreliable -- especially when they're hidden inside another macro.
3748 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
3749 data/c.m4: Remove m4_divert(-1).
3750 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3751 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
3752 m4_divert_push(0) and m4_divert_pop(0).
3753 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
3754 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
3755 pushed and popped by m4sugar, should be first on the stack.
3756
3757 Provide warn, complain, and fatal function callbacks to the skeletons.
3758 This provides more flexibility than m4_fatal, improves the error
3759 message format, and captures messages for translation. Discussed
3760 starting at
3761 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
3762 * data/bison.m4 (b4_error): New, invoked by...
3763 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
3764 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
3765 directives. Because these M4 macros might be called when the current
3766 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
3767 the previous removal of uses of m4_divert, which caused trouble.
3768 (b4_check_percent_code_qualifiers): Use b4_complain instead of
3769 m4_fatal to report unrecognized %code qualifiers.
3770 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
3771 push parser requests.
3772 * data/glr.c: Use b4_complain instead of m4_fatal to report
3773 non-deterministic push parser requests.
3774 Update @output usage to @output(...@) form.
3775 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
3776 report missing %defines. Update @output usage to @output(...@) form.
3777 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
3778 @output(...@) form.
3779 * src/main.c (main): Invoke skel_scanner_free.
3780 * src/scan-skel.h (skel_scanner_free): Prototype new function.
3781 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
3782 obstack_for_string from flex-scanner.h.
3783 (YY_DECL): Use to declare skel_lex static.
3784 (decode_at_digraphs): Remove; now handled in the new
3785 SC_AT_DIRECTIVE_ARG start condition.
3786 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
3787 functions.
3788 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
3789 at_directive_argv): New static globals.
3790 (INITIAL): Use fail_for_invalid_at.
3791 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
3792 recognize the start of a generalized `@directive(...@)' form and
3793 start...
3794 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
3795 directive args (using the new obstack_for_string), to decode the
3796 contained @ diagraphs, and to perform the directive. It recognizes
3797 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
3798 @output(...@).
3799 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
3800 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
3801 `@,'.
3802 (scan_skel): Initialize obstack_for_string on the first call.
3803 (skel_scanner_free): New function to free obstack_for_string.
3804 * tests/input.at (Reject bad %code qualifiers): Update test output.
3805
3806 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
3807
3808 Consolidate the 4 prologue alternative directives (%code, %requires,
3809 %provides, and %code-top) into a single %code directive with an
3810 optional qualifier field. Discussed at
3811 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
3812 * NEWS (2.3a+): Rewrite the existing entry for the prologue
3813 alternatives.
3814 * doc/bison.texinfo (Prologue Alternatives): Update.
3815 (Decl Summary): Update to %code "requires" and %code "provides".
3816 (Calc++ Parser): Update to %code "requires".
3817 (Table of Symbols): Remove entries for %requires, %provides, and
3818 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
3819 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
3820 are replaced by b4_percent_code_provides and b4_percent_code_requires,
3821 which are skeleton-specific.
3822 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
3823 declare what %code qualifiers it supports and to complain if any other
3824 qualifiers were used in the grammar.
3825 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
3826 and b4_user_code([b4_percent_code_provides]) in place of
3827 b4_user_requires and b4_user_provides.
3828 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
3829 Add b4_user_code([b4_percent_code_top]) and
3830 b4_user_code([b4_percent_code]).
3831 Invoke b4_check_percent_code_qualifiers.
3832 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3833 PERCENT_REQUIRES): Remove.
3834 (grammar_declaration): Remove RHS's for %code-top, %provides, and
3835 %requires. Rewrite the %code RHS as the unqualified form defining the
3836 muscle b4_percent_code. Add another RHS for the qualified %code form,
3837 which defines muscles of the form b4_percent_code_QUALIFIER and the
3838 b4_used_percent_code_qualifiers muscle.
3839 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3840 PERCENT_REQUIRES): Remove.
3841 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
3842 %code "requires" and %code "provides".
3843 * tests/input.at (Reject bad %code qualifiers): New.
3844
3845 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3846
3847 Use the new code_props interface for destructors and printers.
3848 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
3849 printer_location members, and change the type of the destructor and
3850 printer members to code_props.
3851 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
3852 symbol_printer_get, semantic_type_destructor_set,
3853 semantic_type_printer_set, default_tagged_destructor_set,
3854 default_tagless_destructor_set, default_tagged_printer_set,
3855 default_tagless_printer_set): Use code_props in arguments and return
3856 types in place of char const * and location.
3857 (symbol_destructor_location_get, symbol_printer_location_get): Remove
3858 since the locations are now contained in the return of
3859 symbol_destructor_get and symbol_printer_get.
3860 * src/output.c (symbol_destructors_output, symbol_printers_output):
3861 Replace with...
3862 (symbol_code_props_output): ... this to eliminate duplicate code.
3863 (output_skeleton): Update to use symbol_code_props_output.
3864 * src/reader.c (symbol_should_be_used): Update use of
3865 symbol_destructor_get.
3866 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3867 Update uses of the various _destructor_set and _printer_set functions.
3868 * src/symtab.c: (default_tagged_destructor_location,
3869 default_tagless_destructor_location, default_tagged_printer_location,
3870 default_tagless_printer_location): Remove since we...
3871 (default_tagged_destructor, default_tagless_destructor,
3872 default_tagged_printer, default_tagless_printer): ... change the type
3873 of these to code_props.
3874 (symbol_new, semantic_type_new, symbol_destructor_set,
3875 semantic_type_destructor_set, symbol_destructor_get,
3876 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
3877 symbol_check_alias_consistency, default_tagged_destructor_set,
3878 default_tagless_destructor_set, default_tagged_printer_set,
3879 default_tagless_printer_set): Update.
3880 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
3881 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
3882 code_props members.
3883 (symbol_print): Use SYMBOL_CODE_PRINT.
3884
3885 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3886
3887 Use the new code_props interface for rule actions.
3888 * src/symlist.h (symbol_list): Replace action, action_location, and
3889 used members with a code_props action_props member.
3890 * src/reader.c (symbol_should_be_used, grammar_rule_check,
3891 grammar_midrule_action, grammar_current_rule_merge_set,
3892 grammar_current_rule_symbol_append, packgram): Update.
3893 * src/scan-code.h (translate_rule_action): Remove, no longer used.
3894 * src/scan-code.l (handle_action_dollar): Update.
3895 (translate_rule_action): Remove, no longer used.
3896 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
3897
3898 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3899
3900 Use the new code_props interface in parse-gram.y.
3901 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
3902 Update all uses of translate_* functions to use the new code_props
3903 interface and to use gram_scanner_last_string_free and
3904 code_scanner_last_string_free where possible.
3905 (grammar_declaration): symbol_list_destructor_set and
3906 symbol_list_printer_set now perform the translation, so don't do it
3907 here. Use gram_scanner_last_string_free where possible.
3908 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
3909 translate_code): Remove, no longer used.
3910 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
3911 symbol_list_printer_set): Perform code translation here rather than
3912 depending on the caller to do so.
3913
3914 * src/symlist.h (struct symbol_list): Correct some documentation typos.
3915 * src/scan-gram.h (gram_last_string): Remove declaration.
3916 * src/scan-gram.l (last_string): Declare it static.
3917
3918 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3919
3920 Encapsulate code properties and related functionality for the various
3921 destructors, printers, and actions into a code_props structure and
3922 interface. This patch merely implements code_props in scan-code.h and
3923 scan-code.l. Future patches will rewrite other modules to use it.
3924 Discussed starting at
3925 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
3926 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
3927 consistently initialize const structs that have an empty location
3928 field.
3929 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
3930 to ensure consistency.
3931 * src/scan-code.h (code_props): New structure.
3932 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
3933 function, macro, and const global variable for initializing a
3934 code_props with no code.
3935 (code_props_plain_init, code_props_symbol_action_init,
3936 code_props_rule_action_init, code_props_translate_code): The rest of
3937 the new code_props functional interface. Among other things, the init
3938 functions set the code_props kind field so that
3939 code_props_translate_code will know whether to behave like
3940 translate_symbol_action, translate_rule_action, or translate_code.
3941 These old translate functions must remain until all other modules are
3942 updated to use the new code_props interface.
3943 (code_scanner_last_string_free): New function similar to
3944 gram_scanner_last_string_free.
3945 (code_scanner_free): Add documentation.
3946 * src/scan-code.l: Implement the new interface.
3947 (code_lex): Make it static, add a code_props* argument, and remove the
3948 rule argument.
3949 (last_string): New static global similar to the one in scan-gram.l.
3950 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
3951 instead of rule.
3952 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
3953 code_props since Bison may one day use this information for destructors
3954 and printers.
3955 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
3956 (handle_action_dollar): Use symbol_list_n_get and set used flag
3957 directly since symbol_list_n_used_set is removed.
3958 (translate_action): Add a code_props* argument and remove the rule,
3959 action, and location arguments. Pass the code_props* on to code_lex.
3960 (translate_rule_action, translate_symbol_action, translate_code):
3961 Rewrite as wrappers around the new code_props interface.
3962 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
3963 it would eventually need to break the encapsulation of code_props.
3964
3965 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3966
3967 * etc/.cvsignore: New.
3968
3969 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3970
3971 Add maintainer-push-check to run maintainer-check using push parsing in
3972 place of pull parsing where available.
3973 * Makefile.am (maintainer-push-check): New.
3974 * data/bison.m4 (b4_use_push_for_pull_if): New.
3975 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
3976 appropriately based on their existing values.
3977 (yypush_parse): Don't print push-parser-specific diagnostics if push
3978 parsing is being used in place of pull parsing.
3979 * data/yacc.c: If push parsing should replace pull parsing, redirect to
3980 push.c.
3981 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
3982 variable, and insert b4_use_push_for_pull_flag into muscles.
3983 * tests/Makefile.am (maintainer-push-check): New.
3984
3985 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3986
3987 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
3988 (whether successful or failed) so that yypush_parse can be invoked
3989 again to start a new parse using the same yypstate.
3990 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
3991 check multiple yypull_parse invocations on the same yypstate. For pull
3992 mode, extend to check multiple yyparse invocations.
3993 (Exploding the Stack Size with Alloca): Extend to try with
3994 %push-pull-parser.
3995 (Exploding the Stack Size with Malloc): Likewise.
3996
3997 * tests/calc.at (Simple LALR Calculator): Don't specify
3998 %skeleton "push.c" since %push-pull-parser implies that now.
3999 * tests/headers.at (export YYLTYPE): Don't check for the push
4000 declarations. Otherwise, this test case can't be used to see if push
4001 mode can truly emulate pull mode.
4002 * tests/input.at (Torturing the Scanner): Likewise.
4003 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
4004 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
4005 AT_YACC_IF, which now includes the case of push mode since %skeleton
4006 need not be used for push mode. This will be more intuitive once
4007 push.c is renamed to yacc.c.
4008
4009 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4010
4011 For push mode, convert yyparse from a macro to a function, invoke yylex
4012 instead of passing a yylexp argument to yypull_parse, and don't
4013 generate yypull_parse or yyparse unless %push-pull-parser is declared.
4014 Discussed starting at
4015 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
4016 * data/bison.m4 (b4_pull_if): New.
4017 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
4018 * data/push.c: Improve M4 quoting a little.
4019 (b4_generate_macro_args, b4_parenthesize): Remove.
4020 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
4021 any time a pull parser is requested.
4022 Don't #define this as a wrapper around yypull_parse. Instead, when
4023 both push and pull are requested, make it a function that does that
4024 same thing.
4025 (yypull_parse): If there's a b4_prefix, #define this to
4026 b4_prefix[pull_parse] when both push and pull are requested.
4027 Don't define this as a function unless both push and pull are
4028 requested.
4029 Remove the yylexp argument and hard-code yylex invocation instead.
4030 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
4031 %push-parser.
4032 * src/getargs.c (pull_parser): New global initialized to true.
4033 * getargs.h (pull_parser): extern it.
4034 * src/output.c (prepare): Insert pull_flag muscle.
4035 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
4036 (prologue_declaration): Set both push_parser and pull_parser = true for
4037 %push-pull-parser. Set push_parser = true and pull_parser = false for
4038 %push-parser.
4039 * src/scan-gram.l: Don't accept %push_parser as an alternative to
4040 %push-parser since there's no backward-compatibility concern here.
4041 Scan %push-pull-parser.
4042 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
4043 instead of %push-parser.
4044 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
4045 prototype it in the module that calls yyparse.
4046 * tests/input.at (Torturing the Scanner): Likewise.
4047 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
4048
4049 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
4050
4051 Update etc/bench.pl. Optimize push mode a little (the yyn change
4052 deserves most of the credit).
4053 * Makefile.am (SUBDIRS): Add etc subdirectory.
4054 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
4055 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
4056 yytoken, yyval, and yyloc declarations to...
4057 (yyparse or yypush_parse): ... here to improve performance. For
4058 yypush_parse invocations after the first, be sure to assign yyn its old
4059 value again.
4060 (yypstate_new): Don't bother initializing the yyresult field since the
4061 initial value isn't used.
4062 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
4063 remove the #define that, in push mode, set it to yyps->NAME.
4064 * etc/Makefile.am: New.
4065 * etc/bench.pl: Remove and build it instead from...
4066 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
4067 "tests/bison" from the build directory by default rather than just
4068 invoking "bison" from $PATH.
4069 (calc_grammar): Update push parser code: don't declare yylval globally,
4070 don't define yyparse_wrapper, and don't #define yyparse.
4071 (bench_grammar): Update to check all working combinations of yacc.c,
4072 push.c, impure, pure, pull, and push.
4073
4074 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4075
4076 For push mode, add pull wrappers around yypush_parse.
4077 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
4078 (yypull_parse): New function wrapping yypush_parse.
4079 (yyparse): New #define wrapping yypull_parse.
4080 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
4081 is declared.
4082 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
4083 prototype yylex in the module that calls yyparse, and don't prototype
4084 yyparse there. Otherwise, the yyparse expansion won't compile.
4085 * tests/input.at (Torturing the Scanner): Likewise.
4086
4087 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4088
4089 Enable push parsers to operate in impure mode. Thus, %push-parser no
4090 longer implies %pure-parser. The point of this change is to move
4091 towards being able to test the push parser code by running the entire
4092 test suite as if %push-parser had been declared.
4093 * data/push.c (yypush_parse): For impure mode, remove the
4094 yypushed_char, yypushed_val, and yypushed_loc arguments.
4095 Instead, declare these as local variables initialized to the global
4096 yychar, yylval, and yylloc.
4097 For the first yypush_parse invocation only, restore the initial values
4098 of these global variables when it's time to read a token since they
4099 have been overwritten.
4100 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
4101 %push-parser.
4102 * tests/calc.at (Simple LALR(1) Calculator): Always declare
4103 %pure-parser along with %push-parser since this test case was designed
4104 for pure push parsers.
4105 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
4106 (AT_YACC_OR_PUSH_IF): New.
4107 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
4108 add a note that it's still wrong for some cases (as it has been for a
4109 while).
4110 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
4111 %push-parser no longer implies %pure-parser.
4112
4113 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4114
4115 Remove some unnecessary differences between the pull parser code and
4116 the push parser code. This patch enables yynerrs in push mode.
4117 * data/push.c: Reformat M4 a little.
4118 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
4119 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
4120 because push mode is on. Instead, if pure mode is on, move yynerrs
4121 to...
4122 (b4_declare_parser_state_variables): ... here.
4123 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
4124 to yyps->NAME so it can be used in yypush_parse.
4125 (yypush_parse): Don't omit uses of yynerrs in push mode.
4126
4127 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4128
4129 Fix bug such that the first pushed token's value and location are
4130 sometimes overwritten (sometimes by %initial-action) before being used.
4131 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
4132 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
4133 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
4134 more closely mimic the pull parser logic.
4135 Don't copy the pushed token to yychar, yylval, and yylloc until it's
4136 time to read a token, which is after any initialization of yylval and
4137 yylloc.
4138 (gottoken): Rename label to...
4139 (yyread_pushed_token): ... for clarity and to avoid infringing on the
4140 user namespace.
4141
4142 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4143
4144 Rearrange initialization of the parser state variables so that the
4145 skeleton doesn't have to have a copy for pull mode and another for push
4146 mode. This patch also fixes at least a bug such that yylloc was not
4147 initialized (with b4_location_initial_line and
4148 b4_location_initial_column) upon calling yypush_parse. However, that
4149 initialization now overwrites the first token's location;
4150 %initial-action assigning @$ already did the same thing, and both bugs
4151 will be fixed in a later patch.
4152 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
4153 (b4_declare_parser_state_variables): Remove initialization of yytoken,
4154 yyss, yyvs, yyls, and yystacksize.
4155 (yypstate_new): Remove initialization of some yypstate fields: yystate,
4156 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
4157 yylsp.
4158 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
4159 yyps->NAME so it can be used in yypush_parse.
4160 (yyparse or yypush_parse): For yypush_parse, don't print the
4161 "Starting parse" diagnostic for invocations after the first.
4162 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
4163 yypush_parse, only do it for the first invocation.
4164 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
4165 initialization to occur in yypush_parse but only on the first
4166 invocation.
4167
4168 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4169
4170 * data/push.c: Add CPP guards around push parser declarations in both
4171 the header and the code file.
4172 In the code file, move the push parser declarations to the same place
4173 they appear in the header file.
4174 Clean up the M4 some, especially the inconsistent underquoting in
4175 some b4_c_function_def and b4_c_function_decl uses.
4176
4177 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4178
4179 Encapsulate the push parser state variables into an M4 macro so the
4180 push skeleton doesn't have to list them again for pull mode's yyparse.
4181 For push mode, remove yypush_parse's local equivalents of these
4182 variables to eliminate unnecessary copying between the two sets at
4183 run-time. This patch also fixes at least a bug related to multiple
4184 %initial-action invocations in push mode.
4185 * data/push.c (b4_declare_parser_variables): Rename to...
4186 (b4_declare_scanner_communication_variables): ... this for clarity and
4187 update both uses.
4188 (b4_declare_yyparse_variables): Remove and move its contents to the one
4189 spot where it was invoked.
4190 (b4_declare_parser_state_variables): New macro containing the parser
4191 state variables required by push mode.
4192 (struct yypstate): Replace all fields but yynew with
4193 b4_declare_parser_state_variables.
4194 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
4195 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
4196 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
4197 (yyparse or yypush_parse): For yyparse in pull mode, replace local
4198 parser state variable declarations with
4199 b4_declare_parser_state_variables.
4200 Don't initialize parser state variables when calling yypush_parse since
4201 yypstate_new already does that.
4202 Invoke the user's initial action only upon the first yypush_parse
4203 invocation.
4204 Remove all code that copies between the local parser state variables
4205 and the yypstate.
4206
4207 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4208
4209 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
4210 prevent a name collision in a future patch where these names will
4211 sometimes be #define'd.
4212 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
4213 since it no longer has the same name as the existing argument.
4214 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
4215
4216 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
4217 and Joel E. Denny <jdenny@ces.clemson.edu>
4218
4219 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4220 that the argument is case-insensitive, and there's no `=' here.
4221 For the %skeleton entry, mention that %language is better.
4222 (Bison Options): Likewise for --language and --skeleton. Move the
4223 --skeleton entry so that the `Tuning the parser' section is sorted
4224 alphabetically on long options.
4225 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
4226 %language directive in detail here; cross-reference the %language
4227 documentation instead.
4228 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
4229 `%require "2.3b"' so that the example is always up-to-date.
4230 (Table of Symbols): Add entries for %language and %skeleton.
4231 * examples/extexi (normalize): Instead of replacing every %require
4232 argument with the current Bison version, just substitute for
4233 `@value{VERSION}'. This guarantees that we're testing what actually
4234 appears in the documentation.
4235 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
4236 rather than `@VERSION@'.
4237
4238 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4239
4240 * NEWS: Reword the %language news a bit, and put it earlier.
4241
4242 * src/getargs.c (skeleton_arg): Last arg is now location const *.
4243 Rewrite to simplify the logic.
4244 (language_argmatch): Likewise.
4245 (program_name): We now own this var.
4246 * src/getargs.h (struct bison_language): Use char[] rather than
4247 const char *.
4248
4249 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
4250 Java is supported.
4251 * src/complain.c (program_name): Remove decl; no longer needed.
4252 * src/main.c (program_name): Remove; now belongs to getargs.
4253
4254 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
4255
4256 * NEWS: Document %language.
4257
4258 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
4259
4260 * data/c-skel.m4, data/c++-skel.m4: New files.
4261 * data/glr.c: Complain on push parsers.
4262
4263 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
4264 over %skeleton.
4265 (Decl Summary): Document %language and %skeleton.
4266 (Command line): Document -L.
4267
4268 * examples/extexi: Rewrite %require directive.
4269 * examples/calc++/Makefile.am: Pass VERSION to extexi.
4270
4271 * src/files.c (compute_exts_from_gc): Look in language structure
4272 for .y extension.
4273 (compute_file_name_parts): Check whether .tab should be added.
4274 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
4275 (language, skeleton_arg, language_argmatch): New.
4276 (long_options): Add --language.
4277 (getargs): Use skeleton_arg, add -L/--language.
4278 * src/getargs.h: Include location.h.
4279 (struct bison_language, language, skeleton_arg, language_argmatch): New.
4280 * src/output.c (prepare): Pick default skeleton from struct language.
4281 Don't dispatch C skeletons here.
4282 * src/parse-gram.y (PERCENT_LANGUAGE): New.
4283 (prologue_declaration): Add "%language" rule, use skeleton_arg.
4284 * src/scan-gram.l ("%language"): New rule.
4285
4286 * tests/calc.at: Test %skeleton and %language.
4287 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
4288 (AT_GLR_IF): Look for %skeleton "glr.cc".
4289 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
4290 (AT_YACC_IF): Reject %language.
4291
4292 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4293
4294 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
4295 since it wasn't used; only the typedef name 'semantic_type' is needed.
4296 Also, omit trailing white space.
4297
4298 * bootstrap: Sync from coreutils.
4299 (gnulib_extra_files): Add build-aux/announce.gen.
4300 (slurp): Adjust .gitignore files like .cvsignore files.
4301 * build-aux/announce-gen: Remove from CVS, since bootstrap
4302 now creates this.
4303
4304 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
4305
4306 Make %push-parser imply %pure-parser. This fixes several bugs; see
4307 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
4308 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
4309 pure_parser = true.
4310 * data/push.c: Don't bother testing b4_push_if when deciding whether
4311 to expand b4_declare_parser_variables globally.
4312 (yypush_parse): Likewise in here.
4313
4314 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
4315 (yy_reduce_print): Reformat M4 for readability.
4316
4317 2006-12-15 Bob Rossi <bob@brasko.net>
4318 and Joel Denny <jdenny@ces.clemson.edu>
4319
4320 * data/push.c (yypstate): Add typedef, and update all uses of
4321 struct yypstate to just yypstate.
4322 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
4323
4324 2006-12-14 Bob Rossi <bob@brasko.net>
4325
4326 * data/push.c (yypush_parse): Declare prototype regardless of
4327 %locations option.
4328
4329 2006-12-14 Bob Rossi <bob@brasko.net>
4330
4331 * data/push.c (yyparse): Remove the prototype and the #define when in
4332 push-parser mode.
4333
4334 2006-12-13 Bob Rossi <bob@brasko.net>
4335
4336 * data/push.c (yypstate_init): Rename to...
4337 (yypstate_new): ... this and use b4_c_function_def.
4338 (yypstate_delete): New.
4339 (yypush_parse): Change parameters yynval and yynlloc to be const.
4340 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
4341 yypstate_delete functions.
4342
4343 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
4344
4345 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
4346 strange test case titles. Reported by Bob Rossi.
4347
4348 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
4349
4350 * TODO: Add pointer to Sylvain Schmitz's work on static detection
4351 of potential ambiguities in GLR grammers.
4352
4353 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
4354
4355 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
4356 `bison ', use m4_index instead of m4_substr since chopping up a string
4357 containing M4-special characters causes problems here.
4358
4359 Fix a couple of bugs related to special characters in user-specified
4360 file names, and make it easier for skeletons to compute output file
4361 names with the same file name prefix as Bison-computed output file
4362 names.
4363 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
4364 b4_parser_file_name and b4_spec_defines_file instead of
4365 @output_parser_name@ and @output_header_name@, which are now redundant.
4366 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
4367 b4_parser_file_name, b4_spec_defines_file, and the new
4368 @basename(FILENAME@) instead of @output_parser_name@ and
4369 @output_header_name@, which inappropriately escaped the file names as
4370 C string literals.
4371 * src/files.c (all_but_ext): Remove static qualifier.
4372 (compute_output_file_names): Move `free (all_but_ext)' to...
4373 (output_file_names_free): ... here since all_but_ext is needed later.
4374 * src/files.h (all_but_ext): Extern.
4375 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
4376 exactly what MUSCLE_INSERT_STRING used to do.
4377 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
4378 characters are escaped properly.
4379 * src/output.c (prepare): Define muscle file_name_all_but_ext as
4380 all_but_ext.
4381 For pkgdatadir muscle, maintain previous functionality by using
4382 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
4383 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
4384 digraphs would never be expanded. Hopefully no one has M4-special
4385 characters in his Bison installation path.
4386 * src/scan-skel.l: Don't parse @output_header_name@ and
4387 @output_parser_name@ anymore since they're now redundant.
4388 In @output, use decode_at_digraphs.
4389 Parse a new @basename command that invokes last_component.
4390 (decode_at_digraphs): New.
4391 (BASE_QPUTS): Remove unused.
4392 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
4393 (Output file name): New tests.
4394
4395 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
4396
4397 Warn about output files that are generated by the skeletons and that
4398 conflict with other output files.
4399 * data/glr.c: Don't generate the header file here when glr.cc does.
4400 * src/files.c (file_names, file_names_count): New static globals.
4401 (compute_output_file_names): Invoke output_file_name_check for files
4402 not generated by the skeletons and remove existing checks.
4403 (output_file_name_check): New function that warns about conflicting
4404 output file names.
4405 (output_file_names_free): Free file_names.
4406 * src/files.h (output_file_name_check): Declare.
4407 * src/scan-skel.l: Invoke output_file_name_check for files generated by
4408 the skeletons.
4409 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
4410 (Conflicting output files): New tests.
4411
4412 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4413
4414 * doc/bison.texinfo: Fix a couple of typos.
4415
4416 2006-12-08 Bob Rossi <bob@brasko.net>
4417
4418 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
4419 Rename to...
4420 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
4421 update all uses.
4422 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
4423 (yypush_parse): Rename yypvars argument to yyps and remove redundant
4424 local pv.
4425 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
4426 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
4427
4428 2006-12-07 Bob Rossi <bob@brasko.net>
4429 and Joel Denny <jdenny@ces.clemson.edu>
4430
4431 * data/push.c (yypvarsinit): Change return type from void* to struct
4432 yypvars*. No longer cast to void* on return.
4433 (struct yypvars): Remove yylen since it need not be remembered between
4434 yypushparse invocations.
4435 (yypushparse): Don't copy between yylen and pv->yylen.
4436
4437 2006-12-05 Bob Rossi <bob@brasko.net>
4438
4439 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
4440 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
4441 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
4442 (struct yypvars): Remove b4_declare_parser_variables.
4443 (yypvarsinit): Remove init code for removed variables.
4444 (global scope): Do not declare b4_declare_parser_variables if
4445 push or pure mode.
4446 (yypushparse): Add b4_declare_parser_variables.
4447 Init new local variables, and remove init code for removed
4448 yypvars variables.
4449 (yyparse): Delete.
4450 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
4451 and yyparse for other modes.
4452 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
4453 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
4454 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
4455 (AT_PURE_LEX_IF): True if pure or push parser.
4456
4457 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
4458
4459 Document Yacc prologue alternatives and default %destructor's and
4460 %printer's as experimental. Don't mention Java yet. Discussed at
4461 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
4462 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
4463 (2.3a): Annotate this entry to say the old forms of these features were
4464 also experimental.
4465 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
4466 Table of Symbols): Say they're experimental. Comment out any mention
4467 of Java (we'll want this back eventually).
4468
4469 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4470
4471 Support a file name argument to %defines. Deprecate `=' in
4472 %file-prefix, %name-prefix, and %output. Discussed at
4473 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
4474 * NEWS (2.3a+): Mention.
4475 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
4476 form of %defines, and remove `=' from entries for %file-prefix,
4477 %name-prefix, and %output.
4478 * src/parse-gram.y (prologue_declaration): Implement.
4479 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
4480 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
4481 all but one occurrence of %name-prefix.
4482 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
4483 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
4484 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
4485 occurrence of each of %file-prefix and %output. Add check for %defines
4486 with argument.
4487 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
4488 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
4489 Remove the `=' from %output.
4490
4491 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
4492
4493 Don't escape $ in test case titles since Autoconf 2.61 now does that
4494 correctly.
4495 * tests/actions.at (Default %printer and %destructor are not for error
4496 or $undefined): Here.
4497 (Default %printer and %destructor are not for $accept): Here.
4498 * tests/input.at (Invalid $n and @n): Here.
4499
4500 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
4501
4502 Rename <!> to <>. Discussed starting at
4503 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
4504 * NEWS (2.3a+): Update.
4505 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
4506 Update.
4507 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
4508 * src/scan-gram.l (INITIAL): Implement.
4509 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
4510 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
4511 comment.
4512 * tests/actions.at (Default tagless %printer and %destructor,
4513 Default tagged and per-type %printer and %destructor,
4514 Default %printer and %destructor are not for error or $undefined,
4515 Default %printer and %destructor are not for $accept,
4516 Default %printer and %destructor for mid-rule values): Update.
4517 * tests/input.at (Default %printer and %destructor redeclared,
4518 Unused values with default %destructor): Update.
4519
4520 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
4521
4522 Don't let %prec take a nonterminal.
4523 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
4524 token.
4525 * tests/input.at (%prec takes a token): New test checking that %prec
4526 won't take a nonterminal.
4527
4528 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4529
4530 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
4531 it was double-quoted.
4532 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
4533 grammar is maintained with Bison's highest standards.
4534 * src/getargs.c: Fix some typos in Doxygen comments.
4535
4536 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4537
4538 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
4539 later. Reported by Paul Eggert in
4540 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
4541 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
4542 * src/scan-code.l (translate_action): Don't bother invoking
4543 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
4544 (code_scanner_free): Instead of invoking
4545 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
4546 which frees more.
4547 * src/scan-gram.l (gram_scanner_free): Likewise.
4548 * src/scan-skel.l (scan_skel): Likewise.
4549
4550 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4551
4552 * src/files.c (tr): Change return type to void.
4553 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
4554 has been called previously for the same key.
4555 (muscle_find): Return storage instead of value so that
4556 --enable-gcc-warnings doesn't produce warnings that the return discards
4557 const. aver that the value and storage are the same since storage
4558 could potentially be NULL when value is not.
4559 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
4560 same as 0.
4561
4562 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4563
4564 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
4565 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
4566 us a slightly cleaner distribution, and also works.
4567 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
4568 gnulib changes.
4569
4570 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
4571 and Paul Eggert <eggert@cs.ucla.edu>
4572
4573 Don't let Bison leak memory except when it complains.
4574 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
4575 (spec_defines_file, dir_prefix): Now char *, not const char *,
4576 since they are freed.
4577 * src/files.c: Likewise.
4578 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
4579 Likewise.
4580 (tr): Now operates in-place. All uses changed.
4581 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
4582 values.
4583 (compute_file_name_parts, compute_output_file_names): Don't store
4584 read-only data in variables that will be freed.
4585 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
4586 src_extension, and header_extension.
4587 (output_file_names_free): New public function to free
4588 spec_verbose_file, spec_graph_file, spec_defines_file,
4589 parser_file_name, and dir_prefix.
4590 * src/getargs.c (getargs): Don't store read-only data in variables that
4591 will be freed.
4592 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
4593 (which previously existed but was unused), and quotearg_free.
4594 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
4595 * src/muscle_tab.c: Likewise.
4596 (muscle_entry): Make the value char const *,
4597 and add a new storage member that is char * and can be freed.
4598 (muscle_entry_free): New private function.
4599 (muscle_init): Use it instead of free.
4600 (muscle_insert, muscle_grow): Update and use new storage member.
4601 (muscle_code_grow): Free the string passed to muscle_grow
4602 since it's not needed anymore.
4603 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
4604 add a new `char *code' member.
4605 ("{...}"): Declare semantic type as code.
4606 * src/scan-code.h (translate_rule_action):
4607 (translate_symbol_action, translate_code, translate_action): Return
4608 `char const *' rather than `char *' since external code should not free
4609 these strings.
4610 * src/scan-code.l: Likewise.
4611 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
4612 which is "{...}" in the parser.
4613 * tests/Makefile.am (maintainer-check-valgrind): Set
4614 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
4615 Valgrind.
4616 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
4617 complain.
4618 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
4619 expecting a non-zero exit status sets --leak-check=summary and
4620 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
4621 this case, and we don't want to hear about it.
4622
4623 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4624
4625 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
4626 instead of from the template, to simplify configuration a bit.
4627 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
4628 and m4/wint_t.m4, as they are needed with the latest gnulib.
4629
4630 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4631
4632 Disable unset/unused mid-rule value warnings by default, and recognize
4633 --warnings=midrule-values to enable them. Discussed starting at
4634 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
4635 * NEWS (2.3a+): Mention.
4636 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
4637 warnings): Add entry for midrule-values subargument.
4638 * src/reader.c (symbol_should_be_used): Don't return true just because
4639 the value is a set/used mid-rule value unless
4640 --warnings=midrule-values was specified.
4641 * tests/input.at (Unused values, Unused values before symbol
4642 declarations): Run tests with and without --warnings=midrule-values.
4643
4644 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
4645 than LIST_FREE directly.
4646
4647 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4648
4649 Finish implementing --warnings=error, which should not be implied by
4650 --warnings=all (or by its synonyms -W and --warnings without
4651 subarguments).
4652 * src/complain.c (set_warning_issued): New function to report that
4653 warnings are being treated as errors and to record an error if so.
4654 Invoke...
4655 (warn_at, warn): ... here.
4656 * src/getargs.c (warnings_args, warnings_types): Reorder so that
4657 "error - warnings are errors" does not appear above "all - all of the
4658 above".
4659 (getargs): For -W and --warnings without subarguments, don't let
4660 FLAGS_ARGMATCH set warnings_error in warnings_flag.
4661 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
4662
4663 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4664
4665 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
4666 empty subargument list. For example: `bison --warnings= parser.y'.
4667
4668 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4669
4670 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
4671 the parser header file so that gcc doesn't warn.
4672
4673 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4674
4675 Split the default %destructor/%printer into two kinds: <*> and <!>.
4676 Discussed starting at
4677 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
4678 * NEWS (2.3a+): Mention.
4679 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
4680 previous change today related to mid-rules.
4681 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
4682 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
4683 (TYPE_TAG_ANY): Add as <*>.
4684 (TYPE_TAG_NONE): Add as <!>.
4685 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
4686 for <*> and <!>.
4687 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
4688 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
4689 * src/symlist.c (symbol_list_default_new): Split into tagged and
4690 tagless versions.
4691 (symbol_list_destructor_set, symbol_list_printer_set): Split
4692 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
4693 SYMLIST_DEFAULT_TAGLESS.
4694 * src/symlist.h: Update symbol_list_default*_new prototypes.
4695 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
4696 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
4697 * src/symtab.c (default_destructor, default_destructor_location,
4698 default_printer, default_printer_location): Split each into tagged and
4699 tagless versions.
4700 (symbol_destructor_get, symbol_destructor_location_get,
4701 symbol_printer_get, symbol_printer_location_get): Implement tagged
4702 default and tagless default cases.
4703 (default_destructor_set, default_printer_set): Split each into tagged
4704 and tagless versions.
4705 * src/symtab.h: Update prototypes.
4706 * tests/actions.at (Default %printer and %destructor): Rename to...
4707 (Default tagless %printer and %destructor): ... this, and extend.
4708 (Per-type %printer and %destructor): Rename to...
4709 (Default tagged and per-type %printer and %destructor): ... this, and
4710 extend.
4711 (Default %printer and %destructor for user-defined end token): Extend.
4712 (Default %printer and %destructor are not for error or $undefined):
4713 Update.
4714 (Default %printer and %destructor are not for $accept): Update.
4715 (Default %printer and %destructor for mid-rule values): Extend.
4716 * tests/input.at (Default %printer and %destructor redeclared): Extend.
4717 (Unused values with default %destructor): Extend.
4718
4719 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4720
4721 Don't apply the default %destructor/%printer to an unreferenced midrule
4722 value. Mentioned at
4723 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
4724 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
4725 like $@n instead of just @n so that the default %destructor/%printer
4726 logic doesn't see them as user-defined symbols.
4727 (symbol_is_dummy): Check for both forms of the name.
4728 * src/reader.c (packgram): Remove the `$' from each midrule symbol
4729 name for which the midrule value is referenced in any action.
4730 * tests/actions.at (Default %printer and %destructor for mid-rule
4731 values): New test.
4732 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
4733 for change to dummy symbol names.
4734
4735 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4736
4737 Warn about unset midrule $$ if the corresponding $n is used.
4738 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
4739 $n usage.
4740 (packgram): Before invoking grammar_rule_check on any rule, make sure
4741 all actions have already been scanned in order to set `used' flags.
4742 Otherwise, checking that a midrule's $$ is set will not always work
4743 properly because the midrule check must forward-reference the midrule's
4744 parent rule.
4745 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
4746 warning.
4747
4748 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4749
4750 More improvements to the documentation of the prologue alternatives:
4751 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
4752 Bison manual.
4753 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
4754 some text to clarify the relative importance of the new directives and
4755 to show how these directives may be viewed as code labels.
4756
4757 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
4758
4759 Similar to the recently removed %before-header, add %code-top as the
4760 alternative to the pre-prologue. Mentioned at
4761 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
4762 Also, let the prologue alternatives appear in the grammar section.
4763 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
4764 (prologue_declaration): Move the existing prologue alternatives to...
4765 (grammar_declaration): ... here and add %code-top.
4766 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
4767
4768 Clean up and extend documentation for the prologue alternatives.
4769 * NEWS (2.3a+): Describe prologue alternatives.
4770 * doc/bison.texinfo (Prologue): Move discussion of prologue
4771 alternatives to...
4772 (Prologue Alternatives): ... this new section, and extend it to discuss
4773 all 4 directives in detail.
4774 (Table of Symbols): Clean up discussion of prologue alternatives and
4775 add %code-top.
4776
4777 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4778
4779 DJGPP specific issues.
4780
4781 * djgpp/config.bat: config.hin has been moved to lib. Adjust
4782 config.bat accordingly.
4783 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
4784 * djgpp/config.site: Likewise.
4785
4786 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
4787
4788 Replace %*-header with %provides, %requires, %code. See discussion at
4789 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
4790
4791 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
4792 (b4_user_start_header): Remove.
4793 * data/glr.c: Use new macros instead of b4_*start_header
4794 and b4_*end_header.
4795 * data/glr.cc: Likewise.
4796 * data/lalr1.cc: Likewise.
4797 * data/push.c: Likewise.
4798 * data/yacc.c: Likewise.
4799
4800 * doc/bison.texinfo: Remove %before-header, rename
4801 %{start,end,after}-header to %requires, %provides, %code.
4802
4803 * src/parse-gram.y: Likewise (also rename token names accordingly).
4804 * src/scan-gram.l: Likewise.
4805 * tests/actions.at: Likewise.
4806
4807 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
4808
4809 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
4810 Problem reported by Joel E. Denny.
4811
4812 2006-10-14 Jim Meyering <jim@meyering.net>
4813
4814 (Sync from coreutils.)
4815 Work also when the working directory (with e.g. coreutils sources)
4816 is version controlled with git, rather than CVS.
4817 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
4818 rather than CVS.
4819 In messages and comments, say e.g., "checked-out sources",
4820 rather than "CVS sources".
4821 (version_controlled_file): New function. Work for git as well as
4822 for CVS. Don't use grep's -q option.
4823 (slurp): Call it here, in place of CVS-specific code.
4824
4825 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
4826
4827 Fix testsuite for ./configure --enable-gcc-warnings:
4828 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
4829 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
4830 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
4831 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
4832 * test/regression.at (Diagnostic that expects two alternatives):
4833 Likewise.
4834
4835 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4836
4837 * bootstrap.conf (gnulib_modules): Add config-h.
4838 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
4839 worry about HAVE_CONFIG_H.
4840 * lib/abitset.c: Likewise.
4841 * lib/bitset.c: Likewise.
4842 * lib/bitset_stats.c: Likewise.
4843 * lib/bitsetv-print.c: Likewise.
4844 * lib/bitsetv.c: Likewise.
4845 * lib/ebitset.c: Likewise.
4846 * lib/get-errno.c: Likewise.
4847 * lib/lbitset.c: Likewise.
4848 * lib/subpipe.c: Likewise.
4849 * lib/timevar.c: Likewise.
4850 * lib/vbitset.c: Likewise.
4851 * lib/bitset.c: Include "bitset.h" first, to test interface.
4852 * lib/bitset_stats.c: Include "bitset_stats.h" first.
4853 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
4854 * lib/bitsetv.c: Include "bitsetv.h" first.
4855 * lib/get-errno.c: Include "get-errno.h" first.
4856 * m4/.cvsignore: Add config-h.m4.
4857 * tests/actions.at (Default %printer and %destructor for ...):
4858 Adjust expected line numbers in output to reflect removal of #if
4859 HAVE_CONFIG_H lines.
4860 * tests/glr-regression.at (Missed %merge type warnings when ...):
4861 Likewise.
4862 * tests/regression.at (Braced code in declaration in rules section):
4863 Likewise.
4864 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
4865 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
4866 Include <config.h> unconditionally.
4867
4868 * bootstrap: Sync from coreutils, as follows:
4869
4870 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4871
4872 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
4873 variable was sometimes used without being initialized. This
4874 messed up the installation of the INSTALL file in some cases.
4875
4876 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4877
4878 * bootstrap (usage, main program, symlink_to_gnulib): Add option
4879 --copy. Inspired by a suggestion from Bruno Haible.
4880
4881 2006-10-03 Jim Meyering <jim@meyering.net>
4882
4883 * bootstrap: Undo last change to this file, since now gnulib-tool
4884 sticks with the automake default in generating dependencies.
4885
4886 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4887
4888 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
4889 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
4890
4891 * doc/bison.1: Add copyright notice.
4892
4893 * data/glr.c: Don't include <stdarg.h>; not used.
4894
4895 * NEWS: The -g and --graph options now output graphs in Graphviz
4896 DOT format, not VCG format.
4897 * doc/bison.1: Likewise.
4898 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
4899 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
4900 of this change in
4901 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
4902 * TODO: Remove Graphviz entry.
4903 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
4904 remove vcg.c, vcg.h, vcg_defaults.h.
4905 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
4906 * src/graphviz.c, src/graphviz.h: New files.
4907 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
4908 * src/files.h: Make comment more generic.
4909 * src/main.c (main): Likewise.
4910 * src/print_graph.h: Likewise.
4911 * src/getargs.c (usage): Make usage description more generic.
4912 * src/print_graph.c: Include graphviz.h rather than vcg.h.
4913 (static_graph, fgraph): Remove. All uses changed to pass
4914 arguments instead of sharing a static var.
4915 (print_core, print_actions, print_state, print_graph):
4916 Output graphviz format rather than VCG format.
4917 * tests/.cvsignore: Remove *.vcg; add *.dot.
4918 * tests/output.at: Expect *.dot files, not *.vcg files.
4919
4920 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
4921 accommodates the 2006-10-08 change.
4922
4923 2006-10-11 Bob Rossi <bob@brasko.net>
4924
4925 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
4926 (b4_yyssa, b4_yyerror_range): New macros.
4927 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
4928 (yypvarsinit): Remove init of removed fields.
4929 (yypushparse): Remove use of removed fields; use new macros instead.
4930
4931 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4932
4933 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
4934 in a push parser. Reindent slightly to match yacc.c better.
4935
4936 2006-10-11 Bob Rossi <bob@brasko.net>
4937
4938 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
4939 yymsg_alloc fields.
4940 (yypvarsinit, yypushparse): Remove init of removed fields.
4941 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
4942
4943 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4944
4945 * THANKS: Add Paolo Bonzini and Bob Rossi.
4946
4947 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
4948
4949 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
4950 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
4951 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
4952 b4_define_user_cde and uses): Remove.
4953 (b4_comment, b4_prefix, b4_sync_start): New.
4954 * data/bison.m4: New file, with most of the content removed from c.m4.
4955 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
4956 * src/output.c (output_skeleton): Pass bison.m4.
4957 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
4958 only if specified.
4959
4960 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
4961
4962 Fix test failure reported by Tom Lane in
4963 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
4964 and try to make such failures easier to catch in the future.
4965 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
4966 that's now the caller's responsibility.
4967 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
4968 Set yychar = YYEOF if it's negative.
4969 * tests/actions.at (yylex): Abort if asked to read past EOF.
4970 * tests/conflicts.at (yylex): Likewise.
4971 * tests/cxx-type.at (yylex): Likewise.
4972 * tests/glr-regression.at (yylex): Likewise.
4973 * tests/input.at (yylex): Likewise.
4974 * tests/regression.at (yylex): Likewise.
4975 * tests/torture.at (yylex): Likewise.
4976
4977 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
4978
4979 Fix problems with translating English-language diagnostics.
4980 * bootstrap: Fix bug introduced in recent bootstrap changes, with
4981 respect to bison-runtime pot generation. The YY_ stuff
4982 wasn't being captured.
4983 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
4984 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
4985 * runtime-po/POTFILES.in: Add data/push.c.
4986
4987 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
4988
4989 Merge bootstrap changes from coreutils.
4990
4991 2006-09-28 Jim Meyering <jim@meyering.net>
4992
4993 Automatically generated dependencies are important even
4994 when all of the sources in a directory come from gnulib.
4995 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
4996 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
4997
4998 2006-09-23 Jim Meyering <jim@meyering.net>
4999
5000 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
5001
5002 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5003
5004 * bootstrap: Add support for --force.
5005 (usage): New function. Describe usage less tersely.
5006 (CVS_only_file): New var.
5007
5008 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
5009
5010 * data/push.c (YYPUSH_MORE): Make it an enum instead.
5011 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
5012 Adjust white space and comments to match GNU style better.
5013
5014 2006-09-20 Bob Rossi <bob@brasko.net>
5015
5016 * data/push.c (yyresult_get): Remove function.
5017 (YYPUSH_MORE): Add #define.
5018 (yypushparse): Modify return value.
5019
5020 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5021
5022 * stamp-h.in: Remove; no longer needed.
5023 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
5024 Remove config.h, config.hin, intl (no longer created).
5025 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
5026 stamp-h1.
5027
5028 Sync bootstrap from coreutils, as follows:
5029
5030 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
5031
5032 * bootstrap (symlink_to_gnulib): New function.
5033 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
5034 to copies-of-gnulib.
5035 (cp_mark_as_generated, slurp, gnulib_files):
5036 Avoid making a copy if it's the same as the old version.
5037 (gnulib_files): Add support for this variable (used by Bison).
5038
5039 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5040
5041 * src/getargs.c (usage): Rework to use conventions similar to
5042 coreutils, to make translation a bit easier and the code a bit
5043 smaller. Problem reported by Tim Van Holder.
5044
5045 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
5046
5047 Use some of gnulib's new modules, taken from coreutils.
5048
5049 * bootstrap: Sync from coreutils, except add support for gnulib_files.
5050 * bootstrap.conf: New file.
5051 (gnulib_modules): Add configmake, inttypes, unistd.
5052 (XGETTEXT_OPTIONS): Add complain, complain_at,
5053 fatal, fatal_at, warn, warn_at, unexpected_end.
5054 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
5055 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
5056 (gl_EARLY): Add.
5057 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
5058 (gl_INIT): Add
5059 (GNULIB_AUTOCONF_SNIPPET): Remove.
5060 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
5061 the pickiest.
5062 * lib/.cvsignore: Add inttypes_.h.
5063 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
5064 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
5065 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
5066 no-longer-necessary initializations.
5067 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
5068 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
5069 use the unistd module.
5070 * src/system.h: Likewise.
5071 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
5072 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
5073 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
5074 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
5075 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
5076 * src/system.h: Include inttypes.h unconditionally, now that we
5077 use the inttypes module. Don't bother to include stdint.h, since
5078 inttypes.h now does that for us.
5079 (LOCALEDIR): Remove, now that we use the configmake module.
5080 * src/getargs.c: Include configmake.h.
5081 * src/main.c: Likewise.
5082 * src/output.c: Likewise.
5083 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
5084 not from $abs_top_builddir, since config.h moved.
5085
5086
5087 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
5088 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
5089
5090 * src/parse-gram.y (symbol_declaration): Don't put statements
5091 before declarations; it's not portable to C89.
5092 * src/scan-code.l (handle_action_at): Likewise.
5093
5094 * src/scan-code.l: Always initialize braces_level; the old code
5095 left it uninitialized and therefore had undefined behavior.
5096
5097 Don't attempt to redefine 'assert', since it runs afoul of
5098 systems where standard headers (mistakenly) include <assert.h>.
5099 Instead, define and use our own alternative, called 'aver'.
5100 * src/reader.c: Don't include assert.h, since we no longer
5101 use assert.
5102 * src/scan-code.l: Likewise.
5103 * src/system.h (assert): Remove, replacing with....
5104 (aver): New function, taking a bool arg. All uses changed.
5105 * src/tables.c (pack_vector): Ensure that aver arg is bool,
5106 not merely an integer.
5107
5108 2006-09-15 Bob Rossi <bob@brasko.net>
5109
5110 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
5111 * data/c.m4 (YYPUSH): New.
5112 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
5113 * src/getargs.c (push_parser): New var.
5114 * src/getargs.h (push_parser): New declaration.
5115 * src/output.c (prepare): Add macro insertion of `push_flag'.
5116 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
5117 (prologue_declaration): Parse %push-parser.
5118 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
5119 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
5120 list of removed lines from the traces observed.
5121 (AT_CHECK_CALC_LALR): Added push parser tests.
5122
5123 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
5124
5125 * NEWS: Version 2.3a.
5126 * configure.ac (AC_INIT): Likewise.
5127
5128 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
5129 "#define YYSTYPE int" that caused "make maintainer-check" to fail
5130 due to header ordering dependencies. I don't know why the #define
5131 was there.
5132
5133 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
5134 runtime cost when YYDEBUG is not defined, and so that some tests
5135 that used to fail now work. Problem and initial suggestion by
5136 Paolo Bonzini.
5137 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
5138 * data/glr.cc (b4_parser_class_name):
5139 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
5140 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
5141 (yydebug_) [YYDEBUG]: New member.
5142 (yycdebug_): Now defined only if YYDEBUG.
5143 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
5144 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
5145 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
5146 if YYYDEBUG.
5147 (debug_stream, set_debug_stream, debug_level, set_debug_level):
5148 Define only if YYDEBUG.
5149 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
5150 set_debug_level.
5151 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
5152 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
5153 AT_CHECK_CALC_GLR_CC that are working now.
5154
5155 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
5156
5157 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
5158 We don't need them in glr.cc, and glr.c defines them.
5159 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
5160 assumes that defining it to anything is the same as defining
5161 it to 1. Problem reported by Paolo Bonzini.
5162
5163 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
5164
5165 * data/c.m4 (b4_null, b4_case): Define.
5166 * src/output.c (prepare_symbols): Use b4_null.
5167 (user_actions_output): Use b4_case.
5168
5169 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
5170
5171 * data/glr.c (b4_shared_declarations): Put start-header first,
5172 before any #includes that we generate, so that feature-test
5173 macros work. Problem reported by Michael Deutschmann in
5174 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
5175 * data/lalr1.cc: Likewise.
5176 * doc/bison.texinfo (Prologue): Document that feature-test macros
5177 should be defined before any Bison declarations.
5178 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
5179 that depend on location.hh after, not before, Bison decls, since
5180 we now include location.hh after the first user prologue.
5181
5182 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
5183 Sander Brandenburg in
5184 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
5185 Also, fix minor white space and comment issues.
5186 (Prologue): Mention that it's better to define feature-test macros
5187 before Bison declarations. Problem reported by Michael Deutschmann.
5188
5189 * README-cvs: Fix typo: "&" should be "&&". Problem reported
5190 by Jim Meyering.
5191 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
5192 This adjusts to recent gnulib changes.
5193
5194 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5195
5196 Finish implementation of per-type %destructor/%printer. Discussed
5197 starting at
5198 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
5199 and
5200 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
5201 * NEWS (2.3+): Add a description of this feature to the default
5202 %destructor/%printer description.
5203 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
5204 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5205 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
5206 list node contains a semantic type.
5207 * src/symtab.c, src/symtab.h: Extend with a table that associates
5208 semantic types with their %destructor's and %printer's.
5209 (semantic_type_from_uniqstr, semantic_type_get,
5210 semantic_type_destructor_set, semantic_type_printer_set): New functions
5211 composing the public interface of that table.
5212 (symbol_destructor_get, symbol_destructor_location_get,
5213 symbol_printer_get, symbol_printer_location_get): If there's no
5214 per-symbol %destructor/%printer, look up the per-type before trying
5215 the default.
5216 * tests/actions.at (Per-type %printer and %destructor): New test case.
5217 * tests/input.at (Default %printer and %destructor redeclared):
5218 Extend to check that multiple occurrences of %symbol-default in a
5219 single %destructor/%printer declaration is an error.
5220 (Per-type %printer and %destructor redeclared, Unused values with
5221 per-type %destructor): New test cases.
5222
5223 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5224
5225 Require default %destructor/%printer to be declared using
5226 %symbol-default instead of an empty symbol list, and start working on
5227 new per-type %destructor/%printer. Discussed at
5228 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
5229 * NEWS (2.3+): Add %symbol-default to example.
5230 * bison.texinfo (Freeing Discarded Symbols): Likewise.
5231 (Table of Symbols): Add entry for %symbol-default.
5232 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
5233 (generic_symlist, generic_symlist_item): New nonterminals for creating
5234 a list in which each item is a symbol, semantic type, or
5235 %symbol-default.
5236 (grammar_declaration): Use generic_symlist in %destructor and %printer
5237 declarations instead of symbols.1 or an empty list.
5238 (symbol_declaration, precedence_declaration, symbols.1): Update actions
5239 for changes to symbol_list.
5240 * src/reader.c: Update for changes to symbol_list.
5241 * src/scan-code.l: Likewise.
5242 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
5243 * src/symlist.c, src/symlist.h: Extend such that a list node may
5244 represent a semantic type or a %symbol-default in addition to just an
5245 ordinary symbol. Add switched functions for setting %destructor's and
5246 %printer's.
5247 * tests/actions.at, tests/input.at: Add %symbol-default to all default
5248 %destructor/%printer declarations.
5249
5250 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
5251
5252 Whether the default %destructor/%printer applies to a particular symbol
5253 isn't a question of whether the user *declares* that symbol (in %token,
5254 for example). It's a question of whether the user by any means
5255 *defines* the symbol at all (by simply using a char token, for
5256 example). $end is defined by Bison whereas any other token with token
5257 number 0 is defined by the user. The error token is always defined by
5258 Bison regardless of whether the user declares it with %token, but we
5259 may one day let the user define error as a nonterminal instead.
5260 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
5261 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
5262 the meaning of "user-defined".
5263 * tests/actions.at (Default %printer and %destructor for user-declared
5264 end token): Rename to...
5265 (Default %printer and %destructor for user-defined end token): ...
5266 this.
5267
5268 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
5269 computation of whether to apply the default, don't maintain a list of
5270 every Bison-defined symbol. Instead, just check for a first character
5271 of '$', which a user symbol cannot have, and check for the error token.
5272
5273 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
5274
5275 Don't apply the default %destructor or %printer to the error token,
5276 $undefined, or $accept. This change fits the general rule that the
5277 default %destructor and %printer are only for user-declared symbols,
5278 and it solves several difficulties that are described in the new test
5279 cases listed below.
5280 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
5281 * tests/actions.at (Default %printer and %destructor are not for error
5282 or $undefined, Default %printer and %destructor are not for $accept):
5283 New test cases.
5284
5285 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
5286
5287 Allow %start after the first rule.
5288 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
5289 when parsing the first rule.
5290 (check_and_convert_grammar): Search for it here after all grammar
5291 declarations have been parsed. Skip midrules, which have dummy LHS
5292 nonterminals.
5293 * src/symtab.c (symbol_is_dummy): New function.
5294 * src/symtab.h (symbol_is_dummy): Declare it.
5295 * tests/input.at (%start after first rule): New test.
5296
5297 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5298
5299 Redo some of the previous commit: add back the ability to use
5300 non-aliased/undeclared string literals since it might be useful to
5301 those declaring %token-table.
5302 * src/reader.c (check_and_convert_grammar): Undo changes in previous
5303 commit: don't worry about complaints from symbols_pack.
5304 * src/symtab.c (symbol_new, symbol_class_set,
5305 symbol_check_alias_consistency): Undo changes in previous commit: count
5306 each string literal as a new symbol and token, assign it a symbol
5307 number, and don't complain about non-aliased string literals.
5308 (symbols_pack): Since symbol_make_alias still does not decrement symbol
5309 and token counts but does still set aliased tokens to the same number,
5310 symbol_pack_processor now leaves empty slots in the symbols array.
5311 Remove those slots.
5312 * tests/regression.at (Undeclared string literal): Remove test case
5313 added in previous commit since non-aliased string literals are allowed
5314 again.
5315 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
5316 remove unnecessary string literal declarations.
5317 * tests/sets.at (Firsts): Likewise.
5318
5319 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5320
5321 Don't allow an undeclared string literal, but allow a string literal to
5322 be used before its declaration.
5323 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
5324 symbols_pack complained.
5325 * src/symtab.c (symbol_new): Don't count a string literal as a new
5326 symbol.
5327 (symbol_class_set): Don't count a string literal as a new token, and
5328 don't assign it a symbol number since symbol_make_alias does that.
5329 (symbol_make_alias): It's not necessary to decrement the symbol and
5330 token counts anymore. Don't assume that an alias declaration occurs
5331 before any uses of the identifier or string, and thus don't assert that
5332 one of them has the highest symbol number so far.
5333 (symbol_check_alias_consistency): Complain if there's a string literal
5334 that wasn't declared as an alias.
5335 (symbols_pack): Bail if symbol_check_alias_consistency failed since
5336 symbol_pack asserts that every token has been assigned a symbol number
5337 although undeclared string literals have not.
5338 * tests/regression.at (String alias declared after use, Undeclared
5339 string literal): New test cases.
5340 (Characters Escapes, Web2c Actions): Declare string literals as
5341 aliases.
5342 * tests/sets.at (Firsts): Likewise.
5343
5344 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
5345
5346 In the grammar scanner, STRING_FINISH unclosed constructs and return
5347 them to the parser in order to improve error messages.
5348 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
5349 SC_BRACED_CODE, SC_PROLOGUE): Implement.
5350 * tests/input.at (Unclosed constructs): New test case.
5351 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
5352 seen.
5353
5354 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
5355 unused global.
5356
5357 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
5358
5359 Handle string aliases for character tokens correctly.
5360 * src/symtab.c (symbol_user_token_number_set): If the token has an
5361 alias, check and set its alias's user token number instead of its own,
5362 which is set to indicate the alias. Previously, every occurrence of
5363 the character token in the grammar overwrote that alias indicator with
5364 the character code.
5365 * tests/input.at (String aliases for character tokens): New test.
5366
5367 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
5368
5369 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
5370
5371 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
5372
5373 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
5374 to prevent failures when building on older platforms.
5375 Check for autopoint failure.
5376 Set XGETTEXT_OPTIONS to values that check for C format strings,
5377 so that translators are warned about them (this also helps
5378 prevent core dumps).
5379
5380 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
5381 function, since it simplifies our code a bit.
5382
5383 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
5384 rather than -W, so we don't get bogus warnings about sign comparisons.
5385 Add -Wpointer-arith, since that warning is useful (it reports code
5386 that does not conform to C89 and that some compilers reject).
5387 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
5388 since it's no longer needed.
5389
5390 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
5391
5392 Clean up scanners a bit.
5393 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
5394 definitions so gcc won't warn when obstack_for_string is unused.
5395 * src/scan-code.l: config.h and system.h are already #include'd by
5396 scan-code-c.c, so get rid of them here.
5397 * src/scan-gram.l: Likewise.
5398 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
5399 definitions rather than duplicating the rest of it.
5400 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
5401
5402 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
5403
5404 Suppress signed/unsigned comparison warnings for yycheck.
5405 * data/c.m4 (b4_safest_int_type): New macro.
5406 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
5407 a signed int type, cast it to b4_safest_int_type first.
5408 * data/yacc.c: Likewise.
5409 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
5410 also overwritten.
5411
5412 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5413
5414 * doc/bison.texinfo: Fix some typos.
5415
5416 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
5417
5418 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
5419 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
5420
5421 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
5422 the latest gnulib does this a different way.
5423 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
5424 translation was patched, so stop omitting it.
5425
5426 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5427
5428 Enable declaration of default %printer/%destructor. Make the parser
5429 use these for all user-declared grammar symbols for which the user does
5430 not declare a specific %printer/%destructor. Thus, the parser uses it
5431 for token 0 if the user declares it but not if Bison generates it as
5432 $end. Discussed starting at
5433 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
5434 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
5435 and
5436 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
5437 * NEWS (2.3+): Mention.
5438 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
5439 declare a %destructor for a mid-rule's semantic value. It's just
5440 impossible to declare one specific to it.
5441 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
5442 code. Describe default %destructor form.
5443 * src/parse-gram.y (grammar_declaration): Parse default
5444 %printer/%destructor declarations.
5445 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
5446 and symbol_destructor_location_get rather than accessing the destructor
5447 and destructor_location members of struct symbol.
5448 (symbol_printers_output): Likewise but for %printer's.
5449 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
5450 again.
5451 * src/symtab.c (default_destructor, default_destructor_location,
5452 default_printer, default_printer_location): New static global
5453 variables to record the default %destructor and %printer.
5454 (symbol_destructor_get, symbol_destructor_location_get,
5455 symbol_printer_get, symbol_printer_location_get): New functions to
5456 compute the appropriate %destructor and %printer for a symbol.
5457 (default_destructor_set, default_printer_set): New functions to set the
5458 default %destructor and %printer.
5459 * src/symtab.h: Prototype all those new functions.
5460 * tests/actions.at (Default %printer and %destructor): New test to
5461 check that the right %printer and %destructor are called, that they're
5462 not called for $end, and that $$ and @$ work correctly.
5463 (Default %printer and %destructor for user-declared end token): New
5464 test to check that the default %printer and %destructor are called for
5465 a user-declared end token.
5466 * tests/input.at (Default %printer and %destructor redeclared, Unused
5467 values with default %destructor): New tests to check related grammar
5468 warnings and errors.
5469
5470 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5471
5472 Clean up handling of %destructor for the end token (token 0).
5473 Discussed starting at
5474 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
5475 and
5476 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
5477
5478 Make the skeletons consistent in how they pop the end token and invoke
5479 its %destructor.
5480 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
5481 state, which has token number 0, since this would invoke the
5482 %destructor for the end token.
5483 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
5484 until after shifting the end token, or else it won't be popped.
5485 * data/yacc.c (yyparse): Likewise.
5486
5487 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
5488 it's the end token. Upon termination, destroy an unshifted lookahead
5489 even when it's the end token.
5490 * data/lalr1.cc (yy::parser::parse): Likewise.
5491 * data/yacc.c (yyparse): Likewise.
5492
5493 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
5494 value warnings for the end token when the user gives the end token a
5495 %destructor.
5496
5497 * tests/actions.at (Printers and Destructors): Test all the above.
5498
5499 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
5500
5501 Update to latest gnulib and gettext versions.
5502 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
5503 Add fopen-safer.
5504 (gnulib_files): Add m4/warning.m4. Don't worry about files
5505 overwritten by autopoint.
5506 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
5507 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
5508 rejects them.
5509 Don't use autoreconf; instead, invoke autopoint etc. by hand,
5510 so that we can remove the intl files at a better time.
5511 (intl_files_to_remove): Remove aclocal.m4, since it gets
5512 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
5513 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
5514 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
5515 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
5516 Remove datarootdir hack; no longer needed.
5517 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
5518 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
5519 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
5520 strdup.h.
5521 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
5522 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
5523
5524 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
5525
5526 * bootstrap: Adjust to today's change to gnulib-tool by invoking
5527 it with --assume-autoconf='latest-stable'.
5528
5529 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
5530
5531 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
5532 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
5533 YYSTYPE' and `{'.
5534 * src/muscle_tab.h (muscle_grow): Replace the header comments with
5535 those from muscle_tab.c since the old ones are misleading.
5536
5537 2006-07-13 Akim Demaille <akim@epita.fr>
5538
5539 Support %define "KEY" {VALUE}.
5540 * src/scan-code.h, src/scan-code.l (translate_action)
5541 (translate_rule_action, translate_symbol_action, translate_code):
5542 Return char *, not const char *.
5543 * src/parse-gram.y (declaration): Rename as...
5544 (prologue_declaration): this.
5545 (string_content): Remove this nonterminal, use STRING.
5546 (braceless, content, content.opt): New nonterminal.
5547 Use them.
5548 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
5549 as value.
5550 * src/scan-gram.l (getargs.h): Don't include it.
5551
5552 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
5553
5554 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
5555 rather than a for-loop that declares a local bool variable. This
5556 should work around a compatibility problem with a Cray x1e C++
5557 compiler reported by Hung Nguyen in
5558 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
5559 The for-loop was introduced in the 2004-11-17 change but I don't
5560 know why it was needed.
5561
5562 2006-07-12 Akim Demaille <akim@epita.fr>
5563
5564 * data/c.m4: Comment changes.
5565
5566 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
5567
5568 * src/complain.c (error_message, ERROR_MESSAGE): New.
5569 To factor...
5570 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
5571 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
5572
5573 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5574
5575 * NEWS: Instead of %union, you can define and use your own union type
5576 YYSTYPE if your grammar contains at least one <type> tag.
5577 Your YYSTYPE need not be a macro; it can be a typedef.
5578 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
5579 (Union Decl, Decl Summary): Document this.
5580 * data/glr.c (YYSTYPE): Implement this.
5581 * data/glr.cc (YYSTYPE): Likewise.
5582 * data/lalr1.cc (YYSTYPE): Likewise.
5583 * data/yacc.c (YYSTYPE): Likewise.
5584 * src/output.c (prepare): Output tag_seen_flag.
5585 * src/parse-gram.y (declaration, grammar_declaration):
5586 Use 'union_seen' rather than 'typed' to determine whether
5587 %union has been seen, since grammars can now be typed without
5588 %union.
5589 (symbol_declaration, type.opt, symbol_def):
5590 Keep track of whether a tag has been seen.
5591 * src/reader.c (union_seen, tag_seen): New vars.
5592 (typed): remove.
5593 * src/reader.h (union_seen, tag_seen, typed): Likewise.
5594 * src/scan-code.l (untyped_var_seen): New variable.
5595 (handle_action_dollar): Adjust to above changes.
5596 (handle_action_dollar, handle_action_at):
5597 Improve overflow checking for outlandish numbers.
5598 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
5599 avoid new diagnostics generated by above changes.
5600 * tests/regression.at (YYSTYPE typedef): Add test to check
5601 for type tags without %union.
5602
5603 * src/symlist.c (symbol_list_length): Return int, not unsigned
5604 int, since callers expect int. This may need to get revisited
5605 once we have proper integer overflow checking.
5606
5607 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
5608 object is now static.
5609
5610 * src/getargs.c (flags_argmatch): Return void, not int,
5611 to pacify ./configure --enable-gcc-warnings.
5612
5613 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
5614 since last_string is already defined to FLEX_PREFIX (last_string).
5615
5616 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
5617
5618 Implement --warnings/-W.
5619 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
5620 replaced by...
5621 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
5622 Adjust callers.
5623 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
5624 (warnings_args, warnings_types): New.
5625 (getargs, short_options, long_options): Accept -W/--warnings.
5626 Sort the options by alphabetical order, upper case letter right
5627 before its lower case.
5628
5629 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5630
5631 Change %merge result type clash warnings to errors. Discussed at
5632 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
5633 * src/reader.c (record_merge_function_type): Use complain_at.
5634 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5635 declared later): Update test case results.
5636
5637 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
5638
5639 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
5640 to be in alphabetical order.
5641 (trace_args): Spelling fixes.
5642
5643 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5644
5645 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
5646 so they don't collide with user-defined macros.
5647 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
5648 this was never guaranteed, and now that we're using gnulib stdint,
5649 which defines int_fast16_t to long int, the problem is exposed.
5650
5651 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
5652
5653 * data/c.m4 (b4_basename): Simplify a bit, since we don't
5654 need the full POSIX semantics (and weren't implementing them
5655 anyway).
5656
5657 Adjust to Autoconf 2.60 and today's gnulib.
5658 * bootstrap (gnulib_modules): Add stdint.
5659 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
5660 no longer copies it.
5661 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
5662 since stdint needs the former and wcwidth (which is now required
5663 by mbswidth) needs the latter.
5664 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
5665 work around a compatibility glitch between gettext 0.14.6 and
5666 Autoconf 2.60.
5667 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
5668 Do not check for uintptr_t, since new stdint module does the right
5669 thing.
5670 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
5671 Add stdint.h, stdint_.h, wcwidth.h.
5672 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
5673 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
5674 stdint.m4, wchar_t.m4, wcwidth.m4.
5675 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
5676 usual order for ../lib/*.h files.
5677 (file_name_split): Use last_component, not base_name, to adjust
5678 to gnulib changes.
5679 * src/parse-gram.h: Include <strverscmp.h> in the usual order
5680 for ../lib/*.h files.
5681 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
5682 Define unconditionally, since we now assume the stdint module.
5683 * src/scan-skel.l: Include <dirname.h>.
5684 (BASE_QPUTS): Use last_component, not base_name.
5685 * src/system.h: Include <unlocked-io.h> in the usual order
5686 for ../lib/*.h files. Include <stdint.h> unconditionally,
5687 since we now use the stdint module.
5688 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
5689 HAVE_UINTPTR_T, since we now use the stdint module.
5690 (base_name): Remove decl, since files now include <dirname.h>
5691 to get the decl.
5692
5693 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
5694
5695 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
5696 New, default to 1.
5697 * data/yacc.c, data/glr.c, data/location.cc: Use them.
5698 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
5699 default.
5700 * tests/calc.at: Adjust.
5701
5702 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
5703
5704 * data/c.m4 (b4_basename): New.
5705 (b4_syncline): Also output the location of its invocation (from
5706 the skeleton).
5707 (b4_user_action, b4_define_user_action, b4_user_actions)
5708 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
5709 (b4_user_stype): New.
5710 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
5711
5712 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5713
5714 In the grammar file, the first column is 1 not 0 on the first line as
5715 on every other line.
5716 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
5717 * tests/input.at (Torturing the Scanner): Update output.
5718
5719 * src/scan-gram.l (scanner_cursor): Declare it static.
5720
5721 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5722
5723 In warnings, say "previous declaration" rather than "first
5724 declaration".
5725 * src/symtab.c (redeclaration): Do that here.
5726 * src/reader.c (record_merge_function_type): In the case of a result
5727 type clash, report the previous declaration rather than the very first
5728 one in the grammar file.
5729 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5730 declared later): Add a third declaration to check this behavior.
5731 * tests/input.at (Incompatible Aliases): Update output.
5732
5733 2006-06-27 Akim Demaille <akim@epita.fr>
5734
5735 * doc/Doxyfile.in: New.
5736 * doc/Makefile.am: Use it.
5737 * src/lalr.h, src/symtab.h: Initial doxygenation.
5738
5739 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5740
5741 Don't miss %merge result type warnings just because the LHS types are
5742 declared after the %merge. This continues the effort of the previous
5743 patch.
5744 * src/reader.c (get_merge_function): Don't set the merger type yet.
5745 (record_merge_function_type): New function for setting the merger type
5746 and checking for clashes.
5747 (grammar_current_rule_merge_set): Set the location of the %merge for
5748 the current rule.
5749 (packgram): Invoke record_merge_function_type for each rule now that
5750 all symbol type declarations have been parsed.
5751 * src/reader.h (merger_list.type_declaration_location): New member
5752 storing the location of the first %merge from which the type for this
5753 merging function was derived.
5754 * src/symlist.h (symbol_list.merger_declaration_location): New member
5755 storing the location of a rule's %merge, if any.
5756 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5757 declared later): New test to catch the error fixed by the above patch.
5758
5759 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5760
5761 Get action warnings (grammar_rule_check) right even when symbol
5762 declarations appear after the rules. Discussed at
5763 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
5764 and
5765 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
5766 Don't mistake the type of $$ in a midrule to be that of its parent
5767 rule's $$.
5768 * src/reader.c (grammar_current_rule_end): Don't invoke
5769 grammar_rule_check yet since not all symbol declarations may have been
5770 parsed yet.
5771 (grammar_midrule_action): Likewise.
5772 Don't record whether the midrule's $$ has been used yet since actions
5773 haven't been translated yet.
5774 Record the midrule's parent rule and its RHS index within the parent
5775 rule.
5776 (grammar_current_rule_action_append): Don't translate the action yet
5777 since not all symbol declarations may have been parsed yet and, thus,
5778 warnings about types for $$, $n, @$, and @n can't be reported yet.
5779 (packgram): Translate the action and invoke grammar_rule_check now that
5780 all symbol declarations have been parsed.
5781 * src/scan-code.l (handle_action_dollar): Now that this is invoked
5782 after parsing the entire grammar file, the symbol list here in the case
5783 of a midrule is actually the midrule's empty RHS, so reference its
5784 parent rule's RHS where necessary.
5785 On the other hand, now that you can already know it's a midrule, you
5786 aren't forced to think $$ has the same type as its parent rule's $$.
5787 (handle_action_at): In the case of a midrule, reference the parent rule
5788 where necessary.
5789 * src/symlist.c (symbol_list_new): Initialize new midrule-related
5790 members.
5791 (symbol_list_length): Now that this is invoked after all rules have
5792 been parsed, a NULL symbol (rather than a NULL symbol list node)
5793 terminates a rule. symbol_list_print already does this correctly.
5794 * src/symlist.h (symbol_list.midrule_parent_rule,
5795 symbol_list.midrule_parent_rhs_index): New members so that midrules can
5796 remember their relationships with their parents.
5797 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
5798 fixed by the above patch.
5799 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
5800 implementing...
5801 (Unused values): ... this old test case and...
5802 (Unused values before symbol declarations): ... this new test case.
5803 This one is the same as `Unused values' except that all symbol
5804 declarations appear after the rules in order to catch the rest of the
5805 errors fixed by the above patch.
5806
5807 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5808
5809 More cleanup.
5810 * src/reader.c (current_rule): Declare it static since it's no longer
5811 used outside this file.
5812 (grammar_current_rule_action_append): Remove redundant arguments from
5813 translate_rule_action invocation.
5814 * src/reader.h (current_rule): Remove this unused extern.
5815 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
5816 * src/scan-code.l (translate_rule_action): Likewise.
5817
5818 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
5819
5820 Clean up yesterday's patch.
5821 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
5822 to...
5823 * src/reader.c (grammar_current_rule_action_append): ... here for
5824 consistency with grammar_current_rule_symbol_append.
5825 * tests/regression.at (Braced code in declaration in rules section):
5826 Make yyerror and yylex static as usual.
5827
5828 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
5829
5830 Fix bug that mistakes braced code in a declaration in the rules section
5831 to be a rule action. Mentioned at
5832 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
5833 * src/scan-gram.l: Move midrule action detection from the start of the
5834 scanning of any braced code to...
5835 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
5836 action. For readability, use $2 and @2 rather than the equivalent
5837 global variables.
5838 * tests/regression.at (Braced code in declaration in rules section):
5839 New test to catch the error fixed by the above patch.
5840
5841 Work on code readability some.
5842 * src/scan-code.l (current_rule): Get rid of this misleading and
5843 redundant declaration: it's actually extern'ed in reader.h.
5844 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
5845 translate_action): Add a rule argument and use it instead of the global
5846 current_rule.
5847 (translate_rule_action): This already receives current_rule through an
5848 argument, so pass it on to translate_action instead of assigning
5849 current_rule to current_rule.
5850 (translate_symbol_action, translate_code): Pass rule = NULL to
5851 translate_action.
5852
5853 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
5854
5855 Rename %before-definitions to %start-header and %after-definitions to
5856 %end-header. Don't use these declarations to separate pre-prologue
5857 blocks from post-prologue blocks. Add new order-independent
5858 declarations %before-header and %after-header as alternatives to the
5859 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
5860 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
5861 * NEWS (2.3+): Update for these changes.
5862 * data/glr.c (b4_before_definitions): Update to...
5863 (b4_start_header): ... this.
5864 (b4_after_definitions): Update to...
5865 (b4_end_header): ... this.
5866 * data/glr.cc: Likewise.
5867 * data/lalr1.cc: Likewise.
5868 * data/yacc.c: Likewise.
5869 * doc/bison.texinfo (The prologue): Update names, and replace remaining
5870 prologue blocks with %*-header declarations.
5871 (Calc++ Parser): Likewise.
5872 (Decl Summary): Update names.
5873 (Table of Symbols): Update description.
5874 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
5875 (PERCENT_END_HEADER): ... this.
5876 (PERCENT_BEFORE_DEFINITIONS): Update to...
5877 (PERCENT_START_HEADER): ... this.
5878 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5879 (declaration): Update token names and m4 macro names.
5880 When parsing %end-header and %start-header, invoke translate_code
5881 before muscle_code_grow, and no longer set global booleans to remember
5882 whether these declarations have been seen.
5883 Parse new %after-header and %before-header.
5884 * src/reader.c (before_definitions, after_definitions): Remove.
5885 (prologue_augment): Accept a new bool argument to specify whether to
5886 augment the pre-prologue or post-prologue.
5887 * src/reader.h (before_definitions, after_definitions): Remove these
5888 extern's.
5889 (prologue_augment): Add new bool argument.
5890 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
5891 (PERCENT_END_HEADER): ... this.
5892 (PERCENT_BEFORE_DEFINITIONS): Update to...
5893 (PERCENT_START_HEADER): ... this.
5894 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5895 * tests/actions.at (Printers and Destructors): Update names.
5896
5897 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
5898
5899 Add comparison operators for C++ location classes. Discussed at
5900 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
5901 * data/c++.m4 (b4_define_location_comparison): New boolean %define
5902 declaration indicating whether filename_type has an operator==. If
5903 filename_type is `std::string', it defaults to `1', `0' otherwise.
5904 * data/location.cc: Iff b4_define_location_comparison is `1', add
5905 operator== and operator!= for class position and for class location.
5906
5907 Some minor fixes.
5908 * src/scan-action.l: Remove unused file.
5909 * src/symtab.c (symbol_printer_set): Use printer_location not
5910 destructor_location.
5911 * src/symtab.h (struct symbol): Replace incorrect source comment for
5912 printer members.
5913 * tests/input.at (Incompatible Aliases): Update output with correct
5914 printer location.
5915
5916 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
5917
5918 Don't put the pre-prologue in the header file. For the yacc.c code
5919 file and the glr.c header and code files, move the pre-prologue before
5920 the token definitions. Add new %before-definitions and
5921 %after-definitions to declare code that will go in both the header file
5922 and code file. Discussed at
5923 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
5924 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
5925 and
5926 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
5927 * NEWS (2.3+): Describe these changes.
5928 * data/glr.c (b4_pre_prologue): Move from within to before...
5929 (b4_shared_declarations): ... this.
5930 Add new b4_before_definitions before b4_token_enums.
5931 Add new b4_after_definitions at the end.
5932 * data/glr.cc (b4_pre_prologue): Replace with...
5933 (b4_before_definitions): ... this in the header file.
5934 (b4_after_definitions): New near the end of the header file.
5935 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
5936 code file right before including the header file.
5937 (b4_before_definitions): New in the previous position of
5938 b4_pre_prologue in the header file.
5939 (b4_after_definitions): New near the end of the header file.
5940 * data/yacc.c: Clean up some m4 quoting especially in the header file.
5941 (b4_token_enums_defines): In the code file, move to right before
5942 YYSTYPE for consistency with the header file.
5943 (b4_before_definitions): New right before b4_token_enums_defines in
5944 both the header and code file.
5945 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
5946 header and code file.
5947 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
5948 of prologues for %union dependencies.
5949 (Decl Summary): In %defines description, mention the effect of
5950 %before-definitions and %after-definitions on the header file.
5951 (Calc++ Parser): Forward declare driver in a %before-definitions rather
5952 than in the pre-prologue so that make check succeeds.
5953 (Table of Symbols): Add entries for %before-definitions and
5954 %after-definitions.
5955 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
5956 %before-definitions.
5957 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
5958 (declaration): Parse those declarations and append to
5959 b4_before_definitions and b4_after_definitions, respectively.
5960 * src/reader.c (before_definitions, after_definitions): New bools to
5961 track whether those declarations have been seen.
5962 (prologue_augment): Add to the post-prologue if %union,
5963 %before-definitions, or %after-definitions has been seen.
5964 * src/reader.h (before_definitions, after_definitions): New extern's.
5965 * src/scan-gram.l: Scan the new declarations.
5966 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
5967 prologue block in a %before-definitions or a %after-definitions based
5968 on whether the %union is declared.
5969 * tests/regression.at (Early token definitions with --yacc, Early token
5970 definitions without --yacc): Move tests for token definitions into the
5971 post-prologue since token names are no longer defined in the
5972 pre-prologue.
5973
5974 2006-06-20 Akim Demaille <akim@epita.fr>
5975
5976 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
5977 (symbol_get): Use it.
5978 * src/parse-gram.y: Use it.
5979
5980 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
5981
5982 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
5983 build succeeds when configured with --enable-gcc-warnings.
5984
5985 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
5986
5987 * src/parse-gram.y (char_name): New function.
5988 (CHAR, STRING, string_content): For %printer, properly escape.
5989 (ID): Prefer fputs to fprintf.
5990 (id): Reindent to be consistent with other rules.
5991 Properly quote char.
5992
5993 The Translation Project changed its way of publishing translations
5994 to maintainers. I haven't received any responses to my request
5995 for supporting the old way, or for documenting the new way. I
5996 have modified 'bootstrap' to use screen scraping
5997 (in this case, HTML scraping). This is unreliable and inelegant,
5998 but I don't see any better way. Yuck.
5999 * bootstrap (TP_URL, WGET_COMMAND): New vars.
6000 (get_translations): New function, which uses HTML scraping to
6001 deduce locations of latest translations.
6002 Use this function to grab both bison and bison-runtime .po files.
6003 Don't bother priming the pump for the runtime-po domain any more,
6004 as it's now translated better than bison is.
6005
6006 2006-06-19 Akim Demaille <akim@epita.fr>
6007
6008 * src/scan-gram.l: No longer "parse" things after `%union' until
6009 `{'. Rather, return a single "%union" token.
6010 No longer make symbols: return strings, and leave the conversion
6011 to symbols to the parser.
6012 (SC_PRE_CODE, token_type): Remove.
6013 * src/parse-gram.y (%union): New field `character'.
6014 Sort tokens.
6015 (CHAR): New token.
6016 (ID, ID_COLON): Now that the scanner no longer makes them
6017 identifiers, adjust all uses to invoke symbol_get.
6018 (id_colon): New, wraps the conversion from string to symbol.
6019 (%union): Accept a possible union_name.
6020 (symbol): Now can be a char.
6021 * data/c.m4 (b4_union_name): Leave a default value.
6022 * data/glr.c, data/yacc.c: Use it.
6023
6024 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
6025
6026 For associating token numbers with token names for "yacc.c", don't use
6027 #define statements unless `--yacc' is specified; always use enum
6028 yytokentype. Most important discussions start at:
6029 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
6030 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
6031 and
6032 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
6033 * NEWS (2.3+): Mention.
6034 * data/c.m4 (b4_yacc_if): New.
6035 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
6036 token #define's.
6037 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
6038 on token name definitions.
6039 * src/getargs.c (usage): Capitalize `Yacc' in English.
6040 * src/output.c (prepare): Define b4_yacc_flag.
6041 * tests/regression.at (Early token definitions): Test that tokens names
6042 are defined before the pre-prologue not just before the post-prologue.
6043 Remove this test case and copy to...
6044 (Early token definitions with --yacc): ... this to test #define's.
6045 (Early token definitions without --yacc): ... and this to test enums.
6046
6047 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
6048
6049 * NEWS: Reword the post-2.3 change to not be so optimistic about
6050 removing the old "look-ahead" spelling.
6051 Update previous look-ahead/lookahead change reports.
6052 * REFERENCES: look-ahead -> lookahead (since that's
6053 what he actually wrote).
6054 * doc/refcard.tex: look ahead -> lookahead,
6055 look-ahead -> lookahead
6056
6057 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
6058
6059 For consistency, use `lookahead' instead of `look-ahead' or
6060 `look_ahead'. Discussed starting at
6061 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
6062 and then at
6063 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
6064 * NEWS: For the next release, note the change to `--report'.
6065 * TODO, doc/bison.1: Update English.
6066 * doc/bison.texinfo: Update English.
6067 (Understanding Your Parser, Bison Options): Document as
6068 `--report=lookahead' rather than `--report=look-ahead'.
6069 * src/conflicts.c: Update English in comments.
6070 (lookahead_set): Rename from look_ahead_set.
6071 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
6072 (resolve_sr_conflict): Rename local look_ahead_tokens to
6073 lookahead_tokens, and update other uses.
6074 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
6075 count_rr_conflicts, conflicts_free): Update uses.
6076 * src/getargs.c (report_args): Move "lookahead" before alternate
6077 spellings.
6078 (report_types): Update uses.
6079 (usage): For `--report' usage description, state `lookahead' spelling
6080 rather than `look-ahead'.
6081 * src/getargs.h (report.report_lookahead_tokens): Rename from
6082 report_look_ahead_tokens.
6083 * src/lalr.c: Update English in comments.
6084 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
6085 (state_lookahead_tokens_count): Rename from
6086 state_look_ahead_tokens_count.
6087 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6088 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
6089 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6090 Update other uses.
6091 Update English in output.
6092 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
6093 * src/print.c: Update English in comments.
6094 (lookahead_set): Rename from look_ahead_set.
6095 (print_reduction): Rename argument lookahead_token from
6096 look_ahead_token.
6097 (print_core, state_default_rule, print_reductions, print_results):
6098 Update uses.
6099 * src/print_graph.c: Update English in comments.
6100 (print_core): Update uses.
6101 * src/state.c: Update English in comments.
6102 (reductions_new): Update uses.
6103 (state_rule_lookahead_tokens_print): Rename from
6104 state_rule_look_ahead_tokens_print, and update other uses.
6105 * src/state.h: Update English in comments.
6106 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
6107 (state_rule_lookahead_tokens_print): Rename from
6108 state_rule_look_ahead_tokens_print.
6109 * src/tables.c: Update English in comments.
6110 (conflict_row, action_row): Update uses.
6111 * tests/glr-regression.at
6112 (Incorrect lookahead during deterministic GLR,
6113 Incorrect lookahead during nondeterministic GLR): Rename
6114 print_look_ahead to print_lookahead.
6115 * tests/torture.at: Update English in comments.
6116 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
6117 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
6118 (Many lookahead tokens): Update uses.
6119 * data/glr.c: Update English in comments.
6120 * lalr1.cc: Likewise.
6121 * yacc.c: Likewise.
6122 * src/conflicts.h: Likewise.
6123 * src/lalr.h: Likewise.
6124 * src/main.c: Likewise.
6125 * src/output.c: Likewise.
6126 * src/parse-gram.c: Likewise.
6127 * src/tables.h: Likewise.
6128 * tests/calc.at: Likewise.
6129
6130 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
6131
6132 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
6133
6134 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
6135
6136 * TODO: Add request from Nelson H. F. Beebe to be able to install
6137 Bison without installing the yacc script.
6138
6139 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6140
6141 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
6142 and yytext if they're already #define'd.
6143 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6144 * src/scan-code-c.c: ... here.
6145 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
6146 <config.h>.
6147
6148 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6149
6150 Get Bison to build again when configured with --enable-gcc-warnings.
6151 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
6152 missing #include's.
6153 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
6154 loc argument as it shadows a global.
6155 * src/scan-gram.l: Remove stray comma that prevents boundary_set
6156 invocation.
6157
6158 * src/.cvsignore: Add scan-code.c.
6159
6160 2006-06-07 Akim Demaille <akim@epita.fr>
6161
6162 * src/scan-gram.l: Move the "add a trailing ; to actions" code
6163 to...
6164 * src/scan-code.l: here.
6165 * tests/input.at (Torturing the Scanner): Fix another location
6166 error.
6167
6168 2006-06-07 Akim Demaille <akim@epita.fr>
6169
6170 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
6171
6172 2006-06-06 Akim Demaille <akim@epita.fr>
6173
6174 Extract the parsing of user actions from the grammar scanner.
6175 As a consequence, the relation between the grammar scanner and
6176 parser is much simpler. We can also split "composite tokens" back
6177 into simple tokens.
6178 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
6179 * src/scan-gram.l (add_column_width, adjust_location): Move to and
6180 rename as...
6181 * src/location.h, src/location.c (add_column_width)
6182 (location_compute): these.
6183 Fix the column count: the initial column is 0.
6184 (location_print): Be robust to ending column being 0.
6185 * src/location.h (boundary_set): New.
6186 * src/main.c: Adjust to scanner_free being renamed as
6187 gram_scanner_free.
6188 * src/output.c: Include scan-code.h.
6189 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
6190 Use boundary_set.
6191 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
6192 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
6193 which is now, again, a separate token.
6194 Adjust all dependencies.
6195 Whereever actions with $ and @ are used, use translate_code.
6196 (action): Remove this nonterminal which is now useless.
6197 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
6198 (grammar_current_rule_action_append): Use translate_code.
6199 (packgram): Bound check ruleno, itemno, and rule_length.
6200 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
6201 (last_string, last_braced_code_loc, max_left_semantic_context)
6202 (scanner_initialize, scanner_free, scanner_last_string_free)
6203 (gram_out, gram_lineno, YY_DECL_): Move to...
6204 * src/scan-gram.h: this new file.
6205 (YY_DECL): Rename as...
6206 (GRAM_DECL): this.
6207 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
6208 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6209 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6210 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6211 Move these declarations, and...
6212 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
6213 these to...
6214 * src/flex-scanner.h: this new file.
6215 * src/scan-gram.l (rule_length, rule_length_overflow)
6216 (increment_rule_length): Remove.
6217 (last_braced_code_loc): Rename as...
6218 (gram_last_braced_code_loc): this.
6219 Adjust to the changes of the parser.
6220 Move all the handling of $ and @ into...
6221 * src/scan-code.l: here.
6222 * src/scan-gram.l (handle_dollar, handle_at): Remove.
6223 (handle_action_dollar, handle_action_at): Move to...
6224 * src/scan-code.l: here.
6225 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
6226 scan-code.h, scan-code-c.c, scan-gram.h.
6227 (EXTRA_bison_SOURCES): Add scan-code.l.
6228 (BUILT_SOURCES): Add scan-code.c.
6229 (yacc): Be robust to white spaces.
6230
6231 * tests/conflicts.at, tests/input.at, tests/reduce.at,
6232 * tests/regression.at: Adjust the column numbers.
6233 * tests/regression.at: Adjust the error message.
6234
6235 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6236
6237 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6238 Use Akim's wording from
6239 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
6240
6241 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6242
6243 Between Bison releases, manually append `+' to the previous Bison
6244 release number, and use that as a signal to automatically print the
6245 ChangeLog's CVS Id keyword from --version. Discussed starting at
6246 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
6247 * ChangeLog: Add Id header.
6248 * configure.ac (AC_INIT): Append `+' to `2.3'.
6249 * src/.cvsignore: Add revision.c.
6250 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
6251 (BUILT_SOURCES): Add revision.c.
6252 (revision.c): New target rule. This file defines a new global variable
6253 named revision. It initializes it with either the Id from ChangeLog
6254 or, if VERSION doesn't contain `+', with the empty string.
6255 * src/getargs.c (version): Print the value of revision.
6256 * src/revision.h: Extern revision.
6257
6258 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
6259
6260 * NEWS: Version 2.3.
6261 * configure.ac (AC_INIT): Likewise.
6262
6263 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
6264
6265 * data/glr.c (YYRECOVERING): Define to be a function-like macro
6266 with no arguments, not as an object-like macro. This is for
6267 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
6268 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
6269 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
6270 Document this.
6271
6272 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
6273
6274 * src/getargs.c (usage): Back out yesterday's modification of the
6275 --help output so that we don't have to wait for translation before
6276 releasing 2.3.
6277
6278 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
6279
6280 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
6281 Problem reported by Akim Demaille.
6282
6283 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6284
6285 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6286
6287 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
6288
6289 * data/yacc.c (yy_reduce_print): Omit trailing white space in
6290 generated source code. Problem reported by Frans Englich in
6291 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
6292
6293 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
6294
6295 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
6296 shell, not within 'make', so that 'make' by an ordinary builder
6297 (using GNU make) does not worry about configuring gzip. This also
6298 works around a bug reported independently by Keith Thompson and by
6299 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
6300 stderr rather than stdout, messing up the build logs.
6301
6302 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6303
6304 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
6305 to make sure that YYID will never be unused. This fixes a 'make
6306 maintainer-check' failure caused by the recent changes to the 'Trivial
6307 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
6308 not used.
6309 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
6310
6311 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6312
6313 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
6314 state before an empty RHS is always resolved here. Only the location
6315 of that state is guaranteed to be resolved, and that's enough. This
6316 fixes the remaining bug reported by Derek M. Jones in
6317 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6318 * tests/glr-regression.at (Uninitialized location when reporting
6319 ambiguity): Test the above case.
6320 Also, the embedded comments in this test case claim it checks the case
6321 of an empty RHS that has inherited the initial location. However, the
6322 corresponding LHS was already resolved, so yyresolveLocations didn't
6323 actually have reason to modify it. Fix this by forcing
6324 nondeterministic operation at the beginning of the parse.
6325
6326 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
6327
6328 * data/c.m4 (b4_yy_symbol_print_generate):
6329 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
6330 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
6331 of the bugs reported today by Derek M Jones in
6332 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6333 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
6334 defined to be a type name without parens or brackets.
6335 (Location Type): Similarly for YYLTYPE.
6336 * tests/regression.at (Trivial grammars): Put in a test for this
6337 bug that will be caught by 'make maintainer-check' (though not,
6338 alas, by 'make check' unless your compiler is picky).
6339
6340 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
6341
6342 * NEWS: Version 2.2.
6343 * configure.ac (AC_INIT): Likewise.
6344
6345 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
6346
6347 * data/glr.c (yyreportTree): Make room in yystates for the state
6348 preceding the RHS. This fixes the segmentation fault reported by Derek
6349 M. Jones in
6350 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
6351 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
6352 to the user. Reported for yyreportTree by Derek M. Jones later in the
6353 same thread.
6354 * THANKS: Add Derek M. Jones.
6355 Update my email address.
6356 Fix typo in Steve Murphy's name.
6357
6358 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
6359
6360 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
6361 checking against YYLAST that caused the parser to miss a potential
6362 alternative in its diagnostic.
6363 Problem reported by Maria Jose Moron Fernandez in
6364 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
6365 * data/lalr1.cc (yysyntax_error_): Likewise.
6366 * data/yacc.c (yysyntax_error): Likewise.
6367 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
6368 tokens, in case we run into an older C compiler.
6369 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
6370 Use them to check for the off-by-one error fixed above.
6371
6372 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
6373 YYSIZE_T, not size_t.
6374 * tests/regression.at (Trivial grammars): New test, to catch
6375 the error fixed by the above patch.
6376
6377 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6378
6379 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
6380 scheme.
6381 Reported by Steve Murphy.
6382
6383 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6384
6385 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
6386 * data/glr.cc: b4_location_flag is now b4_locations_flag.
6387
6388 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6389
6390 Implement --trace=m4.
6391 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
6392 * src/output.c (output_skeleton): When set, pass -dV to m4.
6393
6394 Factor the handling of flags in m4.
6395 * src/output.c (prepare): Rename the muscle names debug, defines,
6396 error_verbose to debug_flag, defines_flag, error_verbose_flag.
6397 * data/c.m4: Adjust.
6398 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
6399 Use b4_define_flag_if to define other b4_FLAG_if macros.
6400 (b4_location_if): As a consequence, rename as...
6401 (b4_locations_if): this, for consistency.
6402 Adjust all the skeletons.
6403
6404 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6405
6406 * etc/bench.pm: Shorten bench names.
6407
6408 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6409
6410 * src/output.h, src/output.c (error_verbose): Move to...
6411 * src/getargs.h, src/getargs.c: here.
6412 Sort the flags.
6413 Adjust dependencies.
6414
6415 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
6416
6417 * data/c.m4 (b4_copyright): Put the special exception for Bison
6418 skeletons here, so we don't have to put it in each skeleton. All
6419 uses changed. Suggested by Akim Demaille. Also, wrap the
6420 copyright notice, in case it is longer than 80 columns. Replace
6421 comma by newline after title.
6422
6423 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
6424
6425 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
6426 incompatibility, not a bug. Mention that it wasn't fixed as of
6427 flex 2.5.33.
6428
6429 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
6430
6431 * examples/extexi: Enforce the precedence of concatenation over
6432 >>.
6433 Reported by Tommy Nordgren.
6434
6435 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
6436
6437 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
6438 with the member "token".
6439 Reported by Martin Nylin.
6440
6441 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
6442
6443 * data/glr.c: Switch to Bison 2.2 special-exception language in
6444 the copyright notice. Use more-regular format for titles and
6445 copyright notices.
6446 * data/glr.cc: Likewise.
6447 * data/location.cc: Likewise.
6448 * data/yacc.cc: Likewise.
6449 * doc/bison.texinfo (Conditions): Document this.
6450 * NEWS: likewise. Upgrade version to 2.2.
6451
6452 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
6453
6454 * data/glr.cc: Remove dead code.
6455
6456 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
6457
6458 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
6459 that variable and the line breaks the bootstrap. Problem reported
6460 by Juan M. Guerrero.
6461
6462 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
6463
6464 * doc/bison.texinfo (Multiple start-symbols): New.
6465
6466 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
6467
6468 * etc/README, etc/bench.pl: New.
6469
6470 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
6471
6472 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
6473 rule.
6474 Reported by Mickael Labau.
6475 * tests/input.at (Torturing the Scanner): Test it.
6476
6477 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
6478
6479 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
6480 Problem reported by Bob Rossi.
6481
6482 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
6483
6484 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
6485 and didn't really work.
6486 For the index, use @ifnotinfo, not @iftex.
6487 Minor cleanups of spacing and terminology.
6488
6489 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
6490
6491 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
6492 of AT_NAME_PREFIX when %name-prefix is not used.
6493
6494 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
6495
6496 Apply --prefix to C++ skeletons too: they change the namespace.
6497 The test suite already exercize these cases.
6498 * data/c++.m4 (b4_namespace): New.
6499 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
6500 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
6501 * data/yacc.c, data/glr.c: Remove a useless `[]'.
6502 * doc/bison.texinfo: Document it.
6503 (Option Cross Key): Use @multitable in all formats. It looks
6504 nicer, even in TeX outputs.
6505 (Rules): Use the same code whatever the output type is.
6506 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
6507 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
6508 * tests/calc.at: Use it, instead of hard coding `yy'.
6509
6510 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
6511
6512 * TODO: Remove dead items.
6513
6514 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
6515
6516 * doc/FAQ: Remove, merged into...
6517 * doc/bison.texinfo (FAQ): this.
6518 * doc/Makefile.am (EXTRA_DIST): Adjust.
6519
6520 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
6521
6522 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
6523 even if empty.
6524 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
6525 * doc/bison.texinfo (Calc++ Scanner): Use it.
6526
6527 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
6528
6529 Fix two nits reported by twlevo, plus one more that I discovered.
6530
6531 * src/assoc.h (assoc_to_string): Give a name to the arg, as
6532 this is the usual Bison style.
6533 * src/location.h (location_print): Likewise.
6534
6535 * src/reader.h (token_name): Likewise.
6536
6537 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
6538
6539 Fix some nits reported by twlevo.
6540 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
6541 and "POSIX". Use more-modern syntax for URLs. Mention C++
6542 and ask for Java. Don't hardwire OS version numbers. Add
6543 copyright notice.
6544 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
6545 * src/conflicts.c (solved_conflicts_obstack): Now static.
6546
6547 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
6548
6549 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
6550 page. Say "you can use it" not "you may use it" as on the web page;
6551 we're describing capabilities not granting permission.
6552
6553 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
6554
6555 * data/glr.c (yyresolveLocations): Rename local variables to avoid
6556 shadowing warnings. Use usual patter for iterating through RHS.
6557 * tests/glr-regression.at
6558 (Uninitialized location when reporting ambiguity):
6559 Modify yylex so that it uses its argument, rather than trying
6560 to rely on ARGSUSED (which doesn't work for gcc with warnings).
6561 const char -> char const.
6562
6563 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
6564 Don't use tabs inside commands; it messes up 'ps'.
6565 Problem reported by twlevo.
6566
6567 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
6568
6569 * tests/glr-regression.at (Uninitialized location when reporting
6570 ambiguity): New test case.
6571 * data/glr.c (yyresolveLocations): New function, which uses
6572 YYLLOC_DEFAULT.
6573 (yyresolveValue): Invoke yyresolveLocations before reporting an
6574 ambiguity.
6575 * doc/bison.texinfo (Default Action for Locations): Note
6576 YYLLOC_DEFAULT's usage for ambiguity locations.
6577 (GLR Semantic Actions): Cross-reference those notes.
6578
6579 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
6580
6581 * tests/glr-regression.at (Leaked semantic values when reporting
6582 ambiguity): Remove unnecessary union and type declarations.
6583 (Leaked lookahead after nondeterministic parse syntax error): New test
6584 case.
6585 * data/glr.c (yyparse): Check for zero stacks remaining before
6586 attempting to shift the lookahead so that you don't lose it.
6587
6588 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6589
6590 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
6591 * tests/glr-regression.at (Leaked semantic values when reporting
6592 ambiguity): New test case.
6593 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
6594 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
6595 now unnecessary yystackp parameter.
6596 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
6597 destructors can be called.
6598
6599 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
6600 in existing testcases.
6601
6602 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6603
6604 Don't leak semantic values for parent RHS when a user action cuts the
6605 parser, and clean up related code a bit.
6606 * tests/glr-regression.at (Leaked merged semantic value if user action
6607 cuts parse): Rename to...
6608 (Leaked semantic values if user action cuts parse): ... this. Add check
6609 for leaked parent RHS values.
6610 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
6611 between an unresolved state (non-empty chain of semantic options) and
6612 an incomplete one (signaled by an empty chain).
6613 (yyresolveStates): Document the interface. Move all manipulation of a
6614 successfully or unsuccessfully resolved yyGLRState to...
6615 (yyresolveValue): ... here so that yyresolveValue always leaves a
6616 yyGLRState with consistent data and thus is easier to understand.
6617 Remove the yyvalp and yylocp parameters since they are always just
6618 taken from the yys parameter. When reporting a discarded merged value
6619 in debugging output, note that it is incompletely merged. Document the
6620 interface.
6621 (yyresolveAction): If resolving any of the RHS states fails, destroy
6622 them all rather than leaking them. Thus, as long as user actions are
6623 written to clean up the RHS correctly, yyresolveAction always cleans up
6624 the RHS of a semantic option. Document the interface.
6625
6626 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
6627
6628 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
6629 led to a segmentation fault in GNU Pascal. Problem reported
6630 by Waldek Hebisch.
6631
6632 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
6633
6634 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
6635 mid-rule action inside a nonterminal symbol in order to declare a
6636 destructor for its semantic value.
6637
6638 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
6639
6640 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
6641 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
6642 __cplusplus && ! defined _STDLIB_H && !
6643 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
6644 defined free))]: Include <stdlib.h> rather than rolling our own
6645 declarations of malloc and free, to avoid problems with
6646 incompatible declarations (using 'throw') C++'s stdlib.h. This
6647 should fix Debian bug 340012
6648 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
6649 reported by Guillaume Melquiond.
6650
6651 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6652
6653 * NEWS: Clarify symbols versus types in unused-value warnings.
6654
6655 * configure.ac (AC_INIT): Bump version number.
6656
6657 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6658
6659 * NEWS: Version 2.1a.
6660 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
6661 since C99 requires this.
6662
6663 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
6664
6665 * m4/c-working.m4: New file.
6666 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
6667
6668 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
6669
6670 * Makefile.maint: Merge from coreutils.
6671
6672 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
6673
6674 More portability fixes for problems summarized by Nelson H. F. Beebe.
6675
6676 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
6677 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
6678 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
6679 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
6680 messes up because C++ code is compiled in 32-bit mode but linked
6681 in 64-bit mode.
6682
6683 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
6684
6685 More portability fixes for problems summarized by Nelson H. F. Beebe.
6686
6687 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
6688 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
6689
6690 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
6691 nodist_PROGRAMS, since we don't need to actually compile the
6692 example if we're just doing a plain 'make'. This avoids bothering
6693 the installer unnecessarily about problems due to weird C++
6694 compilers.
6695
6696 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
6697
6698 More portability fixes for problems summarized by Nelson H. F. Beebe.
6699
6700 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
6701 than #include "...", and compile with -I'.'. The old method was
6702 not portable, according to Posix and the C standard, and it does
6703 not work with Sun C 5.7, where previous #line directives affect
6704 the working directory used in later #include "..." directives.
6705
6706 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6707
6708 Various DJGGP specific issues in /djgpp
6709
6710 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
6711
6712 More portability fixes for problems summarized by Nelson H. F. Beebe.
6713
6714 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
6715 '#include <map>' works and that you can apply ++ to iterators.
6716
6717 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
6718
6719 Work around portability problems summarized by Nelson H. F. Beebe in
6720 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
6721
6722 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6723 that '#include <string>' works.
6724
6725 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
6726 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
6727 "warning: sorry: semantics of inline function static data `const
6728 unsigned char translate_table[262]' are wrong (you'll wind up with
6729 multiple copies)".
6730
6731 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
6732 or, xor to not_, and_, or_, and xor_, respectively. This works
6733 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
6734 random system header somewhere that includes the equivalent of
6735 <iso646.h>.
6736
6737 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
6738 -E" works; it apparently doesn't work with PathScale EKO Compiler
6739 Suite Version 2.0.
6740
6741 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
6742
6743 During deterministic GLR operation, user actions should be able to
6744 influence the parse by changing yychar. To make this easier to fix and
6745 to make glr.c easier to evolve in general, don't maintain yytoken in
6746 parallel with yychar; just compute yytoken when needed.
6747 * tests/glr-regression.at (Incorrect lookahead during deterministic
6748 GLR): Check that setting yychar in a user action has the intended
6749 effect.
6750 * data/glr.c (yyGLRStack): Remove yytokenp member.
6751 (yyclearin): Don't set *yytokenp.
6752 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
6753 yychar rather than *yytokenp to determine the current lookahead.
6754 Compute yytoken locally when needed.
6755 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
6756 point to.
6757
6758 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
6759 after `--report' documentation.
6760
6761 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
6762
6763 * src/parse-gram.y (grammar_declaration): Location of printer
6764 symbol is @1, not list->location. Bug reported by twlevo.
6765 * tests/input.at (Incompatible Aliases): Adjust to above change.
6766
6767 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
6768
6769 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
6770 all the test at once. This makes the output easier to read in the
6771 normal case.
6772
6773 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
6774 got from <http://bro-ids.org/download.html>. The bug is that
6775 when two actions appeared in succession, the second one was
6776 scanned before the first one was added to the grammar rule
6777 as a midrule action. Bison then output the incorrect warning
6778 "parse.y:905.17-906.36: warning: unused value: $3".
6779 * src/parse-gram.y (BRACED_CODE, action): These are no longer
6780 associated with a value.
6781 (rhs): Don't invoke grammar_current_rule_action_append.
6782 (action): Invoke it here instead.
6783 * src/reader.c (grammar_midrule_action): Now extern.
6784 (grammar_current_rule_action_append): Don't invoke
6785 grammar_midrule_action; that is now the scanner's job.
6786 * src/reader.h (last_string, last_braced_code_loc):
6787 (grammar_midrule_action): New decls.
6788 * src/scan-gram.l (last_string): Now extern, sigh.
6789 (last_braced_code_loc): New extern variable.
6790 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
6791 rule already has an action.
6792 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
6793 * tests/input.at (AT_CHECK_UNUSED_VALUES):
6794 Add some tests to check that the above changes fixed the bug.
6795
6796 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
6797
6798 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
6799 All used changed. Check whether the symbol has a destructor,
6800 not whether it is typed.
6801 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
6802 that the values are still reported as unused. All line numbers
6803 adjusted.
6804
6805 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
6806
6807 Work around a bug in bro 0.8, which underparenthesizes its
6808 definition of YYLLOC_DEFAULT.
6809 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
6810 their arguments.
6811 * data/lalr1.cc: Likewise.
6812 * data/yacc.cc: Likewise.
6813
6814 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
6815
6816 Work around a bug in Pike 7.0, and give the Pike folks a
6817 better way to override the usual int widths.
6818 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
6819 user can override the types.
6820 (short): #undef, to work around a bug in Pike 7.0.
6821 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
6822 (union yyalloc.yyss): Use yytype_int16 rather than short.
6823 All uses changed.
6824 (yysigned_char): Remove.
6825 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
6826 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
6827 * tests/regression.at (Web2c Actions): Adjust to above changes.
6828
6829 * src/reader.c (check_and_convert_grammar): New function.
6830 (reader): Close the input file even if something went wrong during
6831 parsing. Minor file descriptor leak reported by twlevo.
6832
6833 * src/assoc.c (assoc_to_string): Use a default: abort (); case
6834 to pacify gcc -Wswitch-default.
6835 * src/scan-gram.l (adjust_location): Use a default: break; case
6836 to pacify gcc -Wswitch-default.
6837 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
6838 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6839 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6840 Move these decls to scan-skel.l, since they don't need to be
6841 visible elsewhere.
6842 * src/scan-skel.l: Accept the above decls.
6843 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
6844 is used.
6845
6846 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
6847
6848 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
6849 since we don't want to insist on a version number at the start
6850 of the changelog every time.
6851 * Makefile.maint: Sync from coreutils a bit better.
6852 (sc_trailing_blank): Renamed from sc_trailing_space.
6853 All uses changed.
6854 (sc_no_if_have_config_h, sc_require_config_h):
6855 (sc_prohibit_assert_without_use): New rules.
6856 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
6857 (sc_dd_max_sym_length): Fix leading spaces in rule.
6858 (sc_system_h_headers): Prefix with @.
6859 (sc_useless_cpp_parens, m4-check): Output line numbers.
6860 (changelog-check): Allow version only in head.
6861 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
6862 satisfy new Makefile.maint rule.
6863 * data/glr.c: Likewise.
6864 * data/glr.cc: Likewise.
6865 * data/lalr1.cc: Likewise.
6866 * data/yacc.c: Likewise.
6867 * lib/ebitsetv.c: Likewise.
6868 * lib/lbitset.c: Likewise.
6869 * lib/subpipe.c: Likewise.
6870 * lib/timevar.c: Likewise.
6871 * src/system.h: Likewise.
6872 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
6873 * djgpp/Makefile.maint: Add copyright notice.
6874 * djgpp/README.in: Likewise.
6875 * djgpp/config.bat: Likewise.
6876 * djgpp/config.site: Likewise.
6877 * djgpp/config_h.sed: Likewise.
6878 * djgpp/djunpack.bat: Likewise.
6879 * djgpp/config.sed: Fix copyright notice to match standard format.
6880 * djgpp/subpipe.h: Likewise.
6881 * lib/bitsetv-print.c: Likewise.
6882 * lib/bitsetv.c: Likewise.
6883 * lib/subpipe.h: Likewise.
6884 * lib/timevar.c: Likewise.
6885 * lib/timevar.h: Likewise.
6886 * djgpp/subpipe.c: Use standard recipe for config.h.
6887 * lib/abitset.c: Likewise.
6888 * lib/bitset.c: Likewise.
6889 * lib/bitset_stats.c: Likewise.
6890 * lib/bitsetv-print.c: Likewise.
6891 * lib/bitsetv.c: Likewise.
6892 * lib/ebitsetv.c: Likewise.
6893 * lib/get-errno.c: Likewise.
6894 * lib/lbitset.c: Likewise.
6895 * lib/subpipe.c: Likewise.
6896 * lib/timevar.c: Likewise.
6897 * lib/vbitset.c: Likewise.
6898 * tests/local.at: Likewise.
6899 * src/scan-gram.l: Don't include verify.h, since system.h does
6900 that for us.
6901 * .x-sc_require_config_h: New file.
6902 * .x-sc_unmarked_diagnostics: New file.
6903
6904 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
6905
6906 Be a bit more systematic about using 'abort'.
6907 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
6908 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
6909 Put 'default: abort ();' before some other case, to satisfy older
6910 pedantic compilers.
6911 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6912 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
6913 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
6914 * src/conflicts.c (resolve_sr_conflict): Likewise.
6915 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
6916 (get_decision_str, get_orientation_str, get_node_alignment_str):
6917 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
6918 (get_linestyle_str, get_arrowstyle_str): Likewise.
6919 * src/conflicts.c (resolve_sr_conflict):
6920 Use a default case rather than one for the one remaining enum
6921 value, to catch invalid enum values as well.
6922 * src/lalr.c (set_goto_map, map_goto):
6923 Prefer "assert (FOO);" to "if (!FOO) abort ();".
6924 * src/nullable.c (nullable_compute, token_definitions_output):
6925 Likewise.
6926 * src/reader.c (packgram, reader): Likewise.
6927 * src/state.c (transitions_to, state_new, state_reduction_find):
6928 Likewise.
6929 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
6930 (symbol_pack): Likewise.
6931 * src/tables.c (conflict_row, pack_vector): Likewise.
6932 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
6933 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
6934 * src/system.h: Don't include <assert.h>.
6935 (assert): New macro.
6936
6937 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
6938 (Destructor Decl, Parser Function, Pure Calling):
6939 Describe rules for braces inside C code more carefully.
6940
6941 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
6942
6943 Fix some porting glitches found by Nelson H. F. Beebe.
6944 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
6945 compilers that don't understand that abort () does not return.
6946 * src/state.c (transitions_to): Likewise.
6947 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6948 that '#include <cstdlib>' works.
6949 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
6950 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
6951 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
6952 for the benefit of some pre-C99 compilers.
6953
6954 * bootstrap: Undo changes to gnulib files that autoreconf made.
6955
6956 Minor fixups to get 'make maintainer-check' to work.
6957 * configure.ac: Don't use -Wnested-externs, as it's incompatible
6958 with the new verify.h implementation.
6959 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
6960 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
6961 * data/yacc.c (YYUSE): Likewise.
6962 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
6963 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
6964 * src/parse-gram.y (declaration): Don't pass a string constant
6965 to a function that expects char *, since GCC might complain
6966 about the constant value.
6967 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
6968 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
6969 before #defining them.
6970 * tests/glr-regression.at
6971 (Incorrectly initialized location for empty right-hand side in GLR):
6972 In yyerror, use the msg arg.
6973 (Corrupted semantic options if user action cuts parse):
6974 (Incorrect lookahead during deterministic GLR):
6975 (Incorrect lookahead during nondeterministic GLR):
6976 Don't name a local var 'index'; it shadows string.h's 'index'.
6977
6978 2006-01-19 Akim Demaille <akim@epita.fr>
6979
6980 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
6981 location, not just parts of it.
6982
6983 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
6984
6985 * NEWS: Document the fact that multiple %unions are now allowed.
6986 * doc/bison.texinfo (Union Decl): Likewise.
6987 * TODO: This feature is now implemented, so remove it from
6988 the wishlist.
6989
6990 * Makefile.maint: Merge with coreutils Makefile.maint.
6991 (CVS_LIST): Use build-aux version if available.
6992 (VERSION_REGEXP): New macro.
6993 (syntax-check-rules): Add sc_no_if_have_config_h,
6994 sc_prohibit_assert_without_use, sc_require_config_h,
6995 sc_useless_cpp_parens.
6996 (sc_obsolete_symbols): Check for O_NDELAY.
6997 (sc_dd_max_sym_length): Track coreutils.
6998 (sc_unmarked_diagnostics): Look in all files, not just *.c.
6999 (sc_useless_cpp_parens): New rule.
7000 (news-date-check): Look for version or today's date.
7001 (changelog-check): Don't require version number near head.
7002 (copyright-check): Use current year instead of hardwiring 2005.
7003 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
7004 (announcement): Add --gpg-key-ID.
7005
7006 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
7007 with "file system".
7008
7009 Avoid undefined behavior that addressed just before the start of an
7010 array. Problem reported by twlevo.
7011 * src/reader.c (packgram): Prepend a new sentinel before ritem.
7012 * src/lalr.c (build_relations): Rely on new sentinel.
7013 * src/gram.c (gram_free): Adjust to new sentinel.
7014
7015 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
7016
7017 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
7018 yylookaheadNeeds. All uses updated.
7019 (yysplitStack): Rename local yynewLookaheadStatuses to
7020 yynewLookaheadNeeds.
7021 * data/glr-regression.at (Incorrect lookahead during nondeterministic
7022 GLR): In comments, change `lookahead status' to `lookahead need'.
7023
7024 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7025
7026 * data/glr.c (yysplitStack): A little stylistic rewrite.
7027
7028 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7029
7030 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
7031
7032 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
7033
7034 * doc/bison.texinfo: Fix some typos.
7035 (GLR Semantic Actions): New subsection discussing special
7036 considerations because GLR semantic actions might be deferred.
7037 (Actions): Mention look-ahead usage of yylval.
7038 (Actions and Locations): Mention look-ahead usage of yylloc.
7039 (Special Features for Use in Actions): Add YYEOF entry and mention it
7040 in the yychar entry.
7041 In the yychar entry, remove mention of the local yychar case (pure
7042 parser) since this is irrelevant information when writing semantic
7043 actions and since it's already discussed in `Table of Symbols' where
7044 yychar is otherwise described as an external variable.
7045 In the yychar entry, don't call it the `current' look-ahead since it
7046 isn't when semantic actions are deferred.
7047 In the yychar and yyclearin entries, add note about deferred semantic
7048 actions.
7049 Add yylloc and yylval entries discussing look-ahead usage.
7050 (Look-Ahead Tokens): When discussing yychar, don't call it the
7051 `current' look-ahead, and do mention yylval and yylloc.
7052 (Error Recovery): Cross-reference `Action Features' when mentioning
7053 yyclearin.
7054 (Table of Symbols): In the yychar entry, don't call it the `current'
7055 look-ahead.
7056 In the yylloc and yylval entries, mention look-ahead usage.
7057
7058 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7059
7060 * tests/glr-regression.at: Update copyright year to 2006.
7061
7062 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7063
7064 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
7065 use during nondeterministic operation to track which stacks have
7066 actually needed the current lookahead.
7067 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
7068 Allocate, deallocate, resize, and otherwise shuffle space for
7069 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
7070 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
7071 appropriately during nondeterministic operation.
7072 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
7073 members to store the current lookahead to be used by the deferred
7074 user action.
7075 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
7076 from which the RHS is taken. Set the lookahead members of the new
7077 yySemanticOption according to the lookahead status for stack yyk.
7078 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
7079 yyaddDeferredAction.
7080 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
7081 members of yySemanticOption before invoking yyuserAction, and then set
7082 them back to their current values afterward.
7083 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
7084 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
7085 * tests/glr-regression.at: Remove `.' from the ends of recent test case
7086 titles for consistency.
7087 (Leaked merged semantic value if user action cuts parse): In order to
7088 suppress lint warnings, use arguments in merge function, and assign
7089 char value < 128 in main.
7090 (Incorrect lookahead during deterministic GLR): New test case.
7091 (Incorrect lookahead during nondeterministic GLR): New test case.
7092
7093 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7094
7095 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
7096 !yyvaluep as signal that no semantic value is available to print.
7097 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
7098 to print a semantic value.
7099
7100 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7101
7102 * tests/glr-regression.at: For consistency with my newer test cases,
7103 don't thank myself.
7104
7105 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7106
7107 * data/glr.c (yyresolveValue): When merging semantic options, if at
7108 least one user action succeeds but a later one cuts the parse, then
7109 destroy the semantic value before returning rather than leaking it.
7110 (yyresolveStates): If a user action cuts the parse and thus
7111 yyresolveValue fails, ignore the (unset) semantic value rather than
7112 corrupting the yyGLRState, and empty the semantic options list since
7113 the user actions should have called all necessary destructors.
7114 Simplify code with YYCHK.
7115 * tests/glr-regression.at (Corrupted semantic options if user action
7116 cuts parse): New test case.
7117 (Undesirable destructors if user action cuts parse): New test case.
7118 Before applying any of this patch, this test case never actually failed
7119 for me... but only because the corrupted semantic options usually
7120 masked this bug.
7121 (Leaked merged semantic value if user action cuts parse): New test
7122 case.
7123
7124 2006-01-05 Akim Demaille <akim@epita.fr>
7125
7126 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
7127
7128 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
7129
7130 * data/c.m4 (b4_c_modern): New macro, with a new provision for
7131 _MSC_VER. Problem reported by Cenzato Marco.
7132 (b4_c_function_def): Use it.
7133 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
7134 b4_c_modern.
7135 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
7136 than rolling our own.
7137
7138 2006-01-04 Akim Demaille <akim@epita.fr>
7139
7140 Also warn about non-used mid-rule values.
7141 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
7142 member.
7143 (symbol_list_new): Adjust.
7144 * src/reader.c (symbol_typed_p): New.
7145 (grammar_rule_check): Use it.
7146 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
7147 Check its rule.
7148 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
7149 Use it.
7150 * tests/actions.at (Exotic Dollars): Adjust.
7151
7152 2006-01-04 Akim Demaille <akim@epita.fr>
7153
7154 * src/reader.c (grammar_midrule_action): If $$ is set in a
7155 mid-rule, move the `used' bit to its lhs.
7156 * tests/input.at (Unused values): New.
7157 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
7158
7159 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
7160
7161 * doc/bison.texinfo (Bison Options): Say more accurately what
7162 --yacc does.
7163 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
7164 about declarations in the grammar when in Yacc mode, as POSIX does
7165 not require a diagnostic when the grammar uses extensions.
7166
7167 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
7168
7169 Warn about dubious constructions like "%token T T".
7170 Reported by twlevo.
7171 * src/symtab.h (struct symbol.declared): New member.
7172 * src/symtab.c (symbol_new): Initialize it to false.
7173 (symbol_class_set): New arg DECLARING, specifying whether
7174 this is a declaration that we want to warn about, if there
7175 is more than one of them. All uses changed.
7176
7177 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
7178 Allow multiple %union directives, whose contents concatenate.
7179 * src/parse-gram.y (grammar_declaration): Likewise.
7180 Use muscle_code_grow, so that we don't need stype_line any more.
7181 All uses changed.
7182
7183 * src/muscle_tab.c (muscle_grow): Fix comment.
7184
7185 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
7186 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
7187 Update copyright year to 2006.
7188
7189 2006-01-03 Akim Demaille <akim@epita.fr>
7190
7191 Have glr.cc pass (some of) the calc.at tests.
7192 * data/glr.cc (b4_parse_param_orig): New.
7193 (b4_parse_param): Improve its definition, and bound it more
7194 clearly in the skeleton.
7195 (b4_epilogue): Append, instead of prepending, in order to keep
7196 #line consistency.
7197 Simplify the generation of auxiliary functions: locations and
7198 purity are mandated.
7199 (b4_global_tokens_and_yystype): Honor it.
7200 * data/location.cc (c++.m4): Don't include it.
7201 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
7202 and AT_SKEL_CC_IF.
7203 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
7204 AT_LALR1_CC_IF.
7205 Be sure to initialize the first position's filename.
7206 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
7207 mandated anyway.
7208 (AT_CHECK_CALC_GLR_CC): New.
7209 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
7210
7211 2006-01-02 Akim Demaille <akim@epita.fr>
7212
7213 * src/output.c (output_skeleton): Don't hard wire the inclusion of
7214 c.m4.
7215 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
7216 * data/glr.cc: Do not include stack.hh.
7217
7218 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7219
7220 * data/glr.c: Reformat whitespace with tabs.
7221 (b4_lpure_formals): Remove this unused m4 macro.
7222 * tests/cxx-type.at: Reformat whitespace with tabs.
7223 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
7224 since it's a member. Rename type to isNterm for clarity.
7225
7226 2005-12-29 Akim <akim@sulaco.local>
7227
7228 Let glr.cc catch up with symbol_value_print.
7229 * data/glr.cc (b4_yysymprint_generate): Replace by...
7230 (b4_yy_symbol_print_generate): this.
7231 (yy_symbol_print, yy_symbol_value_print): Declare them.
7232
7233 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
7234
7235 * src/location.h (boundary): Note that a line or column equal
7236 to INT_MAX indicates an overflow.
7237 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
7238 (rule_length_overflow, increment_rule_length, add_column_width):
7239 New functions.
7240 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
7241 (<SC_BRACED_CODE>"}"):
7242 Use increment_rule_length rather than incrementing it by hand.
7243 (adjust_location, handle_syncline): Diagnose overflow.
7244 (handle_action_dollar, handle_action_at):
7245 Fix bug with monstrosities like $-2147483648.
7246 Remove now-unnecessary checks.
7247 (scan_integer): Verify assumptions and remove now-unnecessary checks.
7248 (convert_ucn_to_byte): Verify assumptions.
7249 (handle_syncline): New arg LOC. All callers changed.
7250 Don't store through a value derived from char const * pointer.
7251
7252 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
7253 GCC warnings.
7254
7255 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
7256
7257 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
7258 Remove unnecessary forward static decls.
7259
7260 2005-12-27 Akim Demaille <akim@epita.fr>
7261
7262 * src/reader.c (grammar_current_rule_check): Also check that $$
7263 is used.
7264 Take the rule to check as argument, hence rename as...
7265 (grammar_rule_check): this.
7266 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
7267 Rename as...
7268 (grammar_rule_begin, grammar_rule_end): these, for consistency.
7269 (grammar_midrule_action, grammar_symbol_append): Now static.
7270 * tests/torture.at (input): Don't rely on the default action
7271 being always performed.
7272 * tests/calc.at: "Set" $$ even when the action is "cut" with
7273 YYERROR or other.
7274 * tests/actions.at (Exotic Dollars): Instead of using unused
7275 values, check that the warning is issued.
7276
7277 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
7278
7279 * NEWS: Improve wording for unused-value warnings.
7280
7281 2005-12-22 Akim Demaille <akim@epita.fr>
7282
7283 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
7284 (b4_yysymprint_generate): Rename as...
7285 (b4_yy_symbol_print_generate): this.
7286 Generate yy_symbol_print instead of yysymprint.
7287 Generate also yy_symbol_value_print, and use it.
7288
7289 2005-12-22 Akim Demaille <akim@epita.fr>
7290
7291 * NEWS: Warn about unused values.
7292 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
7293 a `used' member.
7294 (symbol_list_n_get, symbol_list_n_used_set): New.
7295 (symbol_list_n_type_name_get): Use symbol_list_n_get.
7296 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
7297 * src/reader.c (grammar_current_rule_check): Check that values are
7298 used.
7299 * src/symtab.c (symbol_print): Accept 0.
7300 * tests/existing.at: Remove the type information.
7301 Empty the actions.
7302 Remove useless actions (beware of mid-rule actions: perl -000
7303 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
7304 * tests/actions.at (Exotic Dollars): Use unused values.
7305 * tests/calc.at: Likewise.
7306 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7307 Likewise.
7308
7309 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
7310 rule_useful_p.
7311
7312 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
7313
7314 Undo 2005-12-01 tentative license wording change. The wording is
7315 still being reviewed by the lawyers, and we don't want to wait for
7316 them before publishing a test release. For now, revert to the
7317 previous wording.
7318 * NEWS: Undo 2005-12-01 change.
7319 * data/glr.c: Revert to previous license wording.
7320 * data/glr.cc: Likewise.
7321 * data/lalr1.cc: Likewise.
7322 * data/location.cc: Likewise.
7323 * data/yacc.c: Likewise.
7324
7325 * NEWS: Reword %destructor vs YYABORT etc.
7326 * data/glr.c: Use American spacing, for consistency.
7327 * data/glr.cc: Likewise.
7328 * data/lalr1.cc: Likewise.
7329 * data/yacc.c: Likewise.
7330 * data/yacc.c: Reformat comments slightly.
7331 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
7332 for consistency. Fix some spelling errors and reword recently-included
7333 text slightly.
7334 * tests/cxx-type.at: Cast results of malloc, for C++.
7335
7336 2005-12-21 Joel E. Denny <address@hidden>
7337
7338 * tests/cxx-type.at: Construct a tree, count the parents of shared
7339 nodes, and free each node once and only once. Previously, the memory
7340 for semantic values was leaked instead.
7341
7342 2005-12-21 Joel E. Denny <address@hidden>
7343
7344 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
7345 (yylval, yylloc): If pure, #define to yystackp->yyval and
7346 yystackp->yyloc similar to yychar and yynerrs.
7347 (yyparse): If pure, remove local yylval and yylloc. Add local
7348 yystackp to accommodate pure definitions of yylval and yylloc.
7349 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
7350 yylvalp and yyllocp to &yylval and &yylloc.
7351 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
7352 namespace. Previously, nerrs and char were missing, but lval and lloc
7353 weren't necessary.
7354 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
7355 yylvalp and yyllocp parameters since, if pure, these are now always
7356 accessible through yystackp. If not pure, they are still accessible
7357 globally.
7358 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
7359 `if (YYID (N))' to pacify lint.
7360
7361 2005-12-21 Akim Demaille <akim@epita.fr>
7362
7363 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
7364 destroy the RHS symbols of a rule.
7365 * data/yacc.c (yylen): Initialize to 0.
7366 Keep its value to the number of items to possibly shift.
7367 In particular, a regular successful parse that ends on YYFINAL by
7368 a (internal) YYACCEPT must not have yylen != 0.
7369 (yyerrorlab, yyreturn): Pop the RHS.
7370 Reorder a bit to emphasize the `shifting' bits of code.
7371 (YYPOPSTACK): Now accept a number of items to pop.
7372 * data/lalr1.cc: Likewise.
7373 * data/glr.c: Formatting changes.
7374 Use goto instead of fall through.
7375 * doc/bison.texinfo (Destructor Decl): Complete.
7376
7377 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7378
7379 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7380 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
7381 * djgpp/config.bat: Replace every occurence of the file name
7382 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7383 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7384 * djgpp/config.sed: Replace every occurence of the file name
7385 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7386 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7387 * djgpp/djunpack.bat: DJGPP specific file.
7388 * djgpp/fnchange.lst: DJGPP specific file.
7389 * djgpp/README.in: Add new information about how to unpack the bison
7390 source on MSDOS and other systems which have 8.3 file name restrictions
7391 using djunpack.bat and fnchange.lst.
7392
7393 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
7394
7395 * bootstrap (build_cvs_prefix): Remove; unused.
7396 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
7397 when getting gnulib.
7398
7399 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
7400
7401 * data/glr.c: Reorder typedef declarations for structs to match order
7402 of struct declarations.
7403 Rename yystack everywhere to yystackp except in yyparse where it's not
7404 a pointer.
7405 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
7406 consistency.
7407 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
7408 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
7409 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
7410 lint.
7411
7412 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
7413
7414 * tests/sets.at (Accept): Fix typos in regular expression used to
7415 sed out the final state number.
7416
7417 Work around portability problem on Solaris 10: flex-generated
7418 files include <stdio.h> before <config.h>, which messes up
7419 because the latter defines __EXTENSIONS__. Address the problem
7420 by creating two new little files that include <config.h> first,
7421 then include the flex-generated files. Rewrite everyone else
7422 to include <config.h> first, as well.
7423 * lib/timevar.c: Always include "config.h".
7424 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
7425 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
7426 (EXTRA_bison_SOURCES): New macro.
7427 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
7428 * src/system.h: Don't include config.h.
7429 * src/LR0.c: Include <config.h> first.
7430 * src/assoc.c: Likewise.
7431 * src/closure.c: Likewise.
7432 * src/complain.c: Likewise.
7433 * src/conflicts.c: Likewise.
7434 * src/derives.c: Likewise.
7435 * src/files.c: Likewise.
7436 * src/getargs.c: Likewise.
7437 * src/gram.c: Likewise.
7438 * src/lalr.c: Likewise.
7439 * src/location.c: Likewise.
7440 * src/main.c: Likewise.
7441 * src/muscle_tab.c: Likewise.
7442 * src/nullable.c: Likewise.
7443 * src/output.c: Likewise.
7444 * src/parse-gram.y: Likewise.
7445 * src/print.c: Likewise.
7446 * src/print_graph.c: Likewise.
7447 * src/reader.c: Likewise.
7448 * src/reduce.c: Likewise.
7449 * src/relation.c: Likewise.
7450 * src/state.c: Likewise.
7451 * src/symlist.c: Likewise.
7452 * src/symtab.c: Likewise.
7453 * src/tables.c: Likewise.
7454 * src/uniqstr.c: Likewise.
7455 * src/vcg.c: Likewise.
7456
7457 * src/parse-gram.y: Fix minor problems uncovered by lint.
7458 (current_lhs, current_lhs_location): Now static.
7459 (current_assoc): Remove unused variable.
7460
7461 Cleanups so that Bison-generated parsers have less lint.
7462 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
7463 Prepend /*ARGSUSED*/, for lint's sake.
7464 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
7465 definition if 'lint' is defined.
7466 (YYID): New macro (or function, if lint).
7467 All uses of /*CONSTCOND*/0 replaced by YYID(0).
7468 * data/yacc.c: Likewise.
7469 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
7470 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
7471 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
7472 is C++ only.
7473 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
7474 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
7475 Use YYID(0) rather than 0, for lint.
7476 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
7477 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
7478
7479 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
7480
7481 * tests/glr-regression.at
7482 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7483 Close memory leak reported by twlevo.
7484
7485 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
7486
7487 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
7488 all stacks.
7489 (yyparse): Iterate another stack in order to call user destructors.
7490 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7491 New test case.
7492 (Duplicated user destructor for lookahead): This test now is expected
7493 to succeed.
7494
7495 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
7496
7497 * NEWS: Document the following change.
7498 * data/yacc.c: Say "parser skeleton" rather than "file", since
7499 it's no longer just a file.
7500 * data/glr.c: Grant a special exception for C GLR parsers, that
7501 reads like the already-existing exception for C LALR(1) parsers.
7502 * data/glr.cc: Likewise.
7503 * data/lalr1.cc: Likewise.
7504 * data/location.cc: Likewise.
7505 * data/yacc.c: Reword the "written by" statement to clarify that
7506 it was the parser skeleton, not the entire output file.
7507 * data/glr.c: Written by Paul Hilfinger.
7508 * data/glr.cc: Written by Akim Demaille.
7509 * data/lalr1.cc: Likewise.
7510
7511 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
7512
7513 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
7514 Fix typos in previous change that broke 'make check'.
7515 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
7516 supported in C.
7517 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
7518 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
7519 We can revert this once things settle down.
7520
7521 * src/conflicts.c (conflicts_print): Don't print file name twice
7522 when %expect fails because there were no conflicts.
7523 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
7524 change.
7525 * tests/conflicts.at (%expect not enough, %expect too much):
7526 (%expect with reduce conflicts): Adjust to new behavior.
7527
7528 2005-11-18 Akim Demaille <akim@epita.fr>
7529
7530 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
7531 errors.
7532 * NEWS: Document this.
7533 * doc/bison.texinfo (Expect Decl): Likewise.
7534
7535 2005-11-16 Akim Demaille <akim@epita.fr>
7536
7537 Generalize the display of semantic values and locations in traces.
7538 * data/glr.c (yy_reduce_print): Fix indices (again).
7539 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
7540 literal integers.
7541 * data/lalr1.cc (yyreduce_print): Rename as...
7542 (yy_reduce_print): this.
7543 Display values and locations.
7544 * data/yacc.c (yy_reduce_print): Likewise.
7545 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
7546 (yysymprint): Move higher to be visible from yy_reduce_print).
7547 (yyparse): Adjust.
7548 * tests/calc.at: Adjust the expected length of the traces.
7549
7550 2005-11-14 Akim Demaille <akim@epita.fr>
7551
7552 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
7553 from 1 to N, while values and location start at 0.
7554 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
7555
7556 2005-11-14 Akim Demaille <akim@epita.fr>
7557
7558 * data/glr.c (yy_reduce_print): Fix the $ number.
7559
7560 2005-11-14 Akim Demaille <akim@epita.fr>
7561
7562 "Use" parse parameters.
7563 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
7564 * data/glr.c, data/glr.cc: Use them.
7565 * data/glr.c (YYUSE): Have a C++ definition that supports
7566 non-pointer types.
7567
7568 2005-11-14 Akim Demaille <akim@epita.fr>
7569
7570 * data/glr.c (yyexpandGLRStack): Declare only if defined.
7571
7572 2005-11-14 Akim Demaille <akim@epita.fr>
7573
7574 * data/glr.cc: New.
7575 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
7576
7577 2005-11-12 Akim Demaille <akim@epita.fr>
7578
7579 Let position and location be PODs.
7580 * data/location.cc (position::initialize, location::initialize): New.
7581 (position::position, location::location): Define only if
7582 b4_location_constructors is defined.
7583 * data/lalr1.cc (b4_location_constructors): Define it for backward
7584 compatibility.
7585 * doc/bison.texinfo (Initial Action Decl): Use initialize.
7586
7587 2005-11-12 Akim Demaille <akim@epita.fr>
7588
7589 * data/lalr1.cc: Move the body of the ctor and dtor into the
7590 parser file (instead of the header).
7591 Wrap the implementations in a "namespace yy".
7592
7593 2005-11-12 Akim Demaille <akim@epita.fr>
7594
7595 Have glr.c include its header file when created.
7596 * data/glr.c (b4_shared_declarations): New.
7597 Output them verbatim in the parser if !%defines, otherwise
7598 output then in the header file, and include it instead.
7599
7600 2005-11-11 Akim Demaille <akim@epita.fr>
7601
7602 * data/glr.c: Comment changes.
7603
7604 2005-11-11 Akim Demaille <akim@epita.fr>
7605
7606 When yydebug, report semantic and location values for reductions.
7607 * data/glr.c (yy_reduce_print): Report the semantic values and the
7608 locations.
7609 (YY_REDUCE_PRINT): Adjust.
7610 (yyglrReduce): Use them.
7611 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
7612 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
7613 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
7614 traces.
7615
7616 2005-11-10 Akim Demaille <akim@epita.fr>
7617
7618 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
7619 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
7620 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
7621
7622 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
7623
7624 * m4/cxx.m4, examples/Makefile.am: Don't build
7625 examples/calc++ if no C++ compiler is available. (trivial change)
7626
7627 2005-11-09 Akim Demaille <akim@epita.fr>
7628
7629 * src/scan-skel.l: Use a couple of asserts.
7630
7631 2005-11-03 Akim Demaille <akim@epita.fr>
7632
7633 In some (weird) cases, the final state number is incorrect.
7634 Reported by Alexandre Duret-Lutz.
7635 * src/LR0.c (state_list_append): Remove the computation of
7636 final_state.
7637 (save_reductions): Do it here.
7638 (get_state): Alpha conversion.
7639 (generate_states): Use a for loop.
7640 * src/gram.h (item_number_is_rule_number)
7641 (item_number_is_symbol_number): New.
7642 * src/state.c: Use assert.
7643 * src/system.h: Include assert.h.
7644 * tests/sets.at (Accept): New.
7645
7646 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7647
7648 * data/glr.c (yyfill): Adjust comment.
7649 (yyresolveAction): Initialize default location properly
7650 for empty right-hand sides.
7651 (yydoAction): Ditto.
7652 Add comment explaining apparently dead code.
7653 * tests/glr-regression.at
7654 (Incorrectly initialized location for empty right-hand side in GLR):
7655 New test.
7656
7657 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
7658
7659 * bootstrap (cleanup_gnulib): New function. Use it to clean up
7660 gnulib when interrupted. This fixes some race conditions and
7661 works around some portability problems (one noted by Paul
7662 Hilfinger).
7663
7664 2005-10-22 Akim <akim@epita.fr>
7665
7666 * Makefile.cfg: Adjust to config -> build-aux.
7667 Reported by twledo.
7668
7669 2005-10-21 Akim Demaille <akim@epita.fr>
7670
7671 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
7672 the %parse-params.
7673 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
7674 * data/yacc.c (b4_Pure_if): Rename as...
7675 (b4_yacc_pure_if): this.
7676 (YY_SYMBOL_PRINT, yyparse): Adjust.
7677 * doc/bison.texinfo: Formatting changes.
7678
7679 2005-10-21 Akim Demaille <akim@epita.fr>
7680
7681 Finish the transition config -> build-aux.
7682 * configure.ac, Makefile.am: Use build-aux.
7683 * config/prev-version, config/announce-gen, config/Makefile.am:
7684 Move to...
7685 * build-aux/prev-version, build-aux/announce-gen,
7686 * build-aux/Makefile.am: here.
7687
7688 2005-10-14 Akim Demaille <akim@epita.fr>
7689
7690 * examples/calc++/test: Use set -x only when VERBOSE.
7691
7692 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
7693
7694 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
7695 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
7696
7697 2005-10-13 Akim Demaille <akim@epita.fr>
7698
7699 * src/scan-skel.l: Output the base name parts of the parser and
7700 header file names.
7701 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7702 additional checks.
7703 Use this to exercise C++ outputs in subdirs.
7704 Reported by Oleg Smolsky.
7705
7706 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
7707
7708 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
7709 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
7710 Problem reported by John P. Hartmann.
7711 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
7712 already defined it.
7713
7714 2005-10-12 Akim Demaille <akim@epita.fr>
7715
7716 * src/parse-gram.y (version_check): Exit 63 to please missing
7717 (stands for "version mismatch).
7718 * tests/input.at, doc/bison.texinfo: Adjust.
7719
7720 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
7721
7722 Work around portability problems with Visual Age C compiler
7723 (xlc and xlC_r) reported by John P. Hartmann.
7724 * data/location.cc (initial_column, initial_line): Remove.
7725 All uses replaced by 0 and 1.
7726 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
7727 that xlc complains about.
7728 * src/scan-skel.l (skel_wrap): Likewise.
7729 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
7730 as __STDC__.
7731 * data/yacc.c (YYMODERN_C): New macro, which also looks at
7732 __STDC_VERSION__. Use it everywhere instead of looking at
7733 __STDC__ and __cplusplus.
7734
7735 2005-10-10 Akim Demaille <akim@epita.fr>
7736
7737 * examples/calc++/test: Be quiet unless VERBOSE.
7738
7739 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
7740
7741 * data/c.m4 (yydestruct, yysymprint):
7742 Use YYUSE instead of casting to void.
7743 * data/glr.c (YYUSE): New macro.
7744 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7745 Use it instead of rolling our own.
7746 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7747 (YYCHK1):
7748 Use /*CONSTCOND*/ to suppress lint warnings.
7749 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7750 (YY_STACK_PRINT): Use 'false' not '0'.
7751 (YYUSE): New macro.
7752 (yysymprint_, yydestruct_): Use it instead of rolling our own.
7753 * data/yacc.c (YYUSE): New macro.
7754 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
7755 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
7756 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
7757
7758
7759 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
7760 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
7761
7762 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
7763
7764 Undo the parts of the unlocked-I/O change that substituted
7765 putc or puts for printf. This might hurt performance a bit,
7766 but some people prefer the printf style.
7767 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
7768 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
7769 All uses replaced by YYFPRINTF and YYDPRINTF.
7770 * data/yacc.c: Likewise.
7771 * lib/bitset.c (bitset_print): Likewise.
7772 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
7773 putc and puts.
7774 * lib/lbitset.c (debug_lbitset): Likewise.
7775 * src/closure.c (print_firsts, print_fderives): Likewise.
7776 * src/gram.c (grammar_dump): Likewise.
7777 * src/lalr.c (look_ahead_tokens_print): Likewise.
7778 * src/output.c (escaped_output): Likewise.
7779 (user_actions_output): Break apart two printfs.
7780 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
7781 * src/reduce.c (reduce_print): Likewise.
7782 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7783 * src/system.h: Include unlocked-io.h rathe than stdio.h.
7784
7785 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7786 Use assignments rather than casts-to-void to suppress
7787 unused-variable warnings. This pacifies 'lint'.
7788 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
7789 unused-variable warnings.
7790
7791 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7792
7793 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7794
7795 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
7796
7797 Use unlocked I/O for a minor performance improvement on hosts like
7798 GNU/Linux and Solaris that support unlocked I/O. The basic idea
7799 is to use the gnlib unlocked-io module, and to prefer putc and
7800 puts to printf when either will work (since the latter doesn't
7801 come in an unlocked flavor).
7802 * bootstrap (gnulib_modules): Add unlocked-io.
7803 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
7804 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
7805 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
7806 and similarly for puts and putc and printf.
7807 * data/yacc.c: Likewise.
7808 * lib/bitset.c (bitset_print): Likewise.
7809 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
7810 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
7811 to printf.
7812 * lib/lbitset.c (debug_lbitset): Likewise.
7813 * src/closure.c (print_firsts, print_fderives): Likewise.
7814 * src/gram.c (grammar_dump): Likewise.
7815 * src/lalr.c (look_ahead_tokens_print): Likewise.
7816 * src/output.c (escaped_output): Likewise.
7817 (user_actions_output): Coalesce two printfs.
7818 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
7819 * src/reduce.c (reduce_print): Likewise.
7820 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7821 * src/system.h: Include unlocked-io.h rather than stdio.h.
7822
7823 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
7824 this confuses xgettext.
7825
7826 2005-10-02 Akim Demaille <akim@epita.fr>
7827
7828 * bootstrap (gnulib_modules): Add strverscmp.
7829 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
7830 * m4/.cvsignore: Add strverscmp.m4.
7831 * src/parse-gram.y (%require): New token, new rule.
7832 (version_check): New.
7833 * src/scan-gram.l (%require): Adjust.
7834 * tests/input.at (AT_REQUIRE): New.
7835 Use it.
7836 * doc/bison.texinfo (Require Decl): New.
7837 (Calc++ Parser): Use %require.
7838
7839 2005-10-02 Akim Demaille <akim@epita.fr>
7840
7841 * data/location.cc: New.
7842
7843 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
7844 Akim Demaille <akim@epita.fr>
7845
7846 Make sure -odir/foo.cc creates dir/location.hh etc.
7847 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
7848 (spec_file_prefix, spec_verbose_file, spec_graph_file)
7849 (spec_defines_file): Now const.
7850 (dir_prefix): New.
7851 (short_base_name): Remove.
7852 * src/files.c: Adjust.
7853 (dirname.h): Include.
7854 (base_name): Don't prototype it.
7855 (finput): Remove, duplicates gram_in.
7856 (full_base_name, short_base_name): Replace by...
7857 (all_but_ext, all_but_tab_ext): these.
7858 (compute_base_names): Rename as...
7859 (compute_file_name_parts): this.
7860 Update to compute the new variables, including dir_prefix.
7861 Adjust dependencies.
7862 * src/output.c (prepare): Output them.
7863 * src/reader.c: Adjust to use gram_in, not finput.
7864 * src/scan-skel.l (@dir_prefix@): New.
7865
7866 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7867
7868 * lib/subpipe.c: New function end_of_output_subpipe() added
7869 to allow support for non-posix systems. This is a no-op function
7870 for posix systems.
7871
7872 * lib/subpipe.h: New function end_of_output_subpipe() added
7873 to allow support for non-posix systems. This is a no-op function
7874 for posix systems.
7875
7876 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
7877 handle the lack of pipe/fork functionality on non-posix systems.
7878
7879 * djgpp/Makefile.maint: DJGPP specific file.
7880
7881 * djgpp/README.in: DJGPP specific file.
7882
7883 * djgpp/config.bat: DJGPP specific configuration file.
7884
7885 * djgpp/config.sed: DJGPP specific configuration file.
7886
7887 * djgpp/config.site: DJGPP specific configuration file.
7888
7889 * djgpp/config_h.sed: DJGPP specific configuration file.
7890
7891 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
7892
7893 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
7894
7895 2005-10-02 Akim Demaille <akim@epita.fr>
7896
7897 * data/location.cc: New, extract from...
7898 * data/lalr1.cc: here.
7899 (location.hh): Include it after the user prologue, in case the
7900 filename type is defined by the user.
7901 Forward declation location and position before the pre-prologue.
7902 (yyresult_): Rename as...
7903 (yyresult): this, it's a local variable, not an attribute.
7904 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
7905
7906 2005-10-01 Akim Demaille <akim@epita.fr>
7907
7908 * examples/extexi: Restore the #line generation.
7909
7910 2005-09-30 Akim Demaille <akim@epita.fr>,
7911 Alexandre Duret-Lutz <adl@gnu.org>
7912
7913 Move the token type and YYSTYPE in the parser class.
7914 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
7915 (parser::token): New, from the moved free definition of tokens.
7916 (parser::semantic_value): Now a full definition instead of an
7917 indirection to YYSTYPE.
7918 (b4_post_prologue): No longer included in the header file, but
7919 in the implementation file.
7920 * doc/bison.texi (C+ Language Interface): Update.
7921 * src/parse-gram.y: Support unary %define.
7922 * tests/actions.at: Define global_tokens_and_yystype for backward
7923 compatibility until we update the tests.
7924 * tests/calc.at: Idem.
7925 (first_line, first_column, last_line, last_column): Define for lalr1.cc
7926 to simplify the code.
7927
7928 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
7929
7930 Port to SunOS 4.1.4, which lacks strtoul and strerror.
7931 Ah, the good old days! Problem reported by Peter Klein.
7932 * bootstrap (gnulib_modules): Add strerror, strtoul.
7933 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
7934 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
7935
7936 2005-09-29 Akim Demaille <akim@epita.fr>
7937
7938 * data/c.m4 (b4_error_verbose_if): New.
7939 * data/lalr1.cc: Use it.
7940 (YYERROR_VERBOSE_IF): Remove.
7941 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
7942 parser members, replaced by...
7943 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
7944 local variables.
7945 (yysyntax_error_): Takes the state number as argument.
7946 (yyreduce_print_): Use the argument yyrule, not the former
7947 attribute yyn_.
7948
7949 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
7950
7951 * bootstrap (gnulib_modules): Add verify.
7952 * lib/.cvsignore: Add verify.h.
7953 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
7954 * src/system.h (verify): Remove.
7955 Include verify.h instead.
7956 * src/tables.c (tables_generate): Use new API for 'verify'.
7957
7958 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
7959
7960 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
7961 local variables whose names begin with 'yy'.
7962 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
7963 Trivial changes from Joel E. Denny.
7964
7965 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
7966 it itself.
7967 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
7968 don't use alloca any more.
7969
7970 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
7971 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
7972 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
7973 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
7974 to match yacc.c, to test more hosts.
7975
7976 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
7977
7978 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
7979 doesn't affect behavior.
7980 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
7981 Solaris, AIX, MSC.
7982 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
7983 This works a bit better with glibc, if user code has already included
7984 stdlib.h.
7985 * doc/bison.texinfo (Bison Parser): Document that users can't
7986 arbitrarily use malloc and free for other purposes. Document
7987 that <alloca.h> and <malloc.h> might be included.
7988 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
7989 user must declare alloca.
7990
7991 * HACKING (release): Forwarn the Translation Project about
7992 stable releses.
7993
7994 2005-09-20 Akim Demaille <akim@epita.fr>
7995
7996 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
7997
7998 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
7999
8000 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
8001 (YYSTACK_ALLOC_MAXIMUM): Use it.
8002 (yysyntax_error): New function.
8003 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
8004 multiple syntax errors are reported, and alloca is being used.
8005 Instead, reallocate buffers twice as big each time, so that
8006 we waste at most half the allocated memory. Start with a small
8007 (128-byte) buffer that will suffice in most cases anyway.
8008 Use yysyntax_error to do most of the work.
8009
8010 * doc/bison.texinfo (Error Reporting, Table of Symbols):
8011 yynerrs is the number of errors reported, not the number of
8012 errors encountered.
8013
8014 * tests/glr-regression.at (Duplicated user destructor for lookahead):
8015 Mark it as expected to fail.
8016 Cast result of malloc; problem reported by twlevo@xs4all.nl.
8017 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
8018 Don't start user-code symbols with "yy", to avoid name space problems.
8019
8020 2005-09-19 Akim Demaille <akim@epita.fr>
8021
8022 Remove the traits, failed experiment.
8023 It never proved useful, and anyway because of the current
8024 definition, it was not possible to have several specialization of
8025 this traits, making it useless.
8026 * data/lalr1.cc (yy:traits): Remove.
8027 Inline its definitions in the parser class.
8028
8029 2005-09-19 Akim Demaille <akim@epita.fr>
8030
8031 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
8032 least Mac OSX with a /usr/local install of gettext.
8033
8034 2005-09-19 Akim Demaille <akim@epita.fr>
8035
8036 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
8037 and yytoken for similarity with the other skeletons.
8038
8039 2005-09-19 Akim Demaille <akim@epita.fr>
8040
8041 * NEWS, configure.ac: update version number to 2.1a.
8042
8043 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
8044
8045 * NEWS: Version 2.1.
8046
8047 * NEWS: Remove notice of yytname change, since it was never in an
8048 official release.
8049 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
8050 diagnostic.
8051 * src/output.c (prepare): Likewise.
8052 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
8053 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
8054 is not defined. This is an awful hack, but it's enough for now.
8055 All callers changed.
8056 * tests/glr-regression-at (make_value): Args are const pointers now,
8057 to avoid GCC warning.
8058 (Duplicated user destructor for lookahead): New test. Currently
8059 skipped. It fails on my host but I'm not sure it'll always fail.
8060
8061 2005-09-16 Akim Demaille <akim@epita.fr>
8062
8063 * src/symtab.h (struct symbol): Declare the printer and destructor
8064 as const, to avoid accidental calls to free.
8065 (symbol_destructor_set, symbol_printer_set): Adjust.
8066 * src/symtab.c: Adjust.
8067
8068 2005-09-16 Akim Demaille <akim@epita.fr>
8069
8070 * data/c.m4 (b4_token_enums): New.
8071 (b4_token_defines): Rename as...
8072 (b4_token_enums_defines): this.
8073 (b4_token_defines): New, output only the #defines.
8074 * data/yacc.c, data/glr.c: Adjust.
8075 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
8076 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
8077 as default values.
8078
8079 2005-09-16 Akim Demaille <akim@epita.fr>
8080
8081 * data/lalr1.cc (yylex_): Remove, inline its code.
8082 (yyreport_syntax_error_): Remove, replaced by...
8083 (yysyntax_error_): this which returns a string and leaves to the
8084 caller the call to the users' error function.
8085 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
8086 Move from members of the parser object...
8087 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
8088 to local variables of the parse function.
8089
8090 2005-09-16 Akim Demaille <akim@epita.fr>
8091
8092 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
8093 since it's in Bison's name space.
8094
8095 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
8096
8097 * data/glr.c (yyresolveValue): Add default case to pacify
8098 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
8099
8100 * NEWS: Document when yyparse started to return 2.
8101 * doc/bison.texinfo (Parser Function): Document when yyparse
8102 returns 2.
8103
8104 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
8105 (b4_filename_type): Renamed back from b4_file_name_type. All uses
8106 changed.
8107 (class position): file_name -> filename (reverting). All uses changed.
8108
8109 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
8110
8111 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
8112 do anything if $@ exists. This reverts part of the 2005-07-07
8113 patch.
8114
8115 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
8116
8117 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
8118 contains obsolete information and isn't worth distributing as a
8119 separate file anyway.
8120 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
8121 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
8122 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
8123 (yyparse): Abort if user code uses longjmp to throw an unexpected
8124 value.
8125
8126 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
8127
8128 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
8129 Suggested by twlevo@xs4all.nl.
8130
8131 * data/glr.c (YYCHK1): Do not assume YYE is in range.
8132 This avoids a diagnostic from gcc -Wswitch-enum.
8133 Problem reported by twlevo@xs4all.nl.
8134
8135 * doc/bison.texinfo: Don't use "filename", as per GNU coding
8136 standards. Use "file name" or "file" or "name", depending on
8137 the context.
8138 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
8139 not to hack/foo.tab.c.
8140 (Calc++ Top Level): 2nd arg of main is not const.
8141 * data/glr.c: b4_filename -> b4_file_name.
8142 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
8143 All uses changed.
8144 (class position): filename -> file_name. All uses changed.
8145 * data/yacc.c: b4_filename -> b4_file_name.
8146 * lib/bitset.h: filename -> file_name in local vars.
8147 * lib/bitset_stats.c: Likewise.
8148 * src/files.c: Likewise.
8149 * src/scan-skel.l ("@output ".*\n): Likewise.
8150 * src/files.c (file_name_split): Renamed from filename_split.
8151 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
8152
8153 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
8154
8155 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
8156 to accommodate latest gnulib.
8157
8158 * tests/glr-regression.at (Duplicate representation of merged trees):
8159 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
8160
8161 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
8162 needed.
8163
8164 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
8165
8166 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
8167 All uses changed. Invoke user destructor after an error during a
8168 split parse (trivial change from Joel E. Denny).
8169
8170 * tests/glr-regression.at
8171 (User destructor after an error during a split parse): New test case.
8172 Problem reported by Joel E. Denny in:
8173 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
8174
8175 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
8176
8177 * README-cvs: Give URLs for recommended tools.
8178 Mention Gzip version problem, and bootstrapping issues.
8179 Remove troubleshooting section, as it's somewhat obsolete.
8180
8181 * bootstrap (no_cache): New var, to accommodate different wget
8182 variants. Use it instead of '-C off'. Problem reported by
8183 twlevo@xs4all.nl.
8184
8185 * data/glr.c (yydestroyStackItem): New function.
8186 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
8187 debugging information. Problem reported by Joel E. Denny.
8188
8189 2005-08-25 Akim Demaille <akim@epita.fr>
8190
8191 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
8192
8193 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
8194
8195 * data/glr.c (yyrecoverSyntaxError, yyreturn):
8196 Don't invoke destructor on unresolved entries.
8197 * tests/glr-regression.at
8198 (User destructor for unresolved GLR semantic value): New test case.
8199 Problem reported by Joel E. Denny in:
8200 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
8201
8202 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
8203
8204 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
8205 Add strnlen.c.
8206 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
8207 lib-prefix.m4, po.m4.
8208
8209 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
8210 in yydestruct diagnostic, since it might not be an error.
8211 Problem reported by Joel Denny near end of
8212 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8213 * data/lalr1.cc (yyerturn): Likewise.
8214 * data/yacc.c (yyreturn): Likewise.
8215 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
8216
8217 * src/files.c: Remove obsolete FIXME comment.
8218
8219 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
8220 with the other templates, and to fix bogus run-on messages such
8221 as the one reported at the end of
8222 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8223 All callers changed to avoid the newline.
8224 (yyprocessOneStack): Output two lines rather than one, to accommodate
8225 the above change. This changes the debug output format slightly.
8226
8227 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
8228 reported by Joel E. Denny in
8229 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
8230 (trivial change).
8231 * tests/glr-regression.at (Duplicate representation of merged trees):
8232 New test, from Joel E. Denny in:
8233 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
8234 * THANKS: Add Joel E. Denny.
8235
8236 * configure.ac (AC_INIT): Bump to 2.0c.
8237
8238 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
8239
8240 * NEWS: Version 2.0b.
8241
8242 * Makefile.am (SUBDIRS): Put examples before tests, so that
8243 "make check" doesn't finish with "All 1 tests passed".
8244
8245 * tests/regression.at (Token definitions): Don't rely on
8246 AT_PARSER_CHECK for data that contains backslashes. It currently
8247 uses 'echo', and 'echo' isn't portable if its argument contains
8248 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
8249 that the byte '\0xff' is not printable in the C locale; it is,
8250 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
8251 not printable, so use '\0x81' to test.
8252
8253 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
8254 version of GCC, since the macro is used with non-GCC compilers.
8255
8256 Fix core dump reported by Pablo De Napoli in
8257 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
8258 * tests/regression.at (Invalid inputs with {}): New test.
8259 * src/parse-gram.y (token_name): Translate type before using
8260 it as an index.
8261
8262 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
8263 the user's name space. All uses changed to __attribute__
8264 ((__unused__)).
8265 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
8266 Add __attribute__ ((__noreturn__)).
8267
8268 * etc/clcommit: Remove. We weren't using it, and it failed
8269 "make maintainer-distcheck".
8270 * Makefile.maint: Merge from coreutils.
8271 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
8272 (syntax-check-rules): Change list of rules as described below.
8273 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
8274 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
8275 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
8276 (sc_trailing_space): New rules.
8277 (sc_xalloc_h_in_src): Remove.
8278 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
8279 (sc_space_tab, sc_error_exit_success, sc_changelog):
8280 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
8281 (makefile-check, po-check, author_mark_check):
8282 (makefile_path_separator_check, copyright-check):
8283 Use grep -n, to make it easier to find violations.
8284 Use CVS_LIST and CVS_LIST_EXCEPT.
8285 (header_regexp, h_re): Remove.
8286 (dd_c): New macro.
8287 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
8288 (my-distcheck): Use more-modern GCC flags.
8289 (signatures, %.asc): Remove.
8290 (rel-files, announcement): Remove signatures.
8291 Restore old updating code, even though we don't use it, so
8292 that we're the same as coreutils.
8293 (alpha, beta, major): Depend on news-date-check.
8294 Make the upload commands.
8295
8296 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
8297 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
8298 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
8299 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
8300 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
8301 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
8302 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
8303 * tests/sets.at: Likewise.
8304
8305 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
8306 we comment out the Autoconf version number.
8307 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
8308 it's error-prone and "make maintainer-distcheck" rejects it.
8309
8310 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
8311 Indent calls to "error" to pacify "make maintainer-distcheck",
8312 when the calls are not intended to be translated.
8313 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
8314
8315 * src/Makefile.am (DEFS): Use +=, to pacify
8316 "make maintainer-distcheck".
8317 (bison_SOURCES): Add scan-skel.h.
8318 (sc_tight_scope): New rule, from coreutils.
8319
8320 * src/files.c (src_extension, header_extension):
8321 Now static, not extern.
8322 * src/getargs.c (short_options): Likewise.
8323 * src/muscle_tab.c (muscle_table): Likewise.
8324 * src/parse-gram.y (current_class, current_type, current_prec):
8325 Likewise.
8326 * src/reader.c (grammar_end, previous_rule_end): Likewise.
8327 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
8328 * src/main.c (main): Cast bindtextdomain and textdomain calls to
8329 void, to avoid warning when NLS is disabled.
8330 * src/output.c: Include scan-skel.h.
8331 (scan_skel): Remove decl, since scan-skel.h does this.
8332 (output_skeleton):
8333 Indent calls to "error" to pacify "make maintainer-distcheck".
8334 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
8335 * src/reader.h (gram_end, gram_lineno): New decls to pacify
8336 "make maintainer-distcheck".
8337 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
8338 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
8339 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
8340 (skel_lex_destroy, scan_skel): Move these decls to...
8341 * src/scan-skel.h: New file.
8342 * src/uniqstr.c (uniqstr_assert):
8343 Indent calls to "error" to pacify "make maintainer-distcheck".
8344
8345 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
8346 not @VAR@.
8347
8348 * tests/torture.at: Revamp to avoid misuse of atoi that
8349 "make maintainer-distcheck" complained about.
8350
8351 * examples/extexi (message): Don't print a message more than once,
8352 and omit line-number decoration that makes Emacs compile think
8353 that informative messages are worth worrying about.
8354
8355 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
8356
8357 * configure.ac: Update version number.
8358
8359 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
8360 accidentally.
8361 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
8362 autogenerated by the maintainer.
8363 * examples/calc++/.cvsignore: Add *.yy.
8364
8365 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
8366 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8367 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8368
8369 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
8370
8371 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
8372 from maintainer-distcheck about casting the argument of 'free'.
8373
8374 * NEWS: Mention recent yytname changes.
8375 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
8376
8377 * bootstrap: For translations that have not yet been upgraded to
8378 the new runtime-po domain, prime the pump by extracting the
8379 relevant strings from the obsolete translations. This code can be
8380 removed once the bison-runtime domain has been translated by each
8381 team.
8382
8383 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
8384 now that token names are already quoted.
8385
8386 Fix problem reported by Anthony Heading.
8387 * data/glr.c (YYTOKEN_TABLE): New macro.
8388 (yytname): Define if YYTOKEN_TABLE.
8389 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
8390 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
8391 (YYERROR_VERBOSE): Define the same way the other skeletons do.
8392 * src/output.c (prepare_symbols): Output token_table_flag.
8393
8394 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
8395
8396 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
8397 again if the first call fails.
8398
8399 * data/glr.c (yytnamerr): New function.
8400 (yyreportSyntaxError): Use it to dequote most string literals.
8401 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
8402 with other skeletons. All uses changed.
8403 (yytnameerr_): New function.
8404 (yyreport_syntax_error): Use it to dequote most string literals.
8405 * data/yacc.c (yytnamerr): New function.
8406 (yyerrlab): Use it to decode most string literals.
8407 * doc/bison.texinfo (Decl Summary, Calling Convention):
8408 Clarify quoting convention of yytname.
8409 * src/output.c (prepare_symbols): Quote all names. This undoes
8410 the 2005-04-17 change, which is now accomplished (mostly) via
8411 changes in the parsers as described above.
8412 * tests/regression.at (Token definitions, Web2c Actions):
8413 Undo most 2005-04-17 change here, too.
8414
8415 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
8416
8417 Fix more problems reported by twlevo@xs4all.nl.
8418 * tests/cxx-type.at: Don't pipe output of ./types through sed to
8419 remove trailing spaces. This loses the exit status of ./types,
8420 and isn't needed since ./types shouldn't be emitting trailing
8421 spaces.
8422 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
8423 as the stack isn't valid in that case.
8424
8425 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8426 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8427 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8428 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
8429 is used.
8430 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
8431 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8432 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8433 Likewise.
8434
8435 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
8436 overly-picky compilers that reject 'char *foo = "bar";'.
8437
8438 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
8439 to FILE * parameter, not to stderr. This fixes a typo introduced
8440 in the 2005-07-12 change.
8441
8442 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
8443 warnings from GCC 4.
8444
8445 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
8446 (yyglrShiftDefer, yysplitStack):
8447 Remove unused parameters b4_pure_formals. All uses changed.
8448 (yyglrShift): Remove unused parameters b4_user_formals.
8449 All uses changed.
8450 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
8451
8452 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
8453
8454 Destructor cleanups and regularization among the three skeletons.
8455 * NEWS: Document the behavior changes.
8456 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
8457 stack before failing, as the cleanup code will do it for us now.
8458 * data/lalr1.cc (yyerrlab): Likewise.
8459 * data/glr.c (yyparse): Pop everything off the stack before
8460 freeing it, so that destructors get called properly.
8461 * data/lalr1.cc (yyreturn): Likewise.
8462 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
8463 This is more consistent.
8464 * doc/bison.texinfo (Destructor Decl): Mention more reasons
8465 why destructors might be called. 1.875 -> 2.1.
8466 (Destructor Decl, Decl Summary, Table of Symbols):
8467 Some English-language cleanups for %destructor.
8468 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8469 Add output line for destructor of start symbol.
8470 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
8471 because of that same extra output line.
8472
8473 * NEWS: Document minor wording changes in diagnostics of
8474 Bison-generated parsers.
8475 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
8476 Remove unused formals. All uses changed.
8477 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
8478 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
8479 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
8480 Rename yyoverflowab to yyexhaustedlab.
8481 When memory exhaustion occurs during syntax-error reporting,
8482 report it separately rather than in a single diagnostic; this
8483 eases translation.
8484 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
8485 (Memory Exhausted): Renamed from Parser Stack Overflow.
8486 Revamp wording slightly to prefer "memory exhaustion".
8487 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
8488
8489 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
8490
8491 Add i18n support to the GLR skeleton. Partially fix the C++
8492 skeleton; a C++ expert needs to finish this. Remove debugging
8493 msgids; there's little point to having them translated, since they
8494 can be understood only by someone who can read the
8495 (English-language) source code.
8496
8497 Generate runtime-po/bison-runtime.pot automatically, so that we
8498 don't have to worry about garbage getting in that file. We'll
8499 make sure after the next official release that old msgids don't
8500 get lost. See
8501 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
8502
8503 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
8504 Now auto-generated.
8505 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
8506 Fix typos in explanations of the runtime file.
8507 * bootstrap: Change gettext keyword from YYI18N to YY_.
8508 Use standard Makefile.in.in in runtime-po, since we'll arrange
8509 for backward-compatible bison-runtime.po files in a different way.
8510 * data/glr.c (YY_): New macro, from yacc.c.
8511 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
8512 Translate messages intended for users.
8513 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
8514 the wording in the other skeletons. We don't know that the memory
8515 is virtual.
8516 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
8517 Use same method that yacc.c uses.
8518 Don't translate debugging messages.
8519 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
8520 it doesn't work (yet), and requires C++ expertise to fix.
8521 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
8522 Move defn to a more logical place, to be consistent with other
8523 skeletons.
8524 Don't translate debugging messages.
8525 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
8526 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
8527 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
8528 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
8529
8530 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
8531 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
8532 void, not int.
8533 * tests/glr-regression.at (Badly Collapsed GLR States):
8534 Likewise.
8535 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8536 yylex should return 0 at EOF rather than aborting.
8537
8538 Improve tests for stack overflow in GLR parser.
8539 Problem reported by twlevo@xs4all.nl.
8540 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
8541 All uses removed.
8542 (yyStackOverflow): Just longjmp, but with value 2 so that caller
8543 can handle the problem.
8544 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
8545 (yyparse): New local variable yyresult to record the result.
8546 Use result of setjmp to set it, rather than storing itinto
8547 struct.
8548 (yyDone): Remove label.
8549 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
8550 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
8551 if YYABORT is used).
8552 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
8553 yyparse status; put status > 1 into diagnostic.
8554 Check that status==2 works.
8555 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
8556 Use exit status 3 for failure to open (which shouldn't happen).
8557
8558 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
8559
8560 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
8561 1 on syntax error; just let yyparse do its thing.
8562 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
8563 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
8564 (Exploding the Stack Size with Alloca):
8565 (Exploding the Stack Size with Malloc):
8566 Expect exit status 2, not 1, since the parser is supposed to blow
8567 its stack. Problem reported by twlevo@xs4all.nl.
8568
8569 * data/glr.c (yyparse): Don't assume that the initial calls
8570 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
8571 Print a stack-overflow message and fail instead.
8572 Initialize the line-number information before creating the stack,
8573 so that the stack-overflow message can report line zero safely.
8574
8575 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
8576
8577 Fix problems reported by twlevo@xs4all.nl.
8578 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
8579 (yyuserMerge): Provide a default case if b4_mergers is empty.
8580 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
8581 * tests/glr-regression.at
8582 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8583 Add casts to pacify C++ compilers.
8584 * tests/glr-regression.at (Improper merging of GLR delayed action
8585 sets): Declare yylex before using it.
8586 * tests/Makefile.am (maintainer-check-g++): Fix a stray
8587 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
8588 test for valgrind; valgrind is independent of g++.
8589 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
8590 for compatibility with POSIX 1003.1-2001 (if running coreutils).
8591 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
8592 Use a destructor, so that we can expand the stack. Change
8593 YYSTYPE to char * so that we can free it. Cast result of malloc.
8594
8595 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8596
8597 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
8598 a valgrind failure. Problem reported by twlevo@xs4all.nl.
8599
8600 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
8601
8602 * PACKAGING: New file, suggested by Bruno Haible and taken from
8603 similar wording in gettext's PACKAGING file.
8604 * NEWS: Mention PACKAGING.
8605 * Makefile.am (EXTRA_DIST): Add PACKAGING.
8606
8607 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
8608
8609 * NEWS: Document recent i18n improvements.
8610 * bootstrap: Get runtime translations into runtime-po.
8611 Create runtime-po files automatically, if possible.
8612 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
8613 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
8614 does not infringe on the user's name space.
8615 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
8616 * doc/bison.texinfo (Internationalization): Revamp the English
8617 and Texinfo syntax a bit, to try to make it clearer.
8618 (Bison Options, Option Cross Key): Mention --print-localedir.
8619 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
8620 YYENABLE_NLS. Quote a bit more.
8621 * runtime-po/.cvsignore: New file.
8622 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
8623 * runtime-po/Rules-quot: Remove; now created by bootstrap.
8624 * runtime-po/quot.sed: Likewise.
8625 * runtime-po/boldquot.sed: Likewise.
8626 * runtime-po/en@quot.header: Likewise.
8627 * runtime-po/en@boldquot.header: Likewise.
8628 * runtime-po/insert-header.sin: Likewise.
8629 * runtime-po/remove-potcdate.sin: Likewise.
8630 * runtime-po/Makevars: Likewise.
8631 * runtime-po/LINGUAS: Likewise.
8632 * runtime-po/de.po: Likewise; we will rely on the translation project
8633 to maintain this, so "bootstrap" should get it.
8634 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
8635 its value.
8636 * src/main.c (main): Bind the bison-runtime domain, too.
8637
8638 2005-07-12 Bruno Haible <bruno@clisp.org>
8639
8640 * data/yacc.c: Include <libintl.h> when NLS is enabled.
8641 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
8642 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
8643 * runtime-po: New directory.
8644 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
8645 $(DOMAIN).pot-update rule, so that old messages are never dropped.
8646 * runtime-po/Rules-quot: New file, copied from po/.
8647 * runtime-po/quot.sed: Likewise.
8648 * runtime-po/boldquot.sed: Likewise.
8649 * runtime-po/en@quot.header: Likewise.
8650 * runtime-po/en@boldquot.header: Likewise.
8651 * runtime-po/insert-header.sin: Likewise.
8652 * runtime-po/remove-potcdate.sin: Likewise.
8653 * runtime-po/Makevars: New file.
8654 * runtime-po/POTFILES.in: New file.
8655 * runtime-po/LINGUAS: New file.
8656 * runtime-po/bison-runtime.pot: New file.
8657 * runtime-po/de.po: New file.
8658 * m4/bison.m4: New file.
8659 * Makefile.am (SUBDIRS): Add runtime-po.
8660 (aclocaldir, aclocal_DATA): New variables.
8661 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
8662 Define aclocaldir.
8663 * src/getargs.c (usage): Document --print-localedir option.
8664 (PRINT_LOCALEDIR_OPTION): New enum item.
8665 (long_options): Add --print-localedir option.
8666 (getargs): Handle --print-localedir option.
8667 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
8668 (Internationalization): New section.
8669
8670 2005-07-12 Akim Demaille <akim@epita.fr>
8671
8672 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
8673 for consistency with the rest of the code.
8674 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
8675 Add separators.
8676
8677 2005-07-12 Akim Demaille <akim@epita.fr>
8678
8679 * src/parse-gram.y: Use %printer instead of YYPRINT.
8680
8681 2005-07-12 Akim Demaille <akim@epita.fr>
8682
8683 * src/symtab.h, src/symtab.c (symbol_print): New.
8684 * src/symlist.h, src/symlist.c (symbol_list_print): New.
8685 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
8686
8687 2005-07-12 Akim Demaille <akim@epita.fr>
8688
8689 * data/glr.c (b4_syncline): Fix (swap) the definitions of
8690 b4_at_dollar and b4_dollar_dollar.
8691
8692 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
8693
8694 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
8695 and Pennello's paper.
8696
8697 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
8698
8699 * data/yacc.c (yyparse): Undo previous patch. Instead,
8700 set yylsp[0] and yyvsp[0] only if the initial action
8701 sets yylloc and yylval, respectively.
8702
8703 * data/yacc.c (yyparse): In the initial action, set
8704 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
8705 This avoids the use of undefined variables if the initial
8706 action does not set yylloc and/or yylval.
8707
8708 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
8709
8710 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
8711 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
8712 Remove from CVS. These files are automatically generated.
8713 * examples/extexi: Clarify that this file is now part of Bison,
8714 not GNU M4, and that it works with any POSIX-compatible Awk.
8715 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
8716 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
8717 so that we also get calc++-parser.yy. Geneate it.
8718 Use $(AWK), not gawk, since any conforming Awk will do.
8719 Put comment before action, since older 'make' can't handle comment
8720 in action.
8721 $(BUILT_SOURCES): List all built sources, not just some of them.
8722 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
8723 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
8724 $($(calc_sources_generated)): Remove unnecessary test for existence
8725 of target. (This had a shell syntax error anyway; a stray "x".)
8726 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
8727 calc++-parser.yy.
8728 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
8729
8730 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
8731 implied by the other modules.
8732
8733 2005-07-06 Akim Demaille <akim@epita.fr>
8734
8735 Bind examples/calc++ to the package.
8736 * examples/calc++/Makefile: Remove, replaced by...
8737 * examples/calc++/Makefile.am: ... this new file.
8738 * examples/calc++/test: Remove input.
8739 * examples/calc++/compile: Remove.
8740 * examples/Makefile.am: New.
8741 * configure.ac, Makefile.am: Adjust.
8742 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
8743
8744 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
8745
8746 * data/glr.c (yyFail): Drastically simplify; since the format argument
8747 never had any % directives, we can simply pass it to yyerror.
8748 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
8749 be modified later, as that is the usual style in glr.c.
8750 Problems reported by Paul Hilfinger.
8751
8752 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
8753 and size overflow errors.
8754 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
8755 in case the user prolog sets feature-test macros like _GNU_SOURCE.
8756 (YYSIZEMAX): New macro.
8757 (yystpcpy): New function, taken from yacc.c.
8758 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
8759 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
8760 so that we don't have to maintain their signatures.
8761 (yyFail): Check for buffer overflow, by using vsnprintf rather
8762 than vsprintf. Allocate a bigger buffer if possible.
8763 Report an error if buffer allocation fails.
8764 (yyStackOverflow): New function.
8765 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
8766 the initialization was successful. It might fail if storage was
8767 exhausted.
8768 (yyexpandGLRStack): Add more checks for storage allocation failure.
8769 Use yyStackOverflow to report failures.
8770 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
8771 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
8772 Don't assume stack number fits in int.
8773 (yysplitStack): Check for storage allocation failure.
8774 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
8775 can print diagnostics on storage allocation failure. All callers
8776 changed.
8777 (yyresolveValue): Use yybool for boolean.
8778 (yyreportSyntaxError): Check for size-calculation overflow.
8779 This code is taken from yacc.c.
8780 (yyparse): Check for storage allocation errors when allocating
8781 the initial stack.
8782
8783 2005-07-05 Akim Demaille <akim@epita.fr>
8784
8785 Extract calc++ from the documentation.
8786 * doc/bison.texinfo (Calc++): Add the extraction marks.
8787 * examples/extexi: New, from the aborted GNU Programming 2E.
8788 Separate the different paragraph of a file with empty lines.
8789 * examples/Makefile: Use it to extract the whole calc++ example.
8790
8791 2005-06-24 Akim Demaille <akim@epita.fr>
8792
8793 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
8794 class typedefs.
8795
8796 2005-06-22 Akim Demaille <akim@epita.fr>
8797
8798 * doc/bison.texinfo (C++ Language Interface): First stab.
8799 (C++ Parsers): Remove.
8800
8801 2005-06-22 Akim Demaille <akim@epita.fr>
8802
8803 * data/lalr1.cc (yylex_): Honor %lex-param.
8804
8805 2005-06-22 Akim Demaille <akim@epita.fr>
8806
8807 Start a set of simple examples.
8808 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
8809 * examples/calc++/calc++-driver.hh,
8810 * examples/calc++/calc++-parser.yy,
8811 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
8812 * examples/calc++/compile, examples/calc++/test: New.
8813
8814 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
8815
8816 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
8817 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
8818 which stems from the 2005-05-27 patch.
8819
8820 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8821
8822 * data/glr.c: Modify treatment of unused parameters to permit use
8823 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
8824
8825 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
8826
8827 Fix infringement on user name space reported by Janos Zoltan Szabo.
8828 * data/yacc.c (yyparse): strlen -> yystrlen.
8829
8830 2005-05-30 Akim Demaille <akim@epita.fr>
8831
8832 * data/lalr1.cc (_): New.
8833 Translate the various messages.
8834
8835 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
8836
8837 Fix infringement on user name space reported by Bruno Haible.
8838 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
8839 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
8840 the user's name space.
8841 (alloca): Include <stdlib.h> to get it, if it's not built in.
8842 (YYMALLOC, YYFREE): Define only if needed.
8843 (malloc, free): Declare, but only if needed, as this infringes on
8844 the user name space.
8845
8846 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
8847
8848 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
8849 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
8850 with %d format.
8851 * lib/ebitset.c (min, max): Undef before defining.
8852 * lib/vbitset.c (min, max): Likewise.
8853 * lib/subpipe.c (create_subpipe): Save local variables in case
8854 vfork clobbers them.
8855
8856 2005-05-24 Bruno Haible <bruno@clisp.org>
8857
8858 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
8859 error message syntax used by gcc-4.0.
8860
8861 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
8862
8863 * README: Mention m4 1.4.3. Remove obsolete advice about
8864 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
8865
8866 * bootstrap: Remove workaround for problem I encountered with
8867 gettext 0.14.1; it seems to be fixed now.
8868
8869 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
8870
8871 * NEWS: Version 2.0a.
8872
8873 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
8874 the previous change.
8875
8876 Various maintainer cleanups.
8877 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
8878 conftest*, for benefit of CVS commands run at the same time as
8879 "configure". Add build-aux, since "bootstrap" now creates it and
8880 its subfiles.
8881 * Makefile.cfg (move_if_change): Remove.
8882 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
8883 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
8884 (po_repo, do-po-update, po-update, wget_files, get-targets):
8885 (config.guess-url_prefix, config.sub-url_prefix):
8886 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
8887 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
8888 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
8889 Remove.
8890 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
8891 this is now the recommended name.
8892 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
8893 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
8894 ylwrap. These files now go into build-aux.
8895 * config/move-if-change: Remove.
8896 * config/prev-version.txt: Bump from 1.75 to 2.0.
8897
8898 * bootstrap: Add stdio-safer, unistd-safer modules.
8899 Remove m4/glibc2.m4 (introduced by latest gnulib, but
8900 we don't need it).
8901 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
8902 fopen-safer.c, stdio-safer.h, unistd-safer.h.
8903 * lib/subpipe.c: Include "unistd-safer.h".
8904 (create_subpipe): Make sure all the newly-created
8905 file descriptors are > 2, so that diagnostics don't
8906 get sent down them (which might cause Bison to hang, in theory).
8907 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
8908 * src/files.c (xfopen): Use fopen_safer, not fopen.
8909
8910 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
8911 yesterday's yacc.c fix.
8912
8913 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
8914
8915 * data/glr.c, data/lalr1.cc: Update copyright date.
8916
8917 Fix a destructor bug reported by Wolfgang Spraul in
8918 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
8919 * data/yacc.c (yyabortlab): Don't call destructor, and
8920 don't set yychar to EMPTY.
8921 (yyoverflowlab): Don't call destructor.
8922 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
8923 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
8924 since we no longer output the message "discarding lookahead token
8925 end of input ()".
8926
8927 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8928
8929 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
8930 fix a small glitch in debugging output.
8931 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
8932 after YY_SYMBOL_PRINT where needed.
8933
8934 (struct yyGLRState): Add some comments.
8935 (struct yySemanticOption): Add some comments.
8936 (union yyGLRStackItem): Add comment.
8937
8938 (yymergeOptionSets): Correct this to properly perform the union,
8939 avoiding infinite reported by Michael Rosien.
8940 Update comment.
8941
8942 * tests/glr-regression.at: Add test for GLR merging error reported
8943 by M. Rosien.
8944
8945 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
8946
8947 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
8948 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
8949 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
8950 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
8951 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
8952 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
8953 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
8954 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
8955 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
8956 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
8957 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
8958 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
8959 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
8960 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
8961 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
8962 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
8963 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
8964 src/derives.h, src/files.c, src/files.h, src/getargs.c,
8965 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
8966 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
8967 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
8968 src/output.h, src/parse-gram.c, src/parse-gram.h,
8969 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
8970 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
8971 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
8972 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
8973 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
8974 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
8975 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
8976 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
8977 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
8978 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
8979 tests/reduce.at, tests/regression.at, tests/sets.at,
8980 tests/synclines.at, tests/testsuite.at, tests/torture.at:
8981 Update FSF postal mail address.
8982
8983 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
8984
8985 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
8986 Problem reported by Ralf Menzel.
8987
8988 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
8989
8990 * tests/actions.at: Test that stack overflow invokes destructors.
8991 From Marcus Holland-Moritz.
8992 * data/yacc.c (yyerrlab): Move the code that destroys the stack
8993 from here....
8994 (yyreturn): to here. That way, destructors are called properly
8995 even if the stack overflows, or the user calls YYACCEPT or
8996 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
8997 (yyoverflowlab): Destroy the lookahead.
8998
8999 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
9000
9001 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
9002
9003 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
9004
9005 * NEWS: Bison-generated C parsers no longer quote literal strings
9006 associated with tokens.
9007 * src/output.c (prepare_symbols): Don't escape strings,
9008 since users don't want to see C escapes.
9009 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
9010 in diagnostics.
9011 * tests/input.at (Torturing the Scanner): Likewise.
9012 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
9013
9014 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
9015
9016 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
9017 the data size is known to be too small and we can't increase it.
9018 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
9019
9020 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
9021
9022 * src/parse-gram.y: Include quotearg.h.
9023 (string_as_id): Quote $1 before using it as a key, since the
9024 lexer no longer quotes it for us.
9025 (string_content): Don't strip quotes, since lexer no longer
9026 quotes it for us.
9027 * src/scan-gram.l: Include quotearg.h.
9028 ("\""): Omit quote.
9029 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
9030 a key, since the rest of the lexer doesn't quote it.
9031 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
9032 * tests/regression.at (Token definitions): Check for backslashes
9033 in token strings.
9034
9035 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
9036 (YYSIZE_T): Define to unsigned long int when using an older compiler.
9037 (yyparse): Revamp code to generate long syntax error message, to
9038 make it easier to translate, and to avoid problems with arithmetic
9039 overflow. Change "virtual memory" to "memory" in diagnostic, since
9040 we don't know whether the memory is virtual.
9041
9042 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
9043
9044 * NEWS: Bison-generated C parsers now use the _ macro to
9045 translate strings.
9046 * data/yacc.c (_) [!defined _]: New macro.
9047 All English strings wrapped inside this macro.
9048 * doc/bison.texinfo (Bison Parser): Document _.
9049 * po/POTFILES.in: Include src/parse-gram.c, since it now
9050 includes translateable strings that parse-gram.y doesn't.
9051
9052 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
9053
9054 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
9055 reverting the 2004-10-11 change to this function.
9056 (symbol_check_alias_consistency): Don't call symbol_type_set
9057 if the type name is already correct.
9058 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
9059
9060 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
9061
9062 * tests/regression.at (Token definitions): Don't use a token named
9063 c, as that generates a "#define c ..." that runs afoul of buggy
9064 stdlib.h that uses the identifier c as a member of struct
9065 drand48_data. Problem reported by Horst Wente.
9066
9067 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
9068
9069 * bootstrap: Change translation URL from
9070 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
9071 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
9072 redirection glitches. Problem reported by twlevo@xs4all.nl.
9073
9074 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
9075
9076 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
9077 after operands; POSIX says this isn't portable for the c99 command.
9078
9079 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
9080
9081 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
9082 immediately if a data overrun has occurred; this may help us track
9083 down what may be a spurious failure on MacOS.
9084
9085 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
9086
9087 Respond to problems reported by twlevo@xs4all.nl.
9088
9089 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
9090
9091 * src/vcg.h: Comment fix.
9092 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
9093 (G_CMAX): Change to -1 instead of INT_MAX.
9094
9095 * data/yacc.c (yyparse): Omit spaces before #line.
9096
9097 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
9098
9099 * src/tables.c (state_number_to_vector_number): Put it inside an
9100 "#if 0", since it's not currently used. Problem reported by
9101 Roland McGrath.
9102
9103 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
9104
9105 * src/output.c (escaped_output): Renamed from
9106 escaped_file_name_output, since we now use it for symbol tags as
9107 well. All uses changed.
9108 (symbol_destructors_output, symbol_printers_output):
9109 Escape symbol tags too.
9110 Problem reported by Matyas Forstner in
9111 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
9112
9113 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
9114 not needed.
9115 * src/output.c (user_actions_output, token_definitions_output,
9116 symbol_destructors_output, symbol_printers_output): Likewise.
9117 * src/reader.c (prologue_augment): Likewise.
9118 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
9119
9120 * src/vcg.c (output_edge): Don't quote linestyle arg.
9121 Problem reported by twlevo@xs4all.nl.
9122
9123 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
9124
9125 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
9126 example, reported by Derek M Jones. Also, make the example even
9127 more outrageous, to better illustrate how bad the problem is.
9128
9129 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
9130
9131 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
9132 putsym. Typo reported by Sebastian Piping.
9133
9134 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
9135
9136 * doc/bison.texinfo (Language and Grammar): some -> same
9137 (Epilogue): int he -> in the
9138 Typos reported by Sebastian Piping via Justin Pence.
9139
9140 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
9141
9142 * tests/glr-regression.at (Improper handling of embedded actions
9143 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
9144 embedded actions and $-N in GLR parsers", work around an Autoconf bug
9145 with dollar signs in test names.
9146 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
9147 for a similar reason.
9148
9149 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
9150
9151 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
9152 wants to redefine G_VIEW.
9153
9154 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
9155
9156 * src/vcg.c (get_view_str): Remove case for normal_view.
9157 Problem reported by twlevo@xs4all.nl.
9158
9159 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
9160
9161 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
9162 Problem reported by twlevo@xs4all.nl.
9163
9164 * doc/bison.texinfo: Change @dircategory from "GNU programming
9165 tools" to "Software development". Requested by Richard Stallman
9166 via Karl Berry.
9167
9168 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
9169
9170 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
9171 Problem reported by twlevo@xs4all.nl.
9172
9173 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
9174
9175 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
9176 keyword; it's not needed with modern compilers, and it doesn't
9177 affect correctness with older compilers. Suggested by
9178 twlevo@xs4all.nl.
9179
9180 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
9181
9182 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
9183 gcc -Wswitch-default.
9184 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9185 * data/yacc.c (yyparse): Likewise.
9186
9187 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
9188
9189 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
9190 already. Let config.h define any nonstandard values.
9191
9192 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
9193
9194 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
9195 for the benefit of slower hosts. Problem reported by
9196 Nelson H. F. Beebe.
9197
9198 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
9199
9200 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
9201 being defined and not used.
9202 * data/lalr1.cc (yyparse): Likewise.
9203 Use "if (false)" rather than "if (0)".
9204
9205 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
9206
9207 * TODO: Mention that we should allow NUL bytes in tokens.
9208
9209 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
9210
9211 * src/scan-skel.l (<<EOF>>): Don't close standard output.
9212 Problem reported by Hans Aberg.
9213
9214 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
9215
9216 * src/getargs.c (version): Happy new year; update overall
9217 program copyright date from 2004 to 2005.
9218
9219 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
9220 Problem reported by Hans Aberg.
9221 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
9222 (Output file names.): Add a test for the case when standard output
9223 is closed.
9224
9225 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
9226
9227 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
9228 to fix an oversight in the Bison 2.0 manual.
9229
9230 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
9231
9232 * NEWS: Version 2.0. Reformat the existing news items since
9233 1.875, so that related items are grouped together.
9234 * configure.ac (AC_INIT): Bump version to 2.0.
9235 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
9236
9237 * tests/torture.at (Exploding the Stack Size with Alloca): Set
9238 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
9239 otherwise, we're not testing alloca. Unfortunately there's no
9240 simple way to consult HAVE_ALLOCA here.
9241
9242 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
9243 for yymsg, too.
9244
9245 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
9246 hand. This avoids a warning about comparing int to size_t when
9247 GCC warnings are enabled.
9248
9249 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
9250
9251 * NEWS: Bison-generated parsers no longer default to using the
9252 alloca function (when available) to extend the parser stack, due
9253 to widespread problems in unchecked stack-overflow detection.
9254 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
9255 responsibility to set it to a positive value. This lets the user
9256 specify a value that is not a preprocessor constant.
9257 * data/yacc.c (YYMAXDEPTH): Likewise.
9258 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
9259 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
9260 to be a compile-time constant. However, explain the constraints on it.
9261 Also, explain the constraints on YYINITDEPTH.
9262 (Table of Symbols): Explain that alloca is no longer the default.
9263 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
9264 to 1.
9265
9266 * doc/bison.texinfo (Location Default Action): Mention that n must
9267 be zero when k is zero. Suggested by Frank Heckenbach.
9268
9269 2004-12-22 Akim Demaille <akim@epita.fr>
9270
9271 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
9272 (parser::state_type, parser::semantic_type, parser::location_type):
9273 Private, not public.
9274 (parser::parse): Return ints, not bool.
9275 Returning a bool introduces a problem: 0 corresponds to false, and
9276 it seems weird to return false on success. Returning true changes
9277 the conventions for yyparse.
9278 Alternatively we could return void and send an exception.
9279 There is no clear consensus (yet?).
9280 (state_stack, semantic_stack, location_stack): Rename as...
9281 (state_stack_type, semantic_stack_type, location_stack_type): these.
9282 Private, not public.
9283 * tests/c++.at: New.
9284 * tests/testsuite.at, tests/Makefile.am: Adjust.
9285
9286 2004-12-21 Akim Demaille <akim@epita.fr>
9287
9288 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
9289
9290 2004-12-21 Akim Demaille <akim@epita.fr>
9291
9292 Don't impose std::string for filenames.
9293
9294 * data/lalr1.cc (b4_filename_type): New.
9295 (position::filename): Use it.
9296 (parser.hh): Move the inclusion of stack.hh and location.hh below
9297 the user code, so that needed headers for the filename type can be
9298 included first.
9299 Forward declare them before the user code.
9300 * tests/Makefile.am (check-local, installcheck-local): Pass
9301 TESTSUITEFLAGS to the TESTSUITE.
9302
9303 2004-12-20 Akim Demaille <akim@epita.fr>
9304
9305 Use more STL like names: my_class instead of MyClass.
9306
9307 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
9308 (SemanticStack, SemanticType, StateStack, StateType)
9309 (TokenNumberType, Stack, Slice, Traits, Parser::location)
9310 (Parser::value): Rename as...
9311 (location_stack, location_type, rhs_number_type, semantic_stack)
9312 (semantic_type, state_stack, state_type, token_number_type, stack)
9313 (slice, traits, parser::yylloc, parser::yylval): these.
9314
9315 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
9316
9317 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
9318
9319 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
9320 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9321
9322 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
9323
9324 Remove uses of 'short int' and 'unsigned short int'. This raises
9325 some arbitrary limits. It uses more memory but nowadays that's
9326 not much of an issue.
9327
9328 This change does not affect the generated parsers; that's a different
9329 task, as some users will want to conserve memory there.
9330
9331 Ideally we should use size_t to represent all object counts, and
9332 something like ptrdiff_t to represent signed differences of object
9333 counts; but that will require more code-cleanup than I have the
9334 time to do right now.
9335
9336 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
9337 Use size_t, not int or short int, to count objects.
9338 * src/closure.c (nritemset, closure): Likewise.
9339 * src/closure.h (nritemset, closure): Likewise.
9340 * src/nullable.c (nullable_compute): Likewise.
9341 * src/print.c (print_core): Likewise.
9342 * src/print_graph.c (print_core): Likewise.
9343 * src/state.c (state_compare, state_hash): Likewise.
9344 * src/state.h (struct state): Likewise.
9345 * src/tables.c (default_goto, goto_actions): Likewise.
9346
9347 * src/gram.h (rule_number, rule): Use int, not short int.
9348 * src/output.c (prepare_rules): Likewise.
9349 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
9350 errs, reductions): Likewise.
9351 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
9352 Likewise.
9353 * src/tables.c (vector_number, tally, action_number,
9354 ACTION_NUMBER_MINIMUM): Likewise.
9355 * src/output.c (muscle_insert_short_int_table): Remove.
9356
9357 2004-12-17 Akim Demaille <akim@epita.fr>
9358
9359 * data/lalr1.cc: Extensive Doxygenation.
9360 (error_): Rename as...
9361 (error): this, since it is visible to the user.
9362 Adjust callers.
9363 (Parser::message): Now an automatic variable from...
9364 (Parser::yyreport_syntax_error_): here.
9365 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
9366 Parser::error.
9367 * tests/input.at: Escape $.
9368
9369 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
9370
9371 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
9372 Parenthesize rhs to avoid obscure problems with mistakes like
9373 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
9374 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9375 b4_rhs_location): Likewise.
9376 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9377 b4_rhs_location): Likewise.
9378
9379 2004-12-16 Akim Demaille <akim@epita.fr>
9380
9381 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
9382 yacc.c: be sure to stay within yycheck_.
9383 * tests/actions.at: Re-enable C++ tests.
9384
9385 2004-12-16 Akim Demaille <akim@epita.fr>
9386
9387 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
9388 real.
9389
9390 2004-12-16 Akim Demaille <akim@epita.fr>
9391
9392 Use #define to handle the %name-prefix.
9393
9394 * data/glr.c, data/yacc.c: Comment changes.
9395 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
9396 so that one can refer to yylex in the parser file, and have it
9397 renamed, as is the case with other skeletons.
9398
9399 2004-12-16 Akim Demaille <akim@epita.fr>
9400
9401 Move lalr1.cc internals into yy*.
9402
9403 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
9404 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
9405 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
9406 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
9407 (empty_, final_, terror_, errcode_, ntokens_)
9408 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
9409 (looka_, ilooka_, error_range_, nerrs_):
9410 Rename as...
9411 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
9412 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
9413 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
9414 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
9415 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
9416 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
9417 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
9418 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
9419 these.
9420
9421 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
9422
9423 Fix some problems reported by twlevo at xs4all.
9424 * src/symtab.c (symbol_new): Report an error if the input grammar
9425 contains too many symbols. This is better than calling abort() later.
9426 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
9427 (struct node, struct graph):
9428 Rename member expand to stretch. All uses changed.
9429 (struct graph): Remove member layoutalgorithm. All uses removed.
9430 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
9431 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
9432 All uses changed.
9433 (N_STRETCH): Rename from N_EXPAND. All uses changed.
9434
9435 2004-12-15 Akim Demaille <akim@epita.fr>
9436
9437 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
9438 Add more Doxygen comments.
9439 (symprint_, stack_print_, reduce_print_, destruct_, pop)
9440 (report_syntax_error_, translate_): Rename as...
9441 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
9442 (yypop_, yyreport_syntax_error_, yytranslate_): this.
9443
9444 2004-12-15 Akim Demaille <akim@epita.fr>
9445
9446 * data/lalr1.cc (lex_): Rename as...
9447 (yylex_): this.
9448 Move the trace here.
9449 Take the %name-prefix into account.
9450 Reported by Alexandre Duret-Lutz.
9451
9452 2004-12-15 Akim Demaille <akim@epita.fr>
9453
9454 Simplify the C++ parser constructor.
9455
9456 * data/lalr1.cc (debug_): Rename as...
9457 (yydebug_): so that the parser's internals are always in the yy*
9458 pseudo namespace.
9459 Adjust uses.
9460 (b4_parse_param_decl): Remove the leading comma as it is now only
9461 called as unique argument list.
9462 (Parser::Parser): Remove the constructor accepting a location and
9463 an initial debugging level.
9464 Remove from the other ctor the argument for the debugging level.
9465 (debug_level_type, debug_level, set_debug_level): New.
9466
9467 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
9468 constructor calls.
9469
9470 2004-12-15 Akim Demaille <akim@epita.fr>
9471
9472 Remove b4_root related material: failure experiment
9473 (which goal was to allow to derive from a class).
9474
9475 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
9476 definitions and uses.
9477
9478 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
9479
9480 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
9481 not 2, since it's not portable to subtract 1 from the start of an
9482 array. The new item 0 is never set or used. All uses changed.
9483
9484 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
9485 the default definition of YYLLOC_DEFAULT. Problem reported
9486 by Frank Heckenbach.
9487
9488 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
9489
9490 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
9491 the normal case and one for the error case. Just use the
9492 first one uniformly. Problem reported by Frank Heckenbach.
9493 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
9494 use exactly the same macro in both places.
9495 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
9496 so that the normal-case YYRHSLOC works for the error case too.
9497 All uses changed.
9498 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
9499 (YYLLOC_DEFAULT): Use the same macro as glr.c.
9500 * doc/bison.texinfo (Location Default Action): Don't claim that
9501 we have an array of locations. Use the same macro for both glr
9502 and lalr parsers. Mention YYRHSLOC. Mention what happens when
9503 the index is 0.
9504
9505 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9506
9507 * HACKING: Update email addresses to send announcements to.
9508
9509 * configure.ac (AC_INIT): Bump version to 1.875f.
9510
9511 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9512
9513 * NEWS: Version 1.875e.
9514 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
9515
9516 * src/scan-skel.l: Include "complain.h", for "fatal".
9517
9518 * src/relation.h (relation_print, relation_digraph):
9519 Relation sizes are of type relation_node, not size_t (this is
9520 merely a doc fix, since the two types are equivalent).
9521 (relation_transpose): Relation sizes are of type relation_node,
9522 not int.
9523 * src/relation.c: Likewise.
9524 (top, infinity): Now of type relation_node, not int.
9525 (traverse, relation_transpose): Use relation_node, not int.
9526
9527 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
9528 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
9529 (yyparse): Remove unused local introduced in 2004-10-25 patch.
9530
9531 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
9532 specifying whether the test should be skipped. Use it tp
9533 specify that the [%defines %skeleton "lalr1.cc"] tests currently
9534 fail on some hosts, and should be skipped.
9535
9536 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
9537
9538 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
9539 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
9540 unless otherwise specified below.
9541
9542 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
9543 to allocate kernel_base, kernel_items, kernel_size, since
9544 they needn't be initialized to 0.
9545 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
9546 * src/closure.c (new_closure): Likewise, for itemset.
9547 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
9548 * src/lalr.c (set_goto_map): Likewise, for temp_map.
9549 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
9550 (build_relations): Likewise for edge, states1, includes.
9551 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
9552 * src/reader.c (packgram): Likewise, for ritem, rules.
9553 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
9554 * src/relation.c (relation_digraph): Likewise for VERTICES.
9555 (relation_transpose): Likewise for new_R, end_R.
9556 * src/symtab.c (symbols_token_translations_init): Likewise for
9557 token_translations.
9558 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
9559 (token_actions): Likewise for yydefact, actrow, conflrow,
9560 conflict_list.
9561 (save_column): Likewise for froms[symno], tos[symno].
9562 (goto_actions): Likewise for state_count.
9563 (pack_table): Likewise for base, pos, check.
9564 (tables_generate): Likewise for width.
9565
9566 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
9567 for initial core. Just have a separate core, so we needn't worry
9568 about whether kernel_size and kernel_base are initialized.
9569
9570 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
9571 kernel_size, kernel_items): Remove unnecessary initialization.
9572 * src/conflicts.c (conflicts): Likewise.
9573 * src/derives.c (derives): Likewise.
9574 * src/muscle_tablc (muscle_insert): Likewise.
9575 * src/relation.c (relation_digraph): Likewise.
9576 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
9577 conflrow, conflict_table, conflict_list, table, check):
9578 Likewise.
9579
9580 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
9581 This is because all callers pass unsigned int.
9582 * src/closure.h (new_closure): Likewise.
9583
9584 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
9585 (build_relations): Initialize includes[i] in all cases.
9586 * src/reader.c (packgram): Always initialize rules[ruleno].prec
9587 and rules[ruleno].precsym. Initialize members in order.
9588 * src/relation.c (relation_transpose): Always initialize new_R[i]
9589 and end_R[i].
9590 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
9591
9592 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
9593 conflict_list[0] was always 0, but now it isn't initialized.
9594
9595 * src/table.c (table_grow): When conflict_table grew, the grown
9596 area wasn't cleared. Fix this.
9597
9598 * lib/.cvsignore: Add strdup.c, strdup.h.
9599 * m4/.cvsignore: Add strdup.m4.
9600
9601 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
9602
9603 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
9604 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
9605 GOTO_NUMBER_MAXIMUM, since we occasionally compute
9606 ngotos + 1 without checking for overflow.
9607 (build_relations): Use END_NODE, not -1, to denote end of edges.
9608 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
9609 build_relations): Use goto_number, not int, for goto numbers.
9610 * src/tables.c (save_column, default_goto): Likewise.
9611
9612 2004-11-23 Akim Demaille <akim@epita.fr>
9613
9614 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
9615 of #defining from yystype.
9616 Don't typedef yystype, C++ does not need it.
9617 This lets it possible to forward declare it as union.
9618
9619 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
9620
9621 * bootstrap (gnulib_modules): Add extensions.
9622 Problem reported by Jim Meyering.
9623
9624 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
9625
9626 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
9627 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
9628 src/system.h, src/tables.c: XFREE -> free, to accommodate
9629 recent change to gnulib xalloc.h.
9630 Problem reported by Jim Meyering.
9631
9632 2004-11-17 Akim Demaille <akim@epita.fr>
9633
9634 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
9635
9636 2004-11-17 Akim Demaille <akim@epita.fr>,
9637 Alexandre Duret-Lutz <adl@gnu.org>
9638
9639 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
9640 changes.
9641 (YYCDEBUG): Adjust.
9642 Use it instead of cdebug_.
9643 (Parser::debug_stream, Parser::set_debug_stream): New.
9644 (Parser::symprint_): Define cdebug_ for temporary backward
9645 compatibility.
9646 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
9647 debug_stream ().
9648
9649 2004-11-17 Akim Demaille <akim@epita.fr>
9650
9651 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
9652 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
9653 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
9654 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9655
9656 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
9657
9658 * data/glr.c (yyloc_default): Remove; not used.
9659 Problem reported by Frank Heckenbach.
9660
9661 2004-10-25 Akim Demaille <akim@epita.fr>
9662
9663 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
9664 Introduce another definition to address simple location arrays.
9665 (yyGLRStack): New member: yyerror_range.
9666 (yyrecoverSyntaxError, yyparse): Update it.
9667 (yyrecoverSyntaxError): Use it when shifting the error token to
9668 have an accurate range, equivalent to the one computed by both
9669 yacc.c and lalr1.cc.
9670 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
9671 that column numbers start at column 0, as per GNU Coding
9672 Standards, the others tests, and the doc.
9673 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
9674 Adjust to the above change (first column is 0).
9675 And adjust the location of the "<error>", now covering the whole
9676 line.
9677
9678 2004-10-22 Akim Demaille <akim@epita.fr>
9679 and Paul Eggert <eggert@cs.ucla.edu>
9680
9681 Remove some arbitrary limits on goto numbers and relations.
9682 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
9683 initial values, since they're never used.
9684 (set_goto_map): ngotos is now unsigned, so test for overflow
9685 by seeing whether it wraps around to zero.
9686 * src/lalr.h (goto_number): Now size_t, not short int.
9687 (GOTO_NUMBER_MAXIMUM): Remove.
9688 * src/relation.c (relation_print, traverse, relation_transpose):
9689 Check for END_NODE rather than looking at sign.
9690 * src/relation.h (END_NODE): New macro.
9691 (relation_node): Now size_t, not short int.
9692
9693 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
9694
9695 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
9696 keyword, not an identifier. Problem reported by Baron Schwartz in
9697 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
9698
9699 2004-10-11 Akim Demaille <akim@epita.fr>
9700
9701 * src/symtab.c (symbol_check_alias_consistency): Also check
9702 type names, destructors, and printers.
9703 Reported by Alexandre Duret-Lutz.
9704 Recode the handling of associativity and precedence in terms
9705 of symbol_precedence_set.
9706 Accept no redeclaration at all, not even equal to the previous
9707 value.
9708 (redeclaration): New.
9709 Use it to factor redeclaration complaints.
9710 (symbol_make_alias): Don't set the type of the alias, let
9711 symbol_check_alias_consistency do it as for other features.
9712 * src/symtab.h (symbol): Add new member prec_location, and
9713 type_location.
9714 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
9715 * tests/input.at (Incompatible Aliases): New.
9716
9717 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
9718
9719 .cvsignore fixes to accommodate gnulib changes,
9720 and the practice of naming build directories "_build".
9721 * .cvsignore: Add "_*". Sort.
9722 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
9723 * m4/.cvsignore: Add "*_gl.m4".
9724
9725 2004-10-06 Akim Demaille <akim@epita.fr>
9726
9727 * src/parse-gram.y (add_param): Fix the truncation of trailing
9728 spaces.
9729
9730 2004-10-05 Akim Demaille <akim@epita.fr>
9731
9732 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
9733 whether the reducion was empty or not. This leaves room to
9734 improve the use of YYLLOC_DEFAULT in such a case.
9735 lalr1.cc is still experimental, so changing this is acceptable.
9736 And finally, there are probably not many users who changed the
9737 handling of locations in GLR, so changing is admissible too.
9738
9739 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
9740 empty reduction, set @$ to an empty location ending the previously
9741 stacked symbol.
9742 Adjust uses to make sure the code is triggered on empty
9743 reductions.
9744 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
9745 expected output: empty reductions have empty locations.
9746
9747 2004-09-29 Akim Demaille <akim@epita.fr>
9748
9749 * data/lalr1.cc: Move towards a more standard C++ coding style
9750 for templates: Class < T > -> Class<T>.
9751
9752 2004-09-29 Akim Demaille <akim@epita.fr>
9753
9754 * data/lalr1.cc: Reinstall the former ctor, for sake of
9755 compatibility, but warn it will be removed.
9756 Move towards a more standard C++ coding style (i.e., type *var ->
9757 type* var).
9758
9759 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
9760
9761 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
9762 since it's less likely to work if NULs are involved in the future.
9763
9764 2004-09-27 Akim Demaille <akim@epita.fr>
9765
9766 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
9767
9768 2004-09-27 Akim Demaille <akim@epita.fr>
9769
9770 * data/lalr1.cc (b4_parse_param_decl_1): New.
9771 (b4_parse_param_decl): Use it to have different names between attribute
9772 and argument names.
9773 (b4_cc_constructor_call): Likewise.
9774
9775 2004-09-24 Akim Demaille <akim@epita.fr>
9776
9777 * src/parse-gram.y (add_param): Strip the leading and trailing
9778 blanks from a formal argument declaration.
9779 (YY_LOCATION_PRINT): New.
9780
9781 2004-09-24 Akim Demaille <akim@epita.fr>
9782
9783 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
9784 after the location.
9785
9786 2004-09-24 Akim Demaille <akim@epita.fr>
9787
9788 * doc/bison.texinfo (Table of Symbols): Sort.
9789
9790 2004-09-21 Akim Demaille <akim@epita.fr>
9791
9792 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
9793 the useless parentheses.
9794 Suggested by Paul Eggert.
9795
9796 2004-09-20 Akim Demaille <akim@epita.fr>
9797
9798 Let the initial-action act on the look-ahead, and use it for the
9799 "initial push" (corresponding to an hypothetical beginning-of-file).
9800 And let lalr1.cc honor %initial-action.
9801
9802 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
9803 example.
9804 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
9805 (Parser::Parser): Remove the ctor that used to initialize it.
9806 (Parser::parse): Like in the other skeletons, issue the "starting
9807 parse" message before any action.
9808 Honor %initial-action.
9809 Initialize the stacks with the lookahead.
9810 * data/yacc.c: Let $$ and @$ in %initial-action designate the
9811 look-ahead.
9812 Push them in the stacks.
9813 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
9814
9815 2004-09-20 Akim Demaille <akim@epita.fr>
9816
9817 * doc/bison.texinfo (Initial Action Decl): New.
9818
9819 2004-09-20 Akim Demaille <akim@epita.fr>
9820
9821 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
9822 clearer criterion to define it.
9823 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
9824 When reducing on an empty RHS, use the latest stacked location as
9825 location.
9826 yylloc is not always available.
9827 * data/glr.c: Likewise.
9828 Also, honor initial-actions.
9829
9830 2004-09-20 Akim Demaille <akim@epita.fr>
9831
9832 * data/yacc.c (YY_LOCATION_PRINT): New.
9833 Define when we know YYLTYPE's structure, i.e., when the default
9834 YYLLOC_DEFAULT is used.
9835 * data/c.m4 (b4_yysymprint_generate): Use it.
9836 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
9837 value of the result.
9838 (error_start_): Replace with...
9839 (error_range_): this location array.
9840 This allows to replace code relying on the implementation of
9841 locations by portable code.
9842 * data/yacc.c (yylerrsp): Replace with...
9843 (yyerror_range): this.
9844 Every time a token is popped, update yyerror_range[0], to have an
9845 accurate location for the error token.
9846 * data/glr.c (YY_LOCATION_PRINT): New.
9847 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
9848 deference a pointer.
9849 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
9850 report the location in %printers.
9851
9852 * src/scan-skel.l: Instead of abort, report error messages to ease
9853 understanding skeleton scanning failures.
9854
9855 2004-09-16 Akim Demaille <akim@epita.fr>
9856
9857 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
9858 (iterator, const_iterator): these, to be more in the C++ spirit.
9859 Also, return reverse iterators so that when displaying the stack
9860 we display its bottom first.
9861 (Parser::stack_print_, Parser::reduce_print_): Match the messages
9862 from yacc.c.
9863 We should probably use vector here though.
9864
9865 2004-09-16 Akim Demaille <akim@epita.fr>
9866
9867 Have more complete shift traces.
9868
9869 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
9870 to report Shifts instead of ad hoc YYDPRINTF invocations,
9871 including for the error token.
9872 * data/lalr1.cc (symprint_): Output the location.
9873 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
9874 output the location within the %printer.
9875 Activate GLR tests, at least to make sure they compile properly.
9876 They still don't pass though.
9877 * tests/calc.at: Adjust expect verbose output, since now "Entering
9878 state..." is on a different line than the "Shifting" message.
9879
9880 2004-09-08 Akim Demaille <akim@epita.fr>
9881
9882 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
9883 Bison directive from the Bison file to the invocation of this
9884 macro, so that these directives are passed to
9885 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
9886 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
9887 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
9888 the extra Bison directives instead of the whole series.
9889 Change the grammar so that there are recoverable errors, and
9890 unrecoverable errors. Now we can have the parser give up before
9891 consuming the whole input. As a result we now can observe that
9892 the lookahead is freed when needed.
9893 Change the parser source to parse argv[1] instead of a hard coded
9894 string.
9895 Simplify yylex, and give a value and location to EOF.
9896 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
9897 passed directives already coded in the file.
9898 Add some tests to check the location of "error".
9899 For some tests, the C++ parser is correct, and not yacc.c.
9900 For other tests, they provide different, but unsatisfying, values,
9901 so keep the C++ value so that at least one parser is "correct"
9902 according to the test suite.
9903 (Actions after errors): Remove, this is subsumed by the
9904 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
9905
9906 2004-09-06 Akim Demaille <akim@epita.fr>
9907
9908 * data/lalr1.cc: Adjust the indentation of the labels.
9909 (Parser::pop): New.
9910 Use it.
9911
9912 2004-09-06 Akim Demaille <akim@epita.fr>
9913
9914 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
9915 argument, an informative message.
9916 Call YY_SYMBOL_PRINT.
9917 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
9918 * data/lalr1.cc (destruct_): Likewise.
9919 In addition, no longer depend on b4_yysymprint_generate and
9920 b4_yydestruct_generate to generate these functions, do it "by
9921 hand".
9922
9923 2004-09-03 Akim Demaille <akim@epita.fr>
9924
9925 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
9926 invoked, yydestruct the lookahead.
9927 * tests/calc.at (Calculator $1): Update the expected lengths of
9928 traces: there is an added line for the discarded lookahead.
9929 * doc/bison.texinfo (Destructor Decl): Some rewording.
9930 Define "discarded" symbols.
9931
9932 2004-09-02 Akim Demaille <akim@epita.fr>
9933
9934 * data/lalr1.cc (translate_, destruct_): No reason to be static.
9935
9936 2004-09-02 Akim Demaille <akim@epita.fr>
9937
9938 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
9939 (YYDSYMPRINTF): Rename as...
9940 (YY_SYMBOL_PRINT): this.
9941 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
9942 two.
9943 Use it instead of direct symprint_ calls.
9944 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
9945 one.
9946
9947 2004-09-02 Akim Demaille <akim@epita.fr>
9948
9949 * data/lalr1.cc (b4_yysymprint_generate): New.
9950 (symprint_): New member function, defined when YYDEBUG.
9951 Use it consistently instead of token/nterm debugging output by
9952 hand.
9953 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
9954 %printer calls to use cdebug_ when using lalr1.cc.
9955
9956 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
9957
9958 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
9959 with #ifdef YYDEBUG.
9960
9961 2004-08-26 Akim Demaille <akim@epita.fr>
9962
9963 * doc/bison.texinfo (Implementing Loops): Rename as...
9964 (Implementing Gotos/Loops): this.
9965
9966 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
9967
9968 Adjust to latest gnulib.
9969 * bootstrap (gnulib_modules): Add xalloc-die.
9970 Set LC_ALL=C so that file names sort consistently.
9971 Prefer the gnulib copies of gettext.m4, glibc21.m4,
9972 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
9973 uintmax_t.m4, ulonglong.m4.
9974 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
9975 po.m4 since we are now using _gl.m4 instead.
9976
9977 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
9978
9979 * src/scan-action.l: Remove. Scanning of semantic actions is
9980 handled in scan-gram.l.
9981
9982 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
9983
9984 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
9985
9986 * src/location.h (struct): The file member is a uniqstr.
9987 (equal_boundaries): Use UNIQSTR_EQ for comparison.
9988
9989 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
9990
9991 Fix bug with non-%union parsers that have printers or destructors,
9992 which led to a Bison core dump. Reported by Peter Fales in
9993 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
9994
9995 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
9996 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
9997 not to our own type.
9998 * src/output.c (symbol_destructors_output, symbol_printers_output):
9999 Don't assume %union.
10000 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
10001 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
10002 UNION-FLAG. All callers changed.
10003 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
10004 Use type char, not unsigned int, when declaring an array of char;
10005 this lets us remove a cast.
10006 (Printers and Destructors): Add non-%union test cases.
10007
10008 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10009
10010 * doc/bison.texinfo: Minor editorial changes, mostly to the new
10011 GLR writeups. E.g., avoid frenchspacing and the future tense,
10012 change "lookahead" to "look-ahead", and change "wrt" to "with
10013 respect to".
10014
10015 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10016
10017 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
10018 New sections, split off from the GLR Parsers section. Put the new
10019 Simple GLR Parser near the start of the GLR section, for clarity.
10020 Rewrite connective text.
10021
10022 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
10023
10024 * doc/bison.texinfo (Simple GLR Parsers): New section.
10025
10026 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10027
10028 * NEWS, TODO, doc/bison.texinfo:
10029 Use "look-ahead" instead of "lookahead", to be consistent.
10030 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
10031 while we're fixing "look-ahead".
10032 * src/conflicts.c (shift_set): Renamed from shiftset.
10033 (look_ahead_set): Renamed from lookaheadset.
10034 * src/print.c: Likewise.
10035 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
10036 name for "lookahead".
10037 (report_types, usage): Likewise.
10038 * src/getargs.h (report_look_ahead_tokens): Renamed from
10039 report_lookaheads.
10040 * src/lalr.c (compute_look_ahead_tokens): Renamed from
10041 compute_lookaheads.
10042 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
10043 (look_ahead_tokens_print): Renamed from lookaheads_print.
10044 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
10045 state_rule_lookaheads_print.
10046 * src/state.h: Likewise.
10047 (reductions.look_ahead_tokens): Renamed from lookaheads.
10048 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
10049 AT_DATA_LOOKAHEADS_GRAMMAR.
10050
10051 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
10052
10053 * README: Update location of patched M4 distribution.
10054
10055 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
10056
10057 Don't assume the C++ compiler takes the same arguments as the C compiler
10058 (trivial change).
10059 * configure.ac (O0CXXFLAGS): New var.
10060 * tests/atlocal.in (CXXFLAGS): Use it.
10061
10062 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
10063
10064 Fix some "make check" problems with C++ reported by
10065 Albert Chin-A-Young for Tru64 C++ in this thread:
10066 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
10067
10068 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
10069 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10070 Output to a .cc file for C++, not to a .c file.
10071 * tests/calc.at (AT_CHECK_CALC): Likewise.
10072 * tests/regression.at (AT_CHECK_DANCER): Likewise.
10073 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
10074
10075 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
10076
10077 * tests/calc.at, tests/actions.at: Workaround for SGI
10078 C++ compiler. (trivial change)
10079
10080 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
10081
10082 Spent a few hours checking out which prerequisite versions the
10083 current sources actually require. I went all the way back to
10084 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
10085 a seemingly endless set of combinations of versions more recent
10086 than that. The bottom line is that the current sources require
10087 fairly recent versions of the build tools, and it'll be some work
10088 to change this.
10089 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
10090 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
10091 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
10092 Add comments explaining why those particular versions are
10093 currently needed.
10094
10095 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
10096 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
10097 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
10098
10099 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
10100 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
10101
10102 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
10103
10104 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
10105 0.11.5. Suggested by Bruno Haible.
10106 * bootstrap: Remove gettext version checking.
10107
10108 * doc/bison.texinfo (Decl Summary): Also mention that %union
10109 can depend on prerequisite types. Problem reported by Tim
10110 Van Holder.
10111
10112 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
10113
10114 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
10115 * README-alpha: Don't tell people not to package this.
10116
10117 * bootstrap: Don't assume $(...) works; use `...` instead.
10118 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
10119 gettext better.
10120
10121 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
10122 put into the -d output file, and mention what to do if YYSTYPE is
10123 defined as a macro.
10124
10125 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
10126
10127 Undo change made earlier today: it caused autopoint to not bring
10128 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
10129 autopoint's.
10130
10131 * bootstrap: Check that gettext version matches what's in
10132 configure.ac. Warn users to ignore robots.txt ERROR 404.
10133 * bootstrap: Undo today's earlier change (logged below).
10134 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
10135
10136 The gettext version checking is causing more trouble than it's
10137 curing; remove it. Problem reported by Paul Hilfinger.
10138
10139 * bootstrap: Issue a warning that one can expect a message
10140 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
10141 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
10142
10143 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
10144
10145 Ensure that the C++ compiler used for testing actually works on a
10146 simple test program; if not, skip the C++-related tests. Problem
10147 reported by Vin Shelton in:
10148 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
10149
10150 * m4/cxx.m4: New file.
10151 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
10152 * tests/atlocal.in (BISON_CXX_WORKS): Add.
10153 * tests/local.at (AT_COMPILE_CXX): Use it.
10154
10155 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10156
10157 * data/glr.c (yylloc): Output this macro even if locations are not
10158 being generated, as the GLR parser needs it even in that case.
10159 Problem reported by Troy A. Johnson
10160 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
10161
10162 * configure.ac (AC_INIT): Update to 1.875e.
10163
10164 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10165
10166 * NEWS: Version 1.875d.
10167 * configure.ac (AC_INIT): Likewise.
10168 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
10169
10170 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
10171 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
10172 lalr1.cc runs afoul of the first, and the last two are no longer
10173 supported by GCC 3.4.0.
10174 * README: Mention GNU m4 1.4 or later; mention m4 patches.
10175 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
10176
10177 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
10178
10179 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
10180 unsigned int, for compatibility with latest gnulib hash module.
10181 * src/state.c (state_hash, state_hasher): Likewise.
10182 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
10183 * src/uniqstr.c (hash_uniqstr): Likewise.
10184
10185 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
10186
10187 * NEWS: Unescaped newlines are no longer allowed in char & strings.
10188
10189 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
10190 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
10191 character and string literals.
10192 (unexpected_end): New function.
10193 (unexpected_eof): Use it.
10194 (unexpected_newline): New function.
10195 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
10196 actions.
10197
10198 * NEWS: Document %expect-rr.
10199
10200 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
10201 Fix typo by replacing $1 with $option.
10202 Remove more 'intl'-related files.
10203 Don't DEFUN AM_INTL_SUBDIR twice.
10204
10205 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
10206 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
10207 strtoul.c.
10208 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
10209 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
10210 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
10211 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
10212 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
10213 * src/.cvsignore: Add *.output.
10214
10215 * src/parse-gram.y: Put copyright notice inside %{ %} so it
10216 gets copied to the output file.
10217
10218 2004-04-28 Paul Eggert <eggert@twinsun.com>
10219
10220 Get files from the gnulib and po repositories, instead of relying
10221 on them being in our CVS. Upgrade to latest versions of gnulib
10222 and Automake.
10223
10224 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
10225 * bootstrap: Bootstrap from gnulib and po repositories.
10226 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
10227 * README-cvs: Document these changes. Remove version numbers from
10228 mentions of build tools, since they change so often. Mention Flex.
10229
10230 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
10231 (gl_USE_SYSTEM_EXTENSIONS): Add.
10232 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
10233 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
10234 does this for us.
10235 (AC_ISC_POSIX): Remove; we no longer support this
10236 ancient OS, as it gets in the way of latest Autoconf & gnulib.
10237 (AC_HEADER_STDC): Remove: we now assume C89 or better.
10238 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
10239 Do not check for C89 headers, except for locale.h which is used
10240 by the Yacc library and must port to K&R hosts.
10241 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
10242 Do not check for C89 functions, except for setlocale which is
10243 used by the Yacc library.
10244 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
10245 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
10246 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
10247 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
10248 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
10249 AM_GNU_GETTEXT): Remove; now done by:
10250 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
10251 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
10252 for us.
10253
10254 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
10255 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
10256 Define to empty, as gnulib.mk will do the rest for us.
10257 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
10258 for us.
10259 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
10260 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
10261
10262 * src/files.c: Include gnulib's xstrndup.h.
10263
10264 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
10265 (REALLOC): Use xnrealloc, for likewise.
10266 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
10267 (strnlen, memrchr): Remove decls; functions no longer used.
10268 Include <stpcpy.h>.
10269
10270 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
10271 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10272 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
10273 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
10274 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
10275 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
10276 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
10277 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
10278 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
10279 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
10280 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
10281 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10282 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
10283 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
10284 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
10285 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
10286 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
10287 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
10288 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
10289 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
10290 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
10291 Remove, as these files are now generated automatically
10292 by bootstrap or automake.
10293
10294 * po/ChangeLog: Remove: all but one entry was a duplicate
10295 of this file, and I moved that 2000-11-02 entry here.
10296
10297 * config/.cvsignore: Add Makefile, depcomp, install-sh.
10298 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
10299 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
10300 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
10301 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
10302 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
10303 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
10304 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
10305 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
10306 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
10307 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
10308 xstrndup.h.
10309 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
10310 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
10311 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
10312 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
10313 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
10314 * src/.cvsignore: Remove *_.c.
10315
10316
10317 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
10318 support it. (The latest stable gzip doesn't.)
10319
10320 2004-04-27 Paul Eggert <eggert@twinsun.com>
10321
10322 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
10323 case, as stos_ is now used by destructors due to the 2004-02-09
10324 change.
10325
10326 Remove more K&R C support.
10327 * lib/libiberty.y (PARAMS): Remove. All uses removed.
10328 * lib/subpipe.c (errno): Remove decl.
10329 Include <stdlib.h> unconditionally.
10330 (EXIT_FAILURE): Remove macro.
10331 * src/complain.c (vfprintf, strerror): Remove.
10332 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
10333 unconditionally.
10334 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
10335 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
10336 (strchr, strspn, memchr): Remove decls.
10337 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
10338 unconditionally. Do not declare perror.
10339 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
10340 unconditionally.
10341
10342 * src/complain.c (_): Remove useless defn, as system.h defines this.
10343
10344 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
10345 with latest obstack.h.
10346 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
10347 to procedure types, as obstack.h now does that for us.
10348 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
10349
10350 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
10351 so that this include file can stand alone.
10352 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
10353 does this now. Include subpipe.h first after config.h, to
10354 test whether it can stand alone.
10355
10356 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
10357 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
10358 unused declaration.
10359
10360 * tests/synclines.at (%union synch line): Put a dummy member in
10361 the union, because empty unions aren't allowed in C. Caught
10362 by GCC 3.4.0.
10363
10364 2004-04-13 Jim Meyering <jim@meyering.net>
10365
10366 * src/conflicts.c (conflicts_print): Correct format string typo:
10367 use `%%' to produce literal `%'. (trivial change)
10368
10369 2004-03-30 Paul Eggert <eggert@twinsun.com>
10370
10371 * src/getargs.c (version): Update copyright year to 2004.
10372
10373 * data/c.m4 (b4_int_type): Use 'short int' rather than
10374 'short', and similarly for 'long', 'unsigned', etc.
10375 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
10376 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
10377 yy_yypstack, yydumpstack): Likewise.
10378 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
10379 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
10380 Likewise.
10381 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
10382 yy_stack_print, yyparse): Likewise.
10383 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
10384 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
10385 * lib/bitset.c (bitset_print): Likewise.
10386 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
10387 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10388 * lib/bitsetv.c (bitsetv_dump): Likewise.
10389 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
10390 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
10391 Likewise.
10392 * src/LR0.c (allocate_itemsets): Likewise.
10393 * src/gram.h (rule_number, rule): Likewise.
10394 * src/lalr.h (goto_number): Likewise.
10395 * src/nullable.c (nullable_compute): Likewise.
10396 * src/output.c (prepare_rules): Likewise.
10397 * src/relation.c (relation_print, relation_digraph): Likewise.
10398 * src/relation.h (relation_node): Likewise.
10399 * src/state.h (state_number, transitions, errs, reductions,
10400 struct state): Likewise.
10401 * src/symtab.h (symbol_number, struct symbol): Likewise.
10402 * src/tables.c (vector_number, tally, action_number,
10403 default_goto, goto_actions): Likewise.
10404 * tests/existing.at (GNU Cim Grammar): Likewise.
10405 * tests/regression.at (Web2c Actions): Likewise.
10406
10407 * src/output.c (muscle_insert_short_int_table): Renamed from
10408 muscle_insert_short_table. All uses changed.
10409
10410 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10411
10412 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
10413 (declaration): Replace expected_conflicts with expected_sr_conflicts.
10414 Add %expect-rr rule.
10415
10416 * src/scan-gram.l: Recognize %expect-rr.
10417
10418 * src/conflicts.h (expected_sr_conflicts): Rename from
10419 expected_conflicts.
10420 (expected_rr_conflicts): Declare.
10421
10422 * src/conflicts.c (expected_sr_conflicts): Rename from
10423 expected_conflicts.
10424 (expected_rr_conflicts): Define.
10425 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
10426 for GLR parsers.
10427 Use expected_sr_conflicts in place of expected_conflicts.
10428 Warn if expected_rr_conflicts used in non-GLR parser.
10429
10430 * doc/bison.texinfo: Add documentation for %expect-rr.
10431
10432 2004-03-08 Paul Eggert <eggert@gnu.org>
10433
10434 Add support for hex token numbers. Suggested by Odd Arild Olsen in
10435 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
10436
10437 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
10438 in lalr1.cc.
10439 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
10440 * src/scan-gram.l (scan_integer): New function.
10441 ({int}): Use it.
10442 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
10443 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
10444 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
10445 Say "long int", not "long", for uniformity with GNU style.
10446
10447 2004-02-25 Paul Eggert <eggert@twinsun.com>
10448
10449 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
10450 compilers. This fixes a problem with Intel's C++ compiler being
10451 chatty, reported by Guido Trentalancia in
10452 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
10453
10454 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
10455
10456 Support %destructor and merge error locations in lalr1.cc.
10457
10458 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
10459 (Parser::stos_): Define unconditionally.
10460 (Parser::destruct_): New method. Generate its body with
10461 b4_yydestruct_generate.
10462 (Parser::error_start_): New attribute.
10463 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
10464 token which are discarded.
10465 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
10466 error_start_ when erroneous token are discarded.
10467 (Parser::parse) <yyerrlab1>: Compute the location of the error
10468 token so that it covers all the discarded tokens.
10469 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
10470 it can be called with `%skeleton "lalr1.cc"', and do that.
10471
10472 2004-02-02 Paul Eggert <eggert@twinsun.com>
10473
10474 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
10475 $(top_srcdir)/lib and ../lib. This fixes a bug reported
10476 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
10477 There's no need to mention top_builddir since Automake does that
10478 for us.
10479 (INCLUDES): Remove, as Automake says it's obsolescent.
10480 Contents migrated into AM_CPPFLAGS as described above.
10481 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
10482
10483 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10484
10485 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
10486 (yyreportSyntaxError): Handle case where lookahead token is
10487 YYEMPTY.
10488
10489 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10490
10491 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
10492 resulting parsers are compilable with C++.
10493
10494 2003-12-23 Paul Eggert <eggert@twinsun.com>
10495
10496 * config/depcomp, config/install-sh: Sync with Automake 1.8.
10497 * src/output.c (output_skeleton): Rename local var.
10498 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
10499 Bison tokens, as this runs afoul of the 2003-10-07 change that
10500 disallowed NUL bytes in character constants or string literals.
10501
10502 * tests/local.at: Require Autoconf 2.59's Autotest.
10503 * tests/testsuite.at: Don't include local.at, since we now assume
10504 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
10505 including it.
10506 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
10507 multiple inclusion warnings.
10508
10509 2003-12-02 Akim Demaille <akim@epita.fr>
10510
10511 * doc/bison.texinfo (How Can I Reset the Parser): More about start
10512 conditions.
10513 From Bruno Haible.
10514
10515 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
10516
10517 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
10518
10519 2003-10-07 Paul Eggert <eggert@twinsun.com>
10520
10521 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
10522 if testsuite doesn't exist.
10523
10524 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
10525 literals, unfortunately.
10526 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
10527 Complain about NUL bytes in character constants or string literals.
10528
10529 2003-10-05 Paul Eggert <eggert@twinsun.com>
10530
10531 * NEWS: Don't document %no-default-prec, as it's still
10532 too experimental.
10533 * doc/bison.texinfo: Document %no-default-prec only if
10534 the defaultprec flag is set. Normally it's not.
10535
10536 2003-10-04 Paul Eggert <eggert@twinsun.com>
10537
10538 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
10539 non-modifiable lvalue, instead of a modifiable one.
10540 * doc/bison.texinfo (Actions): Document that $$ can
10541 be assigned to. Do not claim that $$ and $N are
10542 array element references: user code should not rely on this.
10543
10544 2003-10-01 Paul Eggert <eggert@twinsun.com>
10545
10546 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
10547 (grammar_declaration): Use it.
10548 * src/scan-gram.l: New token %no-default-prec.
10549 * tests/conflicts.at: Revamp tests to use %no-default-prec.
10550 * NEWS, doc/bison.texinfo: Document the above.
10551
10552 2003-10-01 Akim Demaille <akim@epita.fr>
10553
10554 VCG no longer supports long_straight_phase.
10555
10556 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
10557 * src/print_graph.c (print_graph): Adjust.
10558
10559 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
10560 and Paul Eggert <eggert@twinsun.com>
10561
10562 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
10563 Table of Symbols): Document %default-prec.
10564 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
10565 (grammar_declaration): Set default_prec on %default-prec.
10566 * src/scan-gram.l (%default-prec): New token.
10567 * src/reader.h (default_prec): New flag.
10568 * src/reader.c: Likewise.
10569 (packgram): Handle it.
10570 * tests/conflicts.at (%default-prec without %prec,
10571 %default-prec with %prec, %default-prec 1): New tests.
10572
10573 2003-09-30 Paul Eggert <eggert@twinsun.com>
10574
10575 * tests/testsuite.at: Include local.at, not input.at, fixing
10576 a typo in the 2003-08-25 patch.
10577
10578 2003-08-27 Akim Demaille <akim@epita.fr>
10579
10580 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
10581 GCC warnings.
10582
10583 2003-08-26 Akim Demaille <akim@epita.fr>
10584
10585 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
10586 "<\#" to avoid magic from Gnus when posting parts of this script.
10587
10588 2003-08-26 Akim Demaille <akim@epita.fr>
10589
10590 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
10591 (Parser::parse): here.
10592 Adjust: nerrs and errstatus is now replaced by...
10593 (Parser::nerrs_, Parser::errstatus_): New.
10594
10595 2003-08-25 Akim Demaille <akim@epita.fr>
10596
10597 * config/announce-gen, Makefile.cfg: New.
10598 * Makefile.am: Adjust.
10599 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
10600 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
10601
10602 2003-08-25 Akim Demaille <akim@epita.fr>
10603
10604 When reducing initial empty rules, Bison parser read an initial
10605 location that is not defined. This results in garbage, and that
10606 affects Bison's own parser. Therefore we need (i) to extend Bison
10607 to support a means to initialize this location, and (ii) to use
10608 this CVS Bison to fix CVS Bison's parser.
10609
10610 * src/reader.h, reader.c (epilogue_augment): Remove, replace
10611 with...
10612 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
10613 * src/parse-gram.y: Adjust.
10614 (%initial-action): New.
10615 (%error-verbose): Since we require CVS Bison, there is no reason
10616 not to use it.
10617 * src/scan-gram.l: Adjust.
10618 * src/Makefile.am (YACC): New, to make sure we use our own parser.
10619 * data/yacc.c (yyparse): Use b4_initial_action.
10620
10621 2003-08-25 Akim Demaille <akim@epita.fr>
10622
10623 * doc/bison.texinfo: Don't promote stdout for error messages.
10624
10625 2003-08-25 Akim Demaille <akim@epita.fr>
10626
10627 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
10628 From Alexandre Duret-Lutz.
10629
10630 2003-08-25 Akim Demaille <akim@epita.fr>
10631
10632 Version 1.875c.
10633
10634 2003-08-25 Akim Demaille <akim@epita.fr>
10635
10636 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
10637 Use them.
10638
10639 2003-08-25 Akim Demaille <akim@epita.fr>
10640
10641 * data/lalr1.cc (Parser::reduce_print_): New.
10642 Use it.
10643
10644 2003-08-25 Akim Demaille <akim@epita.fr>
10645
10646 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
10647 error recovery loops. This patch is based on
10648 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
10649 Also, augment the similarity between lalr1.cc and yacc.c.
10650 Note: the locations of error recovery rules are not correct yet.
10651
10652 * data/lalr1.cc: Comment changes to augment the similarity between
10653 lalr1.cc and yacc.c.
10654 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
10655 (yyerrlab1): Remove, but where it used to be (now the bottom part of
10656 yyerrlab), when hitting EOF, pop the whole stack here instead of
10657 merely falling thru the default error handling mechanism.
10658 (yyerrorlab): New label, with the old contents of YYERROR,
10659 plus the following change: pop the stack of rhs corresponding
10660 to the production that invoked YYERROR. That is how Yacc
10661 behaves (required by POSIX).
10662 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
10663 fail.
10664
10665 2003-08-25 Akim Demaille <akim@epita.fr>
10666
10667 Tune local.at so that people can "autom4te -l autotest calc.at -o
10668 calc" for instance, to extract a sub test suite.
10669
10670 * tests/testsuite.at: Move the initialization, Autotest version
10671 requirement, and AT_TESTED invocation into...
10672 * tests/local.at: here.
10673 * tests/testsuite.at: Include it for compatibility with Autoconf
10674 2.57.
10675 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
10676 be ignore.
10677
10678 2003-08-04 Paul Eggert <eggert@twinsun.com>
10679
10680 Rework code slightly to avoid gcc -Wtraditional warnings.
10681 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
10682 The returned value is now stored in *YY0. All callers changed.
10683 * src/output.c (merge_output): Adjust to the above change.
10684
10685 2003-07-26 Paul Eggert <eggert@twinsun.com>
10686
10687 * data/glr.c (YYASSERT): New macro.
10688 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
10689 yyresolveStates, yyprocessOneStack):
10690 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
10691 Derived from a suggestion by Frank Heckenbach.
10692
10693 2003-07-25 Paul Eggert <eggert@twinsun.com>
10694
10695 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
10696 for portability to K&R C (after ansi2knr, presumably). See
10697 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
10698 by Frank Heckenbach, though I have omitted the structure-initialization
10699 part of his glr-knr.diff patch since I recall that the Portable
10700 C Compiler didn't require that change.
10701
10702 Let the user specify how to allocate and free memory.
10703 Derived from a suggestion by Frank Heckenbach in
10704 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
10705 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
10706 All uses of free, malloc, realloc changed to use these macros,
10707 and unnecessary casts removed.
10708 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
10709
10710 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
10711
10712 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
10713 use s.empty() rather than s == "" to test for empty string; see
10714 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
10715 (trivial change)
10716
10717 2003-06-25 Akim Demaille <akim@epita.fr>
10718
10719 * config/depcomp, config/install-sh: Update from masters.
10720
10721 2003-06-20 Paul Eggert <eggert@twinsun.com>
10722
10723 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
10724 and return properly parenthesized result.
10725 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
10726 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10727 Remove unnecessary parentheses from uses.
10728 * doc/bison.texinfo (Location Default Action): Describe the
10729 conventions for parentheses.
10730
10731 2003-06-19 Paul Eggert <eggert@twinsun.com>
10732
10733 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
10734 yyreportTree): Do not assume that size_t is the same width as int,
10735 when printing sizes. Print sizes using an unsigned format.
10736 Problem reported by Frank Heckenbach in
10737 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
10738
10739 Port to Forte Developer 7 C compiler.
10740 * data/glr.c (struct YYLTYPE): If locations are not being used,
10741 declare a single dummy member, as empty structs do not conform
10742 to the C standard.
10743 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
10744 the Forte Developer 7 C compiler complains that end-of-loop
10745 code is not reached.
10746
10747 2003-06-17 Paul Eggert <eggert@twinsun.com>
10748
10749 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
10750 avoid warnings from picky compilers about redefinition of PARAMS.
10751
10752 2003-06-17 Paul Eggert <eggert@twinsun.com>
10753
10754 Version 1.875b.
10755
10756 * NEWS: Document 1.875b.
10757
10758 * lib/bbitset.h: Do not include config.h; that's the includer's job.
10759 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
10760 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
10761 Don't use 'index' in comments, as it's a builtin fn on some hosts.
10762 * lib/bitset_stats.c: Include gettext.h unconditionally, as
10763 per recent gettext manual's suggestion.
10764 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
10765 Use prototypes, not old-style definitions.
10766 * lib/lbitset.c (lbitset_unused_clear): Likewise.
10767 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
10768 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
10769 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
10770 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
10771 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
10772 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
10773 vbitset_or_and_cmp, vbitset_copy): Likewise.
10774
10775 * lib/libiberty.h: Do not include config.h; that's the includer's job.
10776 Do not include <stdlib.h>.
10777 (PARAMS): Define unconditionally for C89.
10778 (ATTRIBUTE_NORETURN): Remove.
10779 (ATTRIBUTE_UNUSED): Define unconditionally.
10780
10781 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
10782 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
10783 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
10784 * lib/vbitset.c, lib/vbitset.h: New files.
10785 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10786 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
10787 from libbitset.
10788
10789 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
10790 `How Can I Reset @code{yyparse}', since texinfo does not allow
10791 arbitrary @ in node names.
10792
10793 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
10794 shouldn't be needed according to the gettext 0.12.1 documentation
10795 but which seem to be needed anyway: codeset.m4 glibc21.m4
10796 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
10797 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
10798 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
10799
10800 * lib/.cvsignore: Add stdbool.h.
10801 * m4/.cvsignore: Add nls.m4, po.m4.
10802
10803 Upgrade to CVS gnulib.
10804 * stdbool_.h: File renamed from stdbool.h.in.
10805 * configure.ac (AM_STDBOOL_H): Invoke this instead of
10806 AC_HEADER_STDBOOL.
10807 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
10808 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
10809 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
10810 (MOSTLYCLEANFILES): New var.
10811 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
10812 (stdbool.h): New rule.
10813 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
10814 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
10815 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
10816 m4/quote.m4: Upgrade to today's gnulib.
10817
10818 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
10819 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
10820 the tests right now.
10821 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
10822 yyerror are declared before use; C99 requires this.
10823
10824 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10825
10826 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
10827 first.
10828 (yyrecoverSyntaxError): Correct the logic for setting and testing
10829 yyerrState.
10830 Correct comment on handling EOF.
10831 Allow states with only a default reduction, rather than failing
10832 (I can't quite reconstruct why these were not allowed before).
10833
10834 Fixes to avoid problem that $-N rules in GLR parsers can cause
10835 buffer overruns, corrupting state.
10836
10837 * src/output.c (prepare_rules): Output max_left_semantic_context
10838 definition.
10839 * src/reader.h (max_left_semantic_context): New variable declaration.
10840 * src/scan-gram.l (max_left_semantic_context): Define.
10841 (handle_action_dollar): Update max_left_semantic_context.
10842 * data/glr.c (YYMAXLEFT): New definition.
10843 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
10844 (yyresolveAction): Ditto.
10845
10846 Fixes to problems with location handling in GLR parsers reported by
10847 Frank Heckenbach (2003/06/05).
10848
10849 * data/glr.c (YYLTYPE): Make trivial if locations not used.
10850 (YYRHSLOC): Add parentheses, and define only if locations used.
10851 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
10852 locations not used.
10853 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
10854 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
10855
10856 * tests/cxx-type.at: Exercise location information; update tests
10857 to differentiate output with and without locations.
10858 Remove forward declarations of yylex and yyerror---caused errors
10859 because default YYLTYPE not yet defined.
10860 Change semantic actions to compute strings, rather than printing
10861 them directly (to test proper passing of semantics values). Change
10862 output to prefix notation and update test data and expected results.
10863 (yylex): Track locations.
10864 (stmtMerge): Return value rather than printing, and include arguments
10865 in value.
10866
10867 2003-06-03 Paul Eggert <eggert@twinsun.com>
10868
10869 Avoid warnings generated by GCC 2.95.4 when Bison is
10870 configured with --enable-gcc-warnings.
10871 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
10872 yy::]b4_parser_class_name[::translate_,
10873 yy::Stack::operator[] (unsigned),
10874 yy::Stack::operator[] (unsigned) const,
10875 yy::Slice::operator[] (unsigned),
10876 yy::Slice::operator[] (unsigned) const):
10877 Rename local vars to avoid warnings.
10878 * tests/glr-regression.at (Improper handling of embedded actions
10879 and $-N in GLR parsers): Remove unused local variable from yylex.
10880 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
10881 (void) as arg when not pure, since we now assume C89 when building
10882 Bison. Pacify GCC by using parameter.
10883
10884 2003-06-02 Paul Eggert <eggert@twinsun.com>
10885
10886 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
10887 yy::Location::lines, yy::Location::columns): Rename arguments
10888 to avoid shadowing; this removes a warning generated by GCC 3.3.
10889
10890 2003-06-01 Paul Eggert <eggert@twinsun.com>
10891
10892 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
10893 to g++, as GCC 3.3 complains if you do it.
10894 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
10895 everything that WARNING_CFLAGS has, except omit warnings
10896 not suitable for C++.
10897 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
10898 * tests/atlocal.in (CXXFLAGS): New var.
10899 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
10900
10901 Fix a GLR parser bug I reported in February; see
10902 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
10903 The problem was that GLR parsers did not conform to the C standard,
10904 because actions like { $1 = $2 + $3; } expanded to expressions
10905 that invoked YYFILL in separate subexpressions, and YYFILL assigned
10906 to a local variable. The C standard says that expressions
10907 like (var = f ()) + (var = f ()) have undefined behavior.
10908 Another problem was that GCC sometimes issues warnings that
10909 yyfill and its parameters are unused.
10910
10911 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
10912 as possibly unused.
10913 (yyfill): New function.
10914 (YYFILL): Use it.
10915 (yyuserAction): Change type of yynormal to bool, so that it matches
10916 the new yyfill signature. Mark it as possibly unused.
10917
10918
10919 Follow up on a bug I reported in February, where a Bison-generated
10920 parser can loop. Provide a test case and a fix for yacc.c. I
10921 don't have a fix for lalr1.cc or for glr.c, unfortunately.
10922 The original bug report is in:
10923 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
10924
10925 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
10926 macro's size was becoming unwieldy.
10927 (yyerrlab): Do not discard an empty lookahead symbol, as this
10928 might destroy garbage.
10929 (yyerrorlab): New label, with the old contents of YYERROR,
10930 plus the following change: pop the stack of rhs corresponding
10931 to the production that invoked YYERROR. That is how Yacc
10932 behaves, and POSIX requires this behavior.
10933 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
10934 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
10935 Define 'alarm' to do nothing if unistd.h is not available.
10936 Add a new rule "exp: '-' error;" to test the above change to
10937 data/yacc.c. Use 'alarm' to abort any test taking longer than
10938 10 seconds, as it's probably looping.
10939 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
10940 Also, the new yacc.c generates two fewer diagnostics for an
10941 existing test.
10942
10943 2003-05-24 Paul Eggert <eggert@twinsun.com>
10944
10945 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
10946 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
10947 This fixes a problem reported by John Bowman when the Compaq/HP
10948 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
10949 -ansi -Wall -gall).
10950 * data/yacc.c (union yyalloc): Likewise.
10951 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
10952
10953 Switch from 'int' to 'bool' where that makes sense.
10954
10955 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
10956 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
10957 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
10958 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
10959 Return or accept bool, not int. All callers changed.
10960 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
10961 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
10962 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
10963 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
10964 bitset_or_and_cmp_): Likewise.
10965 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
10966 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
10967 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
10968 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
10969 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
10970 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
10971 bitset_stats_or_and_cmp): Likewise.
10972 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
10973 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
10974 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
10975 ebitset_xor_cmp): Likewise.
10976 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
10977 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
10978 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
10979 lbitset_xor_cmp): Likewise.
10980 * lib/bbitset.h: Include <stdbool.h>.
10981 (struct bitset_vtable): The following members now return bool, not
10982 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
10983 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
10984 or_and_cmp).
10985 * src/conflicts.c (count_rr_conflicts): Likewise.
10986 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
10987 All uses changed.
10988 * lib/ebitset.c (ebitset_obstack_init): Likewise.
10989 * lib/lbitset.c (lbitset_obstack_init): Likewise.
10990 * src/getargs.c (debug_flag, defines_flag, locations_flag,
10991 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10992 graph_flag): Likewise.
10993 * src/getargs.h (debug_flag, defines_flag, locations_flag,
10994 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10995 graph_flag): Likewise.
10996 * src/output.c (error_verbose): Likewise.
10997 * src/output.h (error_verbose): Likewise.
10998 * src/reader.c (start_flag, typed): Likewise.
10999 * src/reader.h (typed): Likewise.
11000 * src/getargs.c (LOCATIONS_OPTION): New constant.
11001 (long_options, getargs): Use it.
11002 * src/lalr.c (build_relations): Use bool, not int.
11003 * src/nullable.c (nullable_compute): Likewise.
11004 * src/print.c (print_reductions): Likewise.
11005 * src/tables.c (action_row, pack_vector): Likewise.
11006 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
11007 * src/output.c (prepare): Use it.
11008 * src/output.c (token_definitions_output,
11009 symbol_destructors_output, symbol_destructors_output): Use string,
11010 not boolean integer, to keep track of whether to output separator.
11011 * src/print_graph.c (print_core): Likewise.
11012 * src/state.c (state_rule_lookaheads_print): Likewise.
11013
11014 * config/install-sh: Sync from automake 1.7.5.
11015
11016 2003-05-14 Paul Eggert <eggert@twinsun.com>
11017
11018 * src/parse-gram.y (rules_or_grammar_declaration): Require a
11019 semicolon after a grammar declaration, in the interest of possible
11020 future changes to the Bison input language.
11021 Do not allow a stray semicolon at the start of the grammar.
11022 (rhses.1): Allow one or more semicolons after any rule, including
11023 just before "|" as required by POSIX.
11024 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
11025 grammar.
11026
11027 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
11028
11029 %parse-param support for lalr1.cc.
11030
11031 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
11032 b4_cc_constructor_calls, b4_cc_constructor_call,
11033 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
11034 definitions.
11035 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
11036 parse-param arguments.
11037 (yy::b4_parser_class_name): Declare instance variables to
11038 hold parse-param arguments.
11039 * tests/calc.at: s/value/semantic_value/ because value clashes
11040 with a member of yy::b4_parser_class_name. Adjust C++ code
11041 to handle %parse-param. Enable %parse-param test in C++.
11042
11043 2003-05-12 Paul Eggert <eggert@twinsun.com>
11044
11045 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
11046 English a bit. Fix fclose typo. Change "const char" to "char
11047 const", and use ANSI C rather than K&R for "main". Suggest
11048 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
11049 and suggest yy_switch_to_buffer.
11050
11051 2003-05-05 Paul Eggert <eggert@twinsun.com>
11052
11053 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
11054 C89. This avoids a diagnostic on compilers that define __STDC__
11055 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
11056 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
11057
11058 2003-05-03 Paul Eggert <eggert@twinsun.com>
11059
11060 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
11061 Do not overrun array bounds.
11062 This should fix a bug reported today by Olatunji Oluwabukunmi in
11063 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
11064
11065 2003-04-29 Akim Demaille <akim@epita.fr>
11066
11067 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
11068 * src/getargs.c, src/getargs.h: here, as bool, not int.
11069 (nondeterministic_parser): New.
11070 * src/parse-gram.y, src/scan-gram.l: Support
11071 %nondeterministic-parser.
11072 * src/output.c (prepare): Use nondeterministic_parser instead
11073 of glr_parser where appropriate.
11074 * src/tables.c (conflict_row, action_row, save_row)
11075 (token_actions, token_actions, pack_vector): Ditto.
11076
11077 2003-04-29 Akim Demaille <akim@epita.fr>
11078
11079 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
11080
11081 2003-04-29 Akim Demaille <akim@epita.fr>
11082
11083 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
11084 with %pure-parser and %locations to exercise the patch from Yakov
11085 Markovitch below.
11086
11087 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
11088
11089 * data/yacc.c: (b4_lex_param): Corrected for the case where
11090 %lex-param is provided and %pure-parser isn't.
11091
11092 2003-04-27 Paul Eggert <eggert@twinsun.com>
11093
11094 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
11095 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
11096 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
11097 if it is not defined.
11098 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
11099
11100 2003-04-26 Paul Eggert <eggert@twinsun.com>
11101
11102 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
11103 Declare to be of type suitable for the ninf value itself, not of
11104 type suitable for the corresponding table, since the latter might
11105 be unsigned but the ninf value might be negative. This fixes a
11106 bug reported by Alexandre Duret-Lutz in
11107 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
11108
11109 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
11110 invokes it. We shouldn't invoke it twice because it will attempt
11111 to put error.o in the archive twice. This fixes a glitch reported
11112 by Martin Mokrejs in
11113 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
11114
11115 2003-04-21 Paul Eggert <eggert@twinsun.com>
11116
11117 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
11118 to gnulib.
11119
11120 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
11121
11122 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
11123 Fix obvious typo that results in uncompilable GLR parsers
11124 when both %pure-parser and %locations are used. (trivial change)
11125
11126 2003-04-17 Paul Eggert <eggert@twinsun.com>
11127
11128 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
11129 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
11130 Do not insert the expected token via unput, as this runs afoul
11131 of a POSIX-compatibility bug in flex 2.5.31.
11132 All uses changed to BEGIN the parent state,
11133 since we no longer insert the expected token via unput.
11134 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
11135 that is no longer emitted after the above change.
11136
11137 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
11138 the first one. This change is from Paul Hilfinger, and it fixes
11139 regression reported by Werner Lemberg in
11140 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
11141
11142 (resolve_sr_conflict): Don't invoke state_errs_set
11143 unless one or more tokens have been explicitly made errors.
11144 Otherwise, the above change causes Bison to abort.
11145
11146 * tests/existing.at (GNU pic Grammar): New test case, taken from
11147 Lemberg's email.
11148
11149 2003-03-31 Akim Demaille <akim@epita.fr>
11150
11151 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
11152
11153 2003-03-31 Akim Demaille <akim@epita.fr>
11154
11155 * src/output.c (prepare_symbols): Avoid trailing spaces in the
11156 output.
11157
11158 2003-03-31 Akim Demaille <akim@epita.fr>
11159
11160 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
11161 From Paul Hilfinger.
11162
11163 2003-03-29 Akim Demaille <akim@epita.fr>
11164
11165 * m4/error.m4: Do not put under dynamic conditions some code which
11166 expansion is under static control.
11167
11168 2003-03-29 Akim Demaille <akim@epita.fr>
11169
11170 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
11171
11172 2003-03-29 Akim Demaille <akim@epita.fr>
11173
11174 * doc/bison.texinfo (Strings are Destroyed): New.
11175
11176 2003-03-13 Paul Eggert <eggert@twinsun.com>
11177
11178 * .cvsignore: Add configure.lineno.
11179 * src/.cvsignore: Add yacc.
11180 * tests/.cvsignore: Add testsuite.log.
11181 * doc/fdl.texi: Sync with latest FSF version.
11182
11183 2003-03-12 Paul Eggert <eggert@twinsun.com>
11184
11185 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
11186 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
11187 cursor, instead of leaving it undefined. This fixes a bug
11188 reported by Tim Van Holder in
11189 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
11190 * tests/input.at (Torturing the Scanner): Test the scanner on
11191 an empty input file, which was Tim Van Holder's test case.
11192
11193 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
11194 <sys/resource.h> can be included, include sys/time.h and
11195 sys/times.h first, if available. This works around the SunOS
11196 4.1.4 porting bug reported by Bruce Becker in
11197 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
11198
11199 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
11200 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
11201 AC_HEADER_SYS_WAIT.
11202
11203 Merge changes from gnulib. This was prompted because the CVS
11204 snapshot didn't build on Solaris 7 due to strnlen problems.
11205
11206 These changes need to be merged back into gnulib:
11207 * lib/hash.c: Include <stdbool.h> unconditionally.
11208 * m4/onceonly.m4 (m4_quote): New macro.
11209 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
11210 Quote AC_FOREACH variable-expansions properly.
11211 The 2003-01-03 obstack.h change also needs merging.
11212 {end of changes requiring merging}
11213
11214 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11215 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
11216 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
11217 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
11218 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
11219 New files, imported from gnulib.
11220 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
11221 above.
11222
11223 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
11224 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
11225 gnulib sources.
11226
11227 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
11228 Add.
11229 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
11230 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
11231 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
11232 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
11233 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
11234 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
11235 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
11236 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
11237 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
11238 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
11239 (jm_PREREQ_ARGMATCH): Remove.
11240 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
11241 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
11242
11243 * src/system.h: Include <stdbool.h> unconditionally.
11244
11245 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
11246 assuming at least C89 in the bitset code for some time now.
11247
11248 2003-03-03 Akim Demaille <akim@epita.fr>
11249
11250 * ro.po: New.
11251
11252 2003-03-02 Akim Demaille <akim@epita.fr>
11253
11254 * doc/bison.texinfo (Table of Symbols): Reactivate the
11255 documentation for %lex-param, and %parse-param.
11256
11257 2003-03-02 Akim Demaille <akim@epita.fr>
11258
11259 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
11260 generate verbose error messages.
11261 Use the number of tokens as an upper bound in yytname, as it
11262 cannot be a non terminal.
11263
11264 2003-03-02 Akim Demaille <akim@epita.fr>
11265
11266 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
11267 message.
11268
11269 2003-03-02 Akim Demaille <akim@epita.fr>
11270
11271 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
11272 Use them to exercise yycheck overrun.
11273 Based on Andrew Suffield's grammar.
11274
11275 2003-03-02 Akim Demaille <akim@epita.fr>
11276
11277 Create tests/local.at for Bison generic testing macros.
11278
11279 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
11280 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
11281 This new file.
11282 * tests/calc.at (AT_CHECK_CALC): Adjust.
11283 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
11284 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
11285 * tests/local.at: here.
11286 (AT_COMPILE_CXX): Tags the tests using it as c++.
11287 Ignore the test if CXX is not functional.
11288
11289 2003-03-01 Paul Eggert <eggert@twinsun.com>
11290
11291 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
11292 not loc->end, since loc->end might contain garbage and this leads
11293 to undefined behavior on some platforms.
11294 (id_loc, token_start): Use (IF_LINTed) initial values that do not
11295 depend on *loc, so that the reader doesn't give the the false
11296 impression that *loc is initialized.
11297 (<INITIAL>"%%"): Do not bother setting code_start, since its value
11298 does not survive the return.
11299
11300 2003-03-01 Akim Demaille <akim@epita.fr>
11301
11302 * src/scan-gram.l (code_start): Always initialize it when entering
11303 into yylex, as SC_EPILOGUE is activated *before* the corresponding
11304 yylex invocation. An alternative would be making it static, but
11305 then it starts with the second %%'s beginning, instead of its end.
11306
11307 2003-02-28 Paul Eggert <eggert@twinsun.com>
11308
11309 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
11310 around a UnixWare 7.1.1 porting bug reported by John Hughes in
11311 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
11312
11313 2003-02-26 Paul Eggert <eggert@twinsun.com>
11314
11315 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
11316 Remove Sequent/Pyramid discussion (nobody uses them any more).
11317 Merge VMS and MS-DOS discussion; these ports may well be dead
11318 but let's keep mentioning them for now. Put <> around email
11319 addresses. Add copyright notice.
11320
11321 2003-02-24 Paul Eggert <eggert@twinsun.com>
11322
11323 * data/glr.c (yy_reduce_print): yylineno -> yylno,
11324 to avoid collision with flex use of yylineno.
11325 Problem reported by Bruce Lilly in
11326 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
11327 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11328 * data/yacc.c (yy_reduce_print): Likewise.
11329
11330 * config/depcomp: Sync with Automake 1.7.3.
11331
11332 2003-02-21 Akim Demaille <akim@epita.fr>
11333
11334 * data/lalr1.cc: Use temporary variables instead of casts to
11335 change integer types.
11336 Suggested by Paul Eggert.
11337
11338 2003-02-21 Akim Demaille <akim@epita.fr>
11339
11340 * doc/bison.texinfo: Use "location" consistently to refer to @n,
11341 to avoid confusions with lalr1.cc's notion of Position.
11342 Suggested by Paul Eggert.
11343
11344 2003-02-20 Akim Demaille <akim@epita.fr>
11345
11346 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
11347 before initial_columns.
11348 (location.hh): Use consistent variable names when defining the
11349 operator<<.
11350 Use "last" so that we subtract from Positions, not from unsigned.
11351
11352 2003-02-20 Akim Demaille <akim@epita.fr>
11353
11354 * data/lalr1.cc (position.hh): New subfile, including the extended
11355 and Doxygen'ed documentation of class Position.
11356 (location.hh): Use it.
11357 Document a` la Doxygen.
11358 With the help of Benoit Perrot.
11359
11360 2003-02-20 Akim Demaille <akim@epita.fr>
11361
11362 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
11363 AT_YACC_IF.
11364 Redefine AT_YYERROR_SEES_LOC_IF using it.
11365 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
11366 not defined.
11367 Don't use the location in yy::Parser::error_ and
11368 yy::Parser::print_ when not %locations.
11369 Activate more lalr1.cc tests.
11370
11371 2003-02-19 Akim Demaille <akim@epita.fr>
11372
11373 * data/lalr1.cc: When displaying a line number, be sure to make it
11374 an int.
11375
11376 2003-02-19 Akim Demaille <akim@epita.fr>
11377
11378 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
11379 Remove, useless.
11380 (YYABORT, YYACCEPT, YYERROR): New.
11381 * tests/calc.at: Renable the lalr1.cc test.
11382
11383 2003-02-19 Akim Demaille <akim@epita.fr>
11384
11385 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
11386 error recovery, mixing with/without pops and discarding of the
11387 lookahead.
11388 Exercise YYERROR.
11389 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
11390
11391 2003-02-17 Paul Eggert <eggert@twinsun.com>
11392
11393 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
11394 * tests/testsuite.at (AT_COMPILE): Use them.
11395 This fixes the testsuite problem reported by Robert Lentz in
11396 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
11397
11398 2003-02-12 Paul Eggert <eggert@twinsun.com>
11399
11400 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
11401 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
11402 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
11403 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
11404 Check for malloc failure, for consistency with yacc.c.
11405 (yytname_size): Remove, for consistency with yacc.c.
11406
11407 The bug still remains in data/lalr1.cc, as I didn't have time
11408 to fix it there.
11409
11410 2003-02-06 Akim Demaille <akim@epita.fr>
11411
11412 * configure.ac (GXX): Rename as...
11413 (CXX): this, to keep the original Autoconf semantics.
11414 Require 2.57.
11415 * data/lalr1.cc: Fix b4_copyright invocations.
11416 If YYDEBUG is not defined, don't depend upon name_ being defined.
11417 (location.hh): Include string and iostream.
11418 (Position::filename): New member.
11419 (Position::Position ()): New.
11420 (operator<< (Position)): New.
11421 (operator- (Position, int)): New.
11422 (Location::first, Location::last): Rename as...
11423 (Location::begin, Location::end): these, to mock the conventional
11424 iterator names.
11425 (operator<< (Location)): New.
11426 * tests/atlocal.in (CXX): New.
11427 * tests/testsuite.at (AT_COMPILE_CXX): New.
11428 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
11429 locations in a more synthetic way.
11430 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
11431 lalr1.cc is used.
11432 Adjust the C locations to match those from Emacs: first column is
11433 column 0.
11434 Change all the expected results.
11435 Conform to the GCS: simplify the locations when applicable.
11436 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
11437 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
11438 these CPP macros with the m4 macros new defined by...
11439 (AT_CHECK_PUSHDEFS): this, i.e.:
11440 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
11441 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
11442 New macros.
11443 (AT_CHECK_POPDEFS): Undefine them.
11444 (AT_CHECK_CALC_LALR1_CC): New.
11445 Use it for the first lalr1.cc test.
11446
11447 2003-02-04 Akim Demaille <akim@epita.fr>
11448
11449 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
11450 Location as is defined.
11451
11452 2003-02-04 Akim Demaille <akim@epita.fr>
11453
11454 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
11455 name_ being defined.
11456
11457 2003-02-03 Paul Eggert <eggert@twinsun.com>
11458
11459 * src/gram.h (start_symbol): Remove unused decl.
11460
11461 Use more-consistent naming conventions for local vars.
11462
11463 * src/derives.c (derives_compute): Change type of local var from
11464 int to rule_number.
11465 * src/gram.c (grammar_rules_partial_print): Likewise.
11466 * src/print.c (print_core): Likewise.
11467 * src/reduce.c (reduce_grammar_tables): Likewise.
11468
11469 * src/gram.c (grammar_dump): Change name of item_number *
11470 local var from r to rp.
11471 * src/nullable.c (nullable_compute): Likewise.
11472
11473 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
11474
11475 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
11476 for symbol or symbol_number var.
11477 * src/reader.c (grammar_start_symbol_set): Likewise.
11478 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
11479 Likewise.
11480 * src/state.c (transitions_to): Likewise.
11481 * src/state.h: Likewise.
11482 * src/tables.c (symbol_number_to_vector_number): Likewise.
11483
11484 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
11485 char * var.
11486
11487 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
11488 var.
11489
11490 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
11491 var.
11492
11493 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
11494 Use str, not s, for char * var. Use ch, not c, for character var.
11495 Use size for size var.
11496
11497 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
11498 char * var.
11499 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
11500 uniqstr var.
11501 * src/uniqstr.h: Likewise.
11502
11503 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11504 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11505 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
11506 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
11507 param to have same name as that of enum, so that we don't use
11508 "s" to stand for a non-state.
11509
11510 2003-02-02 Akim Demaille <akim@epita.fr>
11511
11512 * src/scan-skel.l: Scan more than one inert character per yylex
11513 invocation.
11514
11515 2003-02-01 Paul Eggert <eggert@twinsun.com>
11516
11517 Version 1.875a.
11518
11519 * po/LINGUAS: Add ms.
11520
11521 2003-01-30 Akim Demaille <akim@epita.fr>
11522
11523 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
11524
11525 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11526
11527 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
11528 of $1.
11529
11530 Changes in response to error report by S. Eken: GLR mode does not
11531 handle negative $ indices or $ indices in embedded rules correctly.
11532 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
11533
11534 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
11535 (b4_rhs_location): Ditto.
11536 (yyfill): New function to copy from stack tree into array
11537 incrementally.
11538 (yyuserAction): Modify to allow incremental move of semantic values
11539 to rhs array when in GLR mode.
11540 Define YYFILL to use in user-defined actions to fill semantic array
11541 as needed.
11542 Remove dummy use of yystack, as there is now a guaranteed use.
11543 (yydoAction): Modify to allow incremental move of semantic values
11544 to rhs array when in GLR mode.
11545 (yyresolveAction): Ditto.
11546 (yyglrShiftDefer): Update comment.
11547 (yyresolveStates): Use X == NULL for pointers, not !X.
11548 (yyglrReduce): Ditto.
11549 (yydoAction): Ditto
11550
11551 * tests/glr-regr1.at: Rename to ...
11552 * tests/glr-regression.at: Add new regression test for the problems
11553 described above (adapted from S. Eken).
11554 Update copyright notice.
11555 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
11556 * tests/Makefile.am: Ditto.
11557
11558 2003-01-28 Paul Eggert <eggert@twinsun.com>
11559
11560 * data/lalr1.cc: Do not use @output_header_name@ unless
11561 b4_defines_flag is set. This fixes two bugs reported by
11562 Tim Van Holder in
11563 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
11564 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
11565
11566 2003-01-21 Paul Eggert <eggert@twinsun.com>
11567
11568 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
11569 we don't need to worry about yyerrlab1 being reported as an
11570 "unused label" by non-GCC C compilers. The downside is that if
11571 locations are used then a couple of statements are duplicated each
11572 time YYERROR is invoked, but the upside is that the warnings
11573 should vanish.
11574 (yyerrlab1): Move code to YERROR.
11575 (yyerrlab2): Remove. Change uses back to yyerrlab1.
11576 This reverts some of the 2002-12-27 change.
11577
11578 2003-01-17 Paul Eggert <eggert@twinsun.com>
11579
11580 * src/output.c (symbol_printers_output): Fix typo that led
11581 to core dump. Problem reported by Antonio Rus in
11582 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
11583
11584 2003-01-13 Akim Demaille <akim@epita.fr>,
11585 Quoc Peyrot <chojin@lrde.epita.fr>,
11586 Robert Anisko <anisko_r@lrde.epita.fr>
11587
11588 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
11589 when the stacks contain one element, as the loop would otherwise
11590 free the last state, and then use the top state (the one we just
11591 popped). This means that the initial elements will not be freed
11592 explicitly, as is the case in yacc.c; it is not a problem, as
11593 these elements have fake values.
11594
11595 2003-01-11 Paul Eggert <eggert@twinsun.com>
11596
11597 * NEWS: %expect-violations are now just warnings, reverting
11598 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
11599 bootstrapping problem reported by Matthias Klose; see
11600 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
11601 * src/conflicts.c (conflicts_print): Likewise.
11602 * tests/conflicts.at (%expect not enough, %expect too much,
11603 %expect with reduce conflicts): Likewise.
11604 * doc/bison.texinfo (Expect Decl): Document this. Also mention
11605 that the warning is enabled if the number of conflicts changes
11606 (not necessarily increases).
11607
11608 * src/getargs.c (version): Update copyright year.
11609
11610 2003-01-09 Akim Demaille <akim@epita.fr>
11611
11612 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
11613
11614 2003-01-08 Paul Eggert <eggert@twinsun.com>
11615
11616 * Makefile.maint (WGETFLAGS):
11617 New macro, containing "-C off" to disable proxy caches.
11618 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
11619 (rel-check): Use $(WGET) instead of wget.
11620
11621 2003-01-06 Paul Eggert <eggert@twinsun.com>
11622
11623 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
11624 the GLR paper of Scott, Johnstone and Hussain.
11625
11626 2003-01-04 Paul Eggert <eggert@twinsun.com>
11627
11628 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
11629 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
11630 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
11631 (EXTRA_LIBRARIES): New var, for liby.a.
11632 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
11633 (EXTRA_SCRIPTS): New var, for yacc.
11634
11635 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
11636 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
11637 Problem reported by Nelson H. F. Beebe.
11638
11639 2003-01-03 Paul Eggert <eggert@twinsun.com>
11640
11641 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
11642 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
11643 when compiling Bison 1.875's `bitset bset = obstack_alloc
11644 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
11645
11646 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
11647 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
11648 grow to a huge size with typical invocation.
11649
11650 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
11651 Use the pattern recommended by Autoconf 2.57, except also protect
11652 against double-definition.
11653 * src/system.h: Likewise.
11654 Portability issues reported by Nelson H. F. Beebe.
11655
11656 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
11657 All uses changed. Provide a definition in both C and C++.
11658 (yytrue, yyfalse): Define even if defined (__cplusplus).
11659
11660 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
11661 Reported by Nelson H. F. Beebe.
11662
11663 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
11664
11665 2003-01-02 Paul Eggert <eggert@twinsun.com>
11666
11667 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
11668 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
11669 Bug reported by Nelson H. F. Beebe.
11670
11671 2003-01-01 Paul Eggert <eggert@twinsun.com>
11672
11673 * Version 1.875.
11674
11675 2002-12-30 Paul Eggert <eggert@twinsun.com>
11676
11677 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
11678 Moved here from...
11679 (<INITIAL>","): Here. This causes stray "," to be treated
11680 more uniformly.
11681
11682 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
11683 last brace in braced code when not in Yacc mode, for compatibility
11684 with Bison 1.35. This resurrects the 2001-12-15 patch to
11685 src/reader.c.
11686
11687 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
11688 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
11689
11690 2002-12-28 Paul Eggert <eggert@twinsun.com>
11691
11692 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
11693 that of SYM's type. This fixes Debian bug 168069, reported by
11694 Thomas Olsson.
11695
11696 2002-12-28 Paul Eggert <eggert@twinsun.com>
11697
11698 Version 1.75f.
11699
11700 Switch back to the Yacc style of conflict reports, undoing some
11701 of the 2002-07-30 change.
11702 * doc/bison.texinfo (Understanding): Use Yacc style for
11703 conflict reports. Also, use new way of locating rules.
11704 * src/conflicts.c (conflict_report):
11705 Renamed from conflict_report_yacc, removing the old
11706 'conflict_report'. Translate the entire conflict report at once,
11707 so that we don't assume that "," has the same interpretation in
11708 all languages.
11709 (conflicts_output): Use Yacc-style conflict report for each state,
11710 instead of our more-complicated style.
11711 (conflicts_print): Use Yacc-style conflict report, except print
11712 the input file name when not emulating Yacc.
11713 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
11714 Conflicted Reduction, %expect not enough, %expect too much,
11715 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
11716 * tests/existing.at (GNU Cim Grammar): Likewise.
11717 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
11718
11719 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
11720 fatal): Don't invoke fflush; it's not needed and it might even be
11721 harmful for stdout, as stdout might not be open.
11722 * src/reduce.c (reduce_print): Likewise.
11723
11724 2002-12-27 Paul Eggert <eggert@twinsun.com>
11725
11726 Fix a bug where error locations were not being recorded correctly.
11727 This problem was originally reported by Paul Hilfinger in
11728 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
11729
11730 * data/yacc.c (yyparse): New local var yylerrsp, to record the
11731 top of the location stack's error locations.
11732 (yyerrlab): Set it. When discarding a token, push its location
11733 onto yylerrsp so that we don't lose track of the error's end.
11734 (yyerrlab1): Now is only the target of YYERROR, so that we can
11735 properly record the location of the action that failed. For GCC
11736 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
11737 GCC warning about yyerrlab1 being unused if YYERROR is unused.
11738 (yyerrlab2): New label, which yyerrlab now falls through to.
11739 Compute the error's location by applying YYLLOC_DEFAULT to
11740 the locations of all the symbols that went into the error.
11741 * doc/bison.texinfo (Location Default Action): Mention that
11742 YYLLOC_DEFAULT is also invoked for syntax errors.
11743 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11744 Error locations include the locations of all the tokens that were
11745 discarded, not just the last token.
11746
11747 2002-12-26 Paul Eggert <eggert@twinsun.com>
11748
11749 * src/files.c: Include quote.h.
11750 (compute_output_file_names): Warn if we detect conflicting
11751 outputs to the same file. This should catch the misunderstanding
11752 exemplified by Debian Bug 165349, reported by Bruce Stephens..
11753
11754 * src/conflicts.c (conflicts_print): If the user specifies
11755 "%expect N", report an error if there are any reduce/reduce
11756 conflicts. This is what the manual says should happen.
11757 This fixes Debian bug 130890, reported by Anthony DeRobertis.
11758 * tests/conflicts.at (%expect with reduce conflicts): New test.
11759
11760 Don't use m4_include on relative file names, as it doesn't work as
11761 desired if there happens to be a file with that name under ".".
11762
11763 * m4sugar/version.m4: Remove; it was included but it wasn't used.
11764 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
11765 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
11766 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
11767 * src/output.c (output_skeleton): Use full path names when
11768 specifying a file to include; don't rely on include path, as
11769 it's unreliable when the working file contains a file with
11770 that name.
11771
11772 2002-12-25 Paul Eggert <eggert@twinsun.com>
11773
11774 Remove obsolete references to bison.simple and bison.hairy.
11775 Problem mentioned by Aubin Mahe in
11776 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
11777 * data/glr.c: Comment fix.
11778 * doc/bison.1: Remove references. Also, mention "yacc".
11779
11780 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
11781 with -g option.
11782
11783 * src/parse-gram.y (declaration): Use enum "report_states" rather
11784 than its numeric value 1.
11785
11786 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
11787 opening a new one. This fixes Debian bug 165349, reported by
11788 Bruce Stephens.
11789
11790 2002-12-24 Paul Eggert <eggert@twinsun.com>
11791
11792 Version 1.75e.
11793
11794 * Makefile.maint (cvs-update): Don't assume that the shell
11795 supports $(...), as Solaris sh doesn't.
11796
11797 * src/parse-gram.y (lloc_default): Remove test for empty
11798 nonterminals at the end, since it didn't change the result.
11799
11800 2002-12-24 Paul Eggert <eggert@twinsun.com>
11801
11802 If the user does not define YYSTYPE as a macro, Bison now declares it
11803 using typedef instead of defining it as a macro. POSIX requires this.
11804 For consistency, YYLTYPE is also declared instead of defined.
11805
11806 %union directives can now have a tag before the `{', e.g., the
11807 directive `%union foo {...}' now generates the C code
11808 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
11809 The default union tag is `YYSTYPE', for compatibility with Solaris 9
11810 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
11811 instead of `yyltype'.
11812
11813 `yystype' and `yyltype' are now obsolescent macros instead of being
11814 typedefs or tags; they are no longer documented and will be
11815 withdrawn in a future release.
11816
11817 * data/glr.c (b4_location_type): Remove.
11818 (YYSTYPE): Renamed from yystype.
11819 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
11820 (struct YYLTYPE): Renamed from struct yyltype.
11821 (YYLTYPE): Renamed from yyltype.
11822 (yyltype, yystype): New (and obsolescent) macros,
11823 for backward compatibility.
11824 * data/yacc.c: Likewise.
11825
11826 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
11827 does not specify a union tag. This is for compatibility with
11828 Solaris 9 yacc.
11829
11830 * src/parse-gram.y (add_param): 2nd arg is now char * not char
11831 const *, since it is now modified by stripping surrounding { }.
11832 (current_braced_code): Remove.
11833 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
11834 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
11835 trailing " {...}". Now of type <chars>.
11836 (grammar_declaration): Adjust to bundled tokens.
11837 (code_content): Remove; stripping is now done by add_param.
11838 (print_token_value): Print contents of bundled tokens.
11839 (token_name): New function.
11840
11841 * src/reader.h (braced_code, current_braced_code): Remove.
11842 (token_name): New decl.
11843
11844 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
11845 token_type, not braced_code code_kind. All uses changed.
11846 (SC_PRE_CODE): New state, for scanning after a keyword that
11847 has (or usually has) an immediately-following braced code.
11848 (token_type): New local var, to keep track of which token type
11849 to return when scanning braced code.
11850 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
11851 <INITIAL>"%parse-param", <INITIAL>"%printer",
11852 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
11853 instead of returning a token type immediately.
11854 (<INITIAL>"{"): Set token type.
11855 (<SC_BRACED_CODE>"}"): Use it.
11856 (handle_action_dollar, handle_action_at): Now returns bool
11857 indicating success. Fail if ! current_rule; this prevents a core dump.
11858 (handle_symbol_code_dollar, handle_symbol_code_at):
11859 Remove; merge body into caller.
11860 (handle_dollar, handle_at): Complain in invalid contexts.
11861
11862 * NEWS, doc/bison.texinfo: Document the above.
11863 * NEWS: Fix years and program names in copyright notice.
11864
11865 2002-12-17 Paul Eggert <eggert@twinsun.com>
11866
11867 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
11868 Reporting, Table of Symbols): Omit mentions of %lex-param and
11869 %parse-param from the documentation for now.
11870
11871 2002-12-15 Paul Eggert <eggert@twinsun.com>
11872
11873 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
11874 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
11875 lookahead symbol, and which sets yychar in parser actions) and it
11876 disagreed with the Bison documentation. Bug
11877 reported by Andrew Walrond.
11878
11879 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
11880 as the caller now does that.
11881 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
11882 (YYEMPTY): Parenthesize right hand side, since others use it.
11883 (yyparse): Don't assume that our generated code is the only code
11884 that sets yychar.
11885
11886 2002-12-13 Paul Eggert <eggert@twinsun.com>
11887
11888 Version 1.75d.
11889
11890 POSIX requires a "yacc" command.
11891 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
11892 (MOSTLYCLEANFILES): Add yacc.
11893 (yacc): New rule.
11894 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
11895 as an alias for bison y.
11896
11897 * po/LINGUAS: Add da.
11898
11899 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
11900 problem with latest <getopt.h>.
11901 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
11902
11903 * doc/fdl.texi: Upgrade to 1.2.
11904 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
11905 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
11906 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
11907 gnulib.
11908 * config/install-sh: Sync with autotools.
11909
11910 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
11911 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
11912 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
11913 locations are requested.
11914 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
11915 locations are requested.
11916
11917 2002-12-12 Paul Eggert <eggert@twinsun.com>
11918
11919 Remove unportable casts and storage allocation tricks.
11920 While we're at it, remove almost all casts, since they
11921 usually aren't needed and are a sign of trouble.
11922
11923 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
11924
11925 * src/derives.c (derives_compute): Do not subtract NTOKENS from
11926 the pointer DSET returned by malloc; this isn't portable.
11927 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
11928 Similarly for DERIVES.
11929 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
11930 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
11931 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
11932
11933 * src/derives.c (derives_compute): Do not bother invoking
11934 int_of_rule_number, since rule numbers are integers.
11935
11936 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
11937 rather than XMALLOC (char, N).
11938
11939 * src/files.c (filename_split): Rewrite to avoid cast.
11940
11941 * src/gram.h (symbol_number_as_item_number,
11942 item_number_as_symbol_number, rule_number_as_item_number,
11943 item_number_as_rule_number):
11944 Now inline functions rather than macros, to avoid casts.
11945 * src/state.h (state_number_as_int): Likewise.
11946 * src/tables.c (state_number_to_vector_number,
11947 symbol_number_to_vector_number): Likewise.
11948
11949 * src/gram.h (int_of_rule_number): Remove; no longer used.
11950
11951 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
11952 since the resulting storage is always stored into.
11953
11954 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
11955 where it's needed.
11956
11957 * src/muscle_tab.c (muscle_m4_output):
11958 Now inline. Return bool, not int.
11959 * src/state.c (state_compare): Likewise.
11960 * src/symtab.c (symbol_check_defined,
11961 symbol_check_alias_consistency, symbol_pack, symbol_translation,
11962 hash_compare_symbol, hash_symbol):
11963 Likewise.
11964 * src/uniqstr.c (uniqstr_print): Likewise.
11965 * src/muscle_tab.c (muscle_m4_output_processor):
11966 New function, to avoid casts.
11967 * src/state.c (state_comparator, stage_hasher): Likewise.
11968 * src/symtab.c (symbol_check_defined_processor,
11969 symbol_check_alias_consistency_processor, symbol_pack_processor,
11970 symbol_translation_processor, hash_symbol_comparator,
11971 hash_symbol_hasher): Likewise.
11972 * src/uniqstr.c (uniqstr_print_processor): Likewise.
11973 * src/muscle_tab.c (muscles_m4_output):
11974 Use new functions instead of casting old functions unportably.
11975 * src/state.c (state_hash_new): Likewise.
11976 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
11977 symbols_token_translations_init):
11978 Likewise.
11979 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
11980
11981 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
11982 var instead of casting to long, to avoid casts.
11983 (prepare_states): Use MALLOC rather than alloca, so that we don't
11984 have to worry about alloca.
11985 * src/state.c (state_hash_lookup): Likewise.
11986
11987 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
11988 local var instead of casting to unsigned char, to avoid casts.
11989
11990 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
11991 STATE_ALLOC): Remove.
11992 (transitions_new, errs_new, reductions_new, state_new): Use malloc
11993 rather than calloc, and use offsetof to avoid allocating slightly
11994 too much storage.
11995 (state_new): Initialize all members.
11996
11997 * src/state.c (state_hash): Use unsigned accumulator, not signed.
11998
11999 * src/symtab.c (symbol_free): Remove; unused.
12000 (symbol_get): Remove cast in lhs of assignment.
12001 (symbols_do): Now static. Accept generic arguments, not
12002 hashing-related ones.
12003
12004 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
12005 (symbol_processor): Remove.
12006 (symbols_do): Remove decl; now static.
12007
12008 * src/system.h (alloca): Remove; decl no longer needed.
12009 (<stddef.h>): Include, for offsetof.
12010 (<inttypes.>, <stdint.h>): Include if available.
12011 (uintptr_t): New type, if system lacks it.
12012 (CALLOC, MALLOC, REALLOC): New macros.
12013 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
12014 new macros.
12015
12016 * src/tables.c (table_size): Now int, to pacify GCC.
12017 (table_grow, table_ninf_remap): Use signed table size.
12018 (save_row): Don't bother initializing locals when not needed.
12019 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
12020 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
12021
12022 * src/vcg.h: Correct misspellings.
12023
12024 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
12025
12026
12027 * src/getargs.c (getargs): Don't assume EOF == -1.
12028
12029 2002-12-09 Paul Eggert <eggert@twinsun.com>
12030
12031 Change identifier spellings to avoid collisions with names
12032 that are reserved by POSIX.
12033
12034 Don't use names ending in _t, since POSIX reserves them.
12035 For consistency, remove _e and _s endings -- they're weren't
12036 needed to remove ambiguity. All uses changed.
12037 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
12038 turn was just renamed from struniq_t.
12039 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
12040 which in turn was just renamed from struniq_processor_t.
12041 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
12042 in turn was renamed from hash_compare_struniq_t.
12043 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
12044 (state_list): Renamed from state_list_t.
12045 * src/assoc.h (assoc): Renamed from assoc_t.
12046 * src/conflicts.c (enum conflict_resolution): Renamed from
12047 enum conflict_resolution_e.
12048 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
12049 (rule_list): Renamed from rule_list_t.
12050 * src/getargs.h (enum trace): Renamed from enum trace_e.
12051 (enum report): Renamed from enum report_e.
12052 * src/gram.h (item_number): Renamed from item_number_t.
12053 (rule_number): Renamed from rule_number_t.
12054 (struct rule_s): Remove the "rule_s" part; not used.
12055 (rule): Renamed from rule_t.
12056 (rule_filter): Renamed from rule_filter_t.
12057 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
12058 (goto_list): Renamed from goto_list_t.
12059 * src/lalr.h (goto_number): Renamed from goto_number_t.
12060 * src/location.h (location): Renamed from location_t.
12061 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
12062 and moved here from:
12063 * src/muscle_tab.h (muscle_entry_t): here.
12064 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
12065 (rule_list): Renamed from rule_list_t.
12066 * src/print_graph.c (static_graph): Renamed from graph.
12067 * src/reader.h (braced_code): Renamed from braced_code_t.
12068 Remove brace_code_e tag.
12069 * src/relation.h (relation_node): Renamed from relation_node_t.
12070 (relation_nodes): Renamed from relation_nodes_t.
12071 (relation): Renamed from relation_t.
12072 * src/state.h (state_number): Renamed from state_number_t.
12073 (struct state): Renamed from struct state_s.
12074 (state): Renamed from state_t.
12075 (transitions): Renamed from transitions_t. Unused (and
12076 misspelled) transtion_s tag removed.
12077 (errs): Renamed from errs_t. Unused errs_s tag removed.
12078 (reductions): Renamed from reductions_t. Unused tag
12079 reductions_s removed.
12080 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
12081 (struct symbol_list): Renamed from struct symbol_list_s.
12082 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
12083 (struct symbol): Renamed from struct symbol_s.
12084 (symbol): Renamed from symbol_t.
12085 * src/tables.c (vector_number): Renamed from vector_number_t.
12086 (action_number): Renamed from action_t.
12087 * src/tables.h (base_number): Renamed from base_t.
12088 * src/vcg.h (enum color): Renamed from enum color_e.
12089 (enum textmode): Renamed from enum textmode_e.
12090 (enum shape): Renamed from enum shape_e.
12091 (struct colorentry): Renamed from struct colorentry_s.
12092 (struct classname): Renamed from struct classname_s.
12093 (struct infoname): Renamed from struct infoname_s.
12094 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
12095 (enum decision): Renamed from enum decision_e.
12096 (enum orientation): Renamed from enum orientation_e.
12097 (enum alignment): Renamed from enum alignment_e.
12098 (enum arrow_mode): Renamed from enum arrow_mode_e.
12099 (enum crossing_type): Renamed from enum crossing_type_e.
12100 (enum view): Renamed from enum view_e.
12101 (struct node): Renamed from struct node_s.
12102 (node): Renamed from node_t.
12103 (enum linestyle): Renamed from enum linestyle_e.
12104 (enum arrowstyle): Renamed from enum arrowstyle_e.
12105 (struct edge): Renamed from struct edge.
12106 (edge): Renamed from edge_t.
12107 (struct graph): Renamed from struct graph_s.
12108 (graph): Renamed from graph_t.
12109 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
12110 Rename value_t -> value.
12111 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
12112 value_t_as_yystype -> value_as_yystype.
12113
12114 Don't include <errno.h> in the mainstream code, since it
12115 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
12116 * lib/get-errno.c, lib/get-errno.h: New files.
12117 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
12118 get-errno.c.
12119 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
12120 * src/output.c (output_skeleton): Likewise.
12121 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
12122 instead of errno.
12123 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
12124 Likewise.
12125 (handle_action_dollar, handle_action_at): Likewise.
12126 * src/system.h: Do not include <errno.h>.
12127 (TAB_EXT): Renamed from EXT_TAB.
12128 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
12129
12130 Avoid str[a-z]*, since <string.h> reserves that name space.
12131 Change all instances of "struniq" in names to "uniqstr", and
12132 likewise for "STRUNIQ" and "UNIQSTR".
12133 * src/uniqstr.c: Renamed from src/struniq.c.
12134 * src/uniqstr.h: Renamed from src/struniq.h.
12135 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
12136 * src/files.c (strsuffix): Remove; unused.
12137 (concat2): Renamed from stringappend. Now static.
12138 * src/files.h (strsuffix, stringappend): Remove; unused.
12139 * src/parse-gram.y (<chars>): Renamed from <string>.
12140 (<uniqstr>): Renamed from <struniq>.
12141 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
12142 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
12143 (struct graph_s.expand): Renamed from struct graph_s.stretch.
12144 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
12145 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
12146 (N_EXPAND): Renamed from N_STRETCH.
12147
12148 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
12149 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
12150 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
12151 Remove; unused.
12152 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
12153 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
12154 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
12155 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
12156 (BASE_MAXIMUM): Renamed from BASE_MAX.
12157 (BASE_MINIMUM): Renamed from BASE_MIN.
12158 (ACTION_MAX): Remove; unused.
12159 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
12160 Unnecessary casts removed from above defines.
12161
12162
12163 Fix misspelling in names.
12164 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
12165 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
12166 G_NODE_ALIGNEMENT.
12167
12168
12169 * lib/timevar.c (timevar_report): Renamed from time_report,
12170 for consistency with other names.
12171 * lib/timevar.h (timevar_report): New decl.
12172 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
12173
12174
12175 Sort include-file uses.
12176
12177 Reorder all include files under src to be in the order "system.h".
12178 then the ../lib include files in angle brackets (alphabetized),
12179 then the . include files in double-quotes (alphabetized). Fix
12180 dependency breakages encountered in this process, as follows:
12181 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
12182 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
12183 * src/state.h: Include "symtab.h".
12184
12185 2002-12-08 Paul Eggert <eggert@twinsun.com>
12186
12187 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
12188 since this causes problems when __file__ contains character
12189 sequences like "@" that are treated specially by src/scan-skel.l.
12190 Instead, just use the file's basename. This fixes the bug
12191 reported by Martin Mokrejs in
12192 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
12193
12194 2002-12-06 Paul Eggert <eggert@twinsun.com>
12195
12196 Add support for rules that do not have trailing semicolons, as
12197 POSIX requires. Improve the quality of locations in Bison
12198 diagnostics.
12199
12200 * src/location.c: Include <quotearg.h>.
12201 (empty_location): Now const.
12202 (location_print): New function. Follow the recommendation of the
12203 GNU Coding Standards for locations that span file boundaries.
12204 * src/location.h: Do not include <quotearg.h>; no longer needed.
12205 (boundary): New type.
12206 (location_t): Use it. This allows locations to span file boundaries.
12207 All member uses changed: file -> start.file or end.file (as needed),
12208 first_line -> start.line, first_column -> start.column,
12209 last_line -> end.line, last_column -> end.column.
12210 (equal_boundaries): New function.
12211 (LOCATION_RESET, LOCATION_STEP): Remove.
12212 (LOCATION_PRINT): Remove. All callers changed to use location_print.
12213 (empty_location): Now const.
12214 (location_print): New decl.
12215 * src/parse-gram.y (lloc_default): New function, which handles
12216 empty locations more accurately.
12217 (YYLLOC_DEFAULT): Use it.
12218 (%token COLON): Remove.
12219 (%token ID_COLON): New token.
12220 (rules): Use it.
12221 (declarations, rules): Remove trailing semicolon.
12222 (declaration, rules_or_grammar_declaration):
12223 Allow empty (";") declaration.
12224 (symbol_def): Remove empty actions; no longer needed.
12225 (rules_or_grammar_declaration): Remove trailing semicolon.
12226 (semi_colon.opt): Remove.
12227 * src/reader.h: Include location.h.
12228 (scanner_cursor): New decl.
12229 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
12230 rolling our own.
12231 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
12232 of *loc.
12233 (STEP): Remove. No longer needed, now that adjust_location does
12234 the work. All uses removed.
12235 (scanner_cursor): New var.
12236 (adjust_location): Renamed from extend_location. It now sets
12237 *loc and adjusts the scanner cursor. All uses changed.
12238 Don't bother testing for CR.
12239 (handle_syncline): Remove location arg; now updates scanner cursor.
12240 All callers changed.
12241 (unexpected_end_of_file): Now accepts start boundary of token or
12242 comment, not location. All callers changed. Update scanner cursor,
12243 not the location.
12244 (SC_AFTER_IDENTIFIER): New state.
12245 (context_state): Renamed from c_context. All uses changed.
12246 (id_loc, code_start, token_start): New local vars.
12247 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
12248 processing of Yacc white space and equivalents here.
12249 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
12250 instead of returning ID immediately, since we need to search for
12251 a subsequent colon.
12252 (<INITIAL>"'", "\""): Save token_start.
12253 (<INITIAL>"%{", "{", "%%"): Save code_start.
12254 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
12255 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
12256 BEGIN context_state at end, not INITIAL.
12257 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
12258 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
12259 Return correct token start.
12260 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
12261 the start of a character, string or multiline comment is found.
12262 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
12263 Reduction): Adjust reported locations to match the more-precise
12264 results now expected.
12265 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
12266 * tests/reduce.at (Useless Rules, Reduced Automaton,
12267 Underivable Rules): Likewise.
12268 * tests/regression.at (Invalid inputs): No longer `expecting ";"
12269 or "|"' now that so many other tokens are allowed by the new grammar.
12270
12271 * src/complain.h (current_file): Remove duplicate decl;
12272 current_file is now owned by files.h.
12273 * src/complain.c, src/scan-gram.l: Include files.h.
12274
12275 2002-12-06 Paul Eggert <eggert@twinsun.com>
12276
12277 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
12278 promotes to int; it might be unsigned int.
12279 * data/yacc.c (yy_reduce_print): Likewise.
12280
12281 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
12282 be #defined in the prologue, not in the Bison declarations.
12283 This fixes Debian Bug 102878, reported by Shaul Karl.
12284
12285 2002-12-02 Paul Eggert <eggert@twinsun.com>
12286
12287 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
12288 * lib/strtoul.c: New file, from gnulib.
12289 This fixes a porting bug reported by Peter Klein in
12290 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
12291
12292 2002-11-30 Paul Eggert <eggert@twinsun.com>
12293
12294 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
12295 and put only a forward declaration in the prologue. This is for
12296 consistency with the other scanner helper functions.
12297
12298 Type clashes now generate warnings, not errors, since it
12299 appears that POSIX may allow some grammars with type clashes.
12300 * src/reader.c (grammar_current_rule_check): Warn about
12301 type clashes instead of complaining.
12302 * tests/input.at (Type Clashes): Expect warnings, not complaints.
12303
12304 Add Yacc library, since POSIX requires it.
12305 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
12306 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
12307 * lib/main.c, lib/yyerror.c: New files.
12308
12309 gram_error can be static; it need not be extern.
12310 * src/reader.h (gram_error): Remove decl.
12311 * src/parse-gram.y (gram_error): Now static. Add static decl.
12312 (print_token_value): Omit parameter names from forward decl,
12313 for consistency.
12314
12315 2002-11-29 Paul Eggert <eggert@twinsun.com>
12316
12317 * doc/bison.texinfo: Emphasize that yylex and yyerror must
12318 be declared before being used. E.g., one should typically
12319 declare them in the prologue. Use GNU coding style in examples.
12320 Put "const" consistently after the type it modifies. Mention
12321 that C99 supports "inline". Mention that yyerror traditionally
12322 returns "int".
12323
12324 %parse-param and %lex-param now take just one argument, the
12325 declaration; the argument name is deduced from the declaration.
12326
12327 * doc/bison.texinfo (Parser Function, Pure Calling, Error
12328 Reporting, Table of Symbols): Document this.
12329 * src/parse-gram.y (add_param): New function.
12330 (COMMA): Remove.
12331 (declaration): Implement new rule for %parse-param and %lex-param.
12332 * src/scan-gram.l: "," now elicits a warning, rather than being
12333 a token; this is more compatible with byacc.
12334 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
12335
12336 2002-11-27 Paul Eggert <eggert@twinsun.com>
12337
12338 Rename identifiers to avoid real and potential collisions.
12339
12340 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
12341 to avoid collision with lex macro described by Bruce Lilly in
12342 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
12343 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12344 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
12345 * src/parse-gram.y (print_token_value): Renamed from yyprint.
12346 All uses changed.
12347 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
12348 The name "yycontrol" violates the name space rules, and this stuff
12349 wasn't being used anyway.
12350 (input): Remove action; this stuff wasn't being used.
12351 (gram_error): Rename local variable yylloc -> loc.
12352 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
12353 (YY_DECL): Don't use "yy" at start of local variables.
12354 All uses changed, e.g., yylloc -> loc.
12355 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
12356 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
12357 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
12358 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
12359
12360 * src/parse-gram.y (gram_error): loc is now const *.
12361 * src/reader.h (gram_error): Likewise.
12362
12363 2002-11-24 Paul Eggert <eggert@twinsun.com>
12364
12365 Version 1.75c.
12366
12367 * tests/actions.at (Actions after errors): Use an output format
12368 more similar to that of the Printers and Destructors test.
12369 Test the position of the ';' token too.
12370 (Printers and Destructors): Likewise.
12371 (Printers and Destructors: %glr-parser): Remove for now, to avoid
12372 unnecessarily alarming people when the test fails.
12373
12374 * data/yacc.c (yyerrlab1): Move this label down, so that the
12375 parser does not discard the lookahead token if the user code
12376 invokes YYERROR. This change is required for POSIX conformance.
12377
12378 * lib/error.c: Sync with gnulib.
12379
12380 2002-11-22 Paul Eggert <eggert@twinsun.com>
12381
12382 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
12383 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
12384 * lib/xmalloc.c: Likewise.
12385
12386 2002-11-20 Paul Eggert <eggert@twinsun.com>
12387
12388 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
12389
12390 2002-11-20 Paul Eggert <eggert@twinsun.com>
12391
12392 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
12393 should use `if (! x) abort ();' rather than `assert (x);', and
12394 anyway it's one less thing to worry about configuring.
12395
12396 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
12397 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
12398 and replace all instances of assert with abort.
12399 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
12400 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
12401
12402 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
12403 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
12404 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
12405 hash_find_entry, hash_rehash, hash_insert): Likewise.
12406 * src/conflicts.c (resolve_sr_conflict): Likewise.
12407 * src/lalr.c (set_goto_map, map_goto): Likewise.
12408 * src/nullable.c (nullable_compute): Likewise.
12409 * src/output.c (prepare_rules, token_definitions_output): Likewise.
12410 * src/reader.c (packgram, reader): Likewise.
12411 * src/state.c (state_new, state_free, state_transitions_set,
12412 state_reduction_find): Likewise.
12413 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
12414 symbol_pack): Likewise.
12415 * src/tables.c (conflict_row, pack_vector): Likewise.
12416 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12417 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12418 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
12419 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
12420
12421 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
12422 (ARGMATCH_CONSTRAINT): New macro.
12423 (ARGMATCH_ASSERT): Use it.
12424
12425 * src/system.h (verify): New macro.
12426 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
12427 rather than assert.
12428 * src/tables.c (tables_generate): Likewise.
12429
12430 * src/struniq.c (struniq_assert): Now returns void, and aborts
12431 if the assertion is false.
12432 (struniq_assert_p): Remove.
12433 * src/struniq.h: Likewise.
12434
12435 2002-11-18 Paul Eggert <eggert@twinsun.com>
12436
12437 * data/glr.c (yygetLRActions): Replace `yyindex' with
12438 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
12439 This fixes the regression with Sun ONE Studio 7 cc that I reported in
12440 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
12441
12442 2002-11-18 Akim Demaille <akim@epita.fr>
12443
12444 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
12445 space.
12446 From Tim Van Holder.
12447
12448 2002-11-17 Paul Eggert <eggert@twinsun.com>
12449
12450 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
12451 to "SyntaxError" for consistency with my 2002-11-15 change.
12452
12453 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
12454 not define to {}, since this breaks the common use of `YYDPRINTF
12455 ((...));' if a single statement is desired (e.g. before `else').
12456 Work around GCC warnings by surrounding corresponding calls with
12457 {} if needed.
12458 (yyhasResolvedValue): Remove unused function.
12459 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
12460 loop body.
12461 (yyreportSyntaxError): Renamed from yyreportParseError.
12462 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
12463 All uses changed.
12464 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
12465 extern when possible. Remove unused initializations.
12466
12467 2002-11-16 Akim Demaille <akim@epita.fr>
12468
12469 Augment the similarity between GLR and LALR traces.
12470
12471 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
12472 (YY_REDUCE_PRINT): New.
12473 (yyparse): Use them.
12474 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
12475 YYDPRINT here.
12476 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
12477 state reached after the reduction/recovery, since...
12478 (yyparse, yyprocessOneStack): Report the state we are entering in.
12479
12480 2002-11-16 Akim Demaille <akim@epita.fr>
12481
12482 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
12483 Add support for --trace=skeleton.
12484 * src/scan-skel.l: %option debug.
12485 Scan strings of non-@ or \n instead of character by character.
12486 (scan_skel): Handle trace_skeleton.
12487 (QPUTS): New.
12488 (@output_parser_name@, @output_header_name@): ``Restore'' their
12489 support (used to be M4 macros).
12490 * data/yacc.c: Quote larger chunks, a la glr.c.
12491 * data/lalr1.cc: Likewise.
12492 The header guards are no longer available, so use some other
12493 string than `YYLSP_NEEDED'.
12494
12495 2002-11-16 Akim Demaille <akim@epita.fr>
12496
12497 Make the ``Printers and Destructors'' test more verbose, taking
12498 `yacc.c''s behavior as (possibly wrong) reference.
12499
12500 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
12501 instead of fprint on stdout.
12502 Set and report the last_line of the symbols.
12503 Consistently display values and locations.
12504
12505 2002-11-16 Paul Eggert <eggert@twinsun.com>
12506
12507 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
12508
12509 2002-11-15 Paul Eggert <eggert@twinsun.com>
12510
12511 * tests/actions.at (Actions after errors): New test case.
12512
12513 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
12514 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
12515 tests/action.at, tests/calc.at, tests/conflicts.at,
12516 tests/cxx-type.at, tests/regression.at:
12517 "parse error" -> "syntax error" for POSIX compatibility.
12518 "parsing stack overflow..." -> "parser stack overflow" so
12519 that code matches Bison documentation.
12520
12521 2002-11-15 Akim Demaille <akim@epita.fr>
12522
12523 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
12524 take two BRACED_CODE, not two string_content.
12525 Free the scanner's obstack when we are done.
12526 (code_content): New.
12527 * tests/calc.at: Adjust.
12528 * doc/bison.texinfo: Adjust.
12529 Also, make sure to include the `,' for these declarations.
12530
12531 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
12532
12533 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
12534 definition; avoids potential autoreconf problems.
12535
12536 2002-11-15 Akim Demaille <akim@epita.fr>
12537
12538 Always check the value returned by yyparse.
12539
12540 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
12541 returned by yyparse.
12542 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
12543 Adjust calls.
12544 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
12545 returned by yyparse.
12546
12547 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12548
12549 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
12550 on input.at test.
12551
12552 2002-11-14 Paul Eggert <eggert@twinsun.com>
12553
12554 * src/output.c (output_skeleton): Call xfopen instead of
12555 duplicating xfopen's body.
12556
12557 Fix bugs reported by Nelson H. F. Beebe in
12558 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
12559
12560 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
12561 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
12562 Group compiler. Instead, use "$CC -E bar.c". Include the .h
12563 file twice in the grammar, as an extra check.
12564
12565 * tests/input.at (Torturing the Scanner): Surround the
12566 backslash-newline tests with "#if 0", to make it less likely that
12567 we'll run into compiler bugs. Bring back solitary \ inside
12568 comment, but add a closing comment to work around HP C bug. Don't
12569 test backslash-newline in C character constant.
12570
12571 2002-11-14 Akim Demaille <akim@epita.fr>
12572
12573 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
12574 status of the compiler.
12575 Calling `exit 1' is no longer needed.
12576 Reported by Nelson H. F. Beebe.
12577
12578 2002-11-14 Akim Demaille <akim@epita.fr>
12579
12580 * tests/atlocal.in (CPPFLAGS): We have config.h.
12581 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
12582 New.
12583 * tests/actions.at, tests/calc.at, tests/conflicts.at,
12584 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
12585 * tests/regression.at, tests/torture.at: Use them for all the
12586 grammars that are to be compiled.
12587 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
12588 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
12589 * doc/bison.texinfo (GLR Parsers): Document `inline'.
12590
12591 2002-11-14 Akim Demaille <akim@epita.fr>
12592
12593 * doc/bison.texinfo: Various formatting changes (alignments in
12594 samples, additional @group/@end group, GCS in samples.
12595 Use @deffn instead of simple @table to define the directives,
12596 macros, variables etc.
12597
12598 2002-11-13 Paul Eggert <eggert@twinsun.com>
12599
12600 Fix some bugs reported by Albert Chin-A-Young in
12601 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
12602
12603 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
12604 -o c"; the HP C compiler chatters during compilation.
12605 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
12606 * tests/headers.at (export YYLTYPE): Likewise.
12607
12608 * tests/input.at (Torturing the Scanner): Remove lines containing
12609 solitary backslashes, as they tickle a bug in the HP C compiler.
12610
12611 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
12612 comments, since they're not portable. Use GNU coding style.
12613
12614 2002-11-13 Akim Demaille <akim@epita.fr>
12615
12616 * data/yacc.c: Leave bigger chunks of quoted text.
12617 (YYDSYMPRINTF): New.
12618 Use it to report symbol activities.
12619 * data/glr.c (YYDSYMPRINTF): New.
12620 Use it.
12621
12622 2002-11-12 Paul Eggert <eggert@twinsun.com>
12623
12624 Version 1.75b.
12625
12626 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
12627 (yyglrReduce): Return yyok, not 0.
12628 This should avoid the enumerated-type warnings reported
12629 by Nelson H. F. Beebe in
12630 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
12631
12632 * lib/bbitset.h (BITSET_INLINE): Remove.
12633 * lib/bitset.h [! BITSET_INLINE]: Remove.
12634 (bitset_set, bitset_reset, bitset_test): Rename local vars
12635 to avoid shadowing warnings by GCC.
12636
12637 * data/glr.c (inline): Remove #define. It's the user's
12638 responsibility to #define it away, just like 'const'.
12639 This fixes one of the bugs reported by Nelson H. F. Beebe in
12640 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
12641
12642 * Makefile.maint (po-check): Scan .l and .y files instead of the
12643 .c and the .h files that they generate. This fixes the bug
12644 reported by Tim Van Holder in:
12645 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
12646 Look for N_ as well as for _. Try to avoid matching #define for
12647 N_ and _.
12648 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
12649 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
12650 * src/scan-gram.l: Revamp regular expressions so that " and '
12651 do not confuse xgettext.
12652
12653 * src/struniq.h (struniq_new): Do not declare the return type
12654 to be 'const'; this violates the C standard.
12655 * src/struniq.c (struniq_new): Likewise.
12656
12657 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
12658
12659 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
12660 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
12661 linker.
12662
12663 2002-11-12 Akim Demaille <akim@epita.fr>
12664
12665 * Makefile.maint: Sync with Autoconf:
12666 (local_updates): New.
12667
12668 2002-11-12 Akim Demaille <akim@epita.fr>
12669
12670 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
12671
12672 2002-11-12 Akim Demaille <akim@epita.fr>
12673
12674 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
12675 locations.
12676
12677 2002-11-12 Akim Demaille <akim@epita.fr>
12678
12679 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
12680 not yyvalue.
12681
12682 2002-11-12 Akim Demaille <akim@epita.fr>
12683
12684 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
12685 Use it to test the GLR parser.
12686
12687 2002-11-12 Akim Demaille <akim@epita.fr>
12688
12689 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
12690 defines it.
12691 * data/glr.c (yystos): New.
12692 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
12693 (YYDSYMPRINT): New.
12694 (yyval): Don't define it, it is handled via M4.
12695 (yyrecoverParseError): Free verbosely the discarded symbols.
12696 * data/yacc.c (yysymprint): Remove, rather...
12697 (b4_yysymprint_generate): invoke.
12698 * data/c.m4 (b4_yysymprint_generate): New.
12699 Accept pointers as arguments, as opposed to the version from
12700 yacc.c.
12701 (b4_yydestruct_generate): Likewise.
12702 * tests/cations.at (Printers and Destructors): Use Bison directives
12703 instead of CPP macros.
12704 Don't rely on internal details.
12705
12706 2002-11-12 Akim Demaille <akim@epita.fr>
12707
12708 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
12709 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
12710 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
12711 it against YYEMPTY and so forth), work on yytoken (i.e., set
12712 it to YYEMPTY etc.).
12713 (yydestruct): Replace with a b4_yydestruct_generate invocation.
12714 (b4_symbol_actions): Remove.
12715 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
12716 for 0, end-of-input.
12717
12718 2002-11-12 Akim Demaille <akim@epita.fr>
12719
12720 * doc/bison.texinfo (Destructor Decl): New.
12721
12722 2002-11-12 Akim Demaille <akim@epita.fr>
12723
12724 * src/tables.c (tables_generate): Use free for pointers that
12725 cannot be NULL, not XFREE.
12726 (pack_vector): Use assert, not fatal, for bound violations.
12727 * src/state.c (state_new): Likewise.
12728 * src/reader.c (reader): Likewise.
12729 * src/lalr.c (set_goto_map): Likewise.
12730 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
12731 the file name.
12732
12733 2002-11-12 Akim Demaille <akim@epita.fr>
12734
12735 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
12736 Restore.
12737 * src/scan-gram.l (last_string): Is global to the file, not to
12738 yylex.
12739 * src/parse-gram.y (input): Don't append the epilogue here,
12740 (epilogue.opt): do it here, and free the scanner's obstack.
12741 * src/reader.c (epilogue_set): Rename as...
12742 (epilogue_augment): this.
12743 * data/c.m4 (b4_epilogue): Defaults to empty.
12744
12745 2002-11-12 Akim Demaille <akim@epita.fr>
12746
12747 * src/getargs.c (long_options): Remove duplicates.
12748 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
12749 Remove.
12750 * doc/bison.rnh: Remove.
12751 * doc/bison.texinfo (VMS Invocation): Remove.
12752
12753 2002-11-12 Akim Demaille <akim@epita.fr>
12754
12755 * src/struniq.h, src/struniq.c (struniq_t): Is const.
12756 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
12757
12758 Use struniq for symbols.
12759
12760 * src/symtab.h (symbol_t): The tag member is a struniq.
12761 (symbol_type_set): Adjust.
12762 * src/symtab.c (symbol_new): Takes a struniq.
12763 (symbol_free): Don't free the tag member.
12764 (hash_compare_symbol_t, hash_symbol_t): Rename as...
12765 (hash_compare_symbol, hash_symbol): these.
12766 Use the fact that tags as struniqs.
12767 (symbol_get): Use struniq_new.
12768 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
12769 Returns a strniq.
12770 * src/reader.h (merger_list, grammar_currentmerge_set): The name
12771 and type members are struniqs.
12772 * src/reader.c (get_merge_function)
12773 (grammar_current_rule_merge_set): Adjust.
12774 (TYPE, current_type): Are struniq.
12775
12776 Use struniq for file names.
12777
12778 * src/files.h, src/files.c (infile): Split into...
12779 (grammar_file, current_file): these.
12780 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
12781 * src/reduce.c (reduce_print): Likewise.
12782 * src/getargs.c (getargs): Likewise.
12783 * src/complain.h, src/complain.c: Likewise.
12784 * src/main.c (main): Call struniqs_new early enough to use it for
12785 file names.
12786 Don't free the input file name.
12787
12788 2002-11-12 Akim Demaille <akim@epita.fr>
12789
12790 * src/symtab.c (symbol_free): Remove dead deactivated code:
12791 type_name are properly removed.
12792 Don't use XFREE to free items that cannot be NULL.
12793 * src/struniq.h, src/struniq.c: New.
12794 * src/main.c (main): Initialize/free struniqs.
12795 * src/parse-gram.y (%union): Add astruniq member.
12796 (yyprint): Adjust.
12797 * src/scan-gram.l (<{tag}>): Return a struniq.
12798 Free the obstack bit that used to store it.
12799 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
12800
12801 2002-11-11 Paul Eggert <eggert@twinsun.com>
12802
12803 Revamp to fix many (but not all) of the C- and M4-related quoting
12804 problems. Among other things, this fixes the Bison bug reported
12805 by Jan Hubicka when processing the Bash grammar; see:
12806 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
12807
12808 Use new @ escapes consistently. Represent brackets with @{ and @}
12809 rather than @<:@ and @:>@, since this works a bit better with dumb
12810 editors like vi. Represent @ with @@, since @ is now consistently
12811 an escape. Use @oline@ and @ofile@ rather than __oline__ and
12812 __ofile__, to avoid unexpected expansions. Similarly, use @output
12813 rather than #output.
12814
12815 * data/c.m4 (b4_copyright): Omit file name from comment, since
12816 the file name could contain "*/".
12817 (b4_synclines_flag): Don't quote the 2nd argument; it should already
12818 be quoted. All uses changed.
12819
12820 * data/glr.c: Use new @ escapes consistently.
12821 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
12822 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
12823 Remove, since they couldn't handle arbitrary characters in file
12824 names.
12825 * data/lalr1.cc: Likewise.
12826 * data/yacc.c: Likewise.
12827
12828 * src/files.c (output_infix): Remove; all uses removed.
12829 * src/files.h: Likewise.
12830
12831 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
12832 mishandled funny characters in file names, and anyway it isn't
12833 needed any more.
12834 * data/yacc.c: Likewise.
12835 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
12836
12837 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
12838 * data/yacc.c: Likewise.
12839
12840 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
12841 strings now.
12842 (muscle_init): Quote filename as a C string.
12843 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
12844 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
12845 * src/output.c (escaped_file_name_output): New function.
12846 (prepare_symbols): Quote tokens for M4.
12847 (prepare): Don't insert output_infix, output_prefix,
12848 output_parser_name, output_header_name; this is now down by scan-skel.
12849 Insert skeleton as a C string.
12850
12851 * src/output.c (user_actions_output, symbol_destructors_output,
12852 symbol_printers_output): Quote filenames for C and M4.
12853 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12854
12855 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
12856 escapes other than \\ and \'; this simplifies the code.
12857 (<SC_STRING>): Likewise, for \\ and \".
12858 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
12859 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
12860 Use new escapes @{ and @} for [ and ].
12861
12862 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
12863 them with auto vars.
12864 Switch to new escape scheme, where @ is the escape character uniformly.
12865 Abort if a stray escape character is found. Avoid unbounded input
12866 buffer when parsing non-escaped text.
12867
12868 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
12869 __oline__, #output, $@, and @{ do not have unintended meanings.
12870
12871 2002-11-09 Paul Eggert <eggert@twinsun.com>
12872
12873 Fix the test failure due to GCC warnings described in
12874 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
12875 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
12876 evaluate to 0 if it's impossible for NINF to be in the respective
12877 table.
12878 (yygetLRActions, yyrecoverParseError): Use them.
12879
12880 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
12881 counted in the token inserted at end of file. Now takes
12882 location_t *, not location_t, so that the location can be
12883 adjusted. All uses changed.
12884
12885 * tests/regression.at (Invalid inputs): Adjust wording in
12886 diagnostic to match the new behavior.
12887
12888 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
12889 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
12890 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
12891 abort ();'. This reduces the runtime of the "Many lookaheads"
12892 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
12893 GCC 3.2.
12894
12895 2002-11-07 Paul Eggert <eggert@twinsun.com>
12896
12897 * src/parse-gram.y (CHARACTER): Remove unused token.
12898 All uses removed.
12899
12900 * src/scan-gram.l: Remove stack option. We no longer use the
12901 stack, since the stack was never deeper than 1; instead, use the
12902 new auto var c_context to record the stacked value.
12903
12904 Remove nounput option. At an unexpected end of file, we now unput
12905 the minimal input necessary to end cleanly; this simplifies the
12906 code.
12907
12908 Avoid unbounded token sizes where this is easy.
12909
12910 (unexpected_end_of_file): New function.
12911 Use it to systematize the error message on unexpected EOF.
12912 (last-string): Now auto, not static.
12913 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
12914 (scanner_last_string_free): Remove; not used.
12915 (percent_percent_count): Move decl to just before use.
12916 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
12917 not the (never otherwised-used) CHARACTER.
12918
12919 2002-11-07 Akim Demaille <akim@epita.fr>
12920
12921 Let yyerror always receive the msg as last argument, so that
12922 yyerror can be variadic.
12923
12924 * data/yacc.c (b4_yyerror_args): New.
12925 Use it when calling yyerror.
12926 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
12927 Use it when calling yyerror.
12928 * doc/bison.texinfo (Error Reporting): Adjust.
12929 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
12930 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
12931
12932 2002-11-06 Akim Demaille <akim@epita.fr>
12933
12934 #line should have quoted strings.
12935 Ideally, this should be done by m4_quotearg.
12936
12937 * src/scan-skel.l: Include quotearg.h.
12938 Quote __ofile__.
12939 * src/output.c (symbol_printers_output)
12940 (symbol_destructors_output): Quote the file name.
12941
12942 2002-11-06 Akim Demaille <akim@epita.fr>
12943
12944 * tests/regression.at (Invalid inputs): Adjust to the recent
12945 messages.
12946
12947 2002-11-06 Akim Demaille <akim@epita.fr>
12948
12949 Restore --no-lines.
12950 Reported by Jim Kent.
12951
12952 * data/c.m4 (b4_syncline): New.
12953 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
12954 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
12955 * src/output.c (user_actions_output): Likewise.
12956 (prepare): Define 'b4_synclines_flag'.
12957 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
12958
12959 2002-11-06 Akim Demaille <akim@epita.fr>
12960
12961 * src/main.c (main): Free `infile'.
12962 * src/scan-gram.l (handle_syncline): New.
12963 Recognize `#line'.
12964 * src/output.c (user_actions_output, symbol_destructors_output)
12965 (symbol_printers_output): Use the location's file name, not
12966 infile.
12967 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12968
12969 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12970
12971 * src/tables.c (matching_state): Don't allow states to match if
12972 either has GLR conflict entries.
12973
12974 2002-11-05 Paul Eggert <eggert@twinsun.com>
12975
12976 * src/scan-gram.l: Use more accurate diagnostics, e.g.
12977 "integer out of range" rather than "invalid value".
12978 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
12979 accordingly.
12980
12981 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
12982 Also, remove one static variable in the scanner.
12983
12984 * src/scan-gram.l (braces_level): Now auto, not static.
12985 Initialize to zero if the compiler is being picky.
12986 (INITIAL): Clear braces_level instead of incrementing it.
12987 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
12988 as POSIX 1003.1-2001 requires.
12989 * src/system.h (IF_LINT): New macro, taken from coreutils.
12990 * configure.ac: Define "lint" if --enable-gcc-warnings.
12991
12992 2002-11-05 Akim Demaille <akim@epita.fr>
12993
12994 * src/scan-gram.l: When it starts with `%', complain about the
12995 whole directive, not just that `invalid character: %'.
12996
12997 2002-11-04 Akim Demaille <akim@epita.fr>
12998
12999 * Makefile.maint: Update from Autoconf.
13000 (update, cvs-update, po-update, do-po-update): New.
13001
13002 2002-11-04 Akim Demaille <akim@epita.fr>
13003
13004 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
13005 and yyerror.
13006 Have yyerror `use' its arguments.
13007 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
13008 returns true when location & yacc & pure & parse-param.
13009 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
13010
13011 2002-11-04 Akim Demaille <akim@epita.fr>
13012
13013 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
13014 clashes.
13015 * src/scan-gram.l: Use [\'] instead of ['] to pacify
13016 font-lock-mode.
13017 Use complain_at.
13018 Use quote, not quote_n since LOCATION_PRINT no longer uses the
13019 slot 0.
13020
13021 2002-11-03 Paul Eggert <eggert@twinsun.com>
13022
13023 * src/reader.c (get_merge_function, grammar_current_rule_check):
13024 Use consistent diagnostics for reporting type name clashes.
13025 Quote the types with <>, for consistency with Yacc.
13026 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
13027
13028 2002-11-03 Akim Demaille <akim@epita.fr>
13029
13030 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
13031 New.
13032 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
13033 (b4_parse_param): Remove.
13034 Use b4_identification.
13035 Propagate b4_pure_args where needed to pass them to yyerror.
13036 * data/glr.m4 (b4_parse_param): Remove.
13037 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
13038 (b4_lpure_formals): New.
13039 Use b4_identification.
13040 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
13041 b4_user_formals and b4_user_args.
13042 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
13043 (yyreportAmbiguity): When using a pure parser, also need
13044 the location, and the parse-params.
13045 Adjust callers.
13046 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
13047 When using a pure parser, also need the parse-params.
13048 Adjust callers.
13049 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
13050 (%pure-parser + %parse-param) LALR and GLR parsers.
13051 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
13052 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
13053 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
13054 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
13055 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
13056 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
13057 * doc/bison.texinfo: Untabify the whole file.
13058 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
13059 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
13060 (Error Reporting): Adjust to these new directives.
13061 Document %error-verbose, deprecate YYERROR_VERBOSE.
13062
13063 2002-11-03 Akim Demaille <akim@epita.fr>
13064
13065 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
13066 AT_CHECK_CALC_GLR invocations to use % directives, instead of
13067 command line options.
13068 * tests/cxx-type.at: Formatting changes.
13069
13070 2002-11-03 Paul Eggert <eggert@twinsun.com>
13071
13072 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
13073 to count columns correctly, and to check for invalid inputs.
13074
13075 Use mbsnwidth to count columns correctly. Account for tabs, too.
13076 Include mbswidth.h.
13077 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
13078 (extend_location): New function.
13079 (YY_LINES): Remove.
13080
13081 Handle CRLF in C code rather than in Lex code.
13082 (YY_INPUT): New macro.
13083 (no_cr_read): New function.
13084
13085 Scan UCNs, even though we don't fully handle them yet.
13086 (convert_ucn_to_byte): New function.
13087
13088 Handle backslash-newline correctly in C code.
13089 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
13090 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
13091 all uses changed.
13092 (tag, splice): New EREs. Do not allow NUL or newline in tags.
13093 Use {splice} wherever C allows backslash-newline.
13094 YY_STEP after space, newline, vertical-tab.
13095 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
13096
13097 (letter, id): Don't assume ASCII; e.g., spell out a-z.
13098
13099 ({int}, handle_action_dollar, handle_action_at): Check for integer
13100 overflow.
13101
13102 (YY_STEP): Omit trailing semicolon, so that it's more like C.
13103
13104 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
13105 as well as \000. Check for UCHAR_MAX, not 255.
13106 Allow \x with an arbitrary positive number of digits, as in C.
13107 Check for overflow here.
13108 Allow \? and UCNs, for compatibility with C.
13109
13110 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
13111 with quote slot used by complain_at.
13112
13113 * tests/input.at: Add tests for backslash-newline, m4 quotes
13114 in symbols, long literals, and funny escapes in strings.
13115
13116 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
13117 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
13118 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
13119 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
13120 * m4/mbswidth.m4: New file, from GNU coreutils.
13121
13122 * doc/bison.texinfo (Grammar Outline): Document // comments.
13123 (Symbols): Document that trigraphs have no special meaning in Bison,
13124 nor is backslash-newline allowed.
13125 (Actions): Document that trigraphs have no special meaning.
13126
13127 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
13128 no longer used.
13129
13130 2002-11-02 Paul Eggert <eggert@twinsun.com>
13131
13132 * src/reader.c: Don't include quote.h; not needed.
13133 (get_merge_function): Reword warning to be consistent with
13134 type clash diagnostic in grammar_current_rule_check.
13135
13136 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
13137 bug in trigraph handling.
13138
13139 * src/output.c (prepare_symbols): When printing token names,
13140 escape "[" as "@<:@" and likewise for "]".
13141
13142 * src/system.h (errno): Remove declaration, as we are now
13143 assuming C89 or better, and C89 guarantees errno.
13144
13145 2002-10-30 Paul Eggert <eggert@twinsun.com>
13146
13147 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
13148 Check for close failures.
13149 * src/files.h (xfclose): Return void, not int, since it always
13150 returned zero.
13151 * src/files.c (xfclose): Likewise. Report I/O error if ferror
13152 indicates one.
13153 * src/output.c (output_skeleton): Use xfclose rather than fclose
13154 and ferror. xfclose now checks ferror.
13155
13156 * data/glr.c (YYLEFTMOST_STATE): Remove.
13157 (yyreportTree): Use a stack-based leftmost state. This avoids
13158 our continuing battles with bogus warnings about initializers.
13159
13160 2002-10-30 Akim Demaille <akim@epita.fr>
13161
13162 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
13163 #if.
13164
13165 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13166
13167 * tests/glr-regr1.at: New test for reported regressions.
13168 * tests/testsuite.at: Add glr-regr1.at test.
13169 * tests/Makefile.am: Add glr-regr1.at test.
13170
13171 2002-10-24 Paul Eggert <eggert@twinsun.com>
13172
13173 Version 1.75a.
13174
13175 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
13176 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
13177 we use malloc. Don't assume 'A' through 'Z' are contiguous.
13178 Don't assume strdup exists; POSIX says its an XSI extension.
13179 Check for buffer overflow on input.
13180
13181 2002-10-24 Akim Demaille <akim@epita.fr>
13182
13183 * src/output.c (output_skeleton): Don't disable M4sugar comments
13184 too soon: it results in comments being expanded.
13185 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
13186 first output.
13187
13188 2002-10-24 Akim Demaille <akim@epita.fr>
13189
13190 * data/yacc.c (m4_int_type): New.
13191 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
13192 char' as only yacc.c wants K&R portability.
13193 * data/glr.c (yysigned_char): Remove.
13194 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
13195 Reported by Quoc Peyrot.
13196
13197 2002-10-23 Paul Eggert <eggert@twinsun.com>
13198
13199 * src/main.c (main): With --trace=time, report times even if a
13200 non-fatal error occurs. Formerly, the times were reported in some
13201 such cases but not in others.
13202 * src/reader.c (reader): Just return if a complaint has been issued,
13203 instead of exiting, so that 'main' can report times.
13204
13205 2002-10-22 Akim Demaille <akim@epita.fr>
13206
13207 * src/system.h: Include sys/types.
13208 Reported by Bert Deknuydt.
13209
13210 2002-10-23 Paul Eggert <eggert@twinsun.com>
13211
13212 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
13213 Suggested by Art Haas.
13214
13215 2002-10-22 Paul Eggert <eggert@twinsun.com>
13216
13217 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
13218 decl; not needed any more.
13219 * src/main.c (main): Use return to exit, undoing yesterday's change.
13220 The last OS that we could find where this wouldn't work is
13221 SunOS 3.5, and that's too old to worry about now.
13222
13223 * data/glr.c (struct yyltype): Define members even when not
13224 doing locations. This is more consistent with yacc.c, and it
13225 works around the following bug reports:
13226 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
13227 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
13228
13229 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
13230 @acronym consistently. Standardize on "Yacc" instead of "YACC",
13231 "Algol" instead of "ALGOL". Give a bit more history about BNF.
13232
13233 2002-10-22 Akim Demaille <akim@epita.fr>
13234
13235 * data/README: New.
13236
13237 2002-10-21 Paul Eggert <eggert@twinsun.com>
13238
13239 Be consistent about 'bool'; the old code used an enum in one
13240 module and an int in another, and this violates the C standard.
13241 * m4/stdbool.m4: New file, from coreutils 4.5.3.
13242 * configure.ac (AC_HEADER_STDBOOL): Add.
13243 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
13244 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
13245 * src/symtab.c (hash_compare_symbol_t): Likewise.
13246 * src/system.h (bool, false, true): Use a definition consistent
13247 with ../lib/hash.c. All uses changed.
13248
13249 * src/complain.c (warning_issued): Renamed from warn_message_count,
13250 so that we needn't worry about integer overflow (!).
13251 Now of type bool. All uses changed.
13252 (complaint_issued): Renamed from complain_message_count; likewise.
13253
13254 * src/main.c (main): Use exit to exit with failure.
13255
13256 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
13257 rather than 1 and 0.
13258 * src/main.c (main): Likewise.
13259 * src/getargs.c (getargs): Likewise.
13260 * src/reader.c (reader): Likewise.
13261
13262 * src/getarg.c (getargs): Remove duplicate code for
13263 "Try `bison --help'".
13264
13265 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
13266 What was that "2" for?
13267
13268 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
13269 * src/getargs.c (usage): Likewise.
13270
13271 * src/getargs.c (getargs): When there are too few operands, report
13272 the last one. When there are too many, report the first extra
13273 one. This is how diffutils does it.
13274
13275 2002-10-20 Paul Eggert <eggert@twinsun.com>
13276
13277 Remove K&R vestiges.
13278 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
13279 * src/complain.c (VA_START): Remove. Assume prototypes.
13280 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
13281 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
13282 fatal): Assume prototypes.
13283 * src/complain.h: Assume prototypes.
13284 * src/system.h (PARAMS): Remove.
13285 Include <limits.h> unconditionally, since it's guaranteeed even
13286 for a freestanding C89 compiler.
13287 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
13288 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
13289
13290 2002-10-20 Akim Demaille <akim@epita.fr>
13291
13292 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
13293 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
13294 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
13295 (yyresolveStates, yyresolveAction, yyresolveStack)
13296 (yyprocessOneStack): Use them.
13297 (yy_reduce_print): New.
13298 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
13299
13300 2002-10-20 Akim Demaille <akim@epita.fr>
13301
13302 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
13303 arguments and output `void'.
13304 (b4_c_function): Rename as...
13305 (b4_c_function_def): this.
13306 (b4_c_function_decl, b4_c_ansi_function_def)
13307 (b4_c_ansi_function_decl): New.
13308 Change the interpretation of the arguments: before `int, foo', now
13309 `int foo, foo'.
13310 * data/yacc.c (yyparse): Prototype and define thanks to these.
13311 Adjust b4_c_function_def uses.
13312 * data/glr.c (yyparse): Likewise, but ANSI only.
13313
13314 2002-10-20 Akim Demaille <akim@epita.fr>
13315
13316 * src/output.c (prepare): Move the definition of `tokens_number',
13317 `nterms_number', `undef_token_number', `user_token_number_max'
13318 to...
13319 (prepare_tokens): Here.
13320 (prepare_tokens): Rename as...
13321 (prepare_symbols): this.
13322 (prepare): Move the definition of `rules_number' to...
13323 (prepare_rules): here.
13324 (prepare): Move the definition of `last', `final_state_number',
13325 `states_number' to...
13326 (prepare_states): here.
13327 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
13328
13329 2002-10-20 Akim Demaille <akim@epita.fr>
13330
13331 * src/tables.h, src/tables.c, src/output.c: Comment changes.
13332
13333 2002-10-20 Akim Demaille <akim@epita.fr>
13334
13335 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
13336 * data/c.m4: here.
13337
13338 2002-10-20 Akim Demaille <akim@epita.fr>
13339
13340 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
13341 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
13342 `pair'.
13343 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
13344 `name' to...
13345 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
13346 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
13347 These.
13348
13349 2002-10-19 Paul Eggert <eggert@twinsun.com>
13350
13351 Do not create a temporary file, as that involves security and
13352 cleanup headaches. Instead, use a pair of pipes.
13353 Derived from a suggestion by Florian Krohm.
13354 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
13355 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
13356 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
13357 (BISON_PREREQ_SUBPIPE): Add.
13358 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
13359 Add subpipe.h, subpipe.c.
13360 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
13361 * po/POTFILES.in: Add lib/subpipe.c.
13362 * src/output.c: Include "subpipe.h".
13363 (m4_invoke): Remove decl.
13364 (scan_skel): New decl.
13365 (output_skeleton): Use pipe rather than temporary file for m4 input.
13366 Check that m4sugar.m4 is readable, to avoid deadlock.
13367 Check for pipe I/O error.
13368 * src/scan-skel.l (readpipe): Remove decl.
13369 (scan_skel): New function, to be used in place of m4_invoke.
13370 Read from stream rather than file.
13371
13372 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
13373 float, as this generates a warning on Solaris 8 + GCC 3.2 with
13374 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
13375 this generates a more-accurate value anyway.
13376
13377 * lib/timevar.c (timervar_accumulate): Rename locals to
13378 avoid confusion with similarly-named more-global.
13379 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
13380
13381 * src/output.c (prepare): Use xstrdup to convert char const *
13382 to char *, to avoid GCC warning.
13383
13384 2002-10-19 Akim Demaille <akim@epita.fr>
13385
13386 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
13387 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
13388 Use them to have `calc.y' ready for %pure-parser.
13389 * data/yacc.c (YYLEX): Pass a yylex return type to
13390 b4_c_function_call.
13391
13392 2002-10-19 Akim Demaille <akim@epita.fr>
13393
13394 Prototype support of %lex-param and %parse-param.
13395
13396 * src/parse-gram.y: Add the definition of the %lex-param and
13397 %parse-param tokens, plus their rules.
13398 Drop the `_' version of %glr-parser.
13399 Add the "," token.
13400 * src/scan-gram.l (INITIAL): Scan them.
13401 * src/muscle_tab.c: Comment changes.
13402 (muscle_insert, muscle_find): Rename `pair' as `probe'.
13403 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
13404 (muscle_entry_s): The `value' member is no longer const.
13405 Adjust all dependencies.
13406 * src/muscle_tab.c (muscle_init): Adjust: use
13407 MUSCLE_INSERT_STRING.
13408 Initialize the obstack earlier.
13409 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
13410 (muscle_pair_list_grow): New.
13411 * data/c.m4 (b4_c_function_call, b4_c_args): New.
13412 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
13413 * tests/calc.at: Use %locations, not --locations.
13414 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
13415
13416 2002-10-19 Akim Demaille <akim@epita.fr>
13417
13418 * src/getargs.c (usage): Take status as argument and exit
13419 accordingly.
13420 Report the traditional `Try ... --help' message when status != 0.
13421 (usage, version): Don't take a FILE * as arg, it is pointless.
13422 (getargs): When there is an incorrect number of arguments, make it
13423 an error, and report it GNUlically thanks to `usage ()'.
13424
13425 2002-10-18 Paul Eggert <eggert@twinsun.com>
13426
13427 * data/glr.c (yyreportParseError): Don't assume that sprintf
13428 yields the length of the printed string, as this is not true
13429 on SunOS 4.1.4. Reported by Peter Klein.
13430
13431 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
13432 * tests/conflicts.at (%nonassoc and eof): Likewise.
13433 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
13434
13435 2002-10-17 Akim Demaille <akim@epita.fr>
13436
13437 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
13438 * src/getargs.c (trace_types, trace_args): Adjust.
13439 * src/reader.c (grammar_current_rule_prec_set)
13440 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
13441 Standardize error messages.
13442 And s/@prec/%prec/!
13443 (reader): Use trace_flag to enable scanner/parser debugging,
13444 instead of an adhoc scheme.
13445 * src/scan-gram.l: Remove trailing debugging code.
13446
13447 2002-10-16 Paul Eggert <eggert@twinsun.com>
13448
13449 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
13450 MUSCLE_TAB_H.
13451
13452 * NEWS: Officially drop support for building Bison with K&R C,
13453 since it didn't work anyway and it's not worth worrying about.
13454 * Makefile.maint (wget_files): Remove ansi2knr.c.
13455 (ansi2knr.c-url_prefix): Remove.
13456 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
13457 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13458 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13459
13460 2002-10-15 Paul Eggert <eggert@twinsun.com>
13461
13462 Stop using the "enum_" trick for K&R-style function definitions;
13463 it confused me, and I was the author! Instead, assume that people
13464 who want to use K&R C compilers (when using these modules in GCC,
13465 perhaps?) will run ansi2knr.
13466
13467 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
13468 All uses of "enum_" changed to "enum ".
13469 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13470 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13471
13472 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
13473 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
13474 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
13475 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
13476 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
13477 abitset_not, abitset_ones, abitset_or, abitset_or_and,
13478 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
13479 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
13480 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
13481 Use function prototypes; this removes the need for declaring
13482 static functions simply to provide their prototypes.
13483 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
13484 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
13485 bitset_count_, bitset_create, bitset_dump, bitset_first,
13486 bitset_free, bitset_init, bitset_last, bitset_next,
13487 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
13488 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
13489 bitset_print, bitset_release_memory, bitset_toggle_,
13490 bitset_type_choose, bitset_type_get, bitset_type_name_get,
13491 debug_bitset): Likewise.
13492 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
13493 * lib/bitset_stats.c (bitset_log_histogram_print,
13494 bitset_percent_histogram_print, bitset_stats_and,
13495 bitset_stats_and_cmp, bitset_stats_and_or,
13496 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
13497 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
13498 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
13499 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
13500 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
13501 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
13502 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
13503 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
13504 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
13505 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
13506 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
13507 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
13508 bitset_stats_zero): Likewise.
13509 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13510 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13511 bitsetv_dump, debug_bitsetv): Likewise.
13512 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
13513 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
13514 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
13515 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
13516 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
13517 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
13518 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
13519 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
13520 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
13521 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
13522 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
13523 Likewise.
13524 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
13525 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
13526 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
13527 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
13528 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
13529 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
13530 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
13531 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
13532 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
13533 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
13534 lbitset_xor_cmp, lbitset_zero): Likewise.
13535
13536 2002-10-14 Akim Demaille <akim@epita.fr>
13537
13538 Version 1.75.
13539
13540 2002-10-14 Akim Demaille <akim@epita.fr>
13541
13542 * tests/Makefile.am (maintainer-check-posix): New.
13543
13544 2002-10-14 Akim Demaille <akim@epita.fr>
13545
13546 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
13547 member.
13548
13549 2002-10-14 Akim Demaille <akim@epita.fr>
13550
13551 * src/tables.c (table_ninf_remap): base -> tab.
13552 Reported by Matt Rosing.
13553
13554 2002-10-14 Paul Eggert <eggert@twinsun.com>
13555
13556 * tests/action.at, tests/calc.at, tests/conflicts.at,
13557 tests/cxx-type.at, tests/headers.at, tests/input.at,
13558 tests/regression.at, tests/synclines.at, tests/torture.at:
13559 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
13560 so that the tests still work even if POSIXLY_CORRECT is set.
13561 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
13562
13563 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
13564 for portability to K&R hosts. Fix typo: signed char is guaranteed
13565 only to 127, not to 128.
13566 * data/glr.c (yysigned_char): New type.
13567 * data/yacc.c (yysigned_char): Likewise.
13568 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
13569
13570 2002-10-13 Paul Eggert <eggert@twinsun.com>
13571
13572 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
13573 true due to limited range of data type" warning from GCC.
13574
13575 * data/c.m4 (b4_token_defines): Protect against double-inclusion
13576 by wrapping enum yytokentype's definition inside #ifndef
13577 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
13578
13579 2002-10-13 Akim Demaille <akim@epita.fr>
13580
13581 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
13582 Un yy- yyrhs to avoid the name clash with the global YYRHS.
13583
13584 2002-10-13 Akim Demaille <akim@epita.fr>
13585
13586 * Makefile.maint: Update from Autoconf 2.54.
13587 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
13588
13589 2002-10-13 Akim Demaille <akim@epita.fr>
13590
13591 * src/print.c (print_state): Separate the list of solved conflicts
13592 from the other items.
13593 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
13594
13595 2002-10-13 Akim Demaille <akim@epita.fr>
13596
13597 Let nondeterministic skeletons be usable with deterministic
13598 tables.
13599
13600 With the patch, GAWK compiled by GCC without -O2 passes its test
13601 suite using a GLR parser driven by LALR tables. It fails with -O2
13602 because `struct stat' gives two different answers on my machine:
13603 88 (definition of an auto var) and later 96 (memset on this var).
13604 Hence the stack is badly corrumpted. The headers inclusion is to
13605 blame: if I move the awk.h inclusion before GLR's system header
13606 inclusion, the two struct stat have the same size.
13607
13608 * src/tables.c (pack_table): Always create conflict_table.
13609 (token_actions): Always create conflict_list.
13610 * data/glr.c (YYFLAG): Remove, unused.
13611
13612 2002-10-13 Akim Demaille <akim@epita.fr>
13613
13614 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
13615 (O0FLAGS): New.
13616 (VALGRIND, GXX): New.
13617 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
13618 * tests/bison.in: Run $PREBISON a pre-command.
13619 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
13620 (maintainer-check-g++): New.
13621 * Makefile.am (maintainer-check): New.
13622
13623 2002-10-13 Akim Demaille <akim@epita.fr>
13624
13625 * data/glr.c: Formatting changes.
13626 Tweak some trace messages to match yacc.c's.
13627
13628 2002-10-13 Akim Demaille <akim@epita.fr>
13629
13630 GLR parsers sometimes raise parse errors instead of performing the
13631 default reduction.
13632 Reported by Charles-Henry de Boysson.
13633
13634 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
13635 check the length of the traces when %glr.
13636 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
13637 GLR's traces.
13638 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
13639 Test GLR parsers.
13640 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
13641 (yyltype): Remove the yy prefix from the member names.
13642 (yytable): Complete its comment.
13643 (yygetLRActions): Map error action number from YYTABLE from
13644 YYTABLE_NINF to 0.
13645 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
13646 (which was a bug: it should have been YYTABEL_NINF, and yet it was
13647 not satisfying as we could compare an YYACTION computed from
13648 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
13649 only value for error actions.
13650 (yyreportParseError): In verbose parse error messages, don't issue
13651 `error' in the list of expected tokens.
13652 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
13653 next action to perform to match glr.c's decoding.
13654 (yytable): Complete its comment.
13655
13656 2002-10-13 Paul Eggert <eggert@twinsun.com>
13657
13658 Fix problem reported by Henrik Grubbstroem in
13659 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
13660 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
13661 because the Bison parser reads the second action before reducing
13662 the first one.
13663 * src/scan-gram.l (rule_length): New static var.
13664 Use it to keep track of the rule length in the scanner, since
13665 we can't expect the parser to be in lock-step sync with the scanner.
13666 (handle_action_dollar, handle_action_at): Use this var.
13667 * tests/actions.at (Exotic Dollars): Test for the problem.
13668
13669 2002-10-12 Paul Eggert <eggert@twinsun.com>
13670
13671 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
13672 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
13673 Include <sys/time.h> when checking for clock_t and struct tms.
13674 Use same include order as source.
13675 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
13676 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
13677
13678 * lib/timevar.c: Update copyright date and clarify comments.
13679 (get_time) [IN_GCC]: Keep the GCC version for reference.
13680
13681 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
13682 GCC version as of today, then merge Bison's changes.
13683 Change "GCC" to "Bison" in copyright notice. timevar.def's
13684 author is Akim, so change that too.
13685
13686 * src/reader.c (grammar_current_rule_check):
13687 Don't worry about the default action if $$ is untyped.
13688 Prevents bogus warnings reported by Jim Gifford in
13689 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
13690
13691 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
13692 * data/glr.c, data/lalr1.cc, data/yacc.c:
13693 Output token definitions before the first part of user declarations.
13694 Fixes compatibility problem reported by Jim Gifford for kbd in
13695 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
13696
13697 2002-10-11 Paul Eggert <eggert@twinsun.com>
13698
13699 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
13700 (yyparse): here. This undoes some of the 2002-07-25 change.
13701 Compatibility problem reported by Ralf S. Engelschall with
13702 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
13703
13704 2002-10-11 Akim Demaille <akim@epita.fr>
13705
13706 * tests/regression.at Characters Escapes): New.
13707 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
13708 characters.
13709 Reported by Jan Nieuwenhuizen.
13710
13711 2002-10-11 Akim Demaille <akim@epita.fr>
13712
13713 * po/id.po: New.
13714
13715 2002-10-10 Paul Eggert <eggert@twinsun.com>
13716
13717 Portability fixes for bitsets; this also avoids several GCC
13718 warnings.
13719
13720 * lib/abitset.c: Include <stddef.h>, for offsetof.
13721 * lib/lbitset.c: Likewise.
13722
13723 * lib/abitset.c (abitset_bytes): Return a size that is aligned
13724 properly for vectors of objects. Do not assume that adding a
13725 header size to a multiple of a word size yields a value that is
13726 properly aligned for the whole union.
13727 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13728
13729 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
13730 unique names for structures.
13731 * lib/ebitset.c (ebitset_bytes): Likewise.
13732 * lib/lbitset.c (lbitset_bytes): Likewise.
13733
13734 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
13735 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
13736 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
13737 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
13738 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
13739 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
13740 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
13741 to improve the type-checking that GCC can do.
13742 * lib/bitset.c (bitset_op4_cmp): Likewise.
13743 * lib/bitset_stats.c (bitset_stats_count,
13744 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
13745 bitset_stats_copy, bitset_stats_disjoint_p,
13746 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
13747 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
13748 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
13749 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
13750 bitset_stats_and_or_cmp, bitset_stats_andn_or,
13751 bitset_stats_andn_or_cmp, bitset_stats_or_and,
13752 bitset_stats_or_and_cmp): Likewise.
13753 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
13754 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
13755 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
13756 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
13757
13758 * lib/abitset.h: Include bitset.h, not bbitset.h.
13759 * lib/ebitset.h: Likewise.
13760 * lib/lbitset.h: Likewise.
13761
13762 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
13763 All instances of parameters of type enum bitset_opts are now of
13764 type enum_bitset_opts, to conform to the C Standard, and similarly
13765 for enum_bitset_type.
13766 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13767 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13768
13769 Do not use "struct bitset_struct" to mean different things in
13770 different modules. Not only is this confusing, it violates
13771 the C Standard, which requires that structure types in different
13772 modules must be compatible if one is to be passed to the other.
13773 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
13774 All instances of "struct bitset_struct *" replaced with "bitset".
13775 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
13776 (union bitset_union, struct abitset_struct, struct ebitset_struct,
13777 struct lbitset_struct, struct bitset_stats_struct): New types.
13778 All uses of struct bitset_struct changed to union bitset_union,
13779 etc.
13780 * lib/abitset.c (struct abitset_struct, abitset,
13781 struct bitset_struct): Remove.
13782 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
13783 struct bitset_struct): Remove.
13784 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
13785 bitset_struct): Remove.
13786 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
13787 Likewise.
13788
13789 Do not call a function of type T using a call that assumes the
13790 function is of a different type U. Standard C requires that a
13791 function must be called with a type that is compatible with its
13792 definition.
13793 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13794 New decls.
13795 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13796 New functions.
13797 * lib/ebitset.c (PFV): Remove.
13798 * lib/lbitset.c (PFV): Likewise.
13799 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
13800 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
13801 decls.
13802 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
13803 (ebitset_vtable): Use them.
13804 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
13805 lbitset_xor): New functions.
13806 (lbitset_vtable): Use them.
13807
13808 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
13809 Declare.
13810
13811 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
13812 GCC warning.
13813 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
13814 Use offsetof, for simplicity.
13815
13816 2002-10-06 Paul Eggert <eggert@twinsun.com>
13817
13818 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
13819 the same width as int. This reapplies a hunk of the 2002-08-12 patch
13820 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
13821 which was inadvertently undone by the 2002-09-30 patch.
13822 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
13823 the same width as int.
13824
13825 2002-10-04 Paul Eggert <eggert@twinsun.com>
13826
13827 Version 1.50.
13828
13829 * configure.ac (AC_INIT), NEWS: Increment version number.
13830
13831 * doc/bison.texinfo: Minor spelling, grammar, and white space
13832 fixes.
13833 (Symbols): Mention that any negative value returned from yylex
13834 signifies end-of-input. Warn about negative chars. Mention
13835 the portable Standard C character set.
13836
13837 The GNU coding standard says CFLAGS and YFLAGS are reserved
13838 for the installer to set.
13839 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
13840 * src/Makefile.am (AM_CFLAGS): Likewise.
13841 (AM_YFLAGS): Renamed from YFLAGS.
13842
13843 Fix some MAX and MIN problems.
13844 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
13845 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
13846 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
13847 * src/reader.c (reader): Use it.
13848
13849 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
13850 POSIX 1003.1-2001 has removed fgrep.
13851
13852 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
13853
13854 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
13855 interpreted as signed.
13856 * lib/ebitset.c (ebitset_list): Fix bug.
13857
13858 2002-10-01 Paul Eggert <eggert@twinsun.com>
13859
13860 More fixes for 64-bit hosts and large bitsets.
13861
13862 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
13863 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
13864 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
13865 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
13866 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
13867 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
13868 bitset_count_): Likewise.
13869 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
13870 bitset_first, bitset_last): Likewise.
13871 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
13872 bitset_stats_list_reverse, bitset_stats_size,
13873 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
13874 Likewise.
13875 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13876 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13877 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13878 bitsetv_reflexive_transitive_closure): Likewise.
13879 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
13880 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
13881 Likewise.
13882 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
13883 Likewise.
13884
13885 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
13886 Use size_t, not unsigned int, to count bytes.
13887 * lib/abitset.h (abitset_bytes): Likewise.
13888 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
13889 Likewise.
13890 * lib/bitset.h (bitset_bytes): Likewise.
13891 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
13892 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
13893 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13894 * lib/ebitset.c (ebitset_bytes): Likewise.
13895 * lib/ebitset.h (ebitset_bytes): Likewise.
13896 * lib/lbitset.c (lbitset_bytes): Likewise.
13897 * lib/lbitset.h (lbitset_bytes): Likewise.
13898
13899 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
13900 abitset_subset_p, abitset_disjoint_p, abitset_and,
13901 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
13902 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
13903 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
13904 abitset_or_and, abitset_or_and_cmp):
13905 Use bitset_windex instead of unsigned int.
13906 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13907 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
13908 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
13909 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
13910 Likewise.
13911 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
13912
13913 * lib/bitset.c (bitset_print):
13914 Use proper printf formats for widths of integer types.
13915 * lib/bitset_stats.c (bitset_percent_histogram_print,
13916 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
13917 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13918 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13919 * lib/lbitset.c (lbitset_bytes): Likewise.
13920
13921 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
13922 BITSET_SIZE_MAX): New macros.
13923 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
13924 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
13925 to BITSET_WINDEX_MAX.
13926
13927 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
13928 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
13929 since we now return the bitset_bindex type (not int).
13930
13931 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
13932 when computing sizes.
13933 * lib/ebitset.c (ebitset_elts_grow): Likewise.
13934
13935 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
13936 and avoid cast to unsigned.
13937
13938 2002-09-30 Akim Demaille <akim@epita.fr>
13939
13940 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13941 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
13942 Updates from Michael Hayes.
13943
13944 2002-09-30 Art Haas <ahaas@neosoft.com>
13945
13946 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
13947 invocations.
13948 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
13949 defined.
13950
13951 2002-09-27 Akim Demaille <akim@epita.fr>
13952
13953 Version 1.49c.
13954
13955 2002-09-27 Akim Demaille <akim@epita.fr>
13956
13957 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
13958 (Because of AC_LIBSOURCE).
13959
13960 2002-09-27 Akim Demaille <akim@epita.fr>
13961
13962 Playing with Autoscan.
13963
13964 * configure.ac: Remove the old LIBOBJ tweaks.
13965 (AC_REPLACE_FUNCS): Add strrchr and strtol.
13966 * lib/strrchr.c: New.
13967 * lib/strtol.c: New, from the Coreutils 4.5.1.
13968
13969 2002-09-27 Akim Demaille <akim@epita.fr>
13970
13971 Playing with Autoscan.
13972
13973 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
13974 * lib/Makefile.am (libbison_a_SOURCES): No longer include
13975 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
13976 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
13977 Coreutils 4.5.1.
13978
13979 2002-09-24 Akim Demaille <akim@epita.fr>
13980
13981 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
13982 (Frequently Asked Questions, Parser Stack Overflow): New.
13983
13984 2002-09-13 Akim Demaille <akim@epita.fr>
13985
13986 Playing with autoscan.
13987
13988 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
13989 * src/files.c (skeleton_find): Remove, unused.
13990 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
13991 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
13992
13993 2002-09-13 Akim Demaille <akim@epita.fr>
13994
13995 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
13996 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
13997
13998 2002-09-13 Akim Demaille <akim@epita.fr>
13999
14000 * configure.ac: Require 2.54.
14001 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
14002 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
14003 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
14004 Remove, provided by Autoconf macros.
14005
14006 2002-09-12 Akim Demaille <akim@epita.fr>
14007
14008 * m4/prereq.m4: Update, from Coreutils 4.5.1.
14009
14010 2002-09-12 Akim Demaille <akim@epita.fr>
14011
14012 * m4/prereq.m4: Update, from Fileutils 4.1.5.
14013 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
14014 Reported by Martin Mokrejs.
14015
14016 2002-09-10 Akim Demaille <akim@epita.fr>
14017
14018 * src/parse-gram.y: Associate a human readable string to each
14019 token type.
14020 * tests/regression.at (Invalid inputs): Adjust.
14021
14022 2002-09-10 Gary V. Vaughan <gary@gnu.org>
14023
14024 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
14025 with an Autoconf-2.5x style configure.ac.
14026
14027 2002-09-06 Paul Eggert <eggert@twinsun.com>
14028
14029 * doc/bison.texinfo (Conditions): Make explicit that the GPL
14030 exception applies only to yacc.c. This is a modification of a
14031 patch originally suggested by Akim Demaille.
14032
14033 2002-09-06 Akim Demaille <akim@epita.fr>
14034
14035 * data/c.m4 (b4_copyright): Move the GPL exception comment from
14036 here to...
14037 * data/yacc.c: here.
14038
14039 * data/lalr1.cc (struct yyltype): Don't define it, since we use
14040 LocationType.
14041 (b4_ltype): Default to yy::Location from location.hh.
14042
14043 2002-09-04 Jim Meyering <jim@meyering.net>
14044
14045 * data/yacc.c: Guard the declaration of yytoknum also with
14046 `#ifdef YYPRINT', so it is declared only when used.
14047
14048 2002-09-04 Akim Demaille <akim@epita.fr>
14049
14050 * configure.in: Rename as...
14051 * configure.ac: this.
14052 Bump to 1.49c.
14053
14054 2002-09-04 Akim Demaille <akim@epita.fr>
14055
14056 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
14057 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
14058 translate maintainer only messages.
14059
14060 2002-08-12 Paul Eggert <eggert@twinsun.com>
14061
14062 Version 1.49b.
14063
14064 * Makefile.am (SUBDIRS): Remove intl.
14065 (DISTCLEANFILES): Remove.
14066 * NEWS: Mention that GNU M4 is now required. Clarify what is
14067 meant by "larger grammars". Mention the pt_BR translation.
14068 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
14069 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
14070 Bump version from 0.11.2 to 0.11.5.
14071 (BISON_PREREQ_STAGE): Remove.
14072 (AM_GNU_GETTEXT): Use external gettext.
14073 (AC_OUTPUT): Remove intl/Makefile.
14074
14075 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
14076
14077 * data/glr.c: Include string.h, for strlen.
14078 (yyreportParseError): Use size_t for yysize.
14079 (yy_yypstack): No longer nested inside yypstates, as nested
14080 functions are not portable. Do not assume size_t is the
14081 same width as int.
14082 (yypstates): Do not assume that ptrdiff_t is the same width
14083 as int, and similarly for yyposn and YYINDEX.
14084
14085 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
14086
14087 * lib/Makefile.am (INCLUDES): Do not include from the intl
14088 directory, which has been removed.
14089 * src/Makefile.am (INCLUDES): Likewise.
14090
14091 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
14092 (bitsets_sources, additional_bitsets_sources, timevars_sources):
14093 New vars.
14094
14095 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
14096 * tests/Makefile.am (EXTRA_DIST): Likewise.
14097
14098 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
14099 Do not assume that bitset_windex is the same width as unsigned.
14100
14101 * lib/abitset.c (abitset_unused_clear): Do not assume that
14102 bitset_word is the same width as int.
14103 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
14104 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
14105 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
14106 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
14107 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
14108
14109 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
14110 portability to one's complement hosts!).
14111 * lib/ebitset.c (ebitset_op1): Likewise.
14112 * lib/lbitset.c (lbitset_op1): Likewise.
14113
14114 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
14115 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14116 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
14117 Sync with fileutils.
14118 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
14119 lib/gettext.h: Sync with diffutils.
14120
14121 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
14122 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
14123
14124 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
14125 PROTOTYPES to check for prototypes, and "defined __STDC__" to
14126 check for void *.
14127
14128 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
14129 size_t; the old version tried to do this but casted improperly.
14130 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
14131 (bitset_test): Now returns int, not unsigned long.
14132
14133 * lib/bitset_stats.c: Include "gettext.h".
14134 (_): New macro.
14135 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
14136 name locals "index", as it generates unnecessary warnings on some
14137 hosts that have an "index" function.
14138
14139 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
14140 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
14141 they need translation.
14142 * src/LR0.c (state_list_append, new_itemsets, get_state,
14143 append_states, generate_states): Likewise.
14144 * src/assoc.c (assoc_to_string): Likewise.
14145 * src/closure.c (print_closure, set_firsts, closure): Likewise.
14146 * src/gram.c (grammar_dump): Likewise.
14147 * src/injections.c (injections_compute): Likewise.
14148 * src/lalr.c (lookaheads_print): Likewise.
14149 * src/relation.c (relation_transpose): Likewise.
14150 * src/scan-gram.l: Likewise.
14151 * src/tables.c (table_grow, pack_vector): Likewise.
14152
14153 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
14154 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
14155 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
14156 * m4/mbstate_t.m4: Sync with fileutils.
14157 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
14158
14159 * po/LINGUAS: Add pt_BR.
14160 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
14161 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
14162 lib/timevar.c.
14163 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
14164 manual recommends.
14165 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
14166
14167 * src/complain.c (strerror_r): Remove decl; not needed.
14168 (strerror): Use same pattern as ../lib/error.c.
14169
14170 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
14171
14172 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
14173
14174 * src/main.c (main): Cast result of bindtextdomain and textdomain
14175 to void, to avoid a GCC warning when --disable-nls is in effect.
14176
14177 * src/scan-gram.l: Use strings rather than escapes when possible,
14178 to minimize the number of warnings from xgettext.
14179 (handle_action_dollar, handle_action_at): Don't use isdigit,
14180 as it mishandles negative chars and it may not work as expected
14181 outside the C locale.
14182
14183 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
14184 this is a GCC extension and is not portable to other compilers.
14185
14186 * src/system.h (alloca): Use same pattern as ../lib/error.c.
14187 Do not include <ctype.h>; no longer needed.
14188 Do not include <malloc.h>; no longer needed (and generates
14189 warnings on OpenBSD 3.0).
14190
14191 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
14192 it's not portable.
14193
14194 * tests/regression.at: Do not use 'cc -c input.c -o input';
14195 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
14196
14197 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
14198 exit status as failure, not just exit status 1. Sun C exits
14199 with status 2 sometimes.
14200
14201 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
14202 Use it for the two large tests.
14203
14204 2002-08-02 Akim Demaille <akim@epita.fr>
14205
14206 * src/conflicts.c (conflicts_output): Don't output rules never
14207 reduced here, since anyway that computation doesn't work.
14208 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
14209 (rule_useless_p, rule_never_reduced_p): New.
14210 (grammar_rules_partial_print): Use a filter instead of a range.
14211 Display the title only if needed.
14212 (grammar_rules_print): Adjust.
14213 (grammar_rules_never_reduced_report): New.
14214 * src/tables.c (action_row): Move the computation of rules never
14215 reduced to...
14216 (token_actions): here.
14217 * src/main.c (main): Make the parser before making the report, so
14218 that rules never reduced are computed.
14219 Call grammar_rules_never_reduced_report.
14220 * src/print.c (print_results): Report rules never reduced.
14221 * tests/conflicts.at, tests/reduce.at: Adjust.
14222
14223 2002-08-01 Akim Demaille <akim@epita.fr>
14224
14225 Instead of attaching lookaheads and duplicating the rules being
14226 reduced by a state, attach the lookaheads to the reductions.
14227
14228 * src/state.h (state_t): Remove the `lookaheads',
14229 `lookaheads_rule' member.
14230 (reductions_t): Add a `lookaheads' member.
14231 Use a regular array for the `rules'.
14232 * src/state.c (reductions_new): Initialize the lookaheads member
14233 to 0.
14234 (state_rule_lookaheads_print): Adjust.
14235 * src/state.h, src/state.c (state_reductions_find): New.
14236 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
14237 (count_rr_conflicts): Adjust.
14238 * src/lalr.c (LArule): Remove.
14239 (add_lookback_edge): Adjust.
14240 (state_lookaheads_count): New.
14241 (states_lookaheads_initialize): Merge into...
14242 (initialize_LA): this.
14243 (lalr_free): Adjust.
14244 * src/main.c (main): Don't free nullable and derives too early: it
14245 is used by --verbose.
14246 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
14247
14248 2002-08-01 Akim Demaille <akim@epita.fr>
14249
14250 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
14251 `rule_number_t**'.
14252 (set_derives, free_derives): Rename as...
14253 (derives_compute, derives_free): this.
14254 Adjust all dependencies.
14255 * src/nullable.c (set_nullable, free_nullable): Rename as...
14256 (nullable_compute, nullable_free): these.
14257 (rule_list_t): Store rule_t *, not rule_number_t.
14258 * src/state.c (state_rule_lookaheads_print): Directly compare rule
14259 pointers, instead of their numbers.
14260 * src/main.c (main): Call nullable_free, and derives_free earlier,
14261 as they were lo longer used.
14262
14263 2002-08-01 Akim Demaille <akim@epita.fr>
14264
14265 * lib/timevar.c (get_time): Include children time.
14266 * src/lalr.h (LA, LArule): Don't export them: used with the
14267 state_t.
14268 * src/lalr.c (LA, LArule): Static.
14269 * src/lalr.h, src/lalr.c (lalr_free): New.
14270 * src/main.c (main): Call it.
14271 * src/tables.c (pack_vector): Check whether loc is >= to the
14272 table_size, not >.
14273 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
14274 (tables_generate): do it, since that's also it which allocates
14275 them.
14276 Don't free LA and LArule, main does.
14277
14278 2002-07-31 Akim Demaille <akim@epita.fr>
14279
14280 Separate parser tables computation and output.
14281
14282 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
14283 (conflict_list, conflict_list_cnt, table, check, table_ninf)
14284 (yydefgoto, yydefact, high): Move to...
14285 * src/tables.h, src/tables.c: here.
14286 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14287 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14288 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
14289 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
14290 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
14291 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
14292 (action_row, save_row, token_actions, save_column, default_goto)
14293 (goto_actions, sort_actions, matching_state, pack_vector)
14294 (table_ninf_remap, pack_table, prepare_actions): Move to...
14295 * src/tables.c: here.
14296 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
14297 * src/output.c (token_actions, output_base, output_conflicts)
14298 (output_check): Merge into...
14299 (prepare_actions): this.
14300 (actions_output): Rename as...
14301 (user_actions_output): this.
14302 * src/main.c (main): Call tables_generate and tables_free.
14303
14304 2002-07-31 Akim Demaille <akim@epita.fr>
14305
14306 Steal GCC's --time-report support.
14307
14308 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
14309 stolen/adjusted from GCC.
14310 * m4/stage.m4: Remove time related checks.
14311 * m4/timevar.m4: New.
14312 * configure.in: Adjust.
14313 * src/system.h: Adjust to using timevar.h.
14314 * src/getargs.h, src/getargs.c: Support trace_time for
14315 --trace=time.
14316 * src/main.c (stage): Remove.
14317 (main): Replace `stage' invocations with timevar calls.
14318 * src/output.c: Insert pertinent timevar calls.
14319
14320 2002-07-31 Akim Demaille <akim@epita.fr>
14321
14322 Let --trace have arguments.
14323
14324 * src/getargs.h (enum trace_e): New.
14325 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
14326 (long_options, short_options): --trace/-T takes an optional
14327 argument.
14328 Change all the uses of trace_flag to reflect the new flags.
14329 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
14330
14331 Strengthen `stage' portability.
14332
14333 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
14334 * configure.in: Use it.
14335 Don't check for malloc.h and sys/times.h.
14336 * src/system.h: Include them when appropriate.
14337 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
14338 times and struct tms are available.
14339
14340 2002-07-30 Akim Demaille <akim@epita.fr>
14341
14342 In verbose parse error message, don't report `error' as an
14343 expected token.
14344 * tests/actions.at (Printers and Destructors): Adjust.
14345 * tests/calc.at (Calculator $1): Adjust.
14346 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
14347 error message, do not report the parser accepts the error token in
14348 that state.
14349
14350 2002-07-30 Akim Demaille <akim@epita.fr>
14351
14352 Normalize conflict related messages.
14353
14354 * src/complain.h, src/complain.c (warn, complain): New.
14355 * src/conflicts.c (conflicts_print): Use them.
14356 (conflict_report_yacc): New, extracted from...
14357 (conflicts_print): here.
14358 * tests/conflicts.at, tests/existing.at: Adjust.
14359
14360 2002-07-30 Akim Demaille <akim@epita.fr>
14361
14362 Report rules which are never reduced by the parser: those hidden
14363 by conflicts.
14364
14365 * src/LR0.c (save_reductions): Don't make the final state too
14366 different: save its reduction (accept) instead of having a state
14367 without any action (no shift or goto, no reduce).
14368 Note: the final state is now a ``regular'' state, i.e., the
14369 parsers now contain `reduce 0' as default reduction.
14370 Nevertheless, since they decide to `accept' when yystate =
14371 final_state, they still will not reduce rule 0.
14372 * src/print.c (print_actions, print_reduction): Adjust.
14373 * src/output.c (action_row): Track reduced rules.
14374 (token_actions): Report rules never reduced.
14375 * tests/conflicts.at, tests/regression.at: Adjust.
14376
14377 2002-07-30 Akim Demaille <akim@epita.fr>
14378
14379 `stage' was accidently included in a previous patch.
14380 Initiate its autoconfiscation.
14381
14382 * configure.in: Look for malloc.h and sys/times.h.
14383 * src/main.c (stage): Adjust.
14384 Report only when trace_flag.
14385
14386 2002-07-29 Akim Demaille <akim@epita.fr>
14387
14388 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
14389 state_number_t.
14390 (errs_t): symbol_t*, not symbol_number_t.
14391 (reductions_t): rule_t*, not rule_number_t.
14392 (FOR_EACH_SHIFT): New.
14393 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
14394 * src/print.c, src/print_graph.c: Adjust.
14395
14396 2002-07-29 Akim Demaille <akim@epita.fr>
14397
14398 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
14399
14400 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
14401 (endtoken, accept): these.
14402 * src/reader.c (reader): Set endtoken's default tag to "$end".
14403 Set undeftoken's tag to "$undefined" instead of "$undefined.".
14404 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
14405 Adjust.
14406
14407 2002-07-29 Akim Demaille <akim@epita.fr>
14408
14409 * src/reduce.c (reduce_grammar): When the language is empty,
14410 complain about the start symbol, not the axiom.
14411 Use its location.
14412 * tests/reduce.at (Empty Language): New.
14413
14414 2002-07-26 Akim Demaille <akim@epita.fr>
14415
14416 * src/reader.h, src/reader.c (gram_error): ... can't get
14417 yycontrol without making too strong assumptions on the parser
14418 itself.
14419 * src/output.c (prepare_tokens): Use the real 0th value of
14420 token_translations instead of `0'.
14421 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
14422 visible here.
14423 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
14424 for the time being: %locations ought to provide it to yyerror.
14425
14426 2002-07-25 Akim Demaille <akim@epita.fr>
14427
14428 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
14429 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
14430 * tests/regression.at (Web2c Actions): Adjust.
14431
14432 2002-07-25 Akim Demaille <akim@epita.fr>
14433
14434 Stop storing rules from 1 to nrules + 1.
14435
14436 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
14437 * src/nullable.c, src/output.c, src/print.c, src/reader.c
14438 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
14439 Iterate from 0 to nrules.
14440 Use rule_number_as_item_number and item_number_as_rule_number.
14441 Adjust to `derive' now containing possibly 0.
14442 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
14443 Handle the `- 1' part in rule numbers from/to item numbers.
14444 * src/conflicts.c (log_resolution): Fix the message which reversed
14445 shift and reduce.
14446 * src/output.c (action_row): Initialize default_rule to -1.
14447 (token_actions): Adjust.
14448 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
14449 expected output.
14450 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
14451
14452 2002-07-25 Akim Demaille <akim@epita.fr>
14453
14454 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
14455 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
14456 (b4_c_knr_arg_decl): New.
14457 * data/yacc.c: Use it to define yysymprint, yydestruct, and
14458 yyreport_parse_error.
14459
14460 2002-07-25 Akim Demaille <akim@epita.fr>
14461
14462 * data/yacc.c (yyreport_parse_error): New, extracted from...
14463 (yyparse): here.
14464 (yydestruct, yysymprint): Move above yyparse.
14465 Be K&R compliant.
14466
14467 2002-07-25 Akim Demaille <akim@epita.fr>
14468
14469 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
14470 replace...
14471 (b4_sint_type, b4_uint_type): these.
14472 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
14473 * tests/regression.at (Web2c Actions): Adjust.
14474
14475 2002-07-25 Akim Demaille <akim@epita.fr>
14476
14477 * src/gram.h (TIEM_NUMBER_MAX): New.
14478 (item_number_of_rule_number, rule_number_of_item_number): Rename
14479 as...
14480 (rule_number_as_item_number, item_number_as_rule_number): these.
14481 Adjust dependencies.
14482 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14483 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14484 (symbol_number_to_vector_number): New.
14485 (order): Of vector_number_t* type.
14486 (base_t, BASE_MAX, BASE_MIN): New.
14487 (froms, tos, width, pos, check): Of base_t type.
14488 (action_number_t, ACTION_MIN, ACTION_MAX): New.
14489 (actrow): Of action_number_t type.
14490 (conflrow): Of unsigned int type.
14491 (table_ninf, base_ninf): New.
14492 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
14493 (muscle_insert_int_table, muscle_insert_base_table)
14494 (muscle_insert_rule_number_table): New.
14495 (prepare_tokens): Output `toknum' as int_table.
14496 (action_row): Returns a rule_number_t.
14497 Use ACTION_MIN, not SHRT_MIN.
14498 (token_actions): yydefact is rule_number_t*.
14499 (table_ninf_remap): New.
14500 (pack_table): Use it for `base' and `table'.
14501 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
14502 replaced with...
14503 (YYPACT_NINF, YYTABLE_NINF): these.
14504 (yypact, yytable): Compute their types instead of hard-coded
14505 `short'.
14506 * tests/regression.at (Web2c Actions): Adjust.
14507
14508 2002-07-19 Akim Demaille <akim@epita.fr>
14509
14510 * src/scan-gram.l (id): Can start with an underscore.
14511
14512 2002-07-16 Akim Demaille <akim@epita.fr>
14513
14514 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
14515 Adjust all former `associativity' dependencies.
14516 * src/symtab.c (symbol_new): Default associativity is `undef', not
14517 `right'.
14518 (symbol_check_alias_consistence): Adjust.
14519
14520 2002-07-09 Akim Demaille <akim@epita.fr>
14521
14522 * doc/bison.texinfo: Properly set the ``header'' part.
14523 Use @dircategory ``GNU programming tools'' as per Texinfo's
14524 documentation.
14525 Use @copying.
14526
14527 2002-07-09 Akim Demaille <akim@epita.fr>
14528
14529 * lib/quotearg.h: Protect against multiple inclusions.
14530 * src/location.h (location_t): Add a `file' member.
14531 (LOCATION_RESET, LOCATION_PRINT): Adjust.
14532 * src/complain.c (warn_at, complain_at, fatal_at): Drop
14533 `error_one_per_line' support.
14534
14535 2002-07-09 Akim Demaille <akim@epita.fr>
14536
14537 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
14538 * src/reader.c (lineno): Remove.
14539 Adjust all dependencies.
14540 (get_merge_function): Take a location and use complain_at.
14541 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
14542 * tests/regression.at (Invalid inputs, Mixing %token styles):
14543 Adjust.
14544
14545 2002-07-09 Akim Demaille <akim@epita.fr>
14546
14547 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
14548 recovery rule, and forbid extensions when --yacc.
14549 (gram_error): Use complain_at.
14550 * src/reader.c (reader): Exit if there were parse errors.
14551
14552 2002-07-09 Akim Demaille <akim@epita.fr>
14553
14554 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
14555 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
14556 Reported by R Blake <blakers@mac.com>.
14557
14558 2002-07-09 Akim Demaille <akim@epita.fr>
14559
14560 * data/yacc.c: Output the copyright notive in the header.
14561
14562 2002-07-03 Akim Demaille <akim@epita.fr>
14563
14564 * src/output.c (froms, tos): Are state_number_t.
14565 (save_column): sp, sp1, and sp2 are state_number_t.
14566 (prepare): Rename `final' as `final_state_number', `nnts' as
14567 `nterms_number', `nrules' as `rules_number', `nstates' as
14568 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
14569 unused.
14570 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
14571 * data/lalr1.cc (nsym_): Remove, unused.
14572
14573 2002-07-03 Akim Demaille <akim@epita.fr>
14574
14575 * src/lalr.h, src/lalr.c (goto_number_t): New.
14576 * src/lalr.c (goto_list_t): New.
14577 Propagate them.
14578 * src/nullable.c (rule_list_t): New.
14579 Propagate.
14580 * src/types.h: Remove.
14581
14582 2002-07-03 Akim Demaille <akim@epita.fr>
14583
14584 * src/closure.c (print_fderives): Use rule_rhs_print.
14585 * src/derives.c (print_derives): Use rule_rhs_print.
14586 (rule_list_t): New, replaces `shorts'.
14587 (set_derives): Add comments.
14588 * tests/sets.at (Nullable, Firsts): Adjust.
14589
14590 2002-07-03 Akim Demaille <akim@epita.fr>
14591
14592 * src/output.c (prepare_actions): Free `tally' and `width'.
14593 (prepare_actions): Allocate and free `order'.
14594 * src/symtab.c (symbols_free): Free `symbols'.
14595 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
14596 * src/output.c (m4_invoke): Move to...
14597 * src/scan-skel.l: here.
14598 (<<EOF>>): Close yyout, and free its name.
14599
14600 2002-07-03 Akim Demaille <akim@epita.fr>
14601
14602 Fix some memory leaks, and fix a bug: state 0 was examined twice.
14603
14604 * src/LR0.c (new_state): Merge into...
14605 (state_list_append): this.
14606 (new_states): Merge into...
14607 (generate_states): here.
14608 (set_states): Don't ensure a proper `errs' state member here, do it...
14609 * src/conflicts.c (conflicts_solve): here.
14610 * src/state.h, src/state.c: Comment changes.
14611 (state_t): Rename member `shifts' as `transitions'.
14612 Adjust all dependencies.
14613 (errs_new): For consistency, also take the values as argument.
14614 (errs_dup): Remove.
14615 (state_errs_set): New.
14616 (state_reductions_set, state_transitions_set): Assert that no
14617 previous value was assigned.
14618 (state_free): New.
14619 (states_free): Use it.
14620 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
14621 temporary storage: use `errs' and `nerrs' as elsewhere.
14622 (set_conflicts): Allocate and free this `errs'.
14623
14624 2002-07-02 Akim Demaille <akim@epita.fr>
14625
14626 * lib/libiberty.h: New.
14627 * lib: Update the bitset implementation from upstream.
14628 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
14629 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
14630 * src/main.c: Adjust bitset stats calls.
14631
14632 2002-07-01 Paul Eggert <eggert@twinsun.com>
14633
14634 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
14635 char, so that negative chars don't collide with $.
14636
14637 2002-06-30 Akim Demaille <akim@epita.fr>
14638
14639 Have the GLR tests be `warning' checked, and fix the warnings.
14640
14641 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
14642 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
14643 (yyremoveDeletes): `yyi' and `yyj' are size_t.
14644 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
14645 (yyaddDeferredAction): static.
14646 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
14647 (yyreportParseError): yyprefix is const.
14648 yytokenp is used only when verbose.
14649 (yy__GNUC__): Replace with __GNUC__.
14650 (yypdumpstack): yyi is size_t.
14651 (yypreference): Un-yy local variables and arguments, to avoid
14652 clashes with `yyr1'. Anyway, we are not in the user name space.
14653 (yytname_size): be an int, as is compared with ints.
14654 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
14655 Use them.
14656 * tests/cxx-gram.at: Use quotation to protect $1.
14657 Use AT_COMPILE to enable warnings hunts.
14658 Prototype yylex and yyerror.
14659 `Use' argc.
14660 Include `string.h', not `strings.h'.
14661 Produce and prototype stmtMerge only when used.
14662 yylex takes a location.
14663
14664 2002-06-30 Akim Demaille <akim@epita.fr>
14665
14666 We spend a lot of time in quotearg, in particular when --verbose.
14667
14668 * src/symtab.c (symbol_get): Store a quoted version of the key.
14669 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
14670 Adjust all callers.
14671
14672 2002-06-30 Akim Demaille <akim@epita.fr>
14673
14674 * src/state.h (reductions_t): Rename member `nreds' as num.
14675 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
14676 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
14677
14678 2002-06-30 Akim Demaille <akim@epita.fr>
14679
14680 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
14681 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
14682 (shifts_to): Rename as...
14683 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
14684 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
14685 (TRANSITION_IS_DISABLED, transitions_to): these.
14686
14687 2002-06-30 Akim Demaille <akim@epita.fr>
14688
14689 * src/print.c (print_shifts, print_gotos): Merge into...
14690 (print_transitions): this.
14691 (print_transitions, print_errs, print_reductions): Align the
14692 lookaheads columns.
14693 (print_core, print_transitions, print_errs, print_state,
14694 print_grammar): Output empty lines separator before, not after.
14695 (state_default_rule_compute): Rename as...
14696 (state_default_rule): this.
14697 * tests/conflicts.at (Defaulted Conflicted Reduction),
14698 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
14699 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
14700
14701 2002-06-30 Akim Demaille <akim@epita.fr>
14702
14703 Display items as we display rules.
14704
14705 * src/gram.h, src/gram.c (rule_lhs_print): New.
14706 * src/gram.c (grammar_rules_partial_print): Use it.
14707 * src/print.c (print_core): Likewise.
14708 * tests/conflicts.at (Defaulted Conflicted Reduction),
14709 (Unresolved SR Conflicts): Adjust.
14710 (Unresolved SR Conflicts): Adjust and rename as...
14711 (Resolved SR Conflicts): this, as was meant.
14712 * tests/regression.at (Web2c Report): Adjust.
14713
14714 2002-06-30 Akim Demaille <akim@epita.fr>
14715
14716 * src/print.c (state_default_rule_compute): New, extracted from...
14717 (print_reductions): here.
14718 Pessimize, but clarify the code.
14719 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
14720
14721 2002-06-30 Akim Demaille <akim@epita.fr>
14722
14723 * src/output.c (action_row): Let default_rule be always a rule
14724 number.
14725
14726 2002-06-30 Akim Demaille <akim@epita.fr>
14727
14728 * src/closure.c (print_firsts, print_fderives, closure):
14729 Use BITSET_EXECUTE.
14730 * src/lalr.c (lookaheads_print): Likewise.
14731 * src/state.c (state_rule_lookaheads_print): Likewise.
14732 * src/print_graph.c (print_core): Likewise.
14733 * src/print.c (print_reductions): Likewise.
14734 * src/output.c (action_row): Likewise.
14735 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
14736
14737 2002-06-30 Akim Demaille <akim@epita.fr>
14738
14739 * src/print_graph.c: Use report_flag.
14740
14741 2002-06-30 Akim Demaille <akim@epita.fr>
14742
14743 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
14744 to...
14745 * src/relation.h, src/relation.c (traverse, relation_digraph)
14746 (relation_print, relation_transpose): New.
14747
14748 2002-06-30 Akim Demaille <akim@epita.fr>
14749
14750 * src/state.h, src/state.c (shifts_to): New.
14751 * src/lalr.c (build_relations): Use it.
14752
14753 2002-06-30 Akim Demaille <akim@epita.fr>
14754
14755 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
14756 (item_number_of_rule_number, rule_number_of_item_number): New.
14757 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
14758 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14759 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
14760 Propagate their use.
14761 Much remains to be done, in particular wrt `shorts' from types.h.
14762
14763 2002-06-30 Akim Demaille <akim@epita.fr>
14764
14765 * src/symtab.c (symbol_new): Initialize the `printer' member.
14766
14767 2002-06-30 Akim Demaille <akim@epita.fr>
14768
14769 * src/LR0.c (save_reductions): Remove, replaced by...
14770 * src/state.h, src/state.c (state_reductions_set): New.
14771 (reductions, errs): Rename as...
14772 (reductions_t, errs_t): these.
14773 Adjust all dependencies.
14774
14775 2002-06-30 Akim Demaille <akim@epita.fr>
14776
14777 * src/LR0.c (state_list_t, state_list_append): New.
14778 (first_state, last_state): Now symbol_list_t.
14779 (this_state): Remove.
14780 (new_itemsets, append_states, save_reductions): Take a state_t as
14781 argument.
14782 (set_states, generate_states): Adjust.
14783 (save_shifts): Remove, replaced by...
14784 * src/state.h, src/state.c (state_shifts_set): New.
14785 (shifts): Rename as...
14786 (shifts_t): this.
14787 Adjust all dependencies.
14788 * src/state.h (state_t): Remove the `next' member.
14789
14790 2002-06-30 Akim Demaille <akim@epita.fr>
14791
14792 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
14793 escaped in slot 0.
14794
14795 2002-06-30 Akim Demaille <akim@epita.fr>
14796
14797 Use hash.h for the state hash table.
14798
14799 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
14800 (allocate_storage): Use state_hash_new.
14801 (free_storage): Use state_hash_free.
14802 (new_state, get_state): Adjust.
14803 * src/lalr.h, src/lalr.c (states): Move to...
14804 * src/states.h (state_t): Remove the `link' member, no longer
14805 used.
14806 * src/states.h, src/states.c: here.
14807 (state_hash_new, state_hash_free, state_hash_lookup)
14808 (state_hash_insert, states_free): New.
14809 * src/states.c (state_table, state_compare, state_hash): New.
14810 * src/output.c (output_actions): Do not free states now, since we
14811 still need to know the final_state number in `prepare', called
14812 afterwards. Do it...
14813 * src/main.c (main): here: call states_free after `output'.
14814
14815 2002-06-30 Akim Demaille <akim@epita.fr>
14816
14817 * src/state.h, src/state.c (state_new): New, extracted from...
14818 * src/LR0.c (new_state): here.
14819 * src/state.h (STATE_ALLOC): Move to...
14820 * src/state.c: here.
14821 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
14822 * src/state.h, src/state.c: here.
14823
14824 2002-06-30 Akim Demaille <akim@epita.fr>
14825
14826 * src/reader.c (gensym): Rename as...
14827 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
14828 (getsym): Rename as...
14829 (symbol_get): this.
14830
14831 2002-06-30 Akim Demaille <akim@epita.fr>
14832
14833 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
14834 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
14835 * src/output.c, src/print.c, src/print_graph.c: Propagate.
14836 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
14837
14838 2002-06-30 Akim Demaille <akim@epita.fr>
14839
14840 Make the test suite pass with warnings checked.
14841
14842 * tests/actions.at (Printers and Destructors): Improve.
14843 Avoid unsigned vs. signed issues.
14844 * tests/calc.at: Don't exercise the scanner here, do it...
14845 * tests/input.at (Torturing the Scanner): here.
14846
14847 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14848
14849 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
14850 reorganize first lines parallel to yacc.c.
14851
14852 2002-06-28 Akim Demaille <akim@epita.fr>
14853
14854 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
14855 (b4_token_enum, b4_token_defines): New, factored from...
14856 * data/lalr1.cc, data/yacc.c, glr.c: here.
14857
14858 2002-06-28 Akim Demaille <akim@epita.fr>
14859
14860 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
14861 unused variables.
14862 * src/output.c (merger_output): static.
14863
14864 2002-06-28 Akim Demaille <akim@epita.fr>
14865
14866 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
14867 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
14868 pacify GCC.
14869 * src/output.c (save_row): Initialize all the variables to pacify GCC.
14870
14871 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14872
14873 Accumulated changelog for new GLR parsing features.
14874
14875 * src/conflicts.c (count_total_conflicts): Change name to
14876 conflicts_total_count.
14877 * src/conflicts.h: Ditto.
14878 * src/output.c (token_actions): Use the new name.
14879 (output_conflicts): Change conflp => conflict_list_heads, and
14880 confl => conflict_list for better readability.
14881 * data/glr.c: Use the new names.
14882 * NEWS: Add self to GLR announcement.
14883
14884 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
14885
14886 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
14887 Akim Demaille.
14888
14889 * data/bison.glr: Change name to glr.c
14890 * data/glr.c: Renamed from bison.glr.
14891 * data/Makefile.am: Add glr.c
14892
14893 * src/getargs.c:
14894
14895 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
14896 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
14897
14898 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14899
14900 * data/bison.glr: Be sure to restore the
14901 current #line when returning to the skeleton contents after having
14902 exposed the input file's #line.
14903
14904 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14905
14906 * data/bison.glr: Bring up to date with changes to bison.simple.
14907
14908 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14909
14910 * data/bison.glr: Correct definitions that use b4_prefix.
14911 Various reformatting.
14912 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
14913 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
14914 yytokenp argument; now part of stack.
14915 (yychar): Define to behave as documented.
14916 (yyclearin): Ditto.
14917
14918 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14919
14920 * src/reader.h: Add declaration for free_merger_functions.
14921
14922 * src/reader.c (merge_functions): New variable.
14923 (get_merge_function): New function.
14924 (free_merger_functions): New function.
14925 (readgram): Check for %prec that is not followed by a symbol.
14926 Handle %dprec and %merge declarations.
14927 (packgram): Initialize dprec and merger fields in rules array.
14928
14929 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
14930 conflict_list_cnt, conflict_list_free): New variables.
14931 (table_grow): Also grow conflict_table.
14932 (prepare_rules): Output dprec and merger tables.
14933 (conflict_row): New function.
14934 (action_row): Output conflict lists for GLR parser. Don't use
14935 default reduction in conflicted states for GLR parser so that there
14936 are spaces for the conflict lists.
14937 (save_row): Also save conflict information.
14938 (token_actions): Allocate conflict list.
14939 (merger_output): New function.
14940 (pack_vector): Pack conflict table, too.
14941 (output_conflicts): New function to output yyconflp and yyconfl.
14942 (output_check): Allocate conflict_tos.
14943 (output_actions): Output conflict tables, also.
14944 (output_skeleton): Output b4_mergers definition.
14945 (prepare): Output b4_max_rhs_length definition.
14946 Use 'bison.glr' as default skeleton for GLR parsers.
14947
14948 * src/gram.c (glr_parser): New flag.
14949 (grammar_free): Call free_merger_functions.
14950
14951 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
14952 all pairs of conflicting reductions, rather than just all tokens
14953 causing conflicts. Needed to size conflict tables.
14954 (conflicts_output): Modify call to count_rr_conflicts for new
14955 interface.
14956 (conflicts_print): Ditto.
14957 (count_total_conflicts): New function.
14958
14959 * src/reader.h (merger_list): New type.
14960 (merge_functions): New variable.
14961
14962 * src/lex.h (tok_dprec, tok_merge): New token types.
14963
14964 * src/gram.h (rule_s): Add dprec and merger fields.
14965 (glr_parser): New flag.
14966
14967 * src/conflicts.h (count_total_conflicts): New function.
14968
14969 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
14970
14971 * doc/bison.texinfo (Generalized LR Parsing): New section.
14972 (GLR Parsers): New section.
14973 (Language and Grammar): Mention GLR parsing.
14974 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
14975 Correct typo ("tge" -> "the").
14976
14977 * data/bison.glr: New skeleton for GLR parsing.
14978
14979 * tests/cxx-gram.at: New tests for GLR parsing.
14980
14981 * tests/testsuite.at: Include cxx-gram.at.
14982
14983 * tests/Makefile.am: Add cxx-gram.at.
14984
14985 * src/parse-gram.y:
14986
14987 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
14988
14989 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
14990
14991 2002-06-27 Akim Demaille <akim@epita.fr>
14992
14993 * src/options.h, src/options.c: Remove.
14994 * src/getargs.c (short_options, long_options): New.
14995
14996 2002-06-27 Akim Demaille <akim@epita.fr>
14997
14998 * data/bison.simple, data/bison.c++: Rename as...
14999 * data/yacc.c, data/lalr1.cc: these.
15000 * doc/bison.texinfo (Environment Variables): Remove.
15001
15002 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
15003
15004 * src/getargs.c (report_argmatch): Initialize strtok().
15005
15006 2002-06-20 Akim Demaille <akim@epita.fr>
15007
15008 * data/bison.simple (b4_symbol_actions): New, replaces...
15009 (b4_symbol_destructor, b4_symbol_printer): these.
15010 (yysymprint): Be sure to call YYPRINT only for tokens, and using
15011 user token numbers.
15012
15013 2002-06-20 Akim Demaille <akim@epita.fr>
15014
15015 * data/bison.simple (yydestructor): Rename as...
15016 (yydestruct): this.
15017
15018 2002-06-20 Akim Demaille <akim@epita.fr>
15019
15020 * src/symtab.h, src/symtab.c (symbol_type_set)
15021 (symbol_destructor_set, symbol_precedence_set): The location is
15022 the last argument.
15023 Adjust all callers.
15024
15025 2002-06-20 Akim Demaille <akim@epita.fr>
15026
15027 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
15028 internals.
15029 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
15030 Takes a location.
15031 * src/symtab.h, src/symtab.c (symbol_class_set)
15032 (symbol_user_token_number_set): Likewise.
15033 Adjust all callers.
15034 Promote complain_at.
15035 * tests/input.at (Type Clashes): Adjust.
15036
15037 2002-06-20 Akim Demaille <akim@epita.fr>
15038
15039 * data/bison.simple (YYLEX): Fix the declaration when
15040 %pure-parser.
15041
15042 2002-06-20 Akim Demaille <akim@epita.fr>
15043
15044 * data/bison.simple (yysymprint): Don't print the token number,
15045 just its name.
15046 * tests/actions.at (Destructors): Rename as...
15047 (Printers and Destructors): this.
15048 Also exercise %printer.
15049
15050 2002-06-20 Akim Demaille <akim@epita.fr>
15051
15052 * data/bison.simple (YYDSYMPRINT): New.
15053 Use it to remove many of the #if YYDEBUG/if (yydebug).
15054
15055 2002-06-20 Akim Demaille <akim@epita.fr>
15056
15057 * src/symtab.h, src/symtab.c (symbol_t): printer and
15058 printer_location are new members.
15059 (symbol_printer_set): New.
15060 * src/parse-gram.y (PERCENT_PRINTER): New token.
15061 Handle its associated rule.
15062 * src/scan-gram.l: Adjust.
15063 (handle_destructor_at, handle_destructor_dollar): Rename as...
15064 (handle_symbol_code_at, handle_symbol_code_dollar): these.
15065 * src/output.c (symbol_printers_output): New.
15066 (output_skeleton): Call it.
15067 * data/bison.simple (yysymprint): New. Cannot be named yyprint
15068 since there are already many grammar files with a user `yyprint'.
15069 Replace the calls to YYPRINT to calls to yysymprint.
15070 * tests/calc.at: Adjust.
15071 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
15072 taking advantage of parser very internal details (stack size!).
15073
15074 2002-06-20 Akim Demaille <akim@epita.fr>
15075
15076 * src/scan-gram.l: Complete the scanner with the missing patterns
15077 to pacify Flex.
15078 Use `quote' and `symbol_tag_get' where appropriate.
15079
15080 2002-06-19 Akim Demaille <akim@epita.fr>
15081
15082 * tests/actions.at (Destructors): Augment to test locations.
15083 * data/bison.simple (yydestructor): Pass it the current location
15084 if locations are enabled.
15085 Prototype only when __STDC__ or C++.
15086 Change the argument names to move into the yy name space: there is
15087 user code here.
15088
15089 2002-06-19 Akim Demaille <akim@epita.fr>
15090
15091 * data/bison.simple (b4_pure_if): New.
15092 Use it instead of #ifdef YYPURE.
15093
15094 2002-06-19 Akim Demaille <akim@epita.fr>
15095
15096 * data/bison.simple (b4_location_if): New.
15097 Use it instead of #ifdef YYLSP_NEEDED.
15098
15099 2002-06-19 Akim Demaille <akim@epita.fr>
15100
15101 Prepare @$ in %destructor, but currently don't bind it in the
15102 skeleton, as %location use is not cleaned up yet.
15103
15104 * src/scan-gram.l (handle_dollar, handle_destructor_at)
15105 (handle_action_at): New.
15106 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
15107 a braced_code_t and a location as additional arguments.
15108 (handle_destructor_dollar): Instead of requiring `b4_eval', just
15109 unquote one when outputting `b4_dollar_dollar'.
15110 Adjust callers.
15111 * data/bison.simple (b4_eval): Remove.
15112 (b4_symbol_destructor): Adjust.
15113 * tests/input.at (Invalid @n): Adjust.
15114
15115 2002-06-19 Zack Weinberg <zack@codesourcery.com>
15116
15117 * doc/bison.texinfo: Document ability to have multiple
15118 prologue sections.
15119
15120 2002-06-18 Akim Demaille <akim@epita.fr>
15121
15122 * src/files.c (compute_base_names): When computing the output file
15123 names from the input file name, strip the directory part.
15124
15125 2002-06-18 Akim Demaille <akim@epita.fr>
15126
15127 * data/bison.simple.new: Comment changes.
15128 Reported by Andreas Schwab.
15129
15130 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
15131
15132 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
15133 there are no `label `yyoverflowlab' defined but not used' warnings
15134 when yyoverflow is defined.
15135
15136 2002-06-18 Akim Demaille <akim@epita.fr>
15137
15138 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
15139 new member.
15140 (symbol_destructor_set): Adjust.
15141 * src/output.c (symbol_destructors_output): Output the destructor
15142 locations.
15143 Output the symbol name.
15144 * data/bison.simple (b4_symbol_destructor): Adjust.
15145
15146 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
15147 and Akim Demaille <akim@epita.fr>
15148
15149 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
15150 what's left on the stack when the error recovery hits EOF.
15151 * tests/actions.at (Destructors): Complete to exercise this case.
15152
15153 2002-06-17 Akim Demaille <akim@epita.fr>
15154
15155 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
15156 arguments is really empty, not only equal to `[]'.
15157 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
15158 member.
15159 (symbol_destructor_set): New.
15160 * src/output.c (symbol_destructors_output): New.
15161 * src/reader.h (brace_code_t, current_braced_code): New.
15162 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
15163 (handle_dollar): Rename as...
15164 (handle_action_dollar): this.
15165 (handle_destructor_dollar): New.
15166 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
15167 (grammar_declaration): Use it.
15168 * data/bison.simple (yystos): Is always defined.
15169 (yydestructor): New.
15170 * tests/actions.at (Destructors): New.
15171 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
15172
15173 2002-06-17 Akim Demaille <akim@epita.fr>
15174
15175 * src/symlist.h, src/symlist.c (symbol_list_length): New.
15176 * src/scan-gram.l (handle_dollar, handle_at): Compute the
15177 rule_length only when needed.
15178 * src/output.c (actions_output, token_definitions_output): Output
15179 the full M4 block.
15180 * src/symtab.c: Don't access directly to the symbol tag, use
15181 symbol_tag_get.
15182 * src/parse-gram.y: Use symbol_list_free.
15183
15184 2002-06-17 Akim Demaille <akim@epita.fr>
15185
15186 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
15187 (symbol_list_prepend, get_type_name): Move to...
15188 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
15189 (symbol_list_prepend, symbol_list_n_type_name_get): here.
15190 Adjust all callers.
15191 (symbol_list_free): New.
15192 * src/scan-gram.l (handle_dollar): Takes a location.
15193 * tests/input.at (Invalid $n): Adjust.
15194
15195 2002-06-17 Akim Demaille <akim@epita.fr>
15196
15197 * src/reader.h, src/reader.c (symbol_list_new): Export it.
15198 (symbol_list_prepend): New.
15199 * src/parse-gram.y (%union): `list' is a new member.
15200 (symbols.1): New, replaces...
15201 (terms_to_prec.1, nterms_to_type.1): these.
15202 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
15203 Take a location as additional argument.
15204 Adjust all callers.
15205
15206 2002-06-15 Akim Demaille <akim@epita.fr>
15207
15208 * src/parse-gram.y: Move %token in the declaration section so that
15209 we don't depend upon CVS Bison.
15210
15211 2002-06-15 Akim Demaille <akim@epita.fr>
15212
15213 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
15214 * src/print.c (print_core): Use it.
15215
15216 2002-06-15 Akim Demaille <akim@epita.fr>
15217
15218 * src/conflicts.c (log_resolution): Accept the rule involved in
15219 the sr conflicts instead of the lookahead number that points to
15220 that rule.
15221 (flush_reduce): Accept the current lookahead vector as argument,
15222 instead of the index in LA.
15223 (resolve_sr_conflict): Accept the current number of lookahead
15224 bitset to consider for the STATE, instead of the index in LA.
15225 (set_conflicts): Adjust.
15226 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
15227
15228 2002-06-15 Akim Demaille <akim@epita.fr>
15229
15230 * src/state.h (state_t): Replace the `lookaheadsp' member, a
15231 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
15232 Adjust all dependencies.
15233 * src/lalr.c (initialize_lookaheads): Split into...
15234 (states_lookaheads_count, states_lookaheads_initialize): these.
15235 (lalr): Adjust.
15236
15237 2002-06-15 Akim Demaille <akim@epita.fr>
15238
15239 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
15240 out of...
15241 (grammar_rules_print): here.
15242 * src/reduce.c (reduce_output): Use it.
15243 * tests/reduce.at (Useless Rules, Reduced Automaton)
15244 (Underivable Rules): Adjust.
15245
15246 2002-06-15 Akim Demaille <akim@epita.fr>
15247
15248 Copy BYacc's nice way to report the grammar.
15249
15250 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
15251 New.
15252 Don't print the rules' location, it is confusing and useless.
15253 (rule_print): Use grammar_rhs_print.
15254 * src/print.c (print_grammar): Use grammar_rules_print.
15255
15256 2002-06-15 Akim Demaille <akim@epita.fr>
15257
15258 Complete and rationalize `useless thing' warnings.
15259
15260 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
15261 (symbol_tag_print): New.
15262 Use them everywhere in place of accessing directly the tag member.
15263 * src/gram.h, src/gram.c (rule_print): New.
15264 Use it where a rule used to be printed `by hand'.
15265 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
15266 (reduce_grammar_tables): Report the useless rules.
15267 (reduce_print): Useless things are a warning, not an error.
15268 Report it as such.
15269 * tests/reduce.at (Useless Nonterminals, Useless Rules):
15270 (Reduced Automaton, Underivable Rules): Adjust.
15271 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
15272 * tests/conflicts.at (Unresolved SR Conflicts)
15273 (Solved SR Conflicts): Adjust.
15274
15275 2002-06-15 Akim Demaille <akim@epita.fr>
15276
15277 Let symbols have a location.
15278
15279 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
15280 (getsym): Adjust.
15281 Adjust all callers.
15282 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
15283 Use location_t, not int.
15284 * src/symtab.c (symbol_check_defined): Take advantage of the
15285 location.
15286 * tests/regression.at (Invalid inputs): Adjust.
15287
15288 2002-06-15 Akim Demaille <akim@epita.fr>
15289
15290 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
15291 (input): Don't try to initialize yylloc here, do it in the
15292 scanner.
15293 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
15294 * src/gram.h (rule_t): Change line and action_line into location
15295 and action_location, of location_t type.
15296 Adjust all dependencies.
15297 * src/location.h, src/location.c (empty_location): New.
15298 * src/reader.h, src/reader.c (grammar_start_symbol_set)
15299 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
15300 (grammar_current_rule_symbol_append)
15301 (grammar_current_rule_action_append): Expect a location as argument.
15302 * src/reader.c (grammar_midrule_action): Adjust to attach an
15303 action's location as dummy symbol location.
15304 * src/symtab.h, src/symtab.c (startsymbol_location): New.
15305 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
15306 the line numbers.
15307
15308 2002-06-14 Akim Demaille <akim@epita.fr>
15309
15310 Grammar declarations may be found in the grammar section.
15311
15312 * src/parse-gram.y (rules_or_grammar_declaration): New.
15313 (declarations): Each declaration may end with a semicolon, not
15314 just...
15315 (grammar_declaration): `"%union"'.
15316 (grammar): Branch to rules_or_grammar_declaration.
15317
15318 2002-06-14 Akim Demaille <akim@epita.fr>
15319
15320 * src/main.c (main): Invoke scanner_free.
15321
15322 2002-06-14 Akim Demaille <akim@epita.fr>
15323
15324 * src/output.c (m4_invoke): Extracted from...
15325 (output_skeleton): here.
15326 Free tempfile.
15327
15328 2002-06-14 Akim Demaille <akim@epita.fr>
15329
15330 * src/parse-gram.y (directives, directive, gram)
15331 (grammar_directives, precedence_directives, precedence_directive):
15332 Rename as...
15333 (declarations, declaration, grammar, grammar_declaration)
15334 (precedence_declaration, precedence_declarator): these.
15335 (symbol_declaration): New.
15336
15337 2002-06-14 Akim Demaille <akim@epita.fr>
15338
15339 * src/files.c (action_obstack): Remove, unused.
15340 (output_obstack): Remove it, and all its dependencies, as it is no
15341 longer needed.
15342 * src/reader.c (epilogue_set): Build the epilogue in the
15343 muscle_obstack.
15344 * src/output.h, src/output.c (muscle_obstack): Move to...
15345 * src/muscle_tab.h, src/muscle_tab.h: here.
15346 (muscle_init): Initialize muscle_obstack.
15347 (muscle_free): New.
15348 * src/main.c (main): Call it.
15349
15350 2002-06-14 Akim Demaille <akim@epita.fr>
15351
15352 * src/location.h: New, extracted from...
15353 * src/reader.h: here.
15354 * src/Makefile.am (noinst_HEADERS): Merge into
15355 (bison_SOURCES): this.
15356 Add location.h.
15357 * src/parse-gram.y: Use location_t instead of Bison's.
15358 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
15359 Use location_t instead of ints.
15360
15361 2002-06-14 Akim Demaille <akim@epita.fr>
15362
15363 * data/bison.simple, data/bison.c++: Be sure to restore the
15364 current #line when returning to the skeleton contents after having
15365 exposed the input file's #line.
15366
15367 2002-06-12 Akim Demaille <akim@epita.fr>
15368
15369 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
15370 eager.
15371 * tests/actions.at (Exotic Dollars): New.
15372
15373 2002-06-12 Akim Demaille <akim@epita.fr>
15374
15375 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
15376 ['"/] too eagerly.
15377 * tests/input.at (Torturing the Scanner): New.
15378
15379 2002-06-11 Akim Demaille <akim@epita.fr>
15380
15381 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
15382 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
15383 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
15384 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
15385 * src/reader.c (reader): Use it.
15386
15387 2002-06-11 Akim Demaille <akim@epita.fr>
15388
15389 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
15390 Adjust all callers.
15391 (scanner_last_string_free): New.
15392
15393 2002-06-11 Akim Demaille <akim@epita.fr>
15394
15395 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
15396 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
15397 (last_string, YY_OBS_FREE): New.
15398 Use them when returning an ID.
15399
15400 2002-06-11 Akim Demaille <akim@epita.fr>
15401
15402 Have Bison grammars parsed by a Bison grammar.
15403
15404 * src/reader.c, src/reader.h (prologue_augment): New.
15405 * src/reader.c (copy_definition): Remove.
15406
15407 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
15408 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
15409 (grammar_current_rule_prec_set, grammar_current_rule_check)
15410 (grammar_current_rule_symbol_append)
15411 (grammar_current_rule_action_append): Export.
15412 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
15413 (symbol_list_action_append): Remove.
15414 Hook the routines from reader.
15415 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
15416 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
15417
15418 * src/reader.c (read_declarations): Remove, unused.
15419
15420 * src/parse-gram.y: Handle the epilogue.
15421 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
15422 (grammar_start_symbol_set): this.
15423 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
15424 * src/reader.c (readgram): Remove, unused.
15425 (reader): Adjust to insert eoftoken and axiom where appropriate.
15426
15427 * src/reader.c (copy_dollar): Replace with...
15428 * src/scan-gram.h (handle_dollar): this.
15429 * src/parse-gram.y: Remove `%thong'.
15430
15431 * src/reader.c (copy_at): Replace with...
15432 * src/scan-gram.h (handle_at): this.
15433
15434 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
15435 New.
15436
15437 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
15438 time being.
15439
15440 * src/reader.h, src/reader.c (grammar_rule_end): New.
15441
15442 * src/parse.y (current_type, current_class): New.
15443 Implement `%nterm', `%token' support.
15444 Merge `%term' into `%token'.
15445 (string_as_id): New.
15446 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
15447 type name.
15448
15449 * src/parse-gram.y: Be sure to handle properly the beginning of
15450 rules.
15451
15452 * src/parse-gram.y: Handle %type.
15453 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
15454
15455 * src/parse-gram.y: More directives support.
15456 * src/options.c: No longer handle source directives.
15457
15458 * src/parse-gram.y: Fix %output.
15459
15460 * src/parse-gram.y: Handle %union.
15461 Use the prologue locations.
15462 * src/reader.c (parse_union_decl): Remove.
15463
15464 * src/reader.h, src/reader.c (epilogue_set): New.
15465 * src/parse-gram.y: Use it.
15466
15467 * data/bison.simple, data/bison.c++: b4_stype is now either not
15468 defined, then default to int, or to the contents of %union,
15469 without `union' itself.
15470 Adjust.
15471 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
15472
15473 * src/output.c (actions_output): Don't output braces, as they are
15474 already handled by the scanner.
15475
15476 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
15477 characters to themselves.
15478
15479 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
15480 that the epilogue has a proper #line.
15481
15482 * src/parse-gram.y: Handle precedence/associativity.
15483
15484 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
15485 a terminal.
15486 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
15487 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
15488 at all to define terminals that cannot be emitted.
15489
15490 * src/scan-gram.l: Escape M4 characters.
15491
15492 * src/scan-gram.l: Working properly with escapes in user
15493 strings/characters.
15494
15495 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
15496 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
15497 grammar.
15498 Use more modest sizes, as for the time being the parser does not
15499 release memory, and therefore the process swallows a huge amount
15500 of memory.
15501
15502 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
15503 stricter %token grammar.
15504
15505 * src/symtab.h (associativity): Add `undef_assoc'.
15506 (symbol_precedence_set): Do nothing when passed an undef_assoc.
15507 * src/symtab.c (symbol_check_alias_consistence): Adjust.
15508
15509 * tests/regression.at (Invalid %directive): Remove, as it is now
15510 meaningless.
15511 (Invalid inputs): Adjust to the new error messages.
15512 (Token definitions): The new grammar doesn't allow too many
15513 eccentricities.
15514
15515 * src/lex.h, src/lex.c: Remove.
15516 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
15517 (copy_character, copy_string2, copy_string, copy_identifier)
15518 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
15519 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
15520 (parse_action): Remove.
15521 * po/POTFILES.in: Adjust.
15522
15523 2002-06-11 Akim Demaille <akim@epita.fr>
15524
15525 * src/reader.c (parse_action): Don't store directly into the
15526 rule's action member: return the action as a string.
15527 Don't require `rule_length' as an argument: compute it.
15528 (grammar_current_rule_symbol_append)
15529 (grammar_current_rule_action_append): New, eved out from
15530 (readgram): here.
15531 Remove `action_flag', `rulelength', unused now.
15532
15533 2002-06-11 Akim Demaille <akim@epita.fr>
15534
15535 * src/reader.c (grammar_current_rule_prec_set).
15536 (grammar_current_rule_check): New, eved out from...
15537 (readgram): here.
15538 Remove `xaction', `first_rhs': useless.
15539 * tests/input.at (Type clashes): New.
15540 * tests/existing.at (GNU Cim Grammar): Adjust.
15541
15542 2002-06-11 Akim Demaille <akim@epita.fr>
15543
15544 * src/reader.c (grammar_midrule_action): New, Eved out from
15545 (readgram): here.
15546
15547 2002-06-11 Akim Demaille <akim@epita.fr>
15548
15549 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
15550 New.
15551 (readgram): Use them as replacement of inlined code, crule and
15552 crule1.
15553
15554 2002-06-11 Akim Demaille <akim@epita.fr>
15555
15556 * src/reader.c (grammar_end, grammar_symbol_append): New.
15557 (readgram): Use them.
15558 Make the use of `p' as local as possible.
15559
15560 2002-06-10 Akim Demaille <akim@epita.fr>
15561
15562 GCJ's parser requires the tokens to be defined before the prologue.
15563
15564 * data/bison.simple: Output the token definition before the user's
15565 prologue.
15566 * tests/regression.at (Braces parsing, Duplicate string)
15567 (Mixing %token styles): Check the output from bison.
15568 (Early token definitions): New.
15569
15570 2002-06-10 Akim Demaille <akim@epita.fr>
15571
15572 * src/symtab.c (symbol_user_token_number_set): Don't complain when
15573 assigning twice the same user number to a token, so that we can
15574 use it in...
15575 * src/lex.c (lex): here.
15576 Also use `symbol_class_set' instead of hand written code.
15577 * src/reader.c (parse_assoc_decl): Likewise.
15578
15579 2002-06-10 Akim Demaille <akim@epita.fr>
15580
15581 * src/symtab.c, src/symtab.c (symbol_class_set)
15582 (symbol_user_token_number_set): New.
15583 * src/reader.c (parse_token_decl): Use them.
15584 Use a switch instead of ifs.
15585 Use a single argument.
15586
15587 2002-06-10 Akim Demaille <akim@epita.fr>
15588
15589 Remove `%thong' support as it is undocumented, unused, duplicates
15590 `%token's job, and creates useless e-mail traffic with people who
15591 want to know what it is, why it is undocumented, unused, and
15592 duplicates `%token's job.
15593
15594 * src/reader.c (parse_thong_decl): Remove.
15595 * src/options.c (option_table): Remove "thong".
15596 * src/lex.h (tok_thong): Remove.
15597
15598 2002-06-10 Akim Demaille <akim@epita.fr>
15599
15600 * src/symtab.c, src/symtab.c (symbol_type_set)
15601 (symbol_precedence_set): New.
15602 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
15603 (value_components_used): Remove, unused.
15604
15605 2002-06-09 Akim Demaille <akim@epita.fr>
15606
15607 Move symbols handling code out of the reader.
15608
15609 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
15610 (axiom): Move to...
15611 * src/symtab.h, src/symtab.c: here.
15612
15613 * src/gram.c (start_symbol): Remove: use startsymbol->number.
15614 * src/reader.c (startval): Rename as...
15615 * src/symtab.h, src/symtab.c (startsymbol): this.
15616 * src/reader.c: Adjust.
15617
15618 * src/reader.c (symbol_check_defined, symbol_make_alias)
15619 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15620 (token_translations_init)
15621 Move to...
15622 * src/symtab.c: here.
15623 * src/reader.c (packsymbols): Move to...
15624 * src/symtab.h, src/symtab.c (symbols_pack): here.
15625 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
15626 argument.
15627
15628 2002-06-03 Akim Demaille <akim@epita.fr>
15629
15630 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
15631 then statements.
15632
15633 2002-06-03 Akim Demaille <akim@epita.fr>
15634
15635 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
15636 structs with non literals.
15637 * src/scan-skel.l: never-interactive.
15638 * src/conflicts.c (enum conflict_resolution_e): No trailing
15639 comma.
15640 * src/getargs.c (usage): Split long literal strings.
15641 Reported by Hans Aberg.
15642
15643 2002-05-28 Akim Demaille <akim@epita.fr>
15644
15645 * data/bison.c++: Use C++ ostreams.
15646 (cdebug_): New member.
15647
15648 2002-05-28 Akim Demaille <akim@epita.fr>
15649
15650 * src/output.c (output_skeleton): Be sure to allocate enough room
15651 for `/' _and_ for `\0' in full_skeleton.
15652
15653 2002-05-28 Akim Demaille <akim@epita.fr>
15654
15655 * data/bison.c++: Catch up with bison.simple:
15656 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15657 and Paul Eggert <eggert@twinsun.com>: `error' handing.
15658 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
15659 and popping traces.
15660
15661 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15662
15663 * src/output.c (output_skeleton): Put an explicit path in front of
15664 the skeleton file name, rather than relying on the -I directory,
15665 to partially alleviate effects of having a skeleton file lying around
15666 in the current directory.
15667
15668 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15669
15670 * src/conflicts.c (log_resolution): Correct typo:
15671 obstack_printf should be obstack_fgrow1.
15672
15673 2002-05-26 Akim Demaille <akim@epita.fr>
15674
15675 * src/state.h (state_t): `solved_conflicts' is a new member.
15676 * src/LR0.c (new_state): Set it to 0.
15677 * src/conflicts.h, src/conflicts.c (print_conflicts)
15678 (free_conflicts, solve_conflicts): Rename as...
15679 (conflicts_print, conflicts_free, conflicts_solve): these.
15680 Adjust callers.
15681 * src/conflicts.c (enum conflict_resolution_e)
15682 (solved_conflicts_obstack): New, used by...
15683 (log_resolution): this.
15684 Adjust to attach the conflict resolution to each state.
15685 Complete the description with the precedence/associativity
15686 information.
15687 (resolve_sr_conflict): Adjust.
15688 * src/print.c (print_state): Output its solved_conflicts.
15689 * tests/conflicts.at (Unresolved SR Conflicts)
15690 (Solved SR Conflicts): Exercise --report=all.
15691
15692 2002-05-26 Akim Demaille <akim@epita.fr>
15693
15694 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15695 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15696 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
15697 (token_number_t, item_number_as_token_number)
15698 (token_number_as_item_number, muscle_insert_token_number_table):
15699 Rename as...
15700 (symbol_number_t, item_number_as_symbol_number)
15701 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
15702 these, since it is more appropriate.
15703
15704 2002-05-26 Akim Demaille <akim@epita.fr>
15705
15706 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
15707 `Error:' lines.
15708 * data/bison.simple (yystos) [YYDEBUG]: New.
15709 (yyparse) [YYDEBUG]: Display the symbols which are popped during
15710 error recovery.
15711 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
15712
15713 2002-05-25 Akim Demaille <akim@epita.fr>
15714
15715 * doc/bison.texinfo (Debugging): Split into...
15716 (Tracing): this new section, its former contents, and...
15717 (Understanding): this new section.
15718 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
15719 by...
15720 (report_flag): this.
15721 Adjust all dependencies.
15722 (report_args, report_types, report_argmatch): New.
15723 (usage, getargs): Report/support -r, --report.
15724 * src/options.h
15725 (struct option_table_struct): Rename as..,
15726 (struct option_table_s): this.
15727 Rename the `set_flag' member to `flag' to match with getopt_long's
15728 struct.
15729 * src/options.c (option_table): Split verbose into an entry for
15730 %verbose, and another for --verbose.
15731 Support --report/-r, so remove -r from the obsolete --raw.
15732 * src/print.c: Attach full item sets and lookaheads reports to
15733 report_flag instead of trace_flag.
15734 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
15735
15736 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15737 and Paul Eggert <eggert@twinsun.com>
15738
15739 * data/bison.simple (yyparse): Correct error handling to conform to
15740 POSIX and yacc. Specifically, after syntax error is discovered,
15741 do not reduce further before shifting the error token.
15742 Clean up the code a bit by removing the labels yyerrdefault,
15743 yyerrhandle, yyerrpop.
15744 * NEWS: Document the above.
15745
15746 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15747
15748 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
15749 type; it isn't always big enough, since it doesn't necessarily
15750 include non-terminals.
15751 (yytranslate): Expand definition of yy_token_number_type, so that
15752 the latter can be removed.
15753 (yy_token_number_type): Remove, only one use.
15754 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
15755 don't use TokenNumberType as element type.
15756
15757 * tests/regression.at: Modify expected output to agree with change
15758 to yyr1 and yytranslate.
15759
15760 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
15761
15762 * src/reader.c (parse_action): Use copy_character instead of
15763 obstack_1grow.
15764
15765 2002-05-13 Akim Demaille <akim@epita.fr>
15766
15767 * tests/regression.at (Token definitions): Prototype yylex and
15768 yyerror.
15769
15770 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15771
15772 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
15773 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
15774 32-bit arithmetic.
15775 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
15776
15777 2002-05-07 Akim Demaille <akim@epita.fr>
15778
15779 * tests/synclines.at: Be sure to prototype yylex and yyerror to
15780 avoid GCC warnings.
15781
15782 2002-05-07 Akim Demaille <akim@epita.fr>
15783
15784 Kill GCC warnings.
15785
15786 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
15787 over the RHS of each rule.
15788 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
15789 * src/state.h (state_t): Member `nitems' is unsigned short.
15790 * src/LR0.c (get_state): Adjust.
15791 * src/reader.c (packgram): Likewise.
15792 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
15793 `Type'.
15794 (muscle_insert_int_table): Remove, unused.
15795 (prepare_rules): Remove `max'.
15796
15797 2002-05-06 Akim Demaille <akim@epita.fr>
15798
15799 * src/closure.c (print_firsts): Display of the symbol tags.
15800 (bitmatrix_print): Move to...
15801 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
15802 here.
15803 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
15804
15805 2002-05-06 Akim Demaille <akim@epita.fr>
15806
15807 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
15808 hash_do_for_each.
15809
15810 2002-05-06 Akim Demaille <akim@epita.fr>
15811
15812 * src/LR0.c (new_state, get_state): Instead of using the global
15813 `kernel_size' and `kernel_base', have two new arguments:
15814 `core_size' and `core'.
15815 Adjust callers.
15816
15817 2002-05-06 Akim Demaille <akim@epita.fr>
15818
15819 * src/reader.c (packgram): No longer end `ritem' with a 0
15820 sentinel: it is not used.
15821
15822 2002-05-05 Akim Demaille <akim@epita.fr>
15823
15824 New experimental feature: display the lookaheads in the report and
15825 graph.
15826
15827 * src/print (print_core): When --trace-flag, display the rules
15828 lookaheads.
15829 * src/print_graph.c (print_core): Likewise.
15830 Swap the arguments.
15831 Adjust caller.
15832
15833 2002-05-05 Akim Demaille <akim@epita.fr>
15834
15835 * tests/torture.at (Many lookaheads): New test.
15836
15837 2002-05-05 Akim Demaille <akim@epita.fr>
15838
15839 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
15840 (GENERATE_MUSCLE_INSERT_TABLE): this.
15841 (output_int_table, output_unsigned_int_table, output_short_table)
15842 (output_token_number_table, output_item_number_table): Replace with...
15843 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
15844 (muscle_insert_short_table, muscle_insert_token_number_table)
15845 (muscle_insert_item_number_table): these.
15846 Adjust all callers.
15847 (prepare_tokens): Don't free `translations', since...
15848 * src/reader.h, src/reader.c (grammar_free): do it.
15849 Move to...
15850 * src/gram.h, src/gram.c (grammar_free): here.
15851 * data/bison.simple, data/bison.c++: b4_token_number_max is now
15852 b4_translate_max.
15853
15854 2002-05-05 Akim Demaille <akim@epita.fr>
15855
15856 * src/output.c (output_unsigned_int_table): New.
15857 (prepare_rules): `i' is unsigned.
15858 `prhs', `rline', `r2' are unsigned int.
15859 Rename muscle `rhs_number_max' as `rhs_max'.
15860 Output muscles `prhs_max', `rline_max', and `r2_max'.
15861 Free rline and r1.
15862 * data/bison.simple, data/bison.c++: Adjust to use these muscles
15863 to compute types instead of constant types.
15864 * tests/regression.at (Web2c Actions): Adjust.
15865
15866 2002-05-04 Akim Demaille <akim@epita.fr>
15867
15868 * src/symtab.h (SALIAS, SUNDEF): Rename as...
15869 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
15870 Adjust dependencies.
15871 * src/output.c (token_definitions_output): Be sure not to output a
15872 `#define 'a'' when fed with `%token 'a' "a"'.
15873 * tests/regression.at (Token definitions): New.
15874
15875 2002-05-03 Paul Eggert <eggert@twinsun.com>
15876
15877 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
15878 for K&R C.
15879
15880 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
15881
15882 * Makefile.am (SUBDIRS): Remove intl.
15883 (EXTRA_DIST): Add config/config.rpath.
15884
15885 2002-05-03 Akim Demaille <akim@epita.fr>
15886
15887 * data/bison.simple (m4_if): Don't output empty enums.
15888 And actually, output valid enum definitions :(.
15889
15890 2002-05-03 Akim Demaille <akim@epita.fr>
15891
15892 * configure.bat: Remove, completely obsolete.
15893 * Makefile.am (EXTRA_DIST): Adjust.
15894 Don't distribute config.rpath...
15895 * config/Makefile.am (EXTRA_DIST): Do it.
15896
15897 2002-05-03 Akim Demaille <akim@epita.fr>
15898
15899 * configure.in (GETTEXT_VERSION): New.
15900 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
15901
15902 2002-05-03 Akim Demaille <akim@epita.fr>
15903
15904 * data/bison.simple (b4_token_enum): New.
15905 (b4_token_defines): Use it to output tokens both as #define and
15906 enums.
15907 Suggested by Paul Eggert.
15908 * src/output.c (token_definitions_output): Don't output spurious
15909 white spaces.
15910
15911 2002-05-03 Akim Demaille <akim@epita.fr>
15912
15913 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
15914
15915 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
15916
15917 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
15918 Update the stack class, give a try to deque as the default container.
15919
15920 2002-05-02 Akim Demaille <akim@epita.fr>
15921
15922 * data/bison.simple (yyparse): Do not implement @$ = @1.
15923 (YYLLOC_DEFAULT): Adjust to do it.
15924 * doc/bison.texinfo (Location Default Action): Fix.
15925
15926 2002-05-02 Akim Demaille <akim@epita.fr>
15927
15928 * src/reader.c (parse_braces): Merge into...
15929 (parse_action): this.
15930
15931 2002-05-02 Akim Demaille <akim@epita.fr>
15932
15933 * configure.in (ALL_LINGUAS): Remove.
15934 * po/LINGUAS, hr.po: New.
15935
15936 2002-05-02 Akim Demaille <akim@epita.fr>
15937
15938 Remove the so called hairy (semantic) parsers.
15939
15940 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
15941 * src/gram.h, src/gram.c (semantic_parser): Remove.
15942 (rule_t): Remove the guard and guard_line members.
15943 * src/lex.h (token_t): remove tok_guard.
15944 * src/options.c (option_table): Remove %guard and %semantic_parser
15945 support.
15946 * src/output.c, src/output.h (guards_output): Remove.
15947 (prepare): Adjust.
15948 (token_definitions_output): Don't output the `T'
15949 tokens (???).
15950 (output_skeleton): Don't output the guards.
15951 * src/files.c, src/files.c (attrsfile): Remove.
15952 * src/reader.c (symbol_list): Remove the guard and guard_line
15953 members.
15954 Adjust dependencies.
15955 (parse_guard): Remove.
15956 * data/bison.hairy: Remove.
15957 * doc/bison.texinfo (Environment Variables): Remove occurrences of
15958 BISON_HAIRY.
15959
15960 2002-05-02 Akim Demaille <akim@epita.fr>
15961
15962 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
15963 (parse_guard): Rename the formal argument `stack_offset' as
15964 `rule_length', which is more readable.
15965 Adjust callers.
15966 (copy_at, copy_dollar): Instead of outputting the hard coded
15967 values of $$, $n and so forth, output invocation to b4_lhs_value,
15968 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
15969 Note: this patch partially drops `semantic-parser' support: it
15970 always does `rule_length - n', where semantic parsers ought to
15971 always use `-n'.
15972 * data/bison.simple, data/bison.c++ (b4_lhs_value)
15973 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
15974
15975 2002-05-02 Akim Demaille <akim@epita.fr>
15976
15977 * configure.in (AC_INIT): Bump to 1.49b.
15978 (AM_INIT_AUTOMAKE): Short invocation.
15979
15980 2002-05-02 Akim Demaille <akim@epita.fr>
15981
15982 Version 1.49a.
15983
15984 2002-05-01 Akim Demaille <akim@epita.fr>
15985
15986 * src/skeleton.h: Remove.
15987
15988 2002-05-01 Akim Demaille <akim@epita.fr>
15989
15990 * src/skeleton.h: Fix the #endif.
15991 Reported by Magnus Fromreide.
15992
15993 2002-04-26 Paul Eggert <eggert@twinsun.com>
15994
15995 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
15996 Define if we define YYSTYPE and YYLTYPE, respectively.
15997 (YYCOPY): Fix [] quoting problem in the non-GCC case.
15998
15999 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
16000
16001 * src/scan-skel.l: Postprocess quadrigraphs.
16002
16003 * src/reader.c (copy_character): New function, used to output
16004 single characters while replacing `[' and `]' with quadrigraphs, to
16005 avoid troubles with M4 quotes.
16006 (copy_comment): Output characters with copy_character.
16007 (read_additionnal_code): Likewise.
16008 (copy_string2): Likewise.
16009 (copy_definition): Likewise.
16010
16011 * tests/calc.at: Exercise M4 quoting.
16012
16013 2002-04-25 Akim Demaille <akim@epita.fr>
16014
16015 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
16016 between `!' and the command.
16017 Reported by Paul Eggert.
16018
16019 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
16020
16021 * tests/calc.at: Exercise prologue splitting.
16022
16023 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
16024 `b4_post_prologue' instead of `b4_prologue'.
16025
16026 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
16027 muscles.
16028 (output): Free pre_prologue_obstack and post_prologue_obstack.
16029 * src/files.h, src/files.c (attrs_obstack): Remove.
16030 (pre_prologue_obstack, post_prologue_obstack): New.
16031 * src/reader.c (copy_definition): Add a parameter to specify the
16032 obstack to fill, instead of using attrs_obstack unconditionally.
16033 (read_declarations): Pass pre_prologue_obstack to copy_definition if
16034 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
16035
16036 2002-04-23 Paul Eggert <eggert@twinsun.com>
16037
16038 * data/bison.simple: Remove unnecessary commentary and white
16039 space differences from 1_29-branch.
16040 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
16041
16042 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
16043 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
16044 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
16045 constructors or destructors.
16046
16047 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
16048
16049 2002-04-23 Akim Demaille <akim@epita.fr>
16050
16051 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
16052 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
16053 location with columns.
16054 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
16055 All reported by Paul Eggert.
16056
16057 2002-04-22 Akim Demaille <akim@epita.fr>
16058
16059 * src/reduce.c (dump_grammar): Move to...
16060 * src/gram.h, src/gram.c (grammar_dump): here.
16061 Be sure to separate long item numbers.
16062 Don't read the members of a rule's prec if its nil.
16063
16064 2002-04-22 Akim Demaille <akim@epita.fr>
16065
16066 * src/output.c (table_size, table_grow): New.
16067 (MAXTABLE): Remove, replace uses with table_size.
16068 (pack_vector): Instead of dying when the table is too big, grow it.
16069
16070 2002-04-22 Akim Demaille <akim@epita.fr>
16071
16072 * data/bison.simple (yyr1): Its type is that of a token number.
16073 * data/bison.c++ (r1_): Likewise.
16074 * tests/regression.at (Web2c Actions): Adjust.
16075
16076 2002-04-22 Akim Demaille <akim@epita.fr>
16077
16078 * src/reader.c (token_translations_init): 256 is now the default
16079 value for the error token, i.e., it will be assigned another
16080 number if the user assigned 256 to one of her tokens.
16081 (reader): Don't force 256 to error.
16082 * doc/bison.texinfo (Symbols): Adjust.
16083 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
16084 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
16085 etc. instead of 10, 20, 30 (which was used to `jump' over error
16086 (256) and undefined (2)).
16087
16088 2002-04-22 Akim Demaille <akim@epita.fr>
16089
16090 Propagate more token_number_t.
16091
16092 * src/gram.h (token_number_as_item_number)
16093 (item_number_as_token_number): New.
16094 * src/output.c (GENERATE_OUTPUT_TABLE): New.
16095 Use it to create output_item_number_table and
16096 output_token_number_table.
16097 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16098 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
16099 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
16100 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
16101
16102 2002-04-22 Akim Demaille <akim@epita.fr>
16103
16104 * src/output.h, src/output.c (get_lines_number): Remove.
16105
16106 2002-04-19 Akim Demaille <akim@epita.fr>
16107
16108 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
16109 as Lex/Flex'.
16110 (Debugging): More details about enabling the debugging features.
16111 (Table of Symbols): Describe $$, $n, @$, and @n.
16112 Suggested by Tim Josling.
16113
16114 2002-04-19 Akim Demaille <akim@epita.fr>
16115
16116 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
16117
16118 2002-04-10 Akim Demaille <akim@epita.fr>
16119
16120 * src/system.h: Rely on HAVE_LIMITS_H.
16121 Suggested by Paul Eggert.
16122
16123 2002-04-09 Akim Demaille <akim@epita.fr>
16124
16125 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
16126 full stderr, and strip it according to the bison options, instead
16127 of composing the error message from different bits.
16128 This makes it easier to check for several error messages.
16129 Adjust all the invocations.
16130 Add an invocation exercising the error token.
16131 Add an invocation demonstrating a stupid error message.
16132 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
16133 Adjust the tests.
16134 Error message are for stderr, not stdout.
16135
16136 2002-04-09 Akim Demaille <akim@epita.fr>
16137
16138 * src/gram.h, src/gram.c (error_token_number): Remove, use
16139 errtoken->number.
16140 * src/reader.c (reader): Don't specify the user token number (2)
16141 for $undefined, as it uselessly prevents using it.
16142 * src/gram.h (token_number_t): Move to...
16143 * src/symtab.h: here.
16144 (state_t.number): Is a token_number_t.
16145 * src/print.c, src/reader.c: Use undeftoken->number instead of
16146 hard coded 2.
16147 (Even though this 2 is not the same as above: the number of the
16148 undeftoken remains being 2, it is its user token number which
16149 might not be 2).
16150 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
16151 `user_token_number_max'.
16152 Output `undef_token_number'.
16153 * data/bison.simple, data/bison.c++: Use them.
16154 Be sure to map invalid yylex return values to
16155 `undef_token_number'. This saves us from gratuitous SEGV.
16156
16157 * tests/conflicts.at (Solved SR Conflicts)
16158 (Unresolved SR Conflicts): Adjust.
16159 * tests/regression.at (Web2c Actions): Adjust.
16160
16161 2002-04-08 Akim Demaille <akim@epita.fr>
16162
16163 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
16164 Adding #line.
16165 Remove the duplicate `typedefs'.
16166 (RhsNumberType): Fix the declaration and various other typos.
16167 Use __ofile__.
16168 * data/bison.simple: Use __ofile__.
16169 * src/scan-skel.l: Handle __ofile__.
16170
16171 2002-04-08 Akim Demaille <akim@epita.fr>
16172
16173 * src/gram.h (item_number_t): New, the type of item numbers in
16174 RITEM. Note that it must be able to code symbol numbers as
16175 positive number, and the negation of rule numbers as negative
16176 numbers.
16177 Adjust all dependencies (pretty many).
16178 * src/reduce.c (rule): Remove this `short *' pointer: use
16179 item_number_t.
16180 * src/system.h (MINSHORT, MAXSHORT): Remove.
16181 Include `limits.h'.
16182 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
16183 (shortcpy): Remove.
16184 (MAXTABLE): Move to...
16185 * src/output.c (MAXTABLE): here.
16186 (prepare_rules): Use output_int_table to output rhs.
16187 * data/bison.simple, data/bison.c++: Adjust.
16188 * tests/torture.at (Big triangle): Move the limit from 254 to
16189 500.
16190 * tests/regression.at (Web2c Actions): Ajust.
16191
16192 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
16193 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
16194 passes, but produces negative #line number, once fixed, GCC is
16195 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
16196 C), it passes.
16197 * src/state.h (state_h): Code input lines on ints, not shorts.
16198
16199 2002-04-08 Akim Demaille <akim@epita.fr>
16200
16201 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
16202 and then the grammar.
16203
16204 2002-04-08 Akim Demaille <akim@epita.fr>
16205
16206 * src/system.h: No longer using strndup.
16207
16208 2002-04-07 Akim Demaille <akim@epita.fr>
16209
16210 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
16211 * src/output.c (output_table_data): Return the longest number.
16212 (prepare_tokens): Output `token_number_max').
16213 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
16214 New.
16215 Use them to define yy_token_number_type/TokenNumberType.
16216 Use this type for yytranslate.
16217 * tests/torture.at (Big triangle): Push the limit from 124 to
16218 253.
16219 * tests/regression.at (Web2c Actions): Adjust.
16220
16221 2002-04-07 Akim Demaille <akim@epita.fr>
16222
16223 * tests/torture.at (Big triangle): New.
16224 (GNU AWK Grammar, GNU Cim Grammar): Move to...
16225 * tests/existing.at: here.
16226
16227 2002-04-07 Akim Demaille <akim@epita.fr>
16228
16229 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
16230 nritems.
16231 Adjust dependencies.
16232
16233 2002-04-07 Akim Demaille <akim@epita.fr>
16234
16235 * src/reader.c: Normalize increments to prefix form.
16236
16237 2002-04-07 Akim Demaille <akim@epita.fr>
16238
16239 * src/reader.c, symtab.c: Remove debugging code.
16240
16241 2002-04-07 Akim Demaille <akim@epita.fr>
16242
16243 Rename all the `bucket's as `symbol_t'.
16244
16245 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
16246 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
16247 * src/symtab.c, src/symtab.h (bucket): Rename as...
16248 (symbol_t): this.
16249 (symbol_list_new, bucket_check_defined, bucket_make_alias)
16250 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
16251 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16252 (buckets_new, buckets_free, buckets_do): Rename as...
16253 (symbol_list_new, symbol_check_defined, symbol_make_alias)
16254 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16255 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
16256 (symbols_new, symbols_free, symbols_do): these.
16257
16258 2002-04-07 Akim Demaille <akim@epita.fr>
16259
16260 Use lib/hash for the symbol table.
16261
16262 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
16263 EOF.
16264 * src/lex.c (lex): Set the `number' member of new terminals.
16265 * src/reader.c (bucket_check_defined, bucket_make_alias)
16266 (bucket_check_alias_consistence, bucket_translation): New.
16267 (reader, grammar_free, readgram, token_translations_init)
16268 (packsymbols): Adjust.
16269 (reader): Number the predefined tokens.
16270 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
16271 for predefined tokens.
16272 * src/symtab.h (bucket): Remove all the hash table related
16273 members.
16274 * src/symtab.c (symtab): Replace by...
16275 (bucket_table): this.
16276 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16277 (buckets_new, buckets_do): New.
16278
16279 2002-04-07 Akim Demaille <akim@epita.fr>
16280
16281 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
16282 (start_symbol, max_user_token_number, semantic_parser)
16283 (error_token_number): Initialize.
16284 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
16285 Initialize.
16286 (reader): Don't.
16287 (errtoken, eoftoken, undeftoken, axiom): Extern.
16288
16289 2002-04-07 Akim Demaille <akim@epita.fr>
16290
16291 * src/gram.h (rule_s): prec and precsym are now pointers
16292 to the bucket giving the priority/associativity.
16293 Member `associativity' removed: useless.
16294 * src/reduce.c, src/conflicts.c: Adjust.
16295
16296 2002-04-07 Akim Demaille <akim@epita.fr>
16297
16298 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
16299 Properly escape the symbols' TAG when outputting them.
16300
16301 2002-04-07 Akim Demaille <akim@epita.fr>
16302
16303 * src/lalr.h (LA): Is a bitsetv, not bitset*.
16304
16305 2002-04-07 Akim Demaille <akim@epita.fr>
16306
16307 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
16308 (LArule): this, which is an array to rule_t*.
16309 * src/print.c, src/conflicts.c: Adjust.
16310
16311 2002-04-07 Akim Demaille <akim@epita.fr>
16312
16313 * src/gram.h (rule_t): Rename `number' as `user_number'.
16314 `number' is a new member.
16315 Adjust dependencies.
16316 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
16317
16318 2002-04-07 Akim Demaille <akim@epita.fr>
16319
16320 As a result of the previous patch, it is no longer needed
16321 to reorder ritem itself.
16322
16323 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
16324
16325 2002-04-07 Akim Demaille <akim@epita.fr>
16326
16327 Be sure never to walk through RITEMS, but use only data related to
16328 the rules themselves. RITEMS should be banished.
16329
16330 * src/output.c (output_token_translations): Rename as...
16331 (prepare_tokens): this.
16332 In addition to `translate', prepare the muscles `tname' and
16333 `toknum', which were handled by...
16334 (output_rule_data): this.
16335 Remove, and move the remainder of its outputs into...
16336 (prepare_rules): this new routines, which also merges content from
16337 (output_gram): this.
16338 (prepare_rules): Be sure never to walk through RITEMS.
16339 (output_stos): Rename as...
16340 (prepare_stos): this.
16341 (output): Always invoke prepare_states, after all, just don't use it
16342 in the output if you don't need it.
16343
16344 2002-04-07 Akim Demaille <akim@epita.fr>
16345
16346 * src/LR0.c (new_state): Display `nstates' as the name of the
16347 newly created state.
16348 Adjust to initialize first_state and last_state if needed.
16349 Be sure to distinguish the initial from the final state.
16350 (new_states): Create the itemset of the initial state, and use
16351 new_state.
16352 * src/closure.c (closure): Now that the initial state has its
16353 items properly set, there is no need for a special case when
16354 creating `ruleset'.
16355
16356 As a result, now the rule 0, reducing to $axiom, is visible in the
16357 outputs. Adjust the test suite.
16358
16359 * tests/conflicts.at (Solved SR Conflicts)
16360 (Unresolved SR Conflicts): Adjust.
16361 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
16362 * tests/conflicts.at (S/R in initial): New.
16363
16364 2002-04-07 Akim Demaille <akim@epita.fr>
16365
16366 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
16367 the RHS of the rules.
16368 * src/output.c (output_gram): Likewise.
16369
16370 2002-04-07 Akim Demaille <akim@epita.fr>
16371
16372 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
16373 bucket.
16374 Adjust all dependencies.
16375 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
16376 `number' of the buckets too.
16377 * src/gram.h: Include `symtab.h'.
16378 (associativity): Move to...
16379 * src/symtab.h: here.
16380 No longer include `gram.h'.
16381
16382 2002-04-07 Akim Demaille <akim@epita.fr>
16383
16384 * src/gram.h, src/gram.c (rules_rhs_length): New.
16385 (ritem_longest_rhs): Use it.
16386 * src/gram.h (rule_t): `number' is a new member.
16387 * src/reader.c (packgram): Set it.
16388 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
16389 the end of `rules', and count them out of `nrules'.
16390 (reduce_output, dump_grammar): Adjust.
16391 * src/print.c (print_grammar): It is no longer needed to check for
16392 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
16393 * tests/reduce.at (Reduced Automaton): New test.
16394
16395 2002-04-07 Akim Demaille <akim@epita.fr>
16396
16397 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
16398 lacking `+ 1' to nrules, Bison reported as useless a token if it
16399 was used solely to set the precedence of the last rule...
16400
16401 2002-04-07 Akim Demaille <akim@epita.fr>
16402
16403 * data/bison.c++, data/bison.simple: Don't output the current file
16404 name in #line, to avoid useless diffs between two identical
16405 outputs under different names.
16406
16407 2002-04-07 Akim Demaille <akim@epita.fr>
16408
16409 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
16410 Normalize loops to using `< nrules + 1', not `<= nrules'.
16411
16412 2002-04-07 Akim Demaille <akim@epita.fr>
16413
16414 * TODO: Update.
16415
16416 2002-04-07 Akim Demaille <akim@epita.fr>
16417
16418 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
16419 bucket.value as bucket.number.
16420
16421 2002-04-07 Akim Demaille <akim@epita.fr>
16422
16423 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
16424 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16425 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
16426 RHS, instead of being an index in RITEMS.
16427
16428 2002-04-04 Paul Eggert <eggert@twinsun.com>
16429
16430 * doc/bison.texinfo: Update copyright date.
16431 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
16432 (Symbols): Warn about running Bison in one character set,
16433 but compiling and/or running in an incompatible one.
16434 Warn about character code 256, too.
16435
16436 2002-04-03 Paul Eggert <eggert@twinsun.com>
16437
16438 * src/bison.data (YYSTACK_ALLOC): Depend on whether
16439 YYERROR_VERBOSE is nonzero, not whether it is defined.
16440
16441 Merge changes from bison-1_29-branch.
16442
16443 2002-03-20 Paul Eggert <eggert@twinsun.com>
16444
16445 Merge fixes from Debian bison_1.34-1.diff.
16446
16447 * configure.in (AC_PREREQ): 2.53.
16448
16449 2002-03-20 Akim Demaille <akim@epita.fr>
16450
16451 * src/conflicts.c (log_resolution): Argument `resolution' is const.
16452
16453 2002-03-19 Paul Eggert <eggert@twinsun.com>
16454
16455 * src/bison.simple (YYCOPY): New macro.
16456 (YYSTACK_RELOCATE): Use it.
16457 Remove Type arg; no longer needed. All callers changed.
16458 (yymemcpy): Remove; no longer needed.
16459
16460 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
16461 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16462
16463 2002-03-19 Akim Demaille <akim@epita.fr>
16464
16465 Test and fix the #line outputs.
16466
16467 * tests/atlocal.at (GCC): New.
16468 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
16469 (Prologue synch line, %union synch line, Postprologue synch line)
16470 (Action synch line, Epilogue synch line): New tests.
16471 * src/reader.c (parse_union_decl): Define the muscle stype_line.
16472 * data/bison.simple, data/bison.c++: Use it.
16473
16474 2002-03-19 Akim Demaille <akim@epita.fr>
16475
16476 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
16477 (Solved SR Conflicts, %expect not enough, %expect right)
16478 (%expect too much): Move to...
16479 * tests/conflicts.at: this new file.
16480
16481 2002-03-19 Akim Demaille <akim@epita.fr>
16482
16483 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16484 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
16485 that we can move to enums for instance.
16486 * src/output.c (token_definitions_output): Output a list of
16487 `token-name, token-number' instead of the #define.
16488 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
16489
16490 2002-03-14 Akim Demaille <akim@epita.fr>
16491
16492 Use Gettext 0.11.1.
16493
16494 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
16495
16496 * data/bison.c++: Make the user able to add members to the generated
16497 parser by subclassing.
16498
16499 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
16500
16501 * src/reader.c (read_additionnal_code): `c' should be an integer, not
16502 a character.
16503 Reported by Nicolas Tisserand and Nicolas Burrus.
16504
16505 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
16506
16507 * src/reader.c: Warn about lacking semi-colons, do not complain.
16508
16509 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
16510
16511 * data/bison.c++: Remove a debug line.
16512
16513 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
16514
16515 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
16516 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
16517 provide a default implementation.
16518
16519 2002-03-04 Akim Demaille <akim@epita.fr>
16520
16521 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
16522 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
16523 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
16524 * tests/semantic.at (Parsing Guards): Similarly.
16525 * src/reader.at (readgram): Complain if the last rule is not ended
16526 with a semi-colon.
16527
16528 2002-03-04 Akim Demaille <akim@epita.fr>
16529
16530 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
16531 * src/closure.c: here.
16532 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
16533 RTC.
16534 * src/warshall.h, src/warshall.c: Remove.
16535 * tests/sets.at (Broken Closure): Adjust.
16536
16537 2002-03-04 Akim Demaille <akim@epita.fr>
16538
16539 * src/output.c (output_skeleton): tempdir is const.
16540 bytes_read is unused.
16541
16542 2002-03-04 Akim Demaille <akim@epita.fr>
16543
16544 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16545 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
16546 Update.
16547 From Michael Hayes.
16548
16549 2002-03-04 Akim Demaille <akim@epita.fr>
16550
16551 * src/closure.c (closure): `r' is unused.
16552
16553 2002-03-04 Akim Demaille <akim@epita.fr>
16554
16555 * tests/sets.at (Broken Closure): Add the ending `;'.
16556 * src/reader.at (readgram): Complain if a rule is not ended with a
16557 semi-colon.
16558
16559 2002-03-04 Akim Demaille <akim@epita.fr>
16560
16561 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
16562 (count_sr_conflicts): Use bitset_count.
16563 * src/reduce.c (inaccessable_symbols): Ditto.
16564 (bits_size): Remove.
16565 * src/warshall.h, src/warshall.c: Convert to bitsetv.
16566
16567 2002-03-04 Akim Demaille <akim@epita.fr>
16568
16569 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
16570 * src/reduce.c: Remove the `bitset_zero's following the
16571 `bitset_create's, as now it is performed by the latter.
16572
16573 2002-03-04 Akim Demaille <akim@epita.fr>
16574
16575 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
16576 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
16577 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
16578 latest sources from Michael.
16579
16580 2002-03-04 Akim Demaille <akim@epita.fr>
16581
16582 * src/output.c (output): Don't free the grammar.
16583 * src/reader.c (grammar_free): New.
16584 * src/main.c (main): Call it and don't free symtab here.
16585
16586 2002-03-04 Akim Demaille <akim@epita.fr>
16587
16588 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
16589 before returning.
16590 Reported by Benoit Perrot.
16591
16592 2002-03-04 Akim Demaille <akim@epita.fr>
16593
16594 Use bitset operations when possible, not loops over bits.
16595
16596 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
16597 bitset_or.
16598 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
16599 * src/reduce.c (useless_nonterminals): Formatting changes.
16600 * src/warshall.c (TC): Use bitset_or.
16601
16602 2002-03-04 Akim Demaille <akim@epita.fr>
16603
16604 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
16605 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
16606 Ditto.
16607
16608 2002-03-04 Akim Demaille <akim@epita.fr>
16609
16610 * src/lalr.c (F): Now a bitset*.
16611 Adjust all dependencies.
16612
16613 2002-03-04 Akim Demaille <akim@epita.fr>
16614
16615 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
16616 Adjust all dependencies.
16617
16618 2002-03-04 Akim Demaille <akim@epita.fr>
16619
16620 * src/L0.c, src/LR0.h (nstates): Be size_t.
16621 Adjust comparisons (signed vs unsigned).
16622 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
16623 bitset*.
16624 Adjust all dependencies.
16625
16626 2002-03-04 Akim Demaille <akim@epita.fr>
16627
16628 * src/closure.c (firsts): Now, also a bitset.
16629 Adjust all dependencies.
16630 (varsetsize): Remove, now unused.
16631 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
16632
16633 2002-03-04 Akim Demaille <akim@epita.fr>
16634
16635 * src/print.c: Convert to use bitset.h, not hand coded iterations
16636 over ints.
16637
16638 2002-03-04 Akim Demaille <akim@epita.fr>
16639
16640 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
16641
16642 2002-03-04 Akim Demaille <akim@epita.fr>
16643
16644 * src/closure.c (ruleset): Be a bitset.
16645 (rulesetsize): Remove.
16646
16647 2002-03-04 Akim Demaille <akim@epita.fr>
16648
16649 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16650 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
16651 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
16652 * src/closure.c (fderives): Be an array of bitsets.
16653
16654 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
16655
16656 * data/bison.c++: Merge the two generated headers. Insert a copyright
16657 notice in each output file.
16658
16659 2002-02-28 Akim Demaille <akim@epita.fr>
16660
16661 * data/bison.c++: Copy the prologue of bison.simple to fetch
16662 useful M4 definitions, such as b4_header_guard.
16663
16664 2002-02-25 Akim Demaille <akim@epita.fr>
16665
16666 * src/getargs.c (version): Give the name of the authors, and use a
16667 translator friendly scheme for the bgr
16668 copyright notice.
16669
16670 2002-02-25 Akim Demaille <akim@epita.fr>
16671
16672 * src/output.c (header_output): Remove, now handled completely via
16673 M4.
16674
16675 2002-02-25 Akim Demaille <akim@epita.fr>
16676
16677 * m4/m4.m4: New, from CVS Autoconf.
16678 * configure.in: Invoke it.
16679 * src/output.c (output_skeleton): Use its result instead of the
16680 hard coded name.
16681
16682 2002-02-25 Akim Demaille <akim@epita.fr>
16683
16684 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
16685 Fileutils 4.1.5.
16686 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
16687 * src/output.c (output_skeleton): Use mkstemp to create a real
16688 temporary file.
16689 Move the filling of `skeleton' and its muscle to...
16690 (prepare): here.
16691 (output): Move the definition of the prologue muscle to...
16692 (prepare): here.
16693 * src/system.h (DEFAULT_TMPDIR): New.
16694
16695 2002-02-14 Paul Eggert <eggert@twinsun.com>
16696
16697 Remove the support for C++ namespace cleanliness; it was
16698 causing more problems than it was curing, since it didn't work
16699 properly on some nonstandard C++ compilers. This can wait
16700 for a proper C++ parser.
16701
16702 * NEWS: Document this.
16703 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
16704 of C++, as it's treated like C now.
16705 * src/bison.simple (YYSTD): Remove.
16706 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
16707 Treat C++ just like Standard C instead of trying to support
16708 namespace cleanliness.
16709
16710 2002-02-14 Akim Demaille <akim@epita.fr>
16711
16712 * tests/regression.at (else): Adjust to Andreas' change.
16713
16714 2002-02-14 Akim Demaille <akim@epita.fr>
16715
16716 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
16717
16718 2002-02-13 Andreas Schwab <schwab@suse.de>
16719
16720 * src/output.c (output_rule_data): Don't output NULL, it might
16721 not be defined yet.
16722
16723 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
16724
16725 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
16726 (Copyright notice): Update.
16727
16728 2002-02-11 Akim Demaille <akim@epita.fr>
16729
16730 * tests/regression.at (%nonassoc and eof): Don't include
16731 nonportable headers.
16732
16733 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
16734
16735 * data/bison.c++: Correct error recovery. Make the user able to
16736 initialize the starting location.
16737
16738 2002-02-07 Akim Demaille <akim@epita.fr>
16739
16740 * tests/input.at: New.
16741
16742 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16743
16744 * data/bison.c++: Replace some direct m4 expansions by constants. Be
16745 more consistent when naming methods and variables. Put preprocessor
16746 directives around tables only needed for debugging.
16747
16748 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16749
16750 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
16751 C++ parsers.
16752 (yy::b4_name::parse): Use print_.
16753
16754 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16755
16756 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
16757
16758 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16759
16760 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
16761 C++ parsers.
16762 (yy::b4_name::parse): Build verbose error messages, and use error_.
16763
16764 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
16765
16766 * data/bison.c++: Fix m4 quoting in comments.
16767
16768 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
16769
16770 * data/bison.c++: Adjust the parser code. Fix some muscles that were
16771 not expanded by m4.
16772
16773 2002-02-05 Akim Demaille <akim@epita.fr>
16774
16775 * data/bison.c++: Adjust to the M4 back end.
16776 More is certainly needed.
16777
16778 2002-02-05 Akim Demaille <akim@epita.fr>
16779
16780 Give a try to M4 as a back end.
16781
16782 * lib/readpipe.c: New, from wdiff.
16783 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
16784 BISON_HAIRY.
16785 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
16786 specific values. Now it is m4 that performs the lookup.
16787 * src/parse-skel.y: Remove.
16788 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
16789 * src/output.c (actions_output, guards_output)
16790 (token_definitions_output): No longer keeps track of the output
16791 line number, hence remove the second argument.
16792 (guards_output): Check against the guard member of a rule, not the
16793 action member.
16794 Adjust callers.
16795 (output_skeleton): Don't look for the skeleton location, let m4 do
16796 that.
16797 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
16798 file will be used.
16799 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
16800 (prepare): Given that for the time being changesyntax is not
16801 usable in M4, rename the muscles using `-' to `_'.
16802 Define `defines_flag', `output_parser_name' and `output_header_name'.
16803 * src/output.h (actions_output, guards_output)
16804 (token_definitions_output): Adjust prototypes.
16805 * src/scan-skel.l: Instead of scanning the skeletons, it now
16806 processes the output of m4: `__oline__' and `#output'.
16807 * data/bison.simple: Adjust to be used by M4(sugar).
16808 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
16809 to date.
16810 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
16811 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
16812 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
16813 shamelessly stolen from CVS Autoconf.
16814
16815 2002-02-05 Akim Demaille <akim@epita.fr>
16816
16817 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
16818 * configure.in: Check for the declarations of free and malloc.
16819 * src/muscle_tab.c: Adjust.
16820
16821 2002-02-05 Akim Demaille <akim@epita.fr>
16822
16823 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
16824 which have no values.
16825
16826 2002-02-05 Akim Demaille <akim@epita.fr>
16827
16828 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
16829 * data/: here.
16830
16831 2002-01-29 Paul Eggert <eggert@twinsun.com>
16832
16833 * src/bison.simple (YYSIZE_T): Do not define merely because
16834 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
16835 On some platforms, <alloca.h> does not declare YYSTD (size_t).
16836
16837 2002-01-27 Akim Demaille <akim@epita.fr>
16838
16839 Fix `%nonassoc and eof'.
16840
16841 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
16842 which were not properly copied! Replace
16843 memcpy (res->errs, src->errs, src->nerrs);
16844 with
16845 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
16846 !!!
16847 * tests/regression.at (%nonassoc and eof): Adjust to newest
16848 Autotest: `.' is not in the PATH.
16849
16850 2002-01-27 Akim Demaille <akim@epita.fr>
16851
16852 * tests/sets.at (AT_EXTRACT_SETS): New.
16853 (Nullable): Use it.
16854 (Firsts): New.
16855
16856 2002-01-26 Akim Demaille <akim@epita.fr>
16857
16858 * tests/actions.at, tests/calc.at, tests/headers.at,
16859 * tests/torture.at: Adjust to the newest Autotest which no longer
16860 forces `.' in the PATH.
16861
16862 2002-01-25 Akim Demaille <akim@epita.fr>
16863
16864 * tests/regression.at (%nonassoc and eof): New.
16865 Suggested by Robert Anisko.
16866
16867 2002-01-24 Akim Demaille <akim@epita.fr>
16868
16869 Bison dumps core when trying to complain about broken input files.
16870 Reported by Cris van Pelt.
16871
16872 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
16873 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
16874 into...
16875 (Invalid inputs): Strengthen: exercise parse_percent_token.
16876
16877 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
16878
16879 * src/Makefile.am: Add bison.c++.
16880 * src/bison.c++: New skeleton.
16881
16882 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
16883
16884 * po/it.po: New.
16885
16886 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
16887
16888 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
16889
16890 2002-01-20 Marc Autret <marc@gnu.org>
16891
16892 * src/files.c (compute_output_file_names): Fix
16893
16894 2002-01-20 Marc Autret <marc@gnu.org>
16895
16896 * tests/output.at: New test.
16897 * src/files.c (compute_base_names): Don't map extensions when
16898 the YACC flag is set, use defaults.
16899 Reported by Evgeny Stambulchik.
16900
16901 2002-01-20 Marc Autret <marc@gnu.org>
16902
16903 * src/system.h: Need to define __attribute__ away for non-GCC
16904 compilers as well (i.e., the vendor C compiler).
16905 Suggested by Albert Chin-A-Young.
16906
16907 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
16908
16909 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
16910 canonical definition.
16911 * src/system.h: Use the canonical definition for PARAMS (avoids
16912 a conflict with the macro from lib/hash.h).
16913
16914 2002-01-11 Akim Demaille <akim@epita.fr>
16915
16916 * configure.in: Use AC_FUNC_STRNLEN.
16917 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
16918
16919 2002-01-09 Akim Demaille <akim@epita.fr>
16920
16921 * src/files.c, src/files.h (output_infix): New.
16922 (tab_extension): Remove.
16923 (compute_base_names): Compute the former, drop the latter.
16924 * src/output.c (prepare): Insert the muscles `output-infix', and
16925 `output-suffix'.
16926 * src/parse-skel.y (string, string.1): New.
16927 (section.header): Use it.
16928 (section.yacc): Remove.
16929 (prefix): Remove too.
16930 * src/scan-skel.l: Adjust.
16931 * src/bison.simple, src/bison.hairy: Adjust.
16932
16933 2002-01-09 Akim Demaille <akim@epita.fr>
16934
16935 * configure.in (WERROR_CFLAGS): Compute it.
16936 * src/Makefile.am (CFLAGS): Pass it.
16937 * tests/atlocal.in (CFLAGS): Idem.
16938 * src/files.c: Fix a few warnings.
16939 (get_extension_index): Remove, unused.
16940
16941 2002-01-08 Akim Demaille <akim@epita.fr>
16942
16943 * src/getargs.c (AS_FILE_NAME): New.
16944 (getargs): Use it to convert DOSish file names.
16945 * src/files.c (base_name): Rename as full_base_name to avoid
16946 clashes with `base_name ()'.
16947 (filename_split): New.
16948 (compute_base_names): N-th rewrite, using filename_split.
16949
16950 2002-01-08 Akim Demaille <akim@epita.fr>
16951
16952 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
16953 New, stolen from the Fileutils 4.1.
16954 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16955 * configure.in: Check for the presence of memrchr, and of its
16956 prototype.
16957
16958 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
16959
16960 * lib/hash.h (__P): Added definition for this macro.
16961 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
16962 BUILT_SOURCES, to ensure they are generated first.
16963 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
16964 %error-verbose to allow bootstrapping with bison 1.30x.
16965
16966 2002-01-06 Akim Demaille <akim@epita.fr>
16967
16968 * src/reader.c (parse_braces): Don't fetch the next char, the
16969 convention is to fetch on entry.
16970 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
16971 'switch' without a following semicolon.
16972 * tests/regression.at (braces parsing): New.
16973
16974 2002-01-06 Akim Demaille <akim@epita.fr>
16975
16976 Bison is dead wrong in its RR conflict reports.
16977
16978 * tests/torture.at (GNU Cim Grammar): New.
16979 * src/conflicts.c (count_rr_conflicts): Fix.
16980
16981 2002-01-06 Akim Demaille <akim@epita.fr>
16982
16983 Creating package.m4 from configure.ac causes too many problems.
16984
16985 * tests/Makefile.am (package.m4): Create it by hand,
16986 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
16987
16988 2002-01-06 Akim Demaille <akim@epita.fr>
16989
16990 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
16991 skeleton.h.
16992
16993 2002-01-04 Paul Eggert <eggert@twinsun.com>
16994
16995 * doc/bison.texinfo (Debugging):
16996 Remove YYSTDERR; it's no longer defined or used.
16997 Also, s/cstdio.h/cstdio/.
16998
16999 2002-01-03 Akim Demaille <akim@epita.fr>
17000
17001 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
17002
17003 2002-01-03 Akim Demaille <akim@epita.fr>
17004
17005 * src/parse-skel.y (process_skeleton): Don't bind the parser's
17006 tracing code to --trace, wait for a better --trace option, with
17007 args.
17008
17009 2002-01-03 Akim Demaille <akim@epita.fr>
17010
17011 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
17012 The ISO C++ standard is extremely clear about it: stderr is
17013 considered a macro, not a regular symbol (see table 94 `Header
17014 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
17015 Therefore std:: does not apply to it. It still does with fprintf.
17016 Also, s/cstdio.h/cstdio/.
17017
17018 2002-01-03 Akim Demaille <akim@epita.fr>
17019
17020 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
17021 for non system headers.
17022
17023 2002-01-02 Akim Demaille <akim@epita.fr>
17024
17025 Equip the skeleton chain with location tracking, runtime trace,
17026 pure parser and scanner.
17027
17028 * src/parse-skel.y: Request a pure parser, locations, and prefix
17029 renaming.
17030 (%union): Having several members with the same type does not help
17031 type mismatches, simplify.
17032 (YYPRINT, yyprint): New.
17033 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
17034 (skel_error): this.
17035 Handle locations.
17036 * src/scan-skel.l: Adjust to these changes.
17037 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
17038 (LOCATION_PRINT, skel_control_t): New.
17039
17040 2001-12-30 Akim Demaille <akim@epita.fr>
17041
17042 * src/parse-skel.y: Get rid of the shift/reduce conflict:
17043 replace `gb' with BLANKS.
17044 * src/scan-skel.l: Adjust.
17045
17046 2001-12-30 Akim Demaille <akim@epita.fr>
17047
17048 * src/system.h: We don't need nor want bcopy.
17049 Throw away MS-DOS crap: we don't need getpid.
17050 * configure.in: We don't need strndup. It was even causing
17051 problems: because Flex includes the headers *before* us,
17052 _GNU_SOURCE is not defined by config.h, and therefore strndup was
17053 not visible.
17054 * lib/xstrndup.c: New.
17055 * src/scan-skel.l: Use it.
17056 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
17057 * src/parse-skel.y: Use %directives instead of #defines.
17058
17059 2001-12-30 Akim Demaille <akim@epita.fr>
17060
17061 * src/skeleton.h: New.
17062 * src/output.c (output_parser, output_master_parser): Remove, dead
17063 code.
17064 * src/output.h (get_lines_number, actions_output, guards_output)
17065 (token_definitions_output): Prototype them.
17066 * src/parse-skel.y: Add the license notice.
17067 Include output.h and skeleton.h.
17068 (process_skeleton): Returns void, and takes a single parameter.
17069 * src/scan-skel.l: Add the license notice.
17070 Include skeleton.h.
17071 Don't use %option yylineno: it seems that then Flex imagines
17072 REJECT has been used, and therefore it won't reallocate its
17073 buffers (which makes no other sense to me than a bug). It results
17074 in warnings for `unused: yy_flex_realloc'.
17075
17076 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
17077
17078 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17079 (MUSCLE_INSERT_PREFIX): ...to there.
17080 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17081 (MUSCLE_INSERT_PREFIX): Move from here...
17082
17083 * src/bison.hairy: Add a section directive. Put braces around muscle
17084 names. This parser skeleton is still broken, but Bison should not
17085 choke on a bad muscle 'syntax'.
17086 * src/bison.simple: Add a section directive. Put braces around muscle
17087 names.
17088
17089 * src/files.h (strsuffix, stringappend): Add declarations.
17090 (tab_extension): Add declaration.
17091 (short_base_name): Add declaration.
17092
17093 * src/files.c (strsuffix, stringappend): No longer static. These
17094 functions are used in the skeleton parser.
17095 (tab_extension): New.
17096 (compute_base_names): Use the computations done in this function
17097 to guess if the generated parsers should have '.tab' in their
17098 names.
17099 (short_base_name): No longer static.
17100
17101 * src/output.c (output_skeleton): New.
17102 (output): Disable call to output_master_parser, and give a try to
17103 a new skeleton handling system.
17104 (guards_output, actions_output): No longer static.
17105 (token_definitions_output, get_lines_number): No longer static.
17106
17107 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
17108
17109 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
17110 parse-skel.y.
17111
17112 * src/parse-skel.y: New file.
17113 * src/scan-skel.l: New file.
17114
17115 2001-12-29 Akim Demaille <akim@epita.fr>
17116
17117 %name-prefix is broken.
17118
17119 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
17120 Adjust all dependencies.
17121 * tests/headers.at (export YYLTYPE): Strengthen this test: use
17122 %name-prefix.
17123
17124 Renaming yylval but not yylloc is not consistent. Now we do.
17125
17126 * src/bison.simple: Prefix yylloc if used.
17127 * doc/bison.texinfo (Decl Summary): Document that.
17128
17129 2001-12-29 Akim Demaille <akim@epita.fr>
17130
17131 * doc/bison.texinfo: Promote `%long-directive' over
17132 `%long_directive'.
17133 Remove all references to fixed-output-files, yacc is enough.
17134
17135 2001-12-29 Akim Demaille <akim@epita.fr>
17136
17137 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
17138 user prologue. These are defaults.
17139 * tests/actions.at (Mid-rule actions): Make sure the user can
17140 define YYDEBUG and YYERROR_VERBOSE.
17141
17142 2001-12-29 Akim Demaille <akim@epita.fr>
17143
17144 * src/output.c (header_output): Don't forget to export YYLTYPE and
17145 yylloc.
17146 * tests/headers.at (export YYLTYPE): New, make sure it does.
17147 * tests/regression.at (%union and --defines, Invalid CPP headers):
17148 Move to...
17149 * tests/headers.at: here.
17150
17151 2001-12-29 Akim Demaille <akim@epita.fr>
17152
17153 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
17154
17155 2001-12-29 Akim Demaille <akim@epita.fr>
17156
17157 * tests/actions.at (Mid-rule actions): Output on a single line
17158 instead of several.
17159
17160 2001-12-29 Akim Demaille <akim@epita.fr>
17161
17162 * doc/bison.texinfo: Formatting changes.
17163
17164 2001-12-29 Akim Demaille <akim@epita.fr>
17165
17166 Don't store the token defs in a muscle, just be ready to output it
17167 on command. Now possible via `symbols'. Fixes a memory leak.
17168
17169 * src/output.c (token_definitions_output): New.
17170 (output_parser, header_output): Use it.
17171 * src/reader.c (symbols_save): Remove.
17172
17173 2001-12-29 Akim Demaille <akim@epita.fr>
17174
17175 * src/bison.simple: Do not provide a default for YYSTYPE and
17176 YYLTYPE before the user's prologue. Otherwise it's hardly... a
17177 default.
17178
17179 2001-12-29 Akim Demaille <akim@epita.fr>
17180
17181 Mid-rule actions are simply... ignored!
17182
17183 * src/reader.c (readgram): Be sure to attach mid-rule actions to
17184 the empty-rule associated to the dummy symbol, not to the host
17185 rule.
17186 * tests/actions.at (Mid-rule actions): New.
17187
17188 2001-12-29 Akim Demaille <akim@epita.fr>
17189
17190 Memory leak.
17191
17192 * src/reader.c (reader): Free grammar.
17193
17194 2001-12-29 Akim Demaille <akim@epita.fr>
17195
17196 Memory leak.
17197
17198 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
17199 since it allocates it for each state, although only one is needed.
17200 (allocate_storage): Do it here.
17201
17202 2001-12-29 Akim Demaille <akim@epita.fr>
17203
17204 * src/options.h, src/options.c (create_long_option_table): Rename
17205 as...
17206 (long_option_table_new): this, with a clearer prototype.
17207 (percent_table): Remove, unused,
17208 * src/getargs.c (getargs): Adjust.
17209
17210 2001-12-29 Akim Demaille <akim@epita.fr>
17211
17212 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
17213 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
17214 as states.
17215
17216 2001-12-29 Akim Demaille <akim@epita.fr>
17217
17218 * src/lalr.c (build_relations): Rename `states' as `states1'.
17219 Sorry, I don't understand exactly what it is, no better name...
17220
17221 2001-12-29 Akim Demaille <akim@epita.fr>
17222
17223 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
17224 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
17225 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
17226 as rules.
17227
17228 2001-12-29 Akim Demaille <akim@epita.fr>
17229
17230 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
17231 ago.
17232
17233 2001-12-29 Akim Demaille <akim@epita.fr>
17234
17235 * src/reader.c, src/reader.h (user_toknums): Remove.
17236 Adjust all users to use symbols[i]->user_token_number.
17237
17238 2001-12-29 Akim Demaille <akim@epita.fr>
17239
17240 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
17241 Adjust all users to use symbols[i]->prec or ->assoc.
17242
17243 2001-12-29 Akim Demaille <akim@epita.fr>
17244
17245 * src/reader.c, src/reader.h (tags): Remove.
17246 Adjust all users to use symbols[i]->tag.
17247
17248 2001-12-29 Akim Demaille <akim@epita.fr>
17249
17250 * src/gram.h, src/gram.c (symbols): New, similar to state_table
17251 and rule_table.
17252 * src/reader.c (packsymbols): Fill this table.
17253 Drop sprec.
17254 * src/conflicts.c (resolve_sr_conflict): Adjust.
17255 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
17256 single table.
17257 Use symbols[i]->tag instead of tags[i].
17258
17259 2001-12-29 Akim Demaille <akim@epita.fr>
17260
17261 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
17262 In addition, put a comment in there, to replace...
17263 * tests/regression.at (%union and C comments): Remove.
17264
17265 2001-12-29 Akim Demaille <akim@epita.fr>
17266
17267 * tests/regression.at (Web2c Actions): Blindly move the actual
17268 output as expected output. The contents *seem* right to me, but I
17269 can't pretend reading perfectly parser tables... Nonetheless, all
17270 the other tests pass correctly, the table look OK, even though the
17271 presence of `$axiom' is to be noted: AFAICS it is useless (but
17272 harmless).
17273
17274 2001-12-29 Akim Demaille <akim@epita.fr>
17275
17276 * src/reader.c (readgram): Don't add the rule 0 if there were no
17277 rules read. In other words, add it _after_ having performed
17278 grammar sanity checks.
17279 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
17280
17281 2001-12-29 Akim Demaille <akim@epita.fr>
17282
17283 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
17284 visible, and some states have now a different number.
17285
17286 2001-12-29 Akim Demaille <akim@epita.fr>
17287
17288 * src/reader.c (readgram): Bind the initial rule's lineno to that
17289 of the first rule.
17290 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
17291 (Solved SR Conflicts): Adjust rule 0's line number.
17292
17293 2001-12-29 Akim Demaille <akim@epita.fr>
17294
17295 Fix the `GAWK Grammar' failure.
17296
17297 * src/LR0.c (final_state): Initialize to -1 so that we do compute
17298 the reductions of the first state which was mistakenly confused
17299 with the final state because precisely final_state was initialized
17300 to 0.
17301 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
17302 now noticed by Bison.
17303 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
17304 have a reduction on $default.
17305
17306 2001-12-29 Akim Demaille <akim@epita.fr>
17307
17308 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
17309 rule line numbers.
17310 * src/closure.c (print_closure): Likewise.
17311 * src/derives.c (print_derives): Likewise.
17312 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
17313 now.
17314
17315 2001-12-29 Akim Demaille <akim@epita.fr>
17316
17317 * src/lalr.c (lookaheads_print): New.
17318 (lalr): Call it when --trace-flag.
17319 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
17320 are dumped.
17321
17322 2001-12-29 Akim Demaille <akim@epita.fr>
17323
17324 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
17325 when walking through ritem, even via rule->rhs.
17326 * src/reduce.c (dump_grammar, useful_production, reduce_output)
17327 (useful_production, useless_nonterminals): Likewise.
17328 (reduce_grammar_tables): Likewise, plus update nritems.
17329 * src/nullable.c (set_nullable): Likewise.
17330 * src/lalr.c (build_relations): Likewise.
17331 * tests/sets.at (Nullable): Adjust.
17332 Fortunately, now, the $axiom is no longer nullable.
17333
17334 2001-12-29 Akim Demaille <akim@epita.fr>
17335
17336 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
17337 the 0-sentinel.
17338 * src/gram.c (ritem_longest_rhs): Likewise.
17339 * src/reduce.c (nonterminals_reduce): Likewise.
17340 * src/print_graph.c (print_graph): Likewise.
17341 * src/output.c (output_rule_data): Likewise.
17342 * src/nullable.c (set_nullable): Likewise.
17343
17344 2001-12-29 Akim Demaille <akim@epita.fr>
17345
17346 * src/output.c: Comment changes.
17347
17348 2001-12-27 Paul Eggert <eggert@twinsun.com>
17349
17350 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
17351 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
17352 Sparc, as they were causing more porting problems than the
17353 (minor) performance improvement was worth.
17354
17355 Also, catch up with 1.31's YYSTD.
17356
17357 2001-12-27 Akim Demaille <akim@epita.fr>
17358
17359 * src/output.c (output_gram): Rely on nritems, not the
17360 0-sentinel. See below.
17361 Use -1 as separator, not 0.
17362 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
17363 Rely on -1 as separator in yyrhs, instead of 0.
17364 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
17365 twice `Now at end of input', therefore there are two lines less to
17366 expect.
17367
17368 2001-12-27 Akim Demaille <akim@epita.fr>
17369
17370 * tests/regression.at (Unresolved SR Conflicts):
17371 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
17372 below.
17373
17374 2001-12-27 Akim Demaille <akim@epita.fr>
17375
17376 * src/LR0.c (new_state): Recognize the final state by the fact it
17377 is reached by eoftoken.
17378 (insert_start_shifting_state, insert_eof_shifting_state)
17379 (insert_accepting_state, augment_automaton): Remove, since now
17380 these states are automatically computed from the initial state.
17381 (generate_states): Adjust.
17382 * src/print.c: When reporting a rule number to the user, substract
17383 1, so that the axiom rule is rule 0, and the first user rule is 1.
17384 * src/reduce.c: Likewise.
17385 * src/print_graph.c (print_core): For the time being, just as for
17386 the report, depend upon --trace-flags to dump the full set of
17387 items.
17388 * src/reader.c (readgram): Once the grammar read, insert the rule
17389 0: `$axiom: START-SYMBOL $'.
17390 * tests/set.at: Adjust: rule 0 is now displayed, and since the
17391 number of the states has changed (the final state is no longer
17392 necessarily the last), catch up.
17393
17394 2001-12-27 Akim Demaille <akim@epita.fr>
17395
17396 Try to make the use of the eoftoken valid. Given that its value
17397 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
17398 is used instead of > 0 where appropriate, (ii), depend upon nritems
17399 instead of the 0-sentinel.
17400
17401 * src/gram.h, src/gram.c (nritems): New.
17402 Expected to be duplication of nitems, but for the time being...
17403 * src/reader.c (packgram): Assert nritems and nitems are equal.
17404 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
17405 * src/closure.c (print_closure, print_fderives): Likewise.
17406 * src/gram.c (ritem_print): Likewise.
17407 * src/print.c (print_core, print_grammar): Likewise.
17408 * src/print_graph.c: Likewise.
17409
17410 2001-12-27 Akim Demaille <akim@epita.fr>
17411
17412 * src/main.c (main): If there are complains after grammar
17413 reductions, then output the report anyway if requested, then die.
17414 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
17415 * src/reader.c (eoftoken): New.
17416 (parse_token_decl): If the token being defined has value `0', it
17417 is the eoftoken.
17418 (packsymbols): No longer hack `tags' to insert `$' by hand.
17419 Be sure to preserve the value of the eoftoken.
17420 (reader): Make sure eoftoken is defined.
17421 Initialize nsyms to 0: now eoftoken is created just like the others.
17422 * src/print.c (print_grammar): Don't special case the eof token.
17423 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
17424 lie anyway, albeit pleasant.
17425 * tests/calc.at: Exercise error messages with eoftoken.
17426 Change the grammar so that empty input is invalid.
17427 Adjust expectations.
17428 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
17429
17430 2001-12-27 Akim Demaille <akim@epita.fr>
17431
17432 * configure.in: Check the protos of strchr ans strspn.
17433 Replace strchr if needed.
17434 * src/system.h: Provide the protos of strchr, strspn and memchr if
17435 missing.
17436 * lib/strchr.c: New.
17437 * src/reader.c (symbols_save): Use strchr.
17438
17439 2001-12-27 Akim Demaille <akim@epita.fr>
17440
17441 * src/print.c, src/print_graph.c (escape): New.
17442 Use it to quote the TAGS outputs.
17443 * src/print_graph.c (print_state): Now errors are in red, and
17444 reductions in green.
17445 Prefer high to wide: output the state number on a line of its own.
17446
17447 2001-12-27 Akim Demaille <akim@epita.fr>
17448
17449 * src/state.h, src/state.c (reductions_new): New.
17450 * src/LR0.c (set_state_table): Let all the states have a
17451 `reductions', even if reduced to 0.
17452 (save_reductions): Adjust.
17453 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
17454 * src/print.c (print_reductions, print_actions): Adjust.
17455 * src/output.c (action_row): Adjust.
17456
17457 2001-12-27 Akim Demaille <akim@epita.fr>
17458
17459 * src/state.h, src/state.c (errs_new, errs_dup): New.
17460 * src/LR0.c (set_state_table): Let all the states have an errs,
17461 even if reduced to 0.
17462 * src/print.c (print_errs, print_reductions): Adjust.
17463 * src/output.c (output_actions, action_row): Adjust.
17464 * src/conflicts.c (resolve_sr_conflict): Adjust.
17465
17466 2001-12-27 Akim Demaille <akim@epita.fr>
17467
17468 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
17469
17470 2001-12-27 Akim Demaille <akim@epita.fr>
17471
17472 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
17473 * src/print.c: here.
17474 (lookaheadset, shiftset): New, used as additional storage by
17475 print_reductions.
17476 (print_results): Adjust.
17477 (print_shifts, print_gotos, print_errs): New, extracted from...
17478 (print_actions): here.
17479 * src/print_graph.c (print_actions): Remove dead code.
17480
17481 2001-12-27 Akim Demaille <akim@epita.fr>
17482
17483 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
17484 `$n' and `@n'.
17485
17486 2001-12-27 Akim Demaille <akim@epita.fr>
17487
17488 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
17489 (build_relations): Adjust.
17490
17491 2001-12-27 Akim Demaille <akim@epita.fr>
17492
17493 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
17494 duplication.
17495
17496 2001-12-27 Akim Demaille <akim@epita.fr>
17497
17498 * src/reader.c (packgram): Catch nitems overflows.
17499
17500 2001-12-27 Akim Demaille <akim@epita.fr>
17501
17502 * src/files.c, src/files.h (guard_obstack): Remove.
17503 * src/output.c (output): Adjust.
17504 * src/reader.c (parse_braces): New, factoring...
17505 (copy_action, copy_guard): these two which are renamed as...
17506 (parse_action, parse_guard): these.
17507 As a voluntary consequence, using braces around guards is now
17508 mandatory.
17509
17510 2001-12-27 Akim Demaille <akim@epita.fr>
17511
17512 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
17513 * src/reader.c (symbol_list): `guard' and `guard_line' are new
17514 members.
17515 (symbol_list_new): Adjust.
17516 (copy_action): action_line is the first line, not the last.
17517 (copy_guard): Just as for actions, store the `action' only, not
17518 the switch/case/break flesh.
17519 Don't parse the user action that might follow the guard, let...
17520 (readgram): do it, i.e., now, there can be an action after a
17521 guard.
17522 In other words the guard is just explicitly optional.
17523 (packgram): Adjust.
17524 * src/output.c (guards_output): New.
17525 (output_parser): Call it when needed.
17526 (output): Also free the guard and attrs obstacks.
17527 * src/files.c, src/files.h (obstack_save): Remove.
17528 (output_files): Remove.
17529 As a result, if one needs the former `.act' file, using an
17530 appropriate skeleton which requires actions and guards is now
17531 required.
17532 * src/main.c (main): Adjust.
17533 * tests/semantic.at: New.
17534 * tests/regression.at: Use `input.y' as input file name.
17535 Avoid 8+3 problems by requiring input.c when the test needs the
17536 parser.
17537
17538 2001-12-27 Akim Demaille <akim@epita.fr>
17539
17540 * src/reader.c (symbol_list_new): Be sure to initialize all the
17541 fields.
17542
17543 2001-12-27 Akim Demaille <akim@epita.fr>
17544
17545 All the hacks using a final pseudo state are now useless.
17546
17547 * src/LR0.c (set_state_table): state_table holds exactly nstates.
17548 * src/lalr.c (nLA): New.
17549 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
17550 instead of lookaheadsp from the pseudo state (nstate + 1).
17551
17552 2001-12-27 Akim Demaille <akim@epita.fr>
17553
17554 * src/output.c (action_row, token_actions): Use a state_t instead
17555 of a integer, and nlookaheads instead of the following state's
17556 lookaheadsp.
17557
17558 2001-12-27 Akim Demaille <akim@epita.fr>
17559
17560 * src/conflicts.c (log_resolution, flush_shift)
17561 (resolve_sr_conflict, set_conflicts, solve_conflicts)
17562 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
17563 (conflicts_print, print_reductions): Use a state_t instead of an
17564 integer when referring to a state.
17565 As much as possible, depend upon nlookaheads, instead of the
17566 `lookaheadsp' member of the following state (since lookaheads of
17567 successive states are successive, the difference between state n + 1
17568 and n served as the number of lookaheads for state n).
17569 * src/lalr.c (add_lookback_edge): Likewise.
17570 * src/print.c (print_core, print_actions, print_state)
17571 (print_results): Likewise.
17572 * src/print_graph.c (print_core, print_actions, print_state)
17573 (print_graph): Likewise.
17574 * src/conflicts.h: Adjust.
17575
17576 2001-12-27 Akim Demaille <akim@epita.fr>
17577
17578 * src/bison.hairy: Formatting/comment changes.
17579 ANSIfy.
17580 Remove `register' indications.
17581 Add plenty of `static'.
17582
17583 2001-12-27 Akim Demaille <akim@epita.fr>
17584
17585 * src/output.c (prepare): Drop the muscle `ntbase' which
17586 duplicates ntokens.
17587 * src/bison.simple: Formatting/comment changes.
17588 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
17589 is an undocumented synonym.
17590
17591 2001-12-22 Akim Demaille <akim@epita.fr>
17592
17593 * src/output.c (output_table_data): Change the prototype to use
17594 `int' for array ranges: some invocations do pass an int, not a
17595 short.
17596 Reported by Wayne Green.
17597
17598 2001-12-22 Akim Demaille <akim@epita.fr>
17599
17600 Some actions of web2c.y are improperly triggered.
17601 Reported by Mike Castle.
17602
17603 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
17604 * tests/regression.at (Web2c): Rename as...
17605 (Web2c Report): this.
17606 (Web2c Actions): New.
17607
17608 2001-12-22 Akim Demaille <akim@epita.fr>
17609
17610 Reductions in web2c.y are improperly reported.
17611 Reported by Mike Castle.
17612
17613 * src/conflicts.c (print_reductions): Fix.
17614 * tests/regression.at (Web2c): New.
17615
17616 2001-12-18 Akim Demaille <akim@epita.fr>
17617
17618 Some host fail on `assert (!"foo")', which expands to
17619 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
17620 Reported by Nelson Beebee.
17621
17622 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
17623 `#define it_succeeded 0' and `assert (it_succeeded)'.
17624
17625 2001-12-17 Marc Autret <autret_m@epita.fr>
17626
17627 * src/bison.simple: Don't hard code the skeleton line and filename.
17628 * src/output.c (output_parser): Rename 'line' as 'output_line'.
17629 New line counter 'skeleton_line' (skeleton-line muscle).
17630
17631 2001-12-17 Paul Eggert <eggert@twinsun.com>
17632
17633 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
17634 YYDEBUG must be defined to a nonzero value.
17635
17636 * src/bison.simple (yytname): Do not assume that the user defines
17637 YYDEBUG to a properly parenthesized expression.
17638
17639 2001-12-17 Akim Demaille <akim@epita.fr>
17640
17641 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
17642 nlookaheads is a new member.
17643 Adjust all users.
17644 * src/lalr.h (nlookaheads): Remove this orphan declaration.
17645 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
17646 state.
17647
17648 2001-12-17 Akim Demaille <akim@epita.fr>
17649
17650 * src/files.h, src/files.c (open_files, close_files): Remove.
17651 * src/main.c (main): Don't open/close files, nor invoke lex_free,
17652 let...
17653 * src/reader.c (reader): Do it.
17654
17655 2001-12-17 Akim Demaille <akim@epita.fr>
17656
17657 * src/conflicts.c (print_reductions): Formatting changes.
17658
17659 2001-12-17 Akim Demaille <akim@epita.fr>
17660
17661 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
17662 (flush_reduce): New.
17663 (resolve_sr_conflict): Adjust.
17664
17665 2001-12-17 Akim Demaille <akim@epita.fr>
17666
17667 * src/output.c (output_obstack): Be static and rename as...
17668 (format_obstack): this, to avoid any confusion with files.c's
17669 output_obstack.
17670 * src/reader.h (muscle_obstack): Move to...
17671 * src/output.h: here, since it's defined in output.c.
17672
17673 2001-12-17 Akim Demaille <akim@epita.fr>
17674
17675 * src/output.c (action_row, save_column, default_goto)
17676 (sort_actions, matching_state, pack_vector): Better variable
17677 locality.
17678
17679 2001-12-17 Akim Demaille <akim@epita.fr>
17680
17681 * src/output.c: Various formatting changes.
17682
17683 2001-12-17 Akim Demaille <akim@epita.fr>
17684
17685 * src/files.c (output_files): Free the output_obstack.
17686 * src/main.c (main): Call print and print_graph conditionally.
17687 * src/print.c (print): Work unconditionally.
17688 * src/print_graph.c (print_graph): Work unconditionally.
17689 * src/conflicts.c (log_resolution): Output only if verbose_flag.
17690
17691 2001-12-16 Marc Autret <autret_m@epita.fr>
17692
17693 * src/output.c (actions_output): Fix. When we use %no-lines,
17694 there is one less line per action.
17695
17696 2001-12-16 Marc Autret <autret_m@epita.fr>
17697
17698 * src/bison.simple: Remove a useless #line directive.
17699 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
17700 * src/output.c (get_lines_number): New.
17701 (output_parser): Adjust, now takes care about the lines of a
17702 output muscles.
17703 Fix line numbering.
17704 (actions_output): Computes the number of lines taken by actions.
17705 (output_master_parser): Insert new skeleton which is the name of
17706 the output parser file name.
17707
17708 2001-12-15 Marc Autret <autret_m@epita.fr>
17709
17710 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
17711
17712 2001-12-15 Marc Autret <autret_m@epita.fr>
17713
17714 * src/output.c (output_gram): Keep track of the hairy one.
17715
17716 2001-12-15 Akim Demaille <akim@epita.fr>
17717
17718 Make `make distcheck' work.
17719
17720 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
17721 system.h which uses libgettext.h.
17722
17723 2001-12-15 Akim Demaille <akim@epita.fr>
17724
17725 * src/nullable.c (set_nullable): Useless rules must be skipped,
17726 otherwise, since we range over their symbols, we might look at a
17727 nonterminal which no longer ``exists'', i.e., it is not counted in
17728 `nvars', hence we overflow our arrays.
17729
17730 2001-12-15 Akim Demaille <akim@epita.fr>
17731
17732 The header can also be produced directly, without any obstack!
17733 Yahoo!
17734
17735 * src/files.c, src/files.h (defines_obstack): Remove.
17736 (compute_header_macro): Global.
17737 (defines_obstack_save): Remove.
17738 * src/reader.c (parse_union_decl): No longer output to
17739 defines_obstack: its content can be found in the `stype' muscle
17740 anyway.
17741 (output_token_translations): Merge into...
17742 (symbols_output): this.
17743 Rename as...
17744 (symbols_save): this.
17745 (reader): Adjust.
17746 * src/output.c (header_output): New.
17747 (output): Call it.
17748
17749 2001-12-15 Akim Demaille <akim@epita.fr>
17750
17751 * src/reader.c (parse_union_decl): Instead of handling two obstack
17752 simultaneously, use one to define the `stype' muscle, and use the
17753 value of the latter to fill defines_obstack.
17754 (copy_comment): Remove.
17755 (copy_comment2): Work for a single obstack.
17756 Rename as...
17757 (copy_comment): this.
17758
17759 2001-12-15 Akim Demaille <akim@epita.fr>
17760
17761 * src/lex.c, src/lex.h (xgetc): No longer static.
17762 * src/reader.c (parse_union_decl): Revamp.
17763
17764 2001-12-15 Akim Demaille <akim@epita.fr>
17765
17766 Still making progress in separating Bison into (i) input, (ii)
17767 process, (iii) output: now we can directly output the parser file
17768 without using table_obstack at all.
17769
17770 * src/files.c, src/files.h (table_obstack): Bye bye.
17771 (parser_file_name): New.
17772 * src/files.c (compute_output_file_names): Compute it.
17773 * src/output.c (actions_output, output_parser)
17774 (output_master_parser): To a file instead of an obstack.
17775
17776 2001-12-15 Akim Demaille <akim@epita.fr>
17777
17778 Attach actions to rules, instead of pre-outputting them to
17779 actions_obstack.
17780
17781 * src/gram.h (rule_t): action and action_line are new members.
17782 * src/reader.c (symbol_list): Likewise.
17783 (copy_action): Save the actions within the rule.
17784 (packgram): Save them in rule_table.
17785 * src/output.c (actions_output): New.
17786 (output_parser): Use it on `%%actions'.
17787 (output_rule_data): Don't free rule_table.
17788 (output): Do it.
17789 (prepare): Don't save the `action' muscle.
17790 * src/bison.simple: s/%%action/%%actions/.
17791
17792 2001-12-15 Akim Demaille <akim@epita.fr>
17793
17794 * src/reader.c (copy_action): When --yacc, don't append a `;'
17795 to the user action: let it fail if lacking.
17796 Suggested by Arnold Robbins and Tom Tromey.
17797
17798 2001-12-14 Akim Demaille <akim@epita.fr>
17799
17800 * src/lex.c (literalchar): Simply return the char you decoded, non
17801 longer mess around with obstacks and int pointers.
17802 Adjust all callers.
17803
17804 2001-12-14 Akim Demaille <akim@epita.fr>
17805
17806 * src/lex.c (literalchar): Don't escape the special characters,
17807 just decode them, and keep them as char (before, eol was output as
17808 the 2 char string `\n' etc.).
17809 * src/output.c (output_rule_data): Use quotearg to output the
17810 token strings.
17811
17812 2001-12-13 Paul Eggert <eggert@twinsun.com>
17813
17814 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
17815 Do not infringe on the global user namespace when using C++.
17816 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
17817 All uses of `fprintf' and `stderr' changed.
17818
17819 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
17820
17821 2001-12-13 Akim Demaille <akim@epita.fr>
17822
17823 The computation of nullable is broken: it doesn't handle empty
17824 RHS's properly.
17825
17826 * tests/torture.at (GNU AWK Grammar): New.
17827 * tests/sets.at (Nullable): New.
17828 * src/nullable.c (set_nullable): Instead of blindly looping over
17829 `ritems', loop over the rules, and then over their rhs's.
17830
17831 Work around Autotest bugs.
17832
17833 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
17834 frame, because Autotest understand lines starting with a `+' as
17835 traces from the shell. Then, they are not processed properly.
17836 Admittedly an Autotest bug, but we don't have time to wait for
17837 Autotest to catch up.
17838 * tests/regression.at (Broken Closure): Adjust to the new table
17839 frames.
17840 Move to...
17841 * tests/sets.at: here.
17842
17843 2001-12-13 Akim Demaille <akim@epita.fr>
17844
17845 * src/closure.c (closure): Use nrules instead of playing tricks
17846 with BITS_PER_WORD.
17847
17848 2001-12-13 Akim Demaille <akim@epita.fr>
17849
17850 * src/print.c (print_actions): Output the handling of `$' as the
17851 traces do: shifting the token EOF. Before EOF was treated as a
17852 nonterminal.
17853 * tests/regression.at: Adjust some tests.
17854 * src/print_graph.c (print_core): Complete the set of items via
17855 closure. The next-to-final and final states are still unsatisfying,
17856 but that's to be addressed elsewhere.
17857 No longer output the rule numbers, but do output the state number.
17858 A single loop for the shifts + gotos is enough, but picked a
17859 distinct color for each.
17860 (print_graph): Initialize and finalize closure.
17861
17862 2001-12-13 Akim Demaille <akim@epita.fr>
17863
17864 * src/reader.c (readgram): Remove dead code, an strip useless
17865 braces.
17866 (get_type): Remove, unused.
17867
17868 2001-12-12 Akim Demaille <akim@epita.fr>
17869
17870 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
17871 on that of lib/error.c.
17872
17873 2001-12-12 Akim Demaille <akim@epita.fr>
17874
17875 Some hosts don't like `/' in includes.
17876
17877 * src/system.h: Include libgettext.h without qualifying the path.
17878 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
17879 $(top_srcdir).
17880
17881 2001-12-11 Marc Autret <autret_m@epita.fr>
17882
17883 * src/output.c (output_parser): Remove useless muscle.
17884
17885 2001-12-11 Marc Autret <autret_m@epita.fr>
17886
17887 * src/bison.simple: Remove #line just before %%epilogue. It
17888 is now handled in ...
17889 * src/reader.c (read_additionnal_code): Add the output of a
17890 #line for the epilogue.
17891
17892 2001-12-10 Marc Autret <autret_m@epita.fr>
17893
17894 * src/reader.c (copy_definition): Re-use CPP-outed code which
17895 replace precedent remove.
17896 * src/bison.simple: Remove #line before %%prologue because
17897 %%input-line is wrong at this time.
17898
17899 2001-12-10 Marc Autret <autret_m@epita.fr>
17900
17901 * src/reader.c (symbols_output): Clean up.
17902 * src/output.c (output_gram, output): Clean up.
17903
17904 2001-12-10 Akim Demaille <akim@epita.fr>
17905
17906 * src/lalr.c (initialize_lookaheads): New. Extracted from...
17907 * src/LR0.c (set_state_table): here.
17908 * src/lalr.c (lalr): Call it.
17909
17910 2001-12-10 Akim Demaille <akim@epita.fr>
17911
17912 * src/state.h (shifts): Remove the `number' member: shifts are
17913 attached to state, hence no longer need to be labelled with a
17914 state number.
17915
17916 2001-12-10 Akim Demaille <akim@epita.fr>
17917
17918 Now that states have a complete set of members, the linked list of
17919 shifts is useless: just fill directly the state's shifts member.
17920
17921 * src/state.h (shifts): Remove the `next' member.
17922 * src/LR0.c (first_state, last_state): Remove.
17923 Adjust the callers.
17924 (augment_automaton): Don't look for the shifts that must be added
17925 a shift on EOF: it is those of the state we looked for! But now,
17926 since shifts are attached, it is no longer needed to looking
17927 merely by its id: its number.
17928
17929 2001-12-10 Akim Demaille <akim@epita.fr>
17930
17931 * src/LR0.c (augment_automaton): Better variable locality.
17932 Remove an impossible branch: if there is a state corresponding to
17933 the start symbol being shifted, then there is shift for the start
17934 symbol from the initial state.
17935
17936 2001-12-10 Akim Demaille <akim@epita.fr>
17937
17938 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
17939 only when appropriate: when insert_start_shifting_state' is not
17940 invoked.
17941 * tests/regression.at (Rule Line Numbers): Adjust.
17942
17943 2001-12-10 Akim Demaille <akim@epita.fr>
17944
17945 * src/LR0.c (augment_automaton): Now that all states have shifts,
17946 merge the two cases addition shifts to the initial state.
17947
17948 2001-12-10 Akim Demaille <akim@epita.fr>
17949
17950 * src/lalr.c (set_state_table): Move to...
17951 * src/LR0.c: here.
17952 * src/lalr.c (lalr): Don't call it...
17953 * src/LR0.c (generate_states): do it.
17954 * src/LR0.h (first_state): Remove, only the table is used.
17955
17956 2001-12-10 Akim Demaille <akim@epita.fr>
17957
17958 * src/LR0.h (first_shift, first_reduction): Remove.
17959 * src/lalr.c: Don't use first_shift: find shifts through the
17960 states.
17961
17962 2001-12-10 Akim Demaille <akim@epita.fr>
17963
17964 * src/LR0.c: Attach shifts to states as soon as they are
17965 computed.
17966 * src/lalr.c (set_state_table): Instead of assigning shifts to
17967 state, just assert that the mapping was properly done.
17968
17969 2001-12-10 Akim Demaille <akim@epita.fr>
17970
17971 * src/LR0.c (insert_start_shift): Rename as...
17972 (insert_start_shifting_state): this.
17973 (insert_eof_shifting_state, insert_accepting_state): New.
17974 (augment_automaton): Adjust.
17975 Better locality of the variables.
17976 When looking if the start_symbol is shifted from the initial
17977 state, using `while (... symbol != start_symbol ...)' sounds
17978 better than `while (... symbol < start_symbol ...)': If fail
17979 to see how the order between symbols could be relevant!
17980
17981 2001-12-10 Akim Demaille <akim@epita.fr>
17982
17983 * src/getargs.h: Don't declare `spec_name_prefix' and
17984 `spec_file_prefix', declared by src/files.h.
17985 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
17986 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
17987 * src/output.c (prepare): Adjust.
17988 * src/reader.c (symbols_output): Likewise.
17989 * src/vmsgetargs.c: Vaguely adjust, but who cares?
17990
17991 2001-12-10 Akim Demaille <akim@epita.fr>
17992
17993 * src/muscle_tab.c (muscle_init): NULL is a better default than
17994 `"0"'.
17995
17996 2001-12-10 Akim Demaille <akim@epita.fr>
17997
17998 * src/reader.c (reader): Calling symbols_output once is enough.
17999
18000 2001-12-10 Akim Demaille <akim@epita.fr>
18001
18002 Now that states have a complete set of members, the linked list of
18003 reductions is useless: just fill directly the state's reductions
18004 member.
18005
18006 * src/state.h (struct reductions): Remove member `number' and
18007 `next'.
18008 * src/LR0.c (first_reduction, last_reduction): Remove.
18009 (save_reductions): Don't link the new reductions, store them in
18010 this_state.
18011 * src/lalr.c (set_state_table): No need to attach reductions to
18012 states, it's already done.
18013 * src/output.c (output_actions): No longer free the shifts, then
18014 the reductions, then the states: free all the states and their
18015 members.
18016
18017 2001-12-10 Akim Demaille <akim@epita.fr>
18018
18019 * src/options.c (OPTN, DRTV, BOTH): New.
18020 (option_table): Use them.
18021
18022 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
18023 the job of system.h.
18024 * src/options.c: Don't include stdio.h and xalloc.h for the same
18025 reasons.
18026
18027 2001-12-10 Akim Demaille <akim@epita.fr>
18028
18029 * src/output.c (output, prepare): Make sure the values of the
18030 muscles `action' and `prologue' are 0-terminated.
18031
18032 2001-12-10 Akim Demaille <akim@epita.fr>
18033
18034 Clean up GCC warnings.
18035
18036 * src/reader.c (copy_action): `buf' is not used.
18037 (parse_skel_decl): Be static.
18038 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
18039 * src/options.h (create_long_option_table): Have a real prototype.
18040 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
18041 (hash_delete_at): Return const void *.
18042 Adjust casts to preserve the const.
18043
18044 2001-12-10 Akim Demaille <akim@epita.fr>
18045
18046 * configure.in: Require 2.52g.
18047 M4 is not needed, but AUTOM4TE is.
18048 * m4/m4.m4: Remove.
18049 * tests/Makefile.am: Adjust.
18050
18051 2001-12-10 Akim Demaille <akim@epita.fr>
18052
18053 One structure for states is enough, even though theoretically
18054 there are LR(0) states and LALR(1) states.
18055
18056 * src/lalr.h (state_t): Remove.
18057 (state_table): Be state_t **, not state_t *.
18058 * src/state.h (core, CORE_ALLOC): Rename as...
18059 (state_t, STATE_ALLOC): this.
18060 Add the LALR(1) members: shifts, reductions, errs.
18061 * src/LR0.c (state_table): Rename as...
18062 (state_hash): this, to avoid name clashes with the global
18063 `state_table'.
18064 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
18065 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
18066
18067 2001-12-10 Akim Demaille <akim@epita.fr>
18068
18069 Bison dumps core on bash.y.
18070 Reported by Pascal Bart.
18071
18072 * src/warshall.c (bitmatrix_print): New.
18073 (TC): Use it.
18074 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
18075 j must be the outer loop.
18076 * tests/regression.at (Broken Closure): New.
18077
18078 2001-12-05 Akim Demaille <akim@epita.fr>
18079
18080 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
18081 its argument.
18082 Reported by Peter Hamorsky.
18083
18084 2001-12-05 Akim Demaille <akim@epita.fr>
18085
18086 * src/conflicts.c (err_table): Remove.
18087 (resolve_sr_conflict): Adjust.
18088 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
18089 Rename as...
18090 (state_t.reductions, state_t.shifts): this.
18091
18092 2001-12-05 Akim Demaille <akim@epita.fr>
18093
18094 * src/reduce.c (reduce_grammar_tables): No longer disable the
18095 removal of useless rules via CPP but via `if (0)', so that the
18096 compiler still check the code is valid.
18097 For instance, it should have noticed `rline' no longer exists: use
18098 the `line' member of rule_t.
18099 * src/gram.c (dummy, rline): Remove, unused.
18100
18101 2001-12-05 Akim Demaille <akim@epita.fr>
18102
18103 * src/output.c (pack_vector): Use assert, not berror.
18104 * src/main.c (berror): Remove, unused.
18105
18106 2001-12-05 Akim Demaille <akim@epita.fr>
18107
18108 New experimental feature: if --verbose --trace output all the
18109 items of a state, not only its kernel.
18110
18111 * src/print.c (print_core): If `trace_flag', then invoke closure
18112 before outputting the items of the state (print_core is no longer
18113 a correct name them).
18114 (print_results): Invoke new_closure/free_closure if needed.
18115
18116 2001-12-05 Akim Demaille <akim@epita.fr>
18117
18118 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
18119 * src/closure.c, src/closure.h (itemsetsize): Rename as...
18120 (nitemset): for consistency with the rest of the project.
18121
18122 2001-12-05 Akim Demaille <akim@epita.fr>
18123
18124 * src/closure.c (print_closure): Improve.
18125 (closure): Use it for printing input and output.
18126
18127 2001-12-05 Akim Demaille <akim@epita.fr>
18128
18129 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
18130 indexed by nonterminals.
18131
18132 2001-12-05 Akim Demaille <akim@epita.fr>
18133
18134 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
18135 what it was!).
18136 * src/warshall.h: Remove accidental duplication of the content.
18137
18138 2001-12-05 Akim Demaille <akim@epita.fr>
18139
18140 * src/closure.c (set_fderives): De-obfuscate.
18141
18142 2001-12-05 Akim Demaille <akim@epita.fr>
18143
18144 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
18145
18146 2001-12-05 Akim Demaille <akim@epita.fr>
18147
18148 * src/closure.c (set_firsts): De-obfuscate.
18149
18150 2001-12-05 Akim Demaille <akim@epita.fr>
18151
18152 * src/output.c (action_row): De-obfuscate
18153 using the good o' techniques: arrays not pointers, variable
18154 locality, BITISSET, RESETBIT etc.
18155
18156 2001-12-05 Akim Demaille <akim@epita.fr>
18157
18158 Pessimize the code to simplify it: from now on, all the states
18159 have a valid SHIFTS, which NSHIFTS is possibly 0.
18160
18161 * src/LR0.c (shifts_new): Be global and move to..
18162 * src/state.c, src/state.h: here.
18163 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
18164 * src/print_graph: Adjust.
18165
18166 2001-12-05 Akim Demaille <akim@epita.fr>
18167
18168 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
18169 * src/conflicts.c: Use it.
18170 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
18171 incorrectly ``simplified''.
18172
18173 2001-12-05 Akim Demaille <akim@epita.fr>
18174
18175 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
18176 using the good o' techniques: arrays not pointers, variable
18177 locality, BITISSET, RESETBIT etc.
18178
18179 2001-12-05 Akim Demaille <akim@epita.fr>
18180
18181 * src/state.h (SHIFT_SYMBOL): New.
18182 * src/conflicts.c: Use it to deobfuscate.
18183
18184 2001-12-05 Akim Demaille <akim@epita.fr>
18185
18186 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
18187 (print_reductions): De-obfuscate using the good o' techniques:
18188 arrays not pointers, variable locality, BITISSET.
18189
18190 2001-12-05 Akim Demaille <akim@epita.fr>
18191
18192 * src/conflicts.c (print_reductions): Arrays, not pointers.
18193 Use BITISSET.
18194
18195 2001-12-05 Akim Demaille <akim@epita.fr>
18196
18197 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18198
18199 2001-12-05 Akim Demaille <akim@epita.fr>
18200
18201 * src/conflicts.c (print_reductions): Improve variable locality.
18202
18203 2001-12-05 Akim Demaille <akim@epita.fr>
18204
18205 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18206
18207 2001-12-05 Akim Demaille <akim@epita.fr>
18208
18209 * src/conflicts.c (print_reductions): Improve variable locality.
18210
18211 2001-12-05 Akim Demaille <akim@epita.fr>
18212
18213 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
18214 * src/lalr.c: Use them.
18215
18216 2001-12-05 Akim Demaille <akim@epita.fr>
18217
18218 * src/LR0.c (augment_automaton): Formatting changes.
18219 Better variable locality.
18220
18221 2001-12-05 Akim Demaille <akim@epita.fr>
18222
18223 * src/lalr.c (matrix_print): New.
18224 (transpose): Use it.
18225 Use arrays instead of pointers.
18226
18227 2001-12-05 Akim Demaille <akim@epita.fr>
18228
18229 * src/lalr.c (maxrhs): Move to...
18230 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
18231 * src/lalr.c (build_relations): Adjust.
18232
18233 2001-12-05 Akim Demaille <akim@epita.fr>
18234
18235 * src/lalr.c (transpose): Free the memory allocated to the
18236 argument, as it is replaced by the results by the unique caller.
18237 (build_relations): Merely invoke transpose: it handles the memory
18238 deallocation.
18239 Improve variable locality.
18240 Avoid variables used as mere abbreviations.
18241 (compute_lookaheads): Use arrays instead of pointers.
18242
18243 2001-12-05 Akim Demaille <akim@epita.fr>
18244
18245 * src/lalr.c (initialize_F): Improve variable locality.
18246 Avoid variables used as mere abbreviations.
18247
18248 2001-12-05 Akim Demaille <akim@epita.fr>
18249
18250 * src/derives.c (print_derives): Display the ruleno.
18251 * src/lalr.c (initialize_F, transpose): Better variable locality
18252 to improve readability.
18253 Avoid variables used as mere abbreviations.
18254
18255 2001-12-05 Akim Demaille <akim@epita.fr>
18256
18257 * src/lalr.c (traverse): Use arrays instead of pointers.
18258
18259 2001-12-05 Akim Demaille <akim@epita.fr>
18260
18261 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
18262 the handling of squeue.
18263 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18264
18265 2001-12-05 Akim Demaille <akim@epita.fr>
18266
18267 Because useless nonterminals are now kept alive (instead of being
18268 `destroyed'), we now sometimes examine them, and store information
18269 related to them. Hence we need to know their number, and adjust
18270 memory allocations.
18271
18272 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
18273 static.
18274 * src/LR0.c (allocate_itemsets): The memory allocated to
18275 `symbol_count' was used for two different purpose: once to count
18276 the number of occurrences of each symbol, and later reassigned to
18277 `shift_symbol', containing the symbol that can be shifted from a
18278 given state.
18279 Deobfuscate, i.e., allocate, use and free `symbol_count' here
18280 only, and...
18281 (new_itemsets): Allocate `shift_symbol' here.
18282 (allocate_itemsets): symbol_count includes useless nonterminals.
18283 Make room for them.
18284 (free_storage): Use `free', not `XFREE', for pointers that cannot
18285 be null.
18286
18287 2001-12-05 Akim Demaille <akim@epita.fr>
18288
18289 * src/nullable.c (set_nullable): Deobfuscate the handling of
18290 ritem.
18291 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18292
18293 2001-12-05 Akim Demaille <akim@epita.fr>
18294
18295 * src/gram.c, src/gram.h (ritem_print): New.
18296 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
18297 (This useless function was defined only to work around VMS linkers
18298 that can't handle compilation units with variables only).
18299 * src/reduce.c (dump_grammar): Use it to trace the construction of
18300 ritem.
18301
18302 2001-12-04 Paul Eggert <eggert@twinsun.com>
18303
18304 * src/bison.simple (union yyalloc): Change member names
18305 to be the same as the stack names.
18306 (yyparse): yyptr is now union yyalloc *, not char *.
18307 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
18308 and may generate better code on some machines.
18309 (yystpcpy): Use prototype if __STDC__ is defined, not just
18310 if __cplusplus is defined.
18311
18312 2001-11-30 Akim Demaille <akim@epita.fr>
18313
18314 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
18315 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
18316 Gettext doesn't compile cleanly, and dies with -Werror.
18317 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
18318 Include WARNING_CFLAGS here.
18319 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
18320 before being defined.
18321
18322 2001-11-27 Paul Eggert <eggert@twinsun.com>
18323
18324 * lib/quotearg.h (quotearg_n, quotearg_n_style):
18325 First arg is int, not unsigned.
18326 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
18327 (SIZE_MAX, UINT_MAX): New macros.
18328 (quotearg_n_options): Abort if N is negative.
18329 Avoid overflow check on hosts where size_t is 64 bits and int
18330 is 32 bits, as overflow is impossible there.
18331 Fix off-by-one typo that caused unnecessary reallocation.
18332
18333 2001-11-29 Paul Eggert <eggert@twinsun.com>
18334
18335 Name space cleanup in generated parser.
18336
18337 * doc/bison.texinfo (Bison Parser): Discuss system headers
18338 and their effect on the user name space.
18339
18340 * src/bison.simple:
18341 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
18342 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
18343 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
18344
18345 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
18346 on user names when possible.
18347
18348 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
18349 Simplify test for whather <alloca.h> exists.
18350
18351 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
18352
18353 (<stdio.h>): Include if YYDEBUG.
18354
18355 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
18356 ! defined (yyoverflow) && ! defined (yymemcpy).
18357
18358 (yymemcpy, yyparse): Rename local variables as needed so that
18359 they all begin with 'yy'.
18360
18361 (yystrlen, yystpcpy): New functions.
18362
18363 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
18364 All uses changed.
18365
18366 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
18367 instead of relying on string.h functions. Use YYSTACK_ALLOC
18368 and YYSTACK_FREE instead of malloc and free.
18369
18370 2001-11-30 Akim Demaille <akim@epita.fr>
18371
18372 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
18373 before their first uses.
18374 (YYBISON, YYPURE): Move to the top of the output.
18375
18376 2001-11-30 Akim Demaille <akim@epita.fr>
18377
18378 * tests/reduce.at (Useless Nonterminals): Fix.
18379
18380 2001-11-30 Akim Demaille <akim@epita.fr>
18381
18382 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
18383 if body instead of `;' to pacify GCC's warnings.
18384
18385 2001-11-30 Akim Demaille <akim@epita.fr>
18386
18387 Instead of mapping the LHS of unused rules to -1, keep the LHS
18388 valid, but flag the rules as invalid.
18389
18390 * src/gram.h (rule_t): `useful' is a new member.
18391 * src/print.c (print_grammar): Adjust.
18392 * src/derives.c (set_derives): Likewise.
18393 * src/reader.c (packgram, reduce_output): Likewise.
18394 * src/reduce.c (reduce_grammar_tables): Likewise.
18395 * tests/reduce.at (Underivable Rules, Useless Rules): New.
18396
18397 2001-11-30 Akim Demaille <akim@epita.fr>
18398
18399 * src/reduce.c (reduce_output): Formatting changes.
18400 * src/print.c (print_results, print_grammar): Likewise.
18401 * tests/regression.at (Rule Line Numbers)
18402 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
18403
18404 2001-11-30 Akim Demaille <akim@epita.fr>
18405
18406 * src/reduce.c (nonterminals_reduce): Instead of throwing away
18407 useless nonterminals, move them at the end of the symbol arrays.
18408 (reduce_output): Adjust.
18409 * tests/reduce.at (Useless Nonterminals): Adjust.
18410
18411 2001-11-30 Akim Demaille <akim@epita.fr>
18412
18413 * src/reduce.c: Various comment/formatting changes.
18414 (nonterminals_reduce): New, extracted from...
18415 (reduce_grammar_tables): here.
18416 (reduce_grammar): Call nonterminals_reduce.
18417
18418 2001-11-29 Paul Eggert <eggert@twinsun.com>
18419
18420 * src/bison.simple (YYSTACK_REALLOC): Remove.
18421 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
18422 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
18423 New macros.
18424 (union yyalloc): New type.
18425 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
18426 an arbitrary restriction on hosts where size_t is wider than int.
18427
18428 (yyparse): Don't dump core if alloca or malloc fails; instead, report
18429 a parser stack overflow. Allocate just one block of memory for all
18430 three stacks, instead of allocating three blocks; this typically is
18431 faster and reduces fragmentation.
18432
18433 Do not limit the number of items in the stack to a value that fits
18434 in 'int', as this is an arbitrary limit on hosts with 64-bit
18435 size_t and 32-bit int.
18436
18437 2001-11-29 Marc Autret <autret_m@epita.fr>
18438
18439 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
18440 of defining YYERROR_VERBOSE.
18441 [AT_DATA]: $4 is now out of C declarations in the prologue.
18442
18443 2001-11-28 Marc Autret <autret_m@epita.fr>
18444
18445 * src/reader.c (parse_dquoted_param): New.
18446 (parse_skel_decl): Use it.
18447 * src/lex.h: Add its prototype.
18448 * src/lex.c (literalchar): Become not static.
18449
18450 2001-11-28 Marc Autret <autret_m@epita.fr>
18451
18452 * src/output.h: And put its extern declaration here.
18453 * src/output.c (error_verbose): Define here.
18454 (prepare): Echo name modification.
18455 * src/getargs.h: Clean its extern declaration.
18456 * src/getargs.c (error_verbose_flag): Remove.
18457 (getargs): Remove case 'e'.
18458 * src/options.c (option_table): 'error-verbose' is now seen as simple
18459 percent option.
18460 Include output.h.
18461
18462 * src/reader.c (read_declarations): Remove case tok_include.
18463 (parse_include_decl): Remove.
18464 * src/lex.h (token_t): Remove tok_include.
18465 * src/options.c (option_table): 'include' is now a simple command line
18466 option.
18467
18468 2001-11-28 Marc Autret <autret_m@epita.fr>
18469
18470 * src/bison.simple: Adjust muscle names.
18471 * src/muscle_tab.c (muscle_init): Also rename the muscles.
18472 * src/output.c (prepare): s/_/-/ for the muscles names.
18473 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
18474
18475 2001-11-28 Marc Autret <autret_m@epita.fr>
18476
18477 * src/bison.simple: Fix debug.
18478 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
18479
18480 2001-11-28 Akim Demaille <akim@epita.fr>
18481
18482 * src/LR0.c (shifts_new): New.
18483 (save_shifts, insert_start_shift, augment_automaton): Use it.
18484
18485 2001-11-28 Akim Demaille <akim@epita.fr>
18486
18487 * src/closure.c (closure): `b' and `ruleno' denote the same value:
18488 keep ruleno only.
18489
18490 2001-11-28 Akim Demaille <akim@epita.fr>
18491
18492 * src/closure.c (closure): Instead of looping over word in array
18493 then bits in words, loop over bits in array.
18494
18495 2001-11-28 Akim Demaille <akim@epita.fr>
18496
18497 * src/closure.c (closure): No longer optimize the special case
18498 where all the bits of `ruleset[r]' are set to 0, to make the code
18499 clearer.
18500
18501 2001-11-28 Akim Demaille <akim@epita.fr>
18502
18503 * src/closure.c (closure): `r' and `c' are new variables, used to
18504 de-obfuscate accesses to RULESET and CORE.
18505
18506 2001-11-28 Akim Demaille <akim@epita.fr>
18507
18508 * src/reduce.c (reduce_print): Use ngettext.
18509 (dump_grammar): Improve the trace accuracy.
18510
18511 2001-11-28 Akim Demaille <akim@epita.fr>
18512
18513 * src/reduce.c (dump_grammar): Don't translate trace messages.
18514
18515 2001-11-28 Akim Demaille <akim@epita.fr>
18516
18517 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
18518 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
18519 as all tags are free'ed afterwards.
18520 From Enrico Scholz.
18521
18522 2001-11-27 Paul Eggert <eggert@twinsun.com>
18523
18524 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
18525 use alloca when we didn't want to, and vice versa.
18526
18527 2001-11-27 Marc Autret <autret_m@epita.fr>
18528
18529 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
18530 initialization.
18531 * src/output.c (prepare): Remove its update.
18532
18533 2001-11-27 Marc Autret <autret_m@epita.fr>
18534
18535 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
18536 Use %error-verbose.
18537
18538 2001-11-27 Marc Autret <autret_m@epita.fr>
18539
18540 * src/bison.simple: Remove YYERROR_VERBOSE using.
18541 Use %%error_verbose.
18542 (yyparse): Likewise.
18543 * src/output.c (prepare): Give its final value.
18544 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
18545 * src/getargs.h: Add its extern declaration.
18546 * src/getargs.c (error_verbose_flag): New int.
18547 (getargs): Update to catch new case.
18548 * src/options.c (option_table): 'error-verbose' is a new option.
18549 (shortopts): Update.
18550
18551 2001-11-27 Akim Demaille <akim@epita.fr>
18552
18553 * src/system.h: Use intl/libgettext.h.
18554 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
18555
18556 2001-11-27 Akim Demaille <akim@epita.fr>
18557
18558 * tests/torture.at (Exploding the Stack Size with Malloc):
18559 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
18560
18561 2001-11-27 Akim Demaille <akim@epita.fr>
18562
18563 * src/files.c: Include error.h.
18564 Reported by Hans Aberg.
18565
18566 2001-11-26 Marc Autret <autret_m@epita.fr>
18567
18568 * src/reader.c (parse_include_decl): New, not yet implemented.
18569 (read_declarations): Add case tok_include.
18570 * src/getargs.h (include): Add its extern definition.
18571 * src/getargs.c (include): New const char *.
18572 (getargs): Add case '-I'.
18573 * src/options.c (option_table): Add include as command line and
18574 percent option.
18575 * src/lex.h (token_t): Add tok_include.
18576
18577 2001-11-26 Akim Demaille <akim@epita.fr>
18578
18579 * src/reader.c (readgram): Make sure rules for mid-rule actions
18580 have a lineno equal to that of their host rule.
18581 Reported by Hans Aberg.
18582 * tests/regression.at (Rule Line Numbers): New.
18583
18584 2001-11-26 Akim Demaille <akim@epita.fr>
18585
18586 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
18587 size_ts.
18588
18589 2001-11-26 Akim Demaille <akim@epita.fr>
18590
18591 * src/complain.c, src/complain.h (error): Remove, provided by
18592 lib/error.[ch].
18593
18594 2001-11-26 Akim Demaille <akim@epita.fr>
18595
18596 * src/reader.c (read_declarations): Don't abort on tok_illegal,
18597 issue an error message.
18598 * tests/regression.at (Invalid %directive): New.
18599 Reported by Hans Aberg.
18600
18601 2001-11-26 Akim Demaille <akim@epita.fr>
18602
18603 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
18604 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18605
18606 2001-11-26 Akim Demaille <akim@epita.fr>
18607
18608 * src/conflicts.c (conflicts_print): Don't complain at all when
18609 there are no reduce/reduce conflicts, and as many shift/reduce
18610 conflicts as expected.
18611 * tests/regression.at (%expect right): Adjust.
18612
18613 2001-11-23 Akim Demaille <akim@epita.fr>
18614
18615 * lib/alloca.c: Update, from fileutils.
18616
18617 2001-11-23 Akim Demaille <akim@epita.fr>
18618
18619 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
18620
18621 2001-11-23 Akim Demaille <akim@epita.fr>
18622
18623 * src/system.h: Include alloca.h.
18624 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
18625
18626 2001-11-23 Akim Demaille <akim@epita.fr>
18627
18628 * src/print_graph.c (print_actions): Remove `rule', unused.
18629 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
18630 pacify GCC's signed < unsigned warnings.
18631 * src/closure.c (itemsetsize): Likewise.
18632 * src/reader.c (symbol_list_new): Static.
18633
18634 2001-11-23 Akim Demaille <akim@epita.fr>
18635
18636 Attaching lineno to buckets is stupid, since only one copy of each
18637 symbol is kept, only the line of the first occurrence is kept too.
18638
18639 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
18640 * src/reader.c (rline_allocated): Remove, unused.
18641 (symbol_list): Have a `line' member.
18642 (symbol_list_new): New.
18643 (readgram): Use it.
18644 * src/print.c (print_grammar): Output the rule line numbers.
18645 * tests/regression.at (Solved SR Conflicts)
18646 (Unresolved SR Conflicts): Adjust.
18647 Reported by Hans Aberg.
18648
18649 2001-11-22 Marc Autret <autret_m@epita.fr>
18650
18651 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
18652
18653 2001-11-22 Marc Autret <autret_m@epita.fr>
18654
18655 * src/muscle_tab.c (muscle_init): Remove initialization of
18656 skeleton muscle.
18657 * src/output.c (output_master_parser): Do it here.
18658
18659 2001-11-20 Akim Demaille <akim@epita.fr>
18660
18661 * po/sv.po: New.
18662 * configure.in (ALL_LINGUAS): Adjust.
18663 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
18664 longer contains strings to translate.
18665
18666 2001-11-19 Akim Demaille <akim@epita.fr>
18667
18668 * src/conflicts.c (conflicts_print): Add a missing \n.
18669
18670 2001-11-19 Akim Demaille <akim@epita.fr>
18671
18672 * src/nullable.c (nullable_print): New.
18673 (set_nullable): Call it when tracing.
18674 Better locality of variables.
18675
18676 2001-11-19 Akim Demaille <akim@epita.fr>
18677
18678 * src/print.c (print_actions): Better locality of variables.
18679
18680 2001-11-19 Akim Demaille <akim@epita.fr>
18681
18682 * src/derives.c (print_derives): Fix and enrich.
18683 * src/closure.c (print_fderives): Likewise.
18684
18685 2001-11-19 Akim Demaille <akim@epita.fr>
18686
18687 * src/closure.c (itemsetend): Remove, replaced with...
18688 (itemsetsize): new.
18689
18690 2001-11-19 Akim Demaille <akim@epita.fr>
18691
18692 * src/LR0.c (kernel_end): Remove, replaced with...
18693 (kernel_size): new.
18694
18695 2001-11-19 Akim Demaille <akim@epita.fr>
18696
18697 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
18698 to clarify.
18699
18700 2001-11-19 Akim Demaille <akim@epita.fr>
18701
18702 * src/closure.c (closure): Use arrays instead of pointers to clarify.
18703
18704 2001-11-19 Akim Demaille <akim@epita.fr>
18705
18706 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
18707 trace messages.
18708 * src/LR0.c: Likewise.
18709 (allocate_itemsets): Use arrays instead of pointers to clarify.
18710
18711 2001-11-19 Akim Demaille <akim@epita.fr>
18712
18713 * src/getargs.c (statistics_flag): Replace with...
18714 (trace_flag): New.
18715 (longopts): Accept --trace instead of --statistics.
18716 * src/getargs.h, src/options.c: Adjust.
18717 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
18718 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
18719
18720 2001-11-19 Akim Demaille <akim@epita.fr>
18721
18722 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
18723 pointers to clarify the code.
18724 (save_reductions, save_shifts): Factor common parts of alternatives.
18725
18726 2001-11-19 Akim Demaille <akim@epita.fr>
18727
18728 * src/LR0.c (new_state, get_state): Complete TRACE code.
18729 * src/closure.c: Include `reader.h' to get `tags', needed by the
18730 trace code.
18731 Rename the conditional DEBUG as TRACE.
18732 Output consistently TRACEs to stderr, not stdout.
18733 * src/derives.c: Likewise.
18734 * src/reduce.c: (inaccessable_symbols): Using if is better style
18735 than goto.
18736 Use `#if TRACE' instead of `#if 0' for tracing code.
18737
18738 2001-11-19 Akim Demaille <akim@epita.fr>
18739
18740 * src/system.h (LIST_FREE, shortcpy): New.
18741 * src/LR0.c: Use them.
18742 * src/output.c (free_itemsets, free_reductions, free_shifts):
18743 Remove, replaced by LIST_FREE.
18744
18745 2001-11-19 Akim Demaille <akim@epita.fr>
18746
18747 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
18748 (REDUCTIONS_ALLOC): New.
18749 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
18750 allocation.
18751
18752 2001-11-19 Akim Demaille <akim@epita.fr>
18753
18754 * src/LR0.c (new_state): Complete trace code.
18755 * src/nullable.c (set_nullable): Don't translate traces.
18756
18757 2001-11-19 Akim Demaille <akim@epita.fr>
18758
18759 * src/print_graph.c (print_core): Better locality of variables.
18760 * src/print.c (print_core): Likewise.
18761
18762 2001-11-19 Akim Demaille <akim@epita.fr>
18763
18764 * src/vcg.c: You do the output, so you are responsible of the
18765 handling of VCG syntax, in particular: use quotearg.
18766 * src/print_graph.c: Don't.
18767 (print_actions): Don't output the actions as part of the nodes,
18768 since that's the job of the edges.
18769 (print_state): Don't output by hand: fill the node description,
18770 and ask for its output.
18771
18772 2001-11-19 Akim Demaille <akim@epita.fr>
18773
18774 * src/bison.simple (yyparse): When verbosely reporting an error,
18775 no longer put additional quotes around token names.
18776 * tests/calc.at: Adjust.
18777
18778 2001-11-19 Akim Demaille <akim@epita.fr>
18779
18780 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
18781 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
18782 * src/output.c: Adjust.
18783
18784 2001-11-19 Akim Demaille <akim@epita.fr>
18785
18786 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
18787 (rule_t): this.
18788 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
18789
18790 2001-11-19 Akim Demaille <akim@epita.fr>
18791
18792 * src/gram.h (rule_t): New.
18793 (rule_table): New.
18794 (rrhs, rlhs): Remove, part of state_t.
18795 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
18796 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18797 * src/reader.c, src/reduce.c: Adjust.
18798
18799 2001-11-19 Akim Demaille <akim@epita.fr>
18800
18801 * src/reader.c (symbols_output): New, extracted from...
18802 (packsymbols): Here.
18803 (reader): Call it.
18804
18805 2001-11-19 Akim Demaille <akim@epita.fr>
18806
18807 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
18808 (maxrhs): this new function.
18809
18810 2001-11-19 Akim Demaille <akim@epita.fr>
18811
18812 * src/lalr.c (F): New macro to access the variable F.
18813 Adjust.
18814
18815 2001-11-19 Akim Demaille <akim@epita.fr>
18816
18817 * src/lalr.h (LA): New macro to access the variable LA.
18818 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18819 * src/lalr.c: Adjust.
18820
18821 2001-11-19 Akim Demaille <akim@epita.fr>
18822
18823 * src/lalr.c (initialize_LA): Only initialize LA. Let...
18824 (set_state_table): handle the `lookaheads' members.
18825
18826 2001-11-19 Akim Demaille <akim@epita.fr>
18827
18828 * src/lalr.h (lookaheads): Removed array, whose contents is now
18829 a member of...
18830 (state_t): this structure.
18831 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18832 Adjust.
18833
18834 2001-11-19 Akim Demaille <akim@epita.fr>
18835
18836 * src/lalr.h (consistent): Removed array, whose contents is now
18837 a member of...
18838 (state_t): this structure.
18839 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18840 Adjust.
18841
18842 2001-11-19 Akim Demaille <akim@epita.fr>
18843
18844 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
18845 contents are now members of...
18846 (state_t): this structure.
18847 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18848 Adjust.
18849
18850 2001-11-19 Akim Demaille <akim@epita.fr>
18851
18852 * src/lalr.h (state_t): New.
18853 (state_table): Be a state_t * instead of a core **.
18854 (accessing_symbol): Remove, part of state_t.
18855 * src/lalr.c: Adjust.
18856 (set_accessing_symbol): Merge into...
18857 (set_state_table): this.
18858 * src/print_graph.c, src/conflicts.c: Adjust.
18859
18860 2001-11-14 Akim Demaille <akim@epita.fr>
18861
18862 * tests/calc.at, tests/output.at, tests/regression.at,
18863 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
18864 now the tests are run in private dirs, therefore AC_CLEANUP and
18865 family can be simplified to 0-ary.
18866 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
18867 use abs. path to find config.h.
18868 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
18869 stderr, there can be way too much random noise.
18870 Instead pass -Werror to GCC and rely on the exit status.
18871 Reported by Wolfram Wagner.
18872
18873 2001-11-14 Akim Demaille <akim@epita.fr>
18874
18875 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
18876 defined only if yyoverflow is defined, to avoid `warning: unused
18877 variable `yyvs1''.
18878 Reported by The Test Suite.
18879
18880 2001-11-14 Akim Demaille <akim@epita.fr>
18881
18882 * src/print.c: Include reduce.h.
18883 Reported by Hans Aberg.
18884
18885 2001-11-14 Akim Demaille <akim@epita.fr>
18886
18887 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
18888 Revert a previous patch: these are really const.
18889 * src/conflicts.c (conflict_report): Additional useless pair of
18890 braces to pacify GCC's warnings for `if () if () {} else {}'.
18891 * src/lex.c (parse_percent_token): Replace equal_offset with
18892 arg_offset.
18893 arg is const.
18894 Be sure to strdup `arg' when used, since there is no reason for
18895 token_buffer not to change.
18896
18897 2001-11-14 Akim Demaille <akim@epita.fr>
18898
18899 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
18900 definition.
18901 * src/main.c (main): Use them.
18902 Suggested by Hans Aberg.
18903
18904 2001-11-12 Akim Demaille <akim@epita.fr>
18905
18906 * src/system.h (ngettext): Now that we use ngettext, be sure to
18907 provide a default definition when NLS are not used.
18908
18909 2001-11-12 Akim Demaille <akim@epita.fr>
18910
18911 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
18912 Use @kbd to denote user input.
18913 (Language and Grammar): ANSIfy the example.
18914 Adjust its layout for info/notinfo.
18915 (Location Tracking Calc): Output error messages to stderr.
18916 Output locations in a more GNUtically correct way.
18917 Fix a couple of Englishos.
18918 Adjust @group/@end group pairs.
18919
18920 2001-11-12 Akim Demaille <akim@epita.fr>
18921
18922 %expect was not functioning at all.
18923
18924 * src/conflicts.c (expected_conflicts): Set to -1.
18925 (conflict_report): Use ngettext.
18926 (conflicts_print): Check %expect and make its violation an error.
18927 * doc/bison.texinfo (Expect Decl): Adjust.
18928 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
18929 * tests/regression.at (%expect not enough, %expect right)
18930 (%expect too much): New.
18931
18932 2001-11-12 Akim Demaille <akim@epita.fr>
18933
18934 * tests/regression.at (Conflicts): Rename as...
18935 (Unresolved SR Conflicts): this.
18936 (Solved SR Conflicts): New.
18937
18938 2001-11-12 Akim Demaille <akim@epita.fr>
18939
18940 * src/reduce.c (print_results): Rename as...
18941 (reduce_output): This.
18942 Output to OUT, passed as argument, instead of output_obstack.
18943 (dump_grammar): Likewise.
18944 (reduce_free): New.
18945 Also free V1.
18946 (reduce_grammar): No longer call reduce_output, since...
18947 * src/print.c (print_results): do it.
18948 * src/main.c (main): Call reduce_free;
18949
18950 2001-11-12 Akim Demaille <akim@epita.fr>
18951
18952 * src/conflicts.c (print_reductions): Accept OUT as argument.
18953 Output to it, not to output_obstack.
18954 * src/print.c (print_actions): Adjust.
18955
18956 2001-11-12 Akim Demaille <akim@epita.fr>
18957
18958 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
18959 the result instead of using...
18960 (src_total, rrc_total, src_count, rrc_count): Remove.
18961 (any_conflicts): Remove.
18962 (print_conflicts): Split into...
18963 (conflicts_print, conflicts_output): New.
18964 * src/conflicts.h: Adjust.
18965 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
18966 * src/print.c (print_grammar): Issue `\n' between two rules.
18967 * tests/regression.at (Conflicts): New.
18968 Reported by Tom Lane.
18969
18970 2001-11-12 Akim Demaille <akim@epita.fr>
18971
18972 * tests/regression.at (Invalid input): Remove, duplicate with
18973 ``Invalid input: 1''.
18974
18975 2001-11-12 Akim Demaille <akim@epita.fr>
18976
18977 * tests/torture.at (AT_DATA_STACK_TORTURE)
18978 (Exploding the Stack Size with Alloca)
18979 (Exploding the Stack Size with Malloc): New.
18980
18981 2001-11-12 Akim Demaille <akim@epita.fr>
18982
18983 * src/bison.simple (YYSTACK_REALLOC): New.
18984 (yyparse) [!yyoverflow]: Use it and free the old stack.
18985 Reported by Per Allansson.
18986
18987 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
18988
18989 * src/bison.simple: Define type yystype instead of YYSTYPE, and
18990 define CPP macro, which substitute YYSTYPE by yystype.
18991 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
18992 with yyltype/YYLTYPE. This allows inclusion of the generated
18993 header within the parser if the compiler, such as GGC, accepts
18994 multiple equivalent #defines.
18995 From Akim.
18996
18997 2001-11-05 Akim Demaille <akim@epita.fr>
18998
18999 * src/reader.c (symbols_output): New, extracted from...
19000 (packsymbols): here.
19001 (reader): Adjust.
19002
19003 2001-11-05 Akim Demaille <akim@epita.fr>
19004
19005 * src/lex.c (parse_percent_token): s/quotearg/quote/.
19006
19007 2001-11-05 Akim Demaille <akim@epita.fr>
19008
19009 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
19010 pattern.
19011
19012 2001-11-05 Akim Demaille <akim@epita.fr>
19013
19014 * src/options.h (struct option_table_struct): set_flags is void*.
19015 * src/options.c (longopts): Support `--output' and `%output'.
19016 (usage): Adjust.
19017 * src/lex.h (tok_setopt): Remove, replaced with...
19018 (tok_intopt, tok_stropt): these new guys.
19019 * src/lex.c (getopt.h): Not needed.
19020 (token_buffer, unlexed_token_buffer): Not const.
19021 (percent_table): Promote `-' over `_' in directive names.
19022 Active `%name-prefix', `file-prefix', and `output'.
19023 (parse_percent_token): Accept possible arguments to directives.
19024 Promote `-' over `_' in directive names.
19025
19026 2001-11-04 Akim Demaille <akim@epita.fr>
19027
19028 * doc/bison.texinfo (Decl Summary): Split the list into
19029 `directives for grammars' and `directives for bison'.
19030 Sort'em.
19031 Add description of `%name-prefix', `file-prefix', and `output'.
19032 Promote `-' over `_' in directive names.
19033 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
19034 Simplify the description of `--name-prefix'.
19035 Promote `-' over `_' in directive names.
19036 Promote `--output' over `--output-file'.
19037 Fix the description of `--defines'.
19038 * tests/output.at: Exercise %file-prefix and %output.
19039
19040 2001-11-02 Akim Demaille <akim@epita.fr>
19041
19042 * doc/refcard.tex: Update.
19043
19044 2001-11-02 Akim Demaille <akim@epita.fr>
19045
19046 * src/symtab.h (SUNDEF): New.
19047 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
19048 stand for `uninitialized', instead of 0.
19049 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
19050 * src/lex.c (lex): Adjust.
19051
19052 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
19053 Number it 0.
19054 Let yylex return it instead of a plain 0.
19055 Reported by Dick Streefland.
19056
19057 2001-11-02 Akim Demaille <akim@epita.fr>
19058
19059 * tests/regression.at (Mixing %token styles): New test.
19060
19061 2001-11-02 Akim Demaille <akim@epita.fr>
19062
19063 * src/reader.c (parse_thong_decl): Formatting changes.
19064 (token_translations_init): New, extracted from...
19065 (packsymbols): Here.
19066 Adjust.
19067
19068 2001-11-01 Akim Demaille <akim@epita.fr>
19069
19070 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
19071 Check that `9foo.y' produces correct cpp guards.
19072 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
19073 guards.
19074 Reported by Wwp.
19075
19076 2001-11-01 Akim Demaille <akim@epita.fr>
19077
19078 * tests/regression.at (Invalid input: 2): New.
19079 * src/lex.c (unlexed_token_buffer): New.
19080 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
19081 too.
19082 Reported by Wwp.
19083
19084 2001-11-01 Akim Demaille <akim@epita.fr>
19085
19086 * tests/calc.at: Catch up with 1.30.
19087 * configure.in: Bump to 1.49a.
19088 Adjust to newer Autotest.
19089
19090 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
19091
19092 * src/conflicts.c: Move global variables rrc_total and src_total ...
19093 (print_conflicts): here.
19094 * src/output.c (output): Free global variable user_toknums.
19095 * src/lex.c (token_obstack): Become static.
19096
19097 2001-10-18 Akim Demaille <akim@epita.fr>
19098
19099 * tests/atlocal.in (GCC): Add.
19100 * tests/calc.at: s/m4_match/m4_bmatch/.
19101 s/m4_patsubst/m4_bpatsubst/.
19102 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
19103 * configure.in: AC_SUBST(GCC).
19104
19105 2001-10-14 Marc Autret <autret_m@epita.fr>
19106
19107 * src/options.c (create_long_option_table): Fix.
19108
19109 2001-10-10 Akim Demaille <akim@epita.fr>
19110
19111 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
19112
19113 2001-10-04 Akim Demaille <akim@epita.fr>
19114
19115 * src/reader.c (parse_union_decl): Push the caracters in
19116 union_obstack, not attrs_obstack.
19117
19118 2001-10-04 Akim Demaille <akim@epita.fr>
19119
19120 Merge in the branch 1.29.
19121
19122 * src/reader.c (packsymbols): Use a temporary obstack for
19123 `%%tokendef', since output_stack is already used elsewhere.
19124
19125 2001-10-02 Akim Demaille <akim@epita.fr>
19126
19127 Bump 1.29d.
19128
19129 2001-10-02 Akim Demaille <akim@epita.fr>
19130
19131 Version 1.29c.
19132
19133 2001-10-02 Akim Demaille <akim@epita.fr>
19134
19135 * tests/regression.at (Invalid CPP headers): New.
19136 From Alexander Belopolsky.
19137 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
19138
19139 2001-10-02 Akim Demaille <akim@epita.fr>
19140
19141 * tests/regression.at (Invalid input): New.
19142 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
19143 Reported by Shura.
19144
19145 2001-10-02 Akim Demaille <akim@epita.fr>
19146
19147 * tests/calc.at: Now that --debug works, the tests must be adjusted.
19148
19149 2001-10-02 Akim Demaille <akim@epita.fr>
19150
19151 * src/output.c (output_parser): Assert `skeleton'.
19152 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
19153 systems.
19154 From Shura.
19155
19156 2001-10-01 Marc Autret <autret_m@epita.fr>
19157
19158 * src/lex.h: Echo modifications.
19159 * src/lex.c (unlex): Parameter is now token_t.
19160 From Hans Aberg.
19161
19162 2001-10-01 Marc Autret <autret_m@epita.fr>
19163
19164 * src/main.c: Include lex.h.
19165 From Hans Aberg.
19166
19167 2001-09-29 Akim Demaille <akim@epita.fr>
19168
19169 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
19170
19171 2001-09-28 Akim Demaille <akim@epita.fr>
19172
19173 * tests/testsuite.at: Update to newer Autotest.
19174 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
19175
19176 2001-09-27 Akim Demaille <akim@epita.fr>
19177
19178 Position independent wrapper.
19179
19180 * tests/bison: Remove.
19181 * tests/bison.in: New.
19182 * configure.in: Adjust.
19183
19184 2001-09-27 Paul Eggert <eggert@twinsun.com>
19185
19186 Port quotearg fixes from tar 1.13.24.
19187
19188 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
19189 tm to be declared.
19190 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
19191 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
19192
19193 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
19194 * m4/mbrtowc.m4: New file.
19195 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
19196 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
19197
19198 2001-09-27 Akim Demaille <akim@epita.fr>
19199
19200 Bump to 1.29c.
19201
19202 2001-09-27 Akim Demaille <akim@epita.fr>
19203
19204 Version 1.29b.
19205
19206 2001-09-25 Akim Demaille <akim@epita.fr>
19207
19208 * src/system.h: Include `xalloc.h'.
19209 Remove it from the C files.
19210 * src/files.c (output_files): Free the obstacks.
19211 * src/lex.c (init_lex): Rename as...
19212 (lex_init): this.
19213 (lex_free): New.
19214 * src/main.c (main): Use it.
19215
19216 2001-09-24 Marc Autret <autret_m@epita.fr>
19217
19218 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
19219 to output informations in fout (FILE*).
19220 (open_graph, close_graph): Likewise.
19221 (output_graph, output_edge, output_node): Likewise.
19222 * src/vcg.h: Update function prototypes.
19223 * src/print_graph.c (print_graph): Open output graph file.
19224 (print_actions): Adjust.
19225 * src/files.h: Remove extern declaration.
19226 * src/files.c: Remove graph_obstack declaration.
19227 (open_files): Remove graph_obstack initialization.
19228 (output_files): Remove graph_obstack saving.
19229
19230 2001-09-24 Marc Autret <autret_m@epita.fr>
19231
19232 * src/files.c (compute_output_file_names): Fix.
19233
19234 2001-09-24 Marc Autret <autret_m@epita.fr>,
19235 Akim Demaille <akim@epita.fr>
19236
19237 * src/reader.c (reader): Remove call to free_symtab ().
19238 * src/main.c (main): Call it here.
19239 Include symtab.h.
19240 * src/conflicts.c (initialize_conflicts): Rename as...
19241 (solve_conflicts): this.
19242 * src/print.c (print_core, print_actions, print_state)
19243 (print_grammar): Dump to a file instead a `output_obstack'.
19244 (print_results): Dump `output_obstack', and then proceed with the
19245 FILE *.
19246 * src/files.c (compute_output_file_names, close_files): New.
19247 (output_files): Adjust.
19248 * src/main.c (main): Adjust.
19249
19250 2001-09-23 Marc Autret <autret_m@epita.fr>
19251
19252 * src/files.c (compute_header_macro): Computes header macro name
19253 from spec_defines_file when given.
19254
19255 2001-09-23 Marc Autret <autret_m@epita.fr>
19256
19257 * src/files.c (output_files): Add default extensions.
19258
19259 2001-09-22 Akim Demaille <akim@epita.fr>
19260
19261 * src/conflicts.c (finalize_conflicts): Rename as...
19262 (free_conflicts): this.
19263
19264 2001-09-22 Akim Demaille <akim@epita.fr>
19265
19266 * src/gram.c (gram_free): Rename back as...
19267 (dummy): this.
19268 (output_token_translations): Free `token_translations'.
19269 * src/symtab.c (free_symtab): Free the tag field.
19270
19271 2001-09-22 Akim Demaille <akim@epita.fr>
19272
19273 Remove `translations' as it is always set to true.
19274
19275 * src/gram.h: Adjust.
19276 * src/reader.c (packsymbols, parse_token_decl): Adjust
19277 * src/print.c (print_grammar): Adjust.
19278 * src/output.c (output_token_translations): Adjust.
19279 * src/lex.c (lex): Adjust.
19280 * src/gram.c: Be sure the set pointers to NULL.
19281 (dummy): Rename as...
19282 (gram_free): this.
19283
19284 2001-09-22 Akim Demaille <akim@epita.fr>
19285
19286 * configure.in: Invoke AM_LIB_DMALLOC.
19287 * src/system.h: Use dmalloc.
19288 * src/LR0.c: Be sure to have pointers initialized to NULL.
19289 (allocate_itemsets): Allocate kernel_items only if needed.
19290
19291 2001-09-22 Akim Demaille <akim@epita.fr>
19292
19293 * configure.in: Bump to 1.29b.
19294 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
19295 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
19296 need xmalloc.c in calc.y.
19297 From Pascal Bart.
19298
19299 2001-09-21 Akim Demaille <akim@epita.fr>
19300
19301 Version 1.29a.
19302 * Makefile.maint, config/config.guess, config/config.sub,
19303 * config/missing: Update from masters.
19304 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
19305 upon package.m4.
19306 * configure.in (ALL_LINGUAS): Add `tr'.
19307
19308 2001-09-21 Akim Demaille <akim@epita.fr>
19309
19310 * tests/Makefile.am (package.m4): Move to...
19311 ($(srcdir)/$(TESTSUITE)): here.
19312
19313 2001-09-20 Akim Demaille <akim@epita.fr>
19314
19315 * src/complain.c: No longer try to be standalone: use system.h.
19316 Don't assume __STDC__ is defined to 1. Just test if it is defined.
19317 * src/complain.h: Likewise.
19318 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
19319 Remove the unused variable `n'.
19320 From Albert Chin-A-Young.
19321
19322 2001-09-18 Marc Autret <autret_m@epita.fr>
19323
19324 * doc/bison.1: Update.
19325 * doc/bison.texinfo (Bison Options): Update --defines and --graph
19326 descriptions.
19327 (Option Cross Key): Update.
19328 Add --graph.
19329
19330 2001-09-18 Marc Autret <autret_m@epita.fr>
19331
19332 * tests/regression.at: New test (comment in %union).
19333
19334 2001-09-18 Marc Autret <autret_m@epita.fr>
19335
19336 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
19337 do that.
19338 Reported by Keith Browne.
19339
19340 2001-09-18 Marc Autret <autret_m@epita.fr>
19341
19342 * tests/output.at: Add tests for --defines and --graph.
19343
19344 2001-09-18 Marc Autret <autret_m@epita.fr>
19345
19346 * tests/output.at: Removes tests of %{header,src}_extension features.
19347
19348 2001-09-18 Akim Demaille <akim@epita.fr>
19349
19350 * tests/Makefile.am (package.m4): New.
19351 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
19352 (_AT_CHECK_CALC_ERROR): Likewise.
19353 Factor the `, ' part of verbose error messages.
19354
19355 2001-09-18 Marc Autret <autret_m@epita.fr>
19356
19357 * src/getargs.c (longopts): Declare --defines and --graph as options
19358 with optional arguments.
19359 * src/files.h: Add extern declarations.
19360 * src/files.c (spec_graph_file, spec_defines_file): New.
19361 (output_files): Update.
19362 Remove CPP-outed code.
19363
19364 2001-09-18 Marc Autret <autret_m@epita.fr>
19365
19366 Turn off %{source,header}_extension feature.
19367
19368 * src/files.c (compute_exts_from_gf): Update.
19369 (compute_exts_from_src): Update.
19370 (output_files): CPP-out useless code.
19371 * src/files.h: Remove {header,source}_extension extern declarations.
19372 * src/reader.c (parse_dquoted_param): CPP-out.
19373 (parse_header_extension_decl): Remove.
19374 (parse_source_extension_decl): Remove.
19375 (read_declarations): Remove cases tok_{hdrext,srcext}.
19376 * src/lex.c (percent_table): Remove {header,source}_extension entries.
19377 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
19378
19379 2001-09-10 Akim Demaille <akim@epita.fr>
19380
19381 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
19382 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
19383 (AT_CHECK_OUTPUT): this.
19384 Merely check ls' exit status, its output is useless.
19385
19386 2001-09-10 Akim Demaille <akim@epita.fr>
19387
19388 * tests/calc.at: Use m4_match.
19389 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
19390
19391 2001-09-10 Marc Autret <autret_m@epita.fr>,
19392 Akim Demaille <akim@epita.fr>
19393
19394 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
19395 enum color_e.
19396 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
19397 to `normal'.
19398 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
19399 * src/lex.h: Adjust prototype.
19400 (token_t): Add `tok_undef'.
19401 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
19402 (parse_percent_token): Now returns token_t.
19403 Add default statement in switch.
19404 (lex): Separate `c' as an input variable, from the token_t result
19405 part.
19406 (unlexed): Is a token_t.
19407
19408 2001-09-10 Akim Demaille <akim@epita.fr>
19409
19410 * configure.in: Bump to 1.29a.
19411
19412 2001-09-07 Akim Demaille <akim@epita.fr>
19413
19414 Version 1.29.
19415
19416 2001-08-30 Akim Demaille <akim@epita.fr>
19417
19418 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
19419 * m4/atconfig.m4: Remove.
19420 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
19421 * tests/bison: New.
19422 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
19423 m4_if, m4_patsubst, and m4_regexp.
19424 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
19425 `input' file instead of echo.
19426
19427 2001-08-29 Akim Demaille <akim@epita.fr>
19428
19429 Bump to 1.28e.
19430
19431 2001-08-29 Akim Demaille <akim@epita.fr>
19432
19433 Version 1.28d.
19434
19435 2001-08-29 Paul Eggert <eggert@twinsun.com>
19436
19437 * src/bison.simple (yyparse): Don't take the address of an
19438 item before the start of an array, as that doesn't conform to
19439 the C Standard.
19440
19441 2001-08-29 Robert Anisko <anisko_r@epita.fr>
19442
19443 * doc/bison.texinfo (Location Tracking Calc): New node.
19444
19445 2001-08-29 Paul Eggert <eggert@twinsun.com>
19446
19447 * src/output.c (output): Do not define const, as this now
19448 causes more problems than it cures.
19449
19450 2001-08-29 Akim Demaille <akim@epita.fr>
19451
19452 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
19453 the nodes.
19454 Be sure to tag the `detailmenu'.
19455
19456 2001-08-29 Akim Demaille <akim@epita.fr>
19457
19458 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
19459 download in a tmp dir.
19460
19461 2001-08-28 Marc Autret <autret_m@epita.fr>
19462
19463 * config/depcomp: New file.
19464
19465 2001-08-28 Marc Autret <autret_m@epita.fr>
19466
19467 * doc/bison.1 (mandoc): Adjust.
19468 From Juan Manuel Guerrero.
19469
19470 2001-08-28 Marc Autret <autret_m@epita.fr>
19471
19472 * src/print_graph.c (print_state): Fix.
19473
19474 2001-08-27 Marc Autret <autret_m@epita.fr>
19475
19476 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
19477 char * members.
19478 Echo modifications to the functions prototypes.
19479 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
19480
19481 2001-08-27 Marc Autret <autret_m@epita.fr>
19482
19483 * src/vcg.c: Include `xalloc.h'.
19484 (add_colorentry): New.
19485 (add_classname): New.
19486 (add_infoname): New.
19487 * src/vcg.h: Add new prototypes.
19488
19489 2001-08-27 Akim Demaille <akim@epita.fr>
19490
19491 * Makefile.maint: Sync. again with CVS Autoconf.
19492
19493 2001-08-27 Akim Demaille <akim@epita.fr>
19494
19495 * Makefile.maint: Formatting changes.
19496 (po-update, cvs-update, update): New targets.
19497 (AMTAR): Remove.
19498
19499 2001-08-27 Akim Demaille <akim@epita.fr>
19500
19501 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19502 * Makefile.maint: Sync. with CVS Autoconf.
19503
19504 2001-08-27 Marc Autret <autret_m@epita.fr>
19505
19506 * src/vcg.h (struct infoname_s): New.
19507 (struct colorentry_s): New.
19508 (graph_s): New fields {vertical,horizontal}_order in structure.
19509 Add `infoname' field.
19510 Add `colorentry' field;
19511 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
19512 (G_HORIZONTAL_ORDER): New.
19513 (G_INFONAME): New.
19514 (G_COLORENTRY): New.
19515 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
19516 Add output of `infoname'.
19517 Add output of `colorentry'.
19518
19519 2001-08-27 Marc Autret <autret_m@epita.fr>
19520
19521 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
19522 This one shadowed a global parameter.
19523
19524 2001-08-24 Marc Autret <autret_m@epita.fr>
19525
19526 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
19527 instead of `unsigned'.
19528 (print_state): Do not call obstack_object_size () in obstack_grow ()
19529 to avoid macro variables shadowing.
19530
19531 2001-08-23 Marc Autret <autret_m@epita.fr>
19532
19533 * src/lex.c (percent_table): Typo: s/naem/name/.
19534 Add graph option.
19535 Normalize new options declarations.
19536
19537 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
19538
19539 * tests/suite.at: Exercise %header_extension and %source_extension.
19540
19541 2001-08-16 Marc Autret <autret_m@epita.fr>
19542
19543 * src/reader.c (parse_dquoted_param): New.
19544 (parse_header_extension_decl): Use it.
19545 (parse_source_extension_decl): Likewise.
19546
19547 2001-08-16 Marc Autret <autret_m@epita.fr>
19548
19549 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
19550 (get_xxxx_str): Use assert () instead of complain ().
19551 Remove return invokations in default cases.
19552 (get_decision_str): Modify default behaviour. Remove second argument.
19553 Echo modifications on calls.
19554 (output_graph): Fix.
19555
19556 2001-08-16 Marc Autret <autret_m@epita.fr>
19557
19558 * src/getargs.c (usage): Update with ``-g, --graph''.
19559
19560 2001-08-16 Marc Autret <autret_m@epita.fr>
19561
19562 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
19563 (Option Cross Key): Likewise.
19564 * doc/bison.1: Update.
19565
19566 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
19567
19568 * src/output.c (output_master_parser): Don't finish action_obstack.
19569 (output_parser): Don't care about the muscle action, here.
19570 (prepare): Copy the action_obstack in the action muscle.
19571 (output): Free action_obstack.
19572
19573 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
19574
19575 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
19576 will contain `%union' declaration.
19577 (parse_union_decl): Delete #line directive output.
19578 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
19579 informations about %union.
19580 (parse_union_decl): Copy the union_obstack in the muscle stype.
19581 * src/bison.simple: Add new #line directive.
19582 Add typdef %%stype YYSTYPE.
19583
19584 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
19585
19586 * src/bison.simple: Add new `#line' directive.
19587
19588 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
19589
19590 * src/bison.simple: New `#line' directive.
19591 * src/output.c (output_parser): Support new dynamic muscle input_line.
19592
19593 2001-09-22 Marc Autret <autret_m@epita.fr>
19594
19595 * src/output.c (output_master_parser): New.
19596 (output_parser): Be more re-entrant.
19597
19598 2001-09-21 Marc Autret <autret_m@epita.fr>
19599
19600 * src/reader.c (copy_definition, parse_union_decl): Update and use
19601 `linef' muscle.
19602 (copy_action): Likewise.
19603 Use obstack_1grow ().
19604 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
19605
19606 2001-09-21 Marc Autret <autret_m@epita.fr>
19607
19608 * src/options.c (option_table): Adjust.
19609 * src/lex.c (parse_percent_token): Fix.
19610
19611 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
19612
19613 * src/options.c (symtab.h): Include it, need by lex.h.
19614
19615 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
19616
19617 * src/lex.c (parse_percent_token): Change type of variable `tx', which
19618 is now an option_table_struct*.
19619 (option_strcmp): New function option_strcmp.
19620 (parse_percent_token): Call option_strcmp.
19621 * src/getargs.c (xalloc.h, options.h): Include it.
19622 (getargs): Call create_long_option_table.
19623 (getargs): Free longopts at the end of the function.
19624 (shortopts): Move in options.c.
19625 * src/options.c (create_long_option_table): New function. Convert
19626 information from option_table to option structure.
19627 * src/reader.c (options.h): Include it.
19628
19629 * src/Makefile.am: Adjust.
19630 * src/options.c (option_table): Create from longopts and percent_table.
19631 * src/getargs.c (longopts): Delete.
19632 * src/lex.c (struct percent_table_struct): Delete.
19633 (percent_table): Delete.
19634 (options.h): Include it.
19635 * src/options.c: Create.
19636 * src/options.h: Create.
19637 Declare enum opt_access_e.
19638 Define struct option_table_struct.
19639
19640 2001-09-20 Marc Autret <autret_m@epita.fr>
19641
19642 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
19643 sections of Bison.
19644
19645 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
19646
19647 * src/bison.simple: s/%%filename/%%skeleton.
19648 * src/muscle_tab.c (getargs.h): Include it.
19649 (muscle_init): Insert new muscle skeleton.
19650
19651 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
19652
19653 * src/output.c (output_parser): Delete unused variable actions_dumped.
19654
19655 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
19656
19657 * src/output.c (output): Delete call to reader_output_yylsp.
19658 * src/reader.c (reader): Likewise.
19659 * src/reader.h: Delete declaration of reader_output_yylsp.
19660
19661 2001-09-02 Marc Autret <autret_m@epita.fr>
19662
19663 * src/reader.c: Include muscle_tab.h.
19664 (parse_union_decl): Update.
19665 (parse_macro_decl): Rename parse_muscle_decl.
19666 Update to use renamed functions and variable.
19667 (read_declarations, copy_action, read_additionnal_code, : Updated
19668 with correct variables and functions names.
19669 (packsymbols, reader): Likewise.
19670
19671 * src/reader.h (muscle_obstack): Extern declaration update.
19672
19673 * src/output.c: Include muscle_tab.h
19674 In all functions using macro_insert, change by using muscle_insert ().
19675 (macro_obstack): Rename muscle_obstack.
19676 Echo modifications in the whole file.
19677 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
19678 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
19679 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
19680
19681 * src/muscle_tab.h: Update double inclusion macros.
19682 (macro_entry_s): Rename muscle_entry_s.
19683 Update prototypes.
19684
19685 * src/muscle_tab.c: Include muscle_tab.h.
19686 Rename macro_tabble to muscle_table.
19687 (mhash1, mhash2, mcmp): Use muscle_entry.
19688 (macro_init): Rename muscle_init. Update.
19689 (macro_insert): Rename muscle_insert. Update.
19690 (macro_find): Rename muscle_find. Update.
19691
19692 * src/main.c: Include muscle_tab.h.
19693 (main): Call muscle_init ().
19694 * src/Makefile.am (bison_SOURCES): Echo modifications.
19695
19696 2001-09-02 Marc Autret <autret_m@epita.fr>
19697
19698 Now the files macro_tab.[ch] are named muscle_tab.[ch].
19699
19700 * src/muscle_tab.c, src/muscle_tab.h: Add files.
19701
19702 2001-09-02 Marc Autret <autret_m@epita.fr>
19703
19704 * src/macrotab.c, src/macrotab.h: Remove.
19705
19706 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
19707
19708 * src/reader.c (copy_guard): Use muscle to specify the `#line'
19709 filename.
19710
19711 2001-09-01 Marc Autret <autret_m@epita.fr>
19712
19713 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
19714 to an explicit value to activate the feature. We do it here.
19715
19716 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19717
19718 * src/output.c (prepare): Delete the `filename' muscule insertion.
19719 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
19720 (parse_union_decl): Likewise.
19721 * src/macrotab.c (macro_init): Initialize filename by infile.
19722
19723 2001-08-31 Marc Autret <autret_m@epita.fr>
19724
19725 * src/bison.simple (YYLSP_NEEDED): New definition.
19726 * src/output.c (prepare): Add macro insertion of `locations_flag'
19727
19728 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19729
19730 * src/output.c (prepare): Delete insertion of previous muscles,
19731 and insert the `prefix' muscles.
19732 * src/macrotab.c (macro_init): Likewise.
19733 (macro_init): Initialization prefix directive by `yy'.
19734 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
19735 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
19736 yylval, yydebug, yyerror, yynerrs and yyparse.
19737 New directive `#define' to substitute yydebug, ... with option
19738 name_prefix.
19739
19740 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19741
19742 * src/main.c (main): Standardize.
19743 * src/output.c (output_table_data, output_parser): Likewise.
19744 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
19745
19746 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
19747
19748 * src/reader.c (read_additionnal_code): Rename %%user_code to
19749 %%epilogue.
19750 * src/output.c (output): Rename %%declarations to %%prologue.
19751 * src/bison.simple: Echo modifications.
19752
19753 2001-08-31 Marc Autret <autret_m@epita.fr>
19754
19755 * src/reader.c (readgram): CleanUp.
19756 (output_token_defines): Likewise.
19757 (packsymbols): Likewise.
19758 (reader): Likewise.
19759 * src/output.c (output): CPP-out useless code.
19760
19761 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19762
19763 * src/reader.c (reader): Delete obsolete call to function
19764 output_trailers and output_headers.
19765 * src/output.h: Remove obsolete functions prototypes of output_headers
19766 and output_trailers.
19767
19768 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
19769
19770 * src/main.c: Include macrotab.h.
19771 * src/macrotab.h (macro_entry_s): Constify fields.
19772 Adjust functions prototypes.
19773 * src/macrotab.c (macro_insert): Constify key and value.
19774 (macro_find): Constify key.
19775 (macro_insert): Include 'xalloc.h'
19776 (macro_insert): Use XMALLOC.
19777 (macro_find): Constify return value.
19778 * src/output.c (output_table_data): Rename table to table_data.
19779 (output_parser): Constify macro_key, macro_value.
19780
19781 2001-08-30 Marc Autret <autret_m@epita.fr>
19782
19783 * src/reader.c (parse_skel_decl): New.
19784 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
19785 * src/lex.h (token_t): New token `tok_skel'.
19786 * src/lex.c (percent_table): Add skeleton option entry.
19787 Standardize.
19788
19789 2001-08-29 Marc Autret <autret_m@epita.fr>
19790
19791 * src/bison.simple: Add %%user_code directive at the end.
19792 * src/reader.c (read_additionnal_code): New.
19793 (reader): Use it.
19794 * src/output.c (output_program): Remove.
19795 (output): Update.
19796
19797 2001-08-28 Marc Autret <autret_m@epita.fr>
19798
19799 * src/output.c (output_actions): Clean up.
19800 (output_gram): CPP-out useless code.
19801 * src/reader.c (reader): Clean up, CPP-out useless code.
19802
19803 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
19804
19805 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
19806 directive.
19807 * src/bison.simple: Add `%%definitions'.
19808
19809 2001-08-28 Marc Autret <autret_m@epita.fr>
19810
19811 * config/depcomp: New file.
19812
19813 2001-08-27 Paul Eggert <eggert@twinsun.com>
19814
19815 * src/bison.simple (yyparse): Don't take the address of an
19816 item before the start of an array, as that doesn't conform to
19817 the C Standard.
19818
19819 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
19820
19821 * src/output.c (output): Remove the initialization of the macro
19822 obstack. It was done too late here.
19823
19824 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
19825 completely wrong.
19826 (reader): Initialize the macro obstack here, since we need it to grow
19827 '%define' directives.
19828
19829 * src/reader.h: Declare the macro obstack as extern.
19830
19831 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
19832
19833 * src/output.c (output_parser): Fix. Store single '%' characters in
19834 the output obstack instead of throwing them away.
19835
19836 2001-08-27 Akim Demaille <akim@epita.fr>
19837
19838 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19839
19840 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19841
19842 * lib/Makefile.am: Adjust.
19843
19844 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19845
19846 * src/bison.simple: Update and add '%%' directives.
19847
19848 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19849
19850 * src/reader.c (reader): Remove calls to 'output_headers' and
19851 'output_trailers'. Remove some C output.
19852 (readgram): Disable a piece of code that was writing a default
19853 definition for 'YYSTYPE'.
19854 (reader_output_yylsp): Remove.
19855 (packsymbols): Output token defintions to a macro.
19856 (copy_definition): Disable C output.
19857
19858 * src/reader.c (parse_macro_decl): New function used to parse macro
19859 declarations.
19860 (copy_string2): Put the body of copy_string into this new function.
19861 Add a parameter to let the caller choose whether he wants to copy the
19862 string delimiters or not.
19863 (copy_string): Be a simple call to copy_string2 with the last argument
19864 bound to true.
19865 (read_declarations): Add case for macro definition.
19866 (copy_identifier): New.
19867 (parse_macro_decl): Read macro identifiers using copy_identifier
19868 rather than lex.
19869
19870 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19871
19872 * src/output.c (prepare): Add prefixed names.
19873 (output_parser): Output semantic actions.
19874 (output_parser): Fix bug on '%%line' directives.
19875
19876 * src/output.c (output_headers): Remove. The C code printed by this
19877 function should now be in the skeletons.
19878 (output_trailers): Remove.
19879 (output): Disable call to 'reader_output_yylsp'.
19880 (output_rule_data): Do not output tables to the table obstack.
19881
19882 * src/output.c: Remove some C dedicated output.
19883 Improve the use of macro and output obstacks.
19884 (output_defines): Remove.
19885
19886 * src/output.c (output_token_translations): Associate 'translate'
19887 table with a macro. No output to the table obstack.
19888 (output_gram): Same for 'rhs' and 'prhs'.
19889 (output_stos): Same for 'stos'.
19890 (output_rule_data): Same for 'r1' and 'r2'.
19891 (token_actions): Same for 'defact'.
19892 (goto_actions): Same for 'defgoto'.
19893 (output_base): Same for 'pact' and 'pgoto'.
19894 (output_table): Same for 'table'.
19895 (output_check): Same for 'check'.
19896
19897 * src/output.c (output_table_data): New function.
19898 (output_short_table): Remove.
19899 (output_short_or_char_table): Remove.
19900
19901 * src/output.c (output_parser): Replace most of the skeleton copy code
19902 with something new. Skeletons are now processed character by character
19903 rather than line by line, and Bison looks for '%%' macros. This is the
19904 first step in making Bison's output process (a lot) more flexible.
19905 (output_parser): Use the macro table.
19906
19907 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19908
19909 * src/main.c (main): Initialize the macro table.
19910
19911 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19912
19913 * src/lex.c (percent_table): Add tok_define.
19914 * src/lex.h: Add tok_define.
19915
19916 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19917
19918 * src/macrotab.c: New file.
19919 * src/macrotab.h: New file.
19920 * src/Makefile.am: Update.
19921
19922 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19923
19924 * lib/hash.c: New file.
19925 * lib/hash.h: New file.
19926 * lib/Makefile.am: Update.
19927
19928 2001-08-15 Akim Demaille <akim@epita.fr>
19929
19930 Version 1.28c.
19931
19932 2001-08-15 Marc Autret <autret_m@epita.fr>
19933
19934 * src/reader.c (readgram): Indent output macro YYSTYPE.
19935 (packsymbols): Likewise.
19936 (output_token_defines): Likewise.
19937 * src/files.c: Standardize.
19938 (compute_header_macro): New.
19939 (defines_obstack_save): New. Use compute_header_macro.
19940 (output_files): Update. Use defines_obstack_save.
19941
19942 2001-08-15 Akim Demaille <akim@epita.fr>
19943
19944 * doc/bison.texinfo (Table of Symbols): Document
19945 YYSTACK_USE_ALLOCA.
19946
19947 2001-08-15 Akim Demaille <akim@epita.fr>
19948
19949 * missing: Update from CVS Automake.
19950 * config/config.guess, config/config.sub, config/texinfo.tex:
19951 Update from gnu.org.
19952
19953 2001-08-15 Akim Demaille <akim@epita.fr>
19954
19955 * Makefile.maint: Sync with CVS Autoconf.
19956
19957 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
19958
19959 * doc/bison.texinfo: Include GNU Free Documentation License from
19960 `fdl.texi'.
19961 * doc/fdl.texi: Add to package.
19962
19963 2001-08-14 Marc Autret <autret_m@epita.fr>
19964
19965 Turn on %{source,header}_extension features.
19966
19967 * src/lex.c (percent_table): Un-CPP out header_extension and
19968 source_extension.
19969 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
19970 (compute_exts_from_src): Remove conditions. It restores priorities
19971 between options.
19972
19973 2001-08-14 Marc Autret <autret_m@epita.fr>
19974
19975 * src/files.c (compute_base_names): Add extensions computing when
19976 `--file-prefix' used.
19977 Standardize function calls.
19978
19979 2001-08-13 Marc Autret <autret_m@epita.fr>
19980
19981 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
19982 defining it (defined but null disables alloca).
19983
19984 2001-08-13 Marc Autret <autret_m@epita.fr>
19985
19986 * src/bison.simple (_yy_memcpy): CPP reformat.
19987
19988 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
19989
19990 * tests/atconfig.in (CPPFLAGS): Fix.
19991
19992 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
19993
19994 * doc/bison.texinfo: Include GNU General Public License from
19995 `gpl.texi'.
19996 * doc/gpl.texi: Add to package.
19997
19998 2001-08-10 Marc Autret <autret_m@epita.fr>
19999
20000 * src/print_graph.h: Fix.
20001 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
20002
20003 2001-08-10 Akim Demaille <akim@epita.fr>
20004
20005 * src/system.h: Provide default declarations for stpcpy, strndup,
20006 and strnlen.
20007
20008 2001-08-10 Robert Anisko <anisko_r@epita.fr>
20009
20010 * doc/bison.texinfo (Locations): Update @$ stuff.
20011
20012 2001-08-09 Robert Anisko <anisko_r@epita.fr>
20013
20014 * src/bison.simple (YYLLOC_DEFAULT): Update.
20015 (yyparse): Adjust.
20016
20017 2001-08-08 Marc Autret <autret_m@epita.fr>
20018
20019 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
20020 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
20021 Reported by Fabrice Bauzac.
20022
20023 2001-08-08 Marc Autret <autret_m@epita.fr>
20024
20025 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
20026 * src/vcg.c (output_node): Fix.
20027 * src/vcg.h: Cleanup.
20028 * src/print_graph.c: Add comments.
20029 (node_output_size): New global variable. Simplify the formatting of
20030 the VCG graph output.
20031 (print_actions): Unused code is now used. It notifies the final state
20032 and no action states in the VCG graph. It also give the reduce actions.
20033 The `shift and goto' edges are red and the `go to state' edges are
20034 blue.
20035 Get the current node name and node_obstack by argument.
20036 (node_obstack): New variable.
20037 (print_state): Manage node_obstack.
20038 (print_core): Use node_obstack given by argument.
20039 A node is not only computed here but in print_actions also.
20040 (print_graph): CPP out useless code instead of commenting it.
20041
20042 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
20043
20044 * tests/atconfig.in (CPPFLAGS): Fix.
20045
20046 2001-08-07 Akim Demaille <akim@epita.fr>
20047
20048 * src/print_graph.c (quote): New.
20049 (print_core): Use it.
20050
20051 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
20052
20053 * src/vcg.c (complain.h): Include it.
20054 Unepitaize `return' invocations.
20055 [NDEBUG] (main): Remove.
20056 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
20057 * src/files.c (open_files): Initialize graph_obstack.
20058 * src/print_graph.c (print_actions): CPP out useless code.
20059 (print_core): Don't output the last `\n' in labels.
20060 Use `quote'.
20061 * src/files.c (output_files): Output the VCG file.
20062 * src/main.c (main): Invoke print_graph ();
20063
20064 2001-08-06 Marc Autret <autret_m@epita.fr>
20065
20066 Automaton VCG graph output.
20067 Using option ``-g'' or long option ``--graph'', you can generate
20068 a gram_filename.vcg file containing a VCG description of the LALR (1)
20069 automaton of your grammar.
20070
20071 * src/main.c: Call to print_graph() function.
20072 * src/getargs.h: Update.
20073 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
20074 (graph_flag): New flag.
20075 (longopts): Update.
20076 (getargs): Add case `g'.
20077 * src/files.c (graph_obstack): New obstack struct.
20078 (open_files): Initialize new obstack.
20079 (output_files): Saves graph_obstack if required.
20080 * src/files.h (graph_obstack): New extern declaration.
20081 * src/Makefile.am: Add new source files.
20082
20083 2001-08-06 Marc Autret <autret_m@epita.fr>
20084
20085 * src/print_graph.c, src/print_graph.h (graph): New.
20086 * src/vcg.h: New file.
20087 * src/vcg.c: New file, VCG graph handling.
20088
20089 2001-08-06 Marc Autret <autret_m@epita.fr>
20090
20091 Add of %source_extension and %header_extension which specify
20092 the source or/and the header output file extension.
20093
20094 * src/files.c (compute_base_names): Remove initialisation of
20095 src_extension and header_extension.
20096 (compute_exts_from_gf): Update.
20097 (compute_exts_from_src): Update.
20098 (output_files): Update.
20099 * src/reader.c (parse_header_extension_decl): New.
20100 (parse_source_extension_decl): New.
20101 (read_declarations): New case statements for the new tokens.
20102 * src/lex.c (percent_table): Add entries for %source_extension
20103 and %header_extension.
20104 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
20105
20106 2001-08-06 Marc Autret <autret_m@epita.fr>
20107
20108 * configure.in: Bump to 1.28c.
20109 * doc/bison.texinfo: Texinfo thingies.
20110
20111 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
20112
20113 * tests/atconfig.in (CPPFLAGS): Add.
20114 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
20115
20116 2001-08-03 Akim Demaille <akim@epita.fr>
20117
20118 Version 1.28b.
20119
20120 2001-08-03 Akim Demaille <akim@epita.fr>
20121
20122 * tests/Makefile.am (check-local): Ship testsuite.
20123 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
20124 Include `string.h'.
20125
20126 2001-08-03 Akim Demaille <akim@epita.fr>
20127
20128 * configure.in: Try using -Wformat when compiling.
20129
20130 2001-08-03 Akim Demaille <akim@epita.fr>
20131
20132 * configure.in: Bump to 1.28b.
20133
20134 2001-08-03 Akim Demaille <akim@epita.fr>
20135
20136 * src/complain.c: Adjust strerror_r portability issues.
20137
20138 2001-08-03 Akim Demaille <akim@epita.fr>
20139
20140 Version 1.28a.
20141
20142 2001-08-03 Akim Demaille <akim@epita.fr>
20143
20144 * src/getargs.c, src/getarg.h (skeleton)): Constify.
20145 * src/lex.c (literalchar): Avoid name clashes on `buf'.
20146 * src/getargs.c: Include complain.h.
20147 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
20148 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
20149
20150 2001-08-03 Akim Demaille <akim@epita.fr>
20151
20152 * src/reader.c (readgram): Display hidden chars in error messages.
20153
20154 2001-08-03 Akim Demaille <akim@epita.fr>
20155
20156 Update to gettext 0.10.39.
20157
20158 2001-08-03 Akim Demaille <akim@epita.fr>
20159
20160 * lib/strspn.c: New.
20161
20162 2001-08-01 Marc Autret <autret_m@epita.fr>
20163
20164 * doc/bison.texinfo: Update.
20165 * doc/bison.1 (mandoc): Update.
20166 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
20167 * src/files.c: Support output files extensions computing.
20168 (src_extension): New static variable.
20169 (header_extension): New static variable.
20170 (tr): New function.
20171 (get_extension_index): New function, gets the index of an extension
20172 filename in a string.
20173 (compute_exts_from_gf): New function, computes extensions from the
20174 grammar file extension.
20175 (compute_exts_from_src): New functions, computes extensions from the
20176 C source file extension, file given by ``-o'' option.
20177 (compute_base_names): Update.
20178 (output_files): Update.
20179
20180 2001-08-01 Robert Anisko <anisko_r@epita.fr>
20181
20182 * doc/bison.texi: Document @$.
20183 (Locations): New section.
20184
20185 2001-07-18 Akim Demaille <akim@epita.fr>
20186
20187 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
20188 * config/prev-version.txt, config/move-if-change: New.
20189 * Makefile.am: Adjust.
20190
20191 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
20192
20193 * src/bison.simple (yyparse): Suppress warning `comparaison
20194 between signed and unsigned'.
20195
20196 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
20197
20198 * src/getargs.h (raw_flag): Remove.
20199 * src/getargs.c: Die on `-r'/`--raw'.
20200 * src/lex.c (parse_percent_token): Die on `%raw'.
20201 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
20202 * tests/calc.at: Suppress test with option `--raw'.
20203
20204 2001-07-14 Akim Demaille <akim@epita.fr>
20205
20206 * config/: New.
20207 * configure.in: Require Autoconf 2.50.
20208 Update to gettext 0.10.38.
20209
20210 2001-03-16 Akim Demaille <akim@epita.fr>
20211
20212 * doc/bison.texinfo: ANSIfy the examples.
20213
20214 2001-03-16 Akim Demaille <akim@epita.fr>
20215
20216 * getargs.c (skeleton): New variable.
20217 (longopts): --skeleton is a new option.
20218 (shortopts, getargs): -S is a new option.
20219 * getargs.h: Declare skeleton.
20220 * output.c (output_parser): Use it.
20221
20222 2001-03-16 Akim Demaille <akim@epita.fr>
20223
20224 * m4/strerror_r.m4: New.
20225 * m4/error.m4: Run AC_FUNC_STRERROR_R.
20226 * lib/error.h, lib/error.c: Update.
20227
20228 2001-03-16 Akim Demaille <akim@epita.fr>
20229
20230 * src/getargs.c (longopts): Clean up.
20231
20232 2001-02-21 Akim Demaille <akim@epita.fr>
20233
20234 * src/reader.c (gensym): `gensym_count' is your own.
20235 Use a static buf to create the symbol name, as token_buffer is no
20236 longer a buffer.
20237
20238 2001-02-08 Akim Demaille <akim@epita.fr>
20239
20240 * src/conflicts.c (conflict_report): Be sure not to append to res
20241 between two calls, which could happen if both first sprintf were
20242 skipped, but not the first cp += strlen.
20243
20244 2001-02-08 Akim Demaille <akim@epita.fr>
20245
20246 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
20247 New, from fileutils 4.0.37.
20248 * configure.in: Require Autoconf 2.49c. I took some time before
20249 making this decision. This is the only way out for portability
20250 issues in Bison, it would mean way too much duplicate effort to
20251 import in Bison features implemented in 2.49c since 2.13.
20252 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
20253
20254 2001-02-02 Akim Demaille <akim@epita.fr>
20255
20256 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
20257 * lib/xalloc.h, lib/xmalloc.c: Update.
20258
20259 2001-01-19 Akim Demaille <akim@epita.fr>
20260
20261 Get rid of the ad hoc handling of token_buffer in the scanner: use
20262 the obstacks.
20263
20264 * src/lex.c (token_obstack): New.
20265 (init_lex): Initialize it. No longer call...
20266 (grow_token_buffer): this. Remove it.
20267 Adjust all the places which used it to use the obstack.
20268
20269 2001-01-19 Akim Demaille <akim@epita.fr>
20270
20271 * src/lex.h: Rename all the tokens:
20272 s/\bENDFILE\b/tok_eof/g;
20273 s/\bIDENTIFIER\b/tok_identifier/g;
20274 etc.
20275 Let them be enums, not #define, to ease debugging.
20276 Adjust all the code.
20277
20278 2001-01-18 Akim Demaille <akim@epita.fr>
20279
20280 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
20281 * src/lex.c (maxtoken, grow_token_buffer): Static.
20282
20283 2001-01-18 Akim Demaille <akim@epita.fr>
20284
20285 Since we now use obstacks, more % directives can be enabled.
20286
20287 * src/lex.c (percent_table): Also accept `%yacc',
20288 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
20289 `%debug'.
20290 Handle the actions for `%semantic_parser' and `%pure_parser' here,
20291 instead of returning a token.
20292 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
20293 * src/reader.c (read_declarations): Adjust.
20294 * src/files.c (open_files): Don't call `compute_base_names', don't
20295 compute `attrsfile' since they depend upon data which might be
20296 *in* the input file now.
20297 (output_files): Do it here.
20298 * src/output.c (output_headers): Document the fact that this patch
20299 introduces a guaranteed SEGV for semantic parsers.
20300 * doc/bison.texinfo: Document them.
20301 * tests/suite.at: Exercise these %options.
20302
20303 2000-12-20 Akim Demaille <akim@epita.fr>
20304
20305 Also handle the output file (--verbose) with obstacks.
20306
20307 * files.c (foutput): Remove.
20308 (output_obstack): New.
20309 Adjust all dependencies.
20310 * src/conflicts.c: Return a string.
20311 * src/system.h (obstack_grow_string): Rename as...
20312 (obstack_sgrow): this. Be ready to work with non literals.
20313 (obstack_fgrow4): New.
20314
20315 2000-12-20 Akim Demaille <akim@epita.fr>
20316
20317 * src/files.c (open_files): Fix the computation of short_base_name
20318 in the case of `-o foo.tab.c'.
20319
20320 2000-12-20 Akim Demaille <akim@epita.fr>
20321
20322 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
20323 (copy_dollar): Now that everything uses obstacks, get rid of the
20324 FILE * parameters.
20325
20326 2000-12-20 Akim Demaille <akim@epita.fr>
20327
20328 * src/files.c (open_files): Actually the `.output' file is based
20329 on the short_base_name, not base_name.
20330 * tests/suite.at (Checking output file names): Adjust.
20331
20332 2000-12-20 Akim Demaille <akim@epita.fr>
20333
20334 * src/bison.s1: Remove, we now use directly...
20335 * src/bison.simple: this.
20336 * src/Makefile.am: Use pkgdata instead of data.
20337
20338 2000-12-20 Akim Demaille <akim@epita.fr>
20339
20340 * src/files.c (guard_obstack): New.
20341 (open_files): Initialize it.
20342 (output_files): Dump it...
20343 * src/files.h: Export it.
20344 * src/reader.c (copy_guard): Use it.
20345
20346 2000-12-19 Akim Demaille <akim@epita.fr>
20347
20348 * src/files.c (outfile, defsfile, actfile): Removed as global
20349 vars.
20350 (open_files): Don't compute them.
20351 (output_files): Adjust.
20352 (base_name, short_base_name): Be global.
20353 Adjust dependencies.
20354
20355 2000-12-19 Akim Demaille <akim@epita.fr>
20356
20357 * src/files.c (strsuffix): New.
20358 (stringappend): Be just like strcat but allocate.
20359 (base_names): Eve out from open_files.
20360 Try to simplify the rather hairy computation of base_name and
20361 short_base_name.
20362 (open_files): Use it.
20363 * tests/suite.at (Checking output file names): New test.
20364
20365 2000-12-19 Akim Demaille <akim@epita.fr>
20366
20367 * src/system.h (obstack_grow_literal_string): Rename as...
20368 (obstack_grow_string): this.
20369 * src/output.c (output_parser): Recognize `%% actions' instead of
20370 `$'.
20371 * src/bison.s1: s/$/%% actions/.
20372 * src/bison.hairy: Likewise.
20373
20374 2000-12-19 Akim Demaille <akim@epita.fr>
20375
20376 * src/output.c (output_parser): Compute the `#line' lines when
20377 there are.
20378 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
20379 Suggested by Hans Aberg.
20380
20381 2000-12-19 Akim Demaille <akim@epita.fr>
20382
20383 Let the handling of the skeleton files be local to the procedures
20384 that use it.
20385
20386 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
20387 longer static.
20388 (fparser, open_extra_files): Remove.
20389 (open_files, output_files): Don't take care of fparser.
20390 * src/files.h: Adjust.
20391 * src/output.c (output_parser): Open and close the file to the
20392 skeleton.
20393 * src/reader.c (read_declarations): When %semantic_parser, open
20394 fguard.
20395
20396 2000-12-19 Akim Demaille <akim@epita.fr>
20397
20398 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
20399 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
20400
20401 2000-12-19 Akim Demaille <akim@epita.fr>
20402
20403 * src/files.c (open_files): Yipee! We no longer need all the code
20404 looking for `/tmp' since we have no tmp file.
20405
20406 2000-12-19 Akim Demaille <akim@epita.fr>
20407
20408 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
20409 New macros.
20410 * src/files.c (open_files): Less dependency on MSDOS etc.
20411
20412 2000-12-14 Akim Demaille <akim@epita.fr>
20413
20414 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
20415 Provide a default definition.
20416 Use it when executing the default @ action.
20417 * src/reader.c (reader_output_yylsp): No longer include
20418 `timestamp' and `text' in the default YYLTYPE.
20419
20420 2000-12-12 Akim Demaille <akim@epita.fr>
20421
20422 * src/reader.c (copy_definition, parse_union_decl, copy_action)
20423 (copy_guard): Quote the file names.
20424 Reported by Laurent Mascherpa.
20425
20426 2000-12-12 Akim Demaille <akim@epita.fr>
20427
20428 * src/output.c (output_headers, output_program, output): Be sure
20429 to escape special characters when outputting filenames.
20430 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
20431 (output_headers): Don't depend on them, Use ACTSTR.
20432
20433 2000-11-17 Akim Demaille <akim@epita.fr>
20434
20435 * lib/obstack.h: Formatting changes.
20436 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
20437 prevents type checking.
20438 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
20439 cast the value to (void *): assigning a `foo *' to a `void *'
20440 variable is valid.
20441 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
20442 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
20443 append characters.
20444
20445 2000-11-17 Akim Demaille <akim@epita.fr>
20446
20447 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
20448 as...
20449 (suite.m4, regression.m4, calc.m4): these.
20450 * tests/atgeneral.m4: Update from CVS Autoconf.
20451
20452 2000-11-17 Akim Demaille <akim@epita.fr>
20453
20454 * tests/regression.m4 (%union and --defines): New test,
20455 demonstrating a current bug in the obstack implementation.
20456
20457 2000-11-17 Akim Demaille <akim@epita.fr>
20458
20459 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
20460 macros.
20461 Use them to declare the variables which are global or local to
20462 `yyparse'.
20463
20464 2000-11-17 Akim Demaille <akim@epita.fr>
20465
20466 * acconfig.h: Remove, no longer used.
20467
20468 2000-11-07 Akim Demaille <akim@epita.fr>
20469
20470 * src: s/Copyright (C)/Copyright/g.
20471
20472 2000-11-07 Akim Demaille <akim@epita.fr>
20473
20474 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
20475 defining.
20476 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
20477
20478 2000-11-07 Akim Demaille <akim@epita.fr>
20479
20480 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
20481 Merge in a single CPP if/else.
20482
20483 2000-11-07 Akim Demaille <akim@epita.fr>
20484
20485 * src/output.c (output): Remove useless variables.
20486 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
20487 argument `data' for consistency with the prototypes.
20488 Qualify it `const'.
20489 (obstack_copy, obstack_copy0): Rename the second argument as
20490 `address' for consistency. Qualify it `const'.
20491 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
20492 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
20493 `const' their input argument (`data' or `address').
20494 Adjust the corresponding macros to include `const' in casts.
20495
20496 2000-11-03 Akim Demaille <akim@epita.fr>
20497
20498 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
20499 s/PFILE1/BISON_HAIRY/.
20500 Adjust dependencies.
20501
20502 2000-11-03 Akim Demaille <akim@epita.fr>
20503
20504 For some reason, this was not applied.
20505
20506 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20507 `unlink': it's no longer used.
20508
20509 2000-11-03 Akim Demaille <akim@epita.fr>
20510
20511 * src/files.c (skeleton_find): New function, eved out of...
20512 (open_files, open_extra_files): here.
20513
20514 2000-11-03 Akim Demaille <akim@epita.fr>
20515
20516 Don't use `atexit'.
20517
20518 * src/files.c (obstack_save): New function.
20519 (done): Rename as...
20520 (output_files): this.
20521 Use `obstack_save'.
20522 * src/main.c (main): Don't use `atexit' to register `done', since
20523 it no longer has to remove tmp files, just call `output_files'
20524 when there are no errors.
20525
20526 2000-11-02 Akim Demaille <akim@epita.fr>
20527
20528 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20529 `unlink': it's no longer used.
20530 * src/files.h: Formatting changes.
20531
20532 2000-11-02 Akim Demaille <akim@epita.fr>
20533
20534 Remove the last uses of mktemp and unlink/delete.
20535
20536 * src/files.c (fdefines, ftable): Removed.
20537 (defines_ostack, table_obstack): New.
20538 Adjust dependencies of the former into uses of the latter.
20539 * src/output.c (output_short_or_char_table, output_short_table):
20540 Convert to using obstacks.
20541 * src/reader.c (copy_comment2): Accept one FILE * and two
20542 obstacks.
20543 (output_token_defines, reader_output_yylsp): Use obstacks.
20544 * src/system.h (obstack_fgrow3): New.
20545 * po/POTFILES.in: Adjust.
20546
20547 2000-11-01 Akim Demaille <akim@epita.fr>
20548
20549 Change each use of `fattrs' into a use of `attrs_obstack'.
20550
20551 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
20552 * src/files.c (fattrs): Remove.
20553 (attrs_obstack): New.
20554 Adjust all dependencies.
20555 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
20556
20557 2000-11-01 Akim Demaille <akim@epita.fr>
20558
20559 Introduce obstacks.
20560 Change each use of `faction' into a use of `action_obstack'.
20561
20562 * lib/obstack.h, lib/obstack.c: New files.
20563 * src/files.c (faction): Remove.
20564 (action_obstack): New.
20565 Adjust all dependencies.
20566
20567 2000-10-20 Akim Demaille <akim@epita.fr>
20568
20569 * lib/quote.h (PARAMS): New macro. Use it.
20570
20571 2000-10-16 Akim Demaille <akim@epita.fr>
20572
20573 * src/output.c (output_short_or_char_table): New function.
20574 (output_short_table, output_token_translations): Use it.
20575 (goto_actions): Use output_short_table.
20576
20577 2000-10-16 Akim Demaille <akim@epita.fr>
20578
20579 * src/symtab.c (bucket_new): New function.
20580 (getsym): Use it.
20581
20582 * src/output.c (output_short_table): New argument to display the
20583 comment associated with the table.
20584 Adjust dependencies.
20585 (output_gram): Use it.
20586 (output_rule_data): Nicer output layout for YYTNAME.
20587
20588 2000-10-16 Akim Demaille <akim@epita.fr>
20589
20590 * src/lex.c (read_typename): New function.
20591 (lex): Use it.
20592 * src/reader.c (copy_dollar): Likewise.
20593
20594 2000-10-16 Akim Demaille <akim@epita.fr>
20595
20596 * src/reader.c (copy_comment2): Expect the input stream to be on
20597 the `/' which is suspected to open a comment, instead of being
20598 called after `//' or `/*' was read.
20599 (copy_comment, copy_definition, parse_union_decl, copy_action)
20600 (copy_guard): Adjust.
20601
20602 2000-10-16 Akim Demaille <akim@epita.fr>
20603
20604 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
20605 `read_signed_integer'.
20606
20607 2000-10-16 Akim Demaille <akim@epita.fr>
20608
20609 * src/reader.c (copy_dollar): New function.
20610 (copy_guard, copy_action): Use it.
20611
20612 2000-10-16 Akim Demaille <akim@epita.fr>
20613
20614 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
20615 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
20616 New files, from Fileutils 4.0.27.
20617 * src/main.c (printable_version): Remove.
20618 * src/lex.c, src/reader.c: Use `quote'.
20619
20620 2000-10-04 Akim Demaille <akim@epita.fr>
20621
20622 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
20623
20624 2000-10-04 Akim Demaille <akim@epita.fr>
20625
20626 * doc/bison.texinfo: Various typos spotted by Neil Booth.
20627
20628 2000-10-04 Akim Demaille <akim@epita.fr>
20629
20630 When a literal string is used to define two different tokens,
20631 `bison -v' segfaults.
20632 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
20633
20634 * tests/regression.m4: New file.
20635 Include the core of the sample provided by Piotr Gackiewicz.
20636 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
20637 properly.
20638
20639 2000-10-04 Akim Demaille <akim@epita.fr>
20640
20641 * src/reader.c (parse_expect_decl): Keep `count' within the size
20642 of `buffer'.
20643 From Neil Booth.
20644
20645 2000-10-02 Paul Eggert <eggert@twinsun.com>
20646
20647 * bison.s1 (yyparse): Assign the default value
20648 unconditionally, to avoid a GCC warning and make the parser a
20649 tad smaller.
20650
20651 2000-10-02 Akim Demaille <akim@epita.fr>
20652
20653 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
20654 options.
20655
20656 2000-10-02 Akim Demaille <akim@epita.fr>
20657
20658 * src/derives.c, src/print.c, src/reduce.c: To ease the
20659 translation, move some `\n' out of the translated strings.
20660
20661 2000-10-02 Akim Demaille <akim@epita.fr>
20662
20663 The location tracking mechanism is precious for parse error
20664 messages. Nevertheless, it is enabled only when `@n' is used in
20665 the grammar, which is a different issue (you can use it in error
20666 message, but not in the grammar per se). Therefore, there should
20667 be another means to enable it.
20668
20669 * src/getargs.c (getargs): Support `--locations'.
20670 (usage): Report it.
20671 * src/getargs.h (locationsflag): Export it.
20672 * src/lex.c (percent_table): Support `%locations'.
20673 * src/reader.c (yylsp_needed): Remove this variable, now replaced
20674 with `locationsflag'.
20675 * doc/bison.texinfo: Document `--locations' and `%locations'.
20676 Sort the options.
20677 * tests/calc.m4: Test it.
20678
20679 For regularity of the names, replace each
20680 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
20681 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
20682 In addition replace each `flag' with `_flag'.
20683
20684 2000-10-02 Akim Demaille <akim@epita.fr>
20685
20686 Also test parse error messages, including with YYERROR_VERBOSE.
20687
20688 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
20689 associative).
20690 Use it to check the computations.
20691 Use it to check `nonassoc' is honored.
20692 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
20693 `--yyerror-verbose'.
20694 (_AT_CHECK_CALC): Adjust to this option.
20695 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
20696
20697 2000-10-02 Akim Demaille <akim@epita.fr>
20698
20699 Test also `--verbose', `--defines' and `--name-prefix'. Testing
20700 the latter demonstrates a flaw in the handling of non debugging
20701 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
20702 was used in order to simplify:
20703
20704 #if YYDEBUG
20705 if (yydebug)
20706 {
20707 ...
20708 }
20709 #endif
20710
20711 into
20712
20713 if (yydebug)
20714 {
20715 ...
20716 }
20717
20718 unfortunately this leads to a CPP conflict when
20719 `--name-prefix=foo' is used since it produces `#define yydebug
20720 foodebug'.
20721
20722 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
20723 (YYDPRINTF): New macro.
20724 Spread its use.
20725 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
20726 the bison options.
20727 Also test `--verbose', `--defines' and `--name-prefix'.
20728
20729 2000-10-02 Akim Demaille <akim@epita.fr>
20730
20731 Improve the readability of the produced parsers.
20732
20733 * src/bison.s1: Formatting changes.
20734 Improve the comment related to the `$' mark.
20735 (yydefault): Don't fall through to `yyresume': `goto' there.
20736 * src/output.c (output_parser): When the `$' is met, skip the end
20737 of its line.
20738 New variable, `number_of_dollar_signs', to check there's exactly
20739 one `$' in the parser skeleton.
20740
20741 2000-10-02 Akim Demaille <akim@epita.fr>
20742
20743 * lib/xstrdup.c: New file, from the fileutils.
20744 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
20745 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
20746 instead of strlen + xmalloc + strcpy.
20747 * src/symtab.c (copys): Remove, use xstrdup instead.
20748
20749 2000-10-02 Akim Demaille <akim@epita.fr>
20750
20751 * src/gram.h (associativity): New enum type which replaces the
20752 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
20753 `right_assoc', `left_assoc' and `non_assoc'.
20754 Adjust all dependencies.
20755 * src/reader.c: Formatting changes.
20756 (LTYPESTR): Don't define it, use it as a literal in
20757 `reader_output_yylsp'.
20758 * src/symtab.h (symbol_class): New enum type which replaces the
20759 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
20760 `sunknown', `stoken and `snterm'.
20761
20762 2000-10-02 Akim Demaille <akim@epita.fr>
20763
20764 * src/getargs.c (fixed_outfiles): Rename as...
20765 (yaccflag): for consistency and accuracy.
20766 Adjust dependencies.
20767
20768 2000-10-02 Akim Demaille <akim@epita.fr>
20769
20770 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
20771 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
20772 difficult and introduced a lot of core dump. It turns out that
20773 Bison used an implementation of `xmalloc' based on `calloc', and
20774 at various places it does depend upon the initialization to 0. I
20775 have not tried to isolate the pertinent places, and all the former
20776 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
20777 someone should address this issue.
20778
20779 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
20780 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
20781 files.
20782 Adjust dependencies.
20783 * src/warshall.h: New file.
20784 Propagate.
20785
20786 2000-10-02 Akim Demaille <akim@epita.fr>
20787
20788 Various anti-`extern in *.c' changes.
20789
20790 * src/system.h: Include `assert.h'.
20791
20792 2000-10-02 Akim Demaille <akim@epita.fr>
20793
20794 * src/state.h (nstates, final_state, first_state, first_shift)
20795 (first_reduction): Move their exportation from here...
20796 * src/LR0.h: to here.
20797 Adjust dependencies.
20798 * src/getargs.c (statisticsflag): New variable.
20799 Add support for `--statistics'.
20800 Adjust dependencies.
20801
20802 Remove a lot of now useless `extern' statements in most files.
20803
20804 2000-10-02 Akim Demaille <akim@epita.fr>
20805
20806 * src/LR0.h: New file.
20807 Propagate its use.
20808
20809 2000-10-02 Akim Demaille <akim@epita.fr>
20810
20811 * src/print.h: New file.
20812 Propagate its use.
20813 * src/print.c: Formatting and ordering changes.
20814 (verbose, terse): Replace with...
20815 (print_results): this new function.
20816 Adjust dependencies.
20817
20818 2000-10-02 Akim Demaille <akim@epita.fr>
20819
20820 * src/conflicts.c (conflict_report): New function.
20821 (conflict_log, verbose_conflict_log): Replace with...
20822 (print_conflicts): this function.
20823 Adjust dependencies.
20824 * src/conflicts.h: New file.
20825 Propagate its inclusion.
20826
20827 2000-10-02 Akim Demaille <akim@epita.fr>
20828
20829 * src/nullable.h: New file.
20830 Propagate its inclusion.
20831 * src/nullable.c: Formatting changes.
20832
20833 2000-10-02 Akim Demaille <akim@epita.fr>
20834
20835 * src/reduce.h: New file.
20836 Propagate its inclusion.
20837 * src/reduce.c: Topological sort and other formatting changes.
20838 (bool, TRUE, FALSE): Move their definition to...
20839 * src/system.h: here.
20840
20841 2000-10-02 Akim Demaille <akim@epita.fr>
20842
20843 * src/files.c: Formatting changes.
20844 (tryopen, tryclose, openfiles): Rename as...
20845 (xfopen, xfclose, open_files): this.
20846 (stringappend): static.
20847 * src/files.h: Complete the list of exported symbols.
20848 Propagate its use.
20849
20850 2000-10-02 Akim Demaille <akim@epita.fr>
20851
20852 * src/reader.h: New file.
20853 Propagate its use instead of tedious list of `extern' and
20854 prototypes.
20855 * src/reader.c: Formatting changes, topological sort,
20856 s/register//.
20857
20858 2000-10-02 Akim Demaille <akim@epita.fr>
20859
20860 * src/lex.h: Prototype `lex.c' exported functions.
20861 * src/reader.c: Adjust.
20862 * src/lex.c: Formatting changes.
20863 (safegetc): Rename as...
20864 (xgetc): this.
20865
20866 2000-10-02 Akim Demaille <akim@epita.fr>
20867
20868 * src/lalr.h: New file.
20869 Propagate its inclusion instead of prototypes and `extern'.
20870 * src/lalr.c: Formatting changes, topological sorting etc.
20871
20872 2000-10-02 Akim Demaille <akim@epita.fr>
20873
20874 * src/output.c (token_actions): Introduce a temporary array,
20875 YYDEFACT, that makes it possible for this function to use
20876 output_short_table.
20877
20878 2000-10-02 Akim Demaille <akim@epita.fr>
20879
20880 `user_toknums' is output as a `short[]' in `output.c', while it is
20881 defined as a `int[]' in `reader.c'. For consistency with the
20882 other output tables, `user_toknums' is now defined as a table of
20883 shorts.
20884
20885 * src/reader.c (user_toknums): Be a short table instead of an int
20886 table.
20887 Adjust dependencies.
20888
20889 Factor the short table outputs.
20890
20891 * src/output.c (output_short_table): New function.
20892 * src/output.c (output_gram, output_stos, output_rule_data)
20893 (output_base, output_table, output_check): Use it.
20894
20895 2000-10-02 Akim Demaille <akim@epita.fr>
20896
20897 * src/output.c (output): Topological sort of the functions, in
20898 order to get rid of the `static' prototypes.
20899 No longer use `register'.
20900 * src/output.h: New file.
20901 Propagate its inclusion in files explicitly prototyping functions
20902 from output.c.
20903
20904 2000-09-21 Akim Demaille <akim@epita.fr>
20905
20906 * src/atgeneral.m4: Update from Autoconf.
20907
20908 2000-09-21 Akim Demaille <akim@epita.fr>
20909
20910 * src/closure.h: New file.
20911 * src/closure.c: Formatting changes, topological sort over the
20912 functions, use of closure.h.
20913 (initialize_closure, finalize_closure): Rename as...
20914 (new_closure, free_closure): these. Adjust dependencies.
20915 * src/LR0.c: Formatting changes, topological sort, use of
20916 cloture.h.
20917 (initialize_states): Rename as...
20918 (new_states): this.
20919 * src/Makefile.am (noinst_HEADERS): Adjust.
20920
20921 2000-09-20 Akim Demaille <akim@epita.fr>
20922
20923 * src/acconfig.h: Don't protect config.h against multiple
20924 inclusion.
20925 Don't define PARAMS.
20926 * src/system.h: Define PARAMS.
20927 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
20928 purpose of config.h. system.h must not try to fix wrong
20929 definitions in config.h.
20930
20931 2000-09-20 Akim Demaille <akim@epita.fr>
20932
20933 * src/derives.h: New file.
20934 * src/main.c, src/derives.h: Use it.
20935 Formatting changes.
20936 * src/Makefile.am (noinst_HEADERS): Adjust.
20937
20938 2000-09-20 Akim Demaille <akim@epita.fr>
20939
20940 * tests/atgeneral.m4: Update from Autoconf.
20941 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
20942 (AT_CHECK_CALC): New macros.
20943 Use these macros to test bison with options `', `--raw',
20944 `--debug', `--yacc', `--yacc --debug'.
20945
20946 2000-09-19 Akim Demaille <akim@epita.fr>
20947
20948 * src/output.c: Formatting changes.
20949 * src/machine.h: Remove, leaving its contents in...
20950 * src/system.h: here.
20951 Include stdio.h.
20952 Adjust all dependencies on stdio.h and machine.h.
20953 * src/getargs.h: New file.
20954 Let all `extern' declarations about getargs.c be replaced with
20955 inclusion of `getargs.h'.
20956 * src/Makefile.am (noinst_HEADERS): Adjust.
20957
20958 * tests/calc.m4 (yyin): Be initialized in main, not on the global
20959 scope.
20960 (yyerror): Returns void, not int.
20961 * doc/bison.texinfo: Formatting changes.
20962
20963 2000-09-19 Akim Demaille <akim@epita.fr>
20964
20965 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
20966 portable.
20967
20968 2000-09-18 Akim Demaille <akim@epita.fr>
20969
20970 * configure.in: Append WARNING_CFLAGS to CFLAGS.
20971 * src/Makefile.am (INCLUDES): Don't.
20972 Be ready to fetch headers in lib/.
20973
20974 2000-09-18 Akim Demaille <akim@epita.fr>
20975
20976 * doc/bison.texinfo: Update the copyright.
20977 ANSIfy and GNUify the examples.
20978 Remove the old menu.
20979
20980 2000-09-18 Akim Demaille <akim@epita.fr>
20981
20982 First set of tests: use the `calc' example from the documentation.
20983
20984 * src/bison.s1 (yyparse): Condition the code using `yytname' which
20985 is defined only when YYDEBUG is.
20986 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
20987 * src/files.c (tryopen, tryclose): Formatting changes.
20988 Move to the top and be static.
20989 * src/reader.c (read_signed_integer): Likewise.
20990 * tests/calc.m4: New file.
20991 * Makefile.am, suite.m4: Adjust.
20992 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
20993
20994 2000-09-18 Akim Demaille <akim@epita.fr>
20995
20996 Add support for an Autotest test suite for Bison.
20997
20998 * m4/m4.m4, m4/atconfig.m4: New files.
20999 * m4/Makefile.am (EXTRA_DIST): Adjust.
21000 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
21001 files.
21002 * src/getargs.c: Display a more standard --version message.
21003 * src/reader.c (reader): Formatting changes.
21004 No longer depend upon VERSION_STRING.
21005 * configure.in: No longer use `dnl'.
21006 Set up the test suite and the new directory `tests/.
21007 (VERSION_STRING): Remove.
21008
21009 2000-04-14 Akim Demaille <akim@epita.fr>
21010
21011 * src/reader.c (copy_comment2): New function, same as former
21012 `copy_comment', but outputs into two FILE *.
21013 (copy_comment): Use it.
21014 (parse_union_decl): Use it.
21015 (get_type, parse_start_decl): Use the same `invalid' message.
21016 (parse_start_decl, parse_union_decl): Use the same `multiple'
21017 message.
21018 (parse_union_decl, copy_guard, copy_action): Use the same
21019 `unmatched' message.
21020 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
21021
21022 2000-03-31 Akim Demaille <akim@epita.fr>
21023
21024 * src/files.c (tryopen, tryclose): Move to the top.
21025 Be static.
21026
21027 2000-03-31 Akim Demaille <akim@epita.fr>
21028
21029 * src/main.c (main): Don't call `done', exit does it.
21030
21031 2000-03-31 Akim Demaille <akim@epita.fr>
21032
21033 * allocate.c: s/return (foo)/return foo/.
21034 * lalr.c: Likewise.
21035 * LR0.c: Likewise.
21036 * output.c: Likewise.
21037 * reader.c: Likewise.
21038 * symtab.c: Likewise.
21039 * vmsgetargs.c: Likewise.
21040
21041 2000-03-31 Akim Demaille <akim@epita.fr>
21042
21043 Clean up the error reporting functions.
21044
21045 * src/report.c: New file.
21046 * src/report.h: Likewise.
21047 * src/Makefile.am: Adjust.
21048 * m4/error.m4: New file.
21049 * m4/Makefile.am: Adjust.
21050 * configure.in (jm_PREREQ_ERROR): Call it.
21051 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
21052 Remove.
21053 (fatal, fatals): Remove. All callers use complain.c::fatal.
21054 (warn, warni, warns, warnss, warnss): Remove. All callers use
21055 complain.c::complain.
21056 (toomany): Remove, use fatal instead.
21057 * src/files.c (done): No argument, use complain_message_count.
21058 * src/main.c (main): Register `done' to `atexit'.
21059
21060 * src/getargs.c (usage): More `fputs', less `fprintf'.
21061
21062 2000-03-28 Akim Demaille <akim@epita.fr>
21063
21064 * lib/: New directory.
21065 * Makefile.am (SUBDIRS): Adjust.
21066 * configure.in: Adjust.
21067 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
21068 useless.
21069 * src/alloca.c: Moved to lib/.
21070 * src/getopt.c: Likewise.
21071 * src/getopt1.c: Likewise.
21072 * src/getopt.h: Likewise.
21073 * src/ansi2knr.c: Likewise.
21074 * src/ansi2knr.1: Likewise.
21075 * src/Makefile.am: Adjust.
21076 * lib/Makefile.am: New file.
21077
21078 2000-03-28 Akim Demaille <akim@epita.fr>
21079
21080 * src/getargs.c (usage): Refresh the help message.
21081
21082 2000-03-17 Akim Demaille <akim@epita.fr>
21083
21084 * src/getopt1.c: Updated from textutils 2.0e
21085 * src/getopt.c: Likewise.
21086 * src/getopt.h: Likewise.
21087
21088 2000-03-17 Akim Demaille <akim@epita.fr>
21089
21090 * src/Makefile.am (bison.simple): Fix the awk program: quote only
21091 the file name, not the whole `#line LINE FILE'.
21092
21093 2000-03-17 Akim Demaille <akim@epita.fr>
21094
21095 On syntax errors, report the token on which we choked.
21096
21097 * src/bison.s1 (yyparse): In the label yyerrlab, when
21098 YYERROR_VERBOSE, add yychar in msg.
21099
21100 2000-03-17 Akim Demaille <akim@epita.fr>
21101
21102 * src/reader.c (copy_at): New function.
21103 (copy_guard): Use it.
21104 (copy_action): Use it.
21105
21106 2000-03-17 Akim Demaille <akim@epita.fr>
21107
21108 Be kind to translators, save some useless translations.
21109
21110 * src/main.c (banner): New function.
21111 (fatal_banner): Use it.
21112 (warn_banner): Use it.
21113
21114 2000-03-17 Akim Demaille <akim@epita.fr>
21115
21116 * src/reader.c (copy_definition): Use copy_string and
21117 copy_comment. Removed now unused `match', `ended',
21118 `cplus_comment'.
21119 (copy_comment, copy_string): Moved, to be visible from
21120 copy_definition.
21121
21122 2000-03-17 Akim Demaille <akim@epita.fr>
21123
21124 * src/reader.c (copy_string): Declare `static inline'. No
21125 problems with inline, since it is checked by configure.
21126 (copy_comment): Likewise.
21127
21128 2000-03-17 Akim Demaille <akim@epita.fr>
21129
21130 * src/reader.c (packsymbols): Formatting changes.
21131
21132 2000-03-17 Akim Demaille <akim@epita.fr>
21133
21134 * src/reader.c (copy_comment): New function, factored out from:
21135 (copy_action): Use it. Removed now unused `match', `ended',
21136 `cplus_comment'.
21137 (copy_guard): Likewise.
21138
21139 2000-03-17 Akim Demaille <akim@epita.fr>
21140
21141 * src/reader.c (copy_string): New function, factored out from:
21142 (copy_action): Use it.
21143 (copy_guard): Likewise.
21144
21145 2000-03-17 Akim Demaille <akim@epita.fr>
21146
21147 Change the handling of @s so that they behave exactly like $s.
21148 There is now a pseudo variable @$ (readble and writable), location
21149 of the lhs of the rule (by default ranging from the location of
21150 the first symbol of the rhs, to the location of the last symbol,
21151 or, if the rhs is empty, YYLLOC).
21152
21153 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
21154 yyval.
21155 (yyparse): When providing a default semantic action, provide a
21156 default location action.
21157 (after the $): No longer change `*YYLSP', just stack YYLOC the
21158 same way you stack YYVAL.
21159 * src/reader.c (read_declarations): Use warns.
21160 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
21161 (copy_action, case '@'): Likewise.
21162 Use a standard error message, to save useless work from
21163 translators.
21164
21165 2000-03-17 Akim Demaille <akim@epita.fr>
21166
21167 * src/bison.s1: Formatting and cosmetics changes.
21168 * src/reader.c: Likewise.
21169 Update the Copyright notice.
21170
21171 2000-03-17 Akim Demaille <akim@epita.fr>
21172
21173 * src/bison.s1 (#line): All set to `#line' only, since the
21174 Makefile now handles them.
21175
21176 2000-03-16 Akim Demaille <akim@epita.fr>
21177
21178 * src/output.c (output_rule_data): Output the documentation of
21179 some of the tables.
21180 (Copyright notice): Update.
21181 Formatting changes.
21182
21183 2000-03-16 Akim Demaille <akim@epita.fr>
21184
21185 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
21186 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
21187 One `#if YYDEBUG' remains, since it uses variables which are
21188 defined only if `YYDEBUG != 0'.
21189
21190 2000-03-16 Akim Demaille <akim@epita.fr>
21191
21192 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
21193 and related variables so that the similarities are highlighted.
21194
21195 2000-03-16 Akim Demaille <akim@epita.fr>
21196
21197 * src/bison.s1: Properly indent CPP directives.
21198
21199 2000-03-16 Akim Demaille <akim@epita.fr>
21200
21201 * src/bison.s1: Properly indent the `alloca' CPP section.
21202
21203 2000-03-16 Akim Demaille <akim@epita.fr>
21204
21205 Do not hard code values of directories in `configure.in'.
21206 Update the `configure' tool chain.
21207
21208 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
21209 src/makefile.am.
21210 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
21211 (AC_OUTPUT): Add m4/Makefile.
21212 Bump to bison 1.28a, 1.29 has never been released.
21213 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
21214 handled via src/Makefile.am.
21215 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
21216 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
21217 autoheader.
21218 * Makefile.am (SUBDIRS): Add m4.
21219 (ACLOCAL_AM_FLAGS): New variable.
21220 (AUTOMAKE_OPTIONS): Add check-news.
21221 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
21222 the proper line number and file name.
21223 (DEFS): Propagate the location of bison library files and of the
21224 locale files.
21225 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
21226 builddir.
21227 * acinclude.m4: Remove, replaced by the directory m4.
21228 * m4/Makefile.am (EXTRA_DIST): New variable.
21229 * m4/gettext.m4: New file, from the fileutils.
21230 * m4/lcmessage.m4: Likewise
21231 * m4/progtest.m4: Likewise.
21232 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
21233
21234 2000-03-10 Akim Demaille <akim@epita.fr>
21235
21236 * src/closure.c:
21237 Formatting changes of various comments.
21238 Respect the GNU coding standards at various places.
21239 Don't use `_()' when no translation is needed.
21240
21241 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21242
21243 * src/files.c:
21244 OS/2 honors TMPDIR environment variable.
21245
21246 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21247
21248 * doc/bison.texinfo: Tweaked spelling and grammar.
21249 Updated ISBN.
21250 Removed reference to price of printed copy.
21251 Mention BISON_SIMPLE and BISON_HAIRY.
21252
21253 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21254
21255 * configure.in, NEWS:
21256 Bison 1.29 released.
21257
21258 1999-10-27 Jesse Thilo <jthilo@gnu.org>
21259
21260 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
21261 Added reference card.
21262
21263 1999-07-26 Jesse Thilo <jthilo@gnu.org>
21264
21265 * po/ru.po: Added Russian translation.
21266
21267 1999-07-26 Jesse Thilo <jthilo@gnu.org>
21268
21269 * configure.in: Added Russian translation.
21270
21271 1999-07-06 Jesse Thilo <jthilo@gnu.org>
21272
21273 * configure.in, NEWS, README:
21274 Released version 1.28.
21275
21276 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21277
21278 * src/system.h:
21279 Squashed redefinition warning on some systems.
21280
21281 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
21282 Have configure build version string instead of relying on ANSI string
21283 concatentation.
21284
21285 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21286
21287 * po/POTFILES.in: Got rid of version.c.
21288
21289 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21290
21291 * acconfig.h, configure.in:
21292 Have configure build version string instead of relying on ANSI string
21293 concatentation.
21294
21295 1999-06-08 Jesse Thilo <jthilo@gnu.org>
21296
21297 * doc/bison.1:
21298 Dropped mention of `+' for long-named options.
21299
21300 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21301
21302 * src/files.c: Added <unistd.h> for unlink().
21303
21304 * src/Makefile.am, src/system.h:
21305 I18n fixes.
21306
21307 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21308
21309 * README: Added a FAQ list.
21310
21311 * configure.in, acconfig.h:
21312 I18n fixes.
21313
21314 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21315
21316 * doc/FAQ, doc/Makefile.am:
21317 Added a FAQ list.
21318
21319 1999-05-19 Jesse Thilo <jthilo@gnu.org>
21320
21321 * src/alloc.h, src/symtab.h, src/version.c:
21322 Protected inclusion of "config.h" with HAVE_CONFIG_H.
21323
21324 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21325
21326 * src/.cvsignore, src/Makefile.am:
21327 Reorganized: sources in `src', documentation in `doc'.
21328
21329 * src/lex.c (literalchar):
21330 fixed the code for escaping double quotes (thanks
21331 Jonathan Czisny.)
21332
21333 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21334
21335 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
21336 Adjusted paths to reflect directory reorganization.
21337
21338 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21339
21340 * doc/.cvsignore, doc/Makefile.am:
21341 Reorganized: sources in `src', documentation in `doc'.
21342
21343 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21344
21345 * configure.in:
21346 Updated AC_INIT file to reflect directory reorganization.
21347
21348 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
21349 Reorganized: sources in `src', documentation in `doc'.
21350
21351 1999-04-13 Jesse Thilo <jthilo@gnu.org>
21352
21353 * src/allocate.c:
21354 Don't declare calloc() and realloc() if not necessary.
21355
21356 1999-04-13 Jesse Thilo <jthilo@gnu.org>
21357
21358 * configure.in, acconfig.h, acinclude.m4:
21359 Don't declare calloc() and realloc() if not necessary.
21360
21361 1999-03-23 Jesse Thilo <jthilo@gnu.org>
21362
21363 * po/.cvsignore: Added i18n support.
21364
21365 1999-03-23 Jesse Thilo <jthilo@gnu.org>
21366
21367 * acconfig.h, configure.in, Makefile.am:
21368 Added i18n support.
21369
21370 1999-03-22 Jesse Thilo <jthilo@gnu.org>
21371
21372 * src/bison.s1: Fixed #line numbers.
21373
21374 1999-03-15 Jesse Thilo <jthilo@gnu.org>
21375
21376 * po/es.po, po/fr.po, po/nl.po, po/de.po:
21377 Added PO files from Translation Project.
21378
21379 1999-03-03 Jesse Thilo <jthilo@gnu.org>
21380
21381 * Makefile.am:
21382 Added support for non-ANSI compilers (ansi2knr).
21383
21384 1999-02-16 Jesse Thilo <jthilo@gnu.org>
21385
21386 * configure.in: Bumped version number to 1.27.
21387
21388 * Makefile.am:
21389 Added `bison.simple' to list of files removed by `make distclean'.
21390
21391 1999-02-12 Jesse Thilo <jthilo@gnu.org>
21392
21393 * src/files.c, src/files.h:
21394 Defined locations of parser files in config.h instead of Makefile.
21395
21396 1999-02-12 Jesse Thilo <jthilo@gnu.org>
21397
21398 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
21399 Defined locations of parser files in config.h instead of Makefile.
21400
21401 1999-02-09 Jesse Thilo <jthilo@gnu.org>
21402
21403 * Makefile.am:
21404 Removed inappropriate use of $< macro.
21405
21406 1999-02-05 Jesse Thilo <jthilo@gnu.org>
21407
21408 * po/Makefile.in.in, po/POTFILES.in:
21409 Add `po' directory skeleton.
21410
21411 1999-01-27 Jesse Thilo <jthilo@gnu.org>
21412
21413 * README: Document help-bison list.
21414
21415 * configure.in: Add check for mkstemp().
21416
21417 1999-01-20 Jesse Thilo <jthilo@gnu.org>
21418
21419 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
21420 Hush a few compiler warnings.
21421
21422 * src/files.c:
21423 Add tryclose(), which verifies that fclose was successful.
21424 Hush a couple of compiler warnings.
21425
21426 1999-01-20 Jesse Thilo <jthilo@gnu.org>
21427
21428 * Makefile.am, OChangeLog:
21429 ChangeLog is now automatically generated. Include the old version as
21430 OChangeLog.
21431
21432 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21433
21434 * 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:
21435 Update FSF address.
21436
21437 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21438
21439 * doc/bison.texinfo: Fix formatting glitch.
21440
21441 * doc/bison.texinfo: Update FSF address.
21442
21443 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21444
21445 * acconfig.h: Update FSF address.
21446
21447 1999-01-08 Jesse Thilo <jthilo@gnu.org>
21448
21449 * src/system.h:
21450 Don't define PACKAGE here, since config.h defines it.
21451
21452 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21453
21454 * src/reader.c: Update copyright date.
21455
21456 * src/main.c:
21457 Ditch sprintf to statically-sized buffers in fatal/warn functions in
21458 favor of output directly to stderr (avoids buffer overruns).
21459
21460 * src/reader.c: Some checks for premature EOF.
21461
21462 * 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:
21463 Use prototypes if the compiler understands them.
21464
21465 * src/files.c: Honor TMPDIR on Unix hosts.
21466 Use prototypes if the compiler understands them.
21467
21468 * src/reader.c:
21469 Fix a couple of buffer overrun bugs.
21470 Use prototypes if the compiler understands them.
21471
21472 * src/system.h: Include unistd.h and ctype.h.
21473 Use #ifdef instead of #if for NLS symbols.
21474
21475 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21476
21477 * doc/bison.texinfo:
21478 Delete comment "consider using @set for edition number, etc..." since
21479 we now are doing so.
21480
21481 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21482
21483 * configure.in:
21484 Use prototypes if the compiler understands them.
21485
21486 * NEWS: Document 1.26 highlights.
21487
21488 * Makefile.am: Require Automake 1.3 or later.
21489
21490 * acconfig.h:
21491 Use prototypes if the compiler understands them.
21492
21493 1998-12-29 Jesse Thilo <jthilo@gnu.org>
21494
21495 * src/version.c:
21496 Use VERSION symbol from automake for version number.
21497
21498 1998-12-29 Jesse Thilo <jthilo@gnu.org>
21499
21500 * acconfig.h, configure.in, version.cin:
21501 Use VERSION symbol from automake for version number.
21502
21503 1998-11-28 Jesse Thilo <jthilo@gnu.org>
21504
21505 * Makefile.am:
21506 Distribute original version of simple parser (bison.s1), not built
21507 version (bison.simple).
21508
21509 1998-11-28 Jesse Thilo <jthilo@gnu.org>
21510
21511 * doc/bison.texinfo: Add info dir entry.
21512
21513 * doc/bison.texinfo:
21514 Let automake put version number into documentation.
21515
21516 1998-11-26 Jesse Thilo <jthilo@gnu.org>
21517
21518 * src/bison.cld, src/build.com, src/vmshlp.mar:
21519 Add non-RCS files from /gd/gnu/bison.
21520
21521 1998-11-26 Jesse Thilo <jthilo@gnu.org>
21522
21523 * doc/bison.1:
21524 Document the BISON_HAIRY and BISON_SIMPLE variables.
21525
21526 1998-11-25 Jesse Thilo <jthilo@gnu.org>
21527
21528 * src/version.c: Build version.c automatically.
21529
21530 * src/reader.c:
21531 Fix token numbering (used to start at 258, not 257).
21532
21533 * src/system.h: Include config.h.
21534
21535 * src/getargs.c: Update bug report address.
21536
21537 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
21538 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
21539
21540 1998-11-25 Jesse Thilo <jthilo@gnu.org>
21541
21542 * Makefile.am:
21543 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21544
21545 * configure.in, version.cin:
21546 Build version.c automatically.
21547
21548 * AUTHORS: Add AUTHORS file.
21549
21550 * README: Update bug report address.
21551
21552 * bison.simple:
21553 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21554
21555 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
21556 Add automake stuff.
21557
21558 1998-11-25 Jesse Thilo <jthilo@gnu.org>
21559
21560 * doc/bison.texinfo: Clean up some formatting.
21561
21562 1998-05-05 Richard Stallman <rms@gnu.org>
21563
21564 * doc/bison.texinfo:
21565 Explain better why to make a pure parser.
21566
21567 1998-01-05 Richard Stallman <rms@gnu.org>
21568
21569 * src/files.c (openfiles):
21570 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
21571 find a temporary directory, if possible. Do not unlink files while
21572 they are open.
21573
21574 1997-08-25 Richard Stallman <rms@gnu.org>
21575
21576 * src/reader.c (stack_offset;):
21577 Change some warni to warns.
21578
21579 * src/lex.c (literalchar): Use warns, not warni.
21580
21581 1997-06-28 Richard Stallman <rms@gnu.org>
21582
21583 * src/bison.s1: Add a Bison version comment.
21584
21585 * src/main.c (fatal, warn, berror):
21586 Use program_name.
21587
21588 1997-06-28 Richard Stallman <rms@gnu.org>
21589
21590 * Makefile.in (bison_version): New variable.
21591 (dist): Use that variable.
21592 (bison.s1): Substitute the Bison version into bison.simple.
21593
21594 * bison.simple: Add a Bison version comment.
21595
21596 1997-06-18 Richard Stallman <rms@gnu.org>
21597
21598 * src/main.c (fatal, warn, berror):
21599 Make error messages standard.
21600 (toomany): Improve error message text.
21601
21602 * 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:
21603 new.h renamed to alloc.h.
21604
21605 1997-06-18 Richard Stallman <rms@gnu.org>
21606
21607 * Makefile.in: new.h renamed to alloc.h.
21608
21609 1997-05-24 Richard Stallman <rms@gnu.org>
21610
21611 * src/lex.c (literalchar):
21612 Fix the code for escaping \, " and '.
21613
21614 (lex): Avoid trouble when there are many chars
21615 to discard in a char literal with just several chars in it.
21616
21617 1997-05-17 Richard Stallman <rms@gnu.org>
21618
21619 * src/bison.s1:
21620 Use malloc, if using alloca is troublesome.
21621 (YYSTACK_USE_ALLOCA): New flag macro.
21622 Define it for some systems and compilers.
21623 (YYSTACK_ALLOC): New macro.
21624 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21625 If it was malloc'd, free it.
21626
21627 1997-05-17 Richard Stallman <rms@gnu.org>
21628
21629 * bison.simple:
21630 Use malloc, if using alloca is troublesome.
21631 (YYSTACK_USE_ALLOCA): New flag macro.
21632 Define it for some systems and compilers.
21633 (YYSTACK_ALLOC): New macro.
21634 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21635 If it was malloc'd, free it.
21636
21637 1997-04-23 Richard Stallman <rms@gnu.org>
21638
21639 * src/bison.s1:
21640 (alloca) [__hpux]: Always define as __builtin_alloca.
21641
21642 1997-04-23 Richard Stallman <rms@gnu.org>
21643
21644 * bison.simple:
21645 (alloca) [__hpux]: Always define as __builtin_alloca.
21646
21647 1997-04-22 Richard Stallman <rms@gnu.org>
21648
21649 * src/bison.s1:
21650 [__hpux]: Include alloca.h (right for HPUX 10)
21651 instead of declaring alloca (right for HPUX 9).
21652
21653 * src/bison.s1 (__yy_memcpy):
21654 Declare arg `count' as unsigned int.
21655 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21656
21657 1997-04-22 Richard Stallman <rms@gnu.org>
21658
21659 * bison.simple:
21660 [__hpux]: Include alloca.h (right for HPUX 10)
21661 instead of declaring alloca (right for HPUX 9).
21662
21663 * bison.simple (__yy_memcpy):
21664 Declare arg `count' as unsigned int.
21665 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21666
21667 1997-01-03 Richard Stallman <rms@gnu.org>
21668
21669 * src/allocate.c: [__STDC__ or _MSC_VER]:
21670 Declare calloc and realloc to return void *.
21671
21672 1997-01-02 Richard Stallman <rms@gnu.org>
21673
21674 * src/system.h:
21675 [_MSC_VER]: Include stdlib.h and process.h.
21676 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
21677
21678 * src/main.c (main): Return FAILURE as a value.
21679 (printable_version): Declare arg as int, not char.
21680
21681 1997-01-02 Richard Stallman <rms@gnu.org>
21682
21683 * Makefile.in (dist):
21684 Explicitly check for symlinks, and copy them.
21685
21686 1996-12-19 Richard Stallman <rms@gnu.org>
21687
21688 * src/files.c:
21689 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
21690
21691 1996-12-18 Paul Eggert <eggert@gnu.org>
21692
21693 * src/bison.s1 (yyparse):
21694 If __GNUC__ and YYPARSE_PARAM are both defined,
21695 declare yyparse to have a void * argument.
21696
21697 1996-12-18 Paul Eggert <eggert@gnu.org>
21698
21699 * bison.simple (yyparse):
21700 If __GNUC__ and YYPARSE_PARAM are both defined,
21701 declare yyparse to have a void * argument.
21702
21703 1996-12-17 Richard Stallman <rms@gnu.org>
21704
21705 * src/reduce.c (nbits): Add some casts.
21706
21707 1996-08-12 Richard Stallman <rms@gnu.org>
21708
21709 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
21710
21711 1996-08-12 Richard Stallman <rms@gnu.org>
21712
21713 * bison.simple: Test _MSDOS as well as _MSDOS_.
21714
21715 1996-07-31 Richard Stallman <rms@gnu.org>
21716
21717 * src/bison.s1:
21718 [__sun && __i386]: Include alloca.h.
21719
21720 1996-07-31 Richard Stallman <rms@gnu.org>
21721
21722 * bison.simple:
21723 [__sun && __i386]: Include alloca.h.
21724
21725 1996-07-30 Richard Stallman <rms@gnu.org>
21726
21727 * src/bison.s1: Comment change.
21728
21729 * src/bison.s1: Test _MSDOS_, not MSDOS.
21730
21731 1996-07-30 Richard Stallman <rms@gnu.org>
21732
21733 * bison.simple: Comment change.
21734
21735 * bison.simple: Test _MSDOS_, not MSDOS.
21736
21737 1996-06-01 Richard Stallman <rms@gnu.org>
21738
21739 * 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:
21740 Insert `_' macro around many string constants.
21741
21742 * src/main.c:
21743 Insert `_' macro around many string constants.
21744
21745 (main): Call setlocale, bindtextdomain and textdomain.
21746
21747 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
21748 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
21749 [ENABLE_NLS]: Include libintl.h.
21750 [ENABLE_NLS] (gettext): Define.
21751 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
21752 (N_, PACKAGE, LOCALEDIR): New macros.
21753
21754 1996-06-01 Richard Stallman <rms@gnu.org>
21755
21756 * POTFILES.in: New file.
21757
21758 * Makefile.in (allocate.o):
21759 Define target explicitly.
21760
21761 * Makefile.in (CFLAGS): Set to @CFLAGS@.
21762 (LDFLAGS): Set to @LDFLAGS@.
21763 (configure): Run autoconf only if preceding `cd' succeeds.
21764 (bison.s1): Redirect output to temporary file then move the
21765 temporary to the target, rather than redirecting directly to bison.s1.
21766 (clean): Remove config.status and config.log.
21767 (distclean): Don't remove config.status here.
21768
21769 1996-05-12 Richard Stallman <rms@gnu.org>
21770
21771 * src/bison.s1:
21772 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21773
21774 1996-05-12 Richard Stallman <rms@gnu.org>
21775
21776 * bison.simple:
21777 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21778
21779 1996-05-11 Richard Stallman <rms@gnu.org>
21780
21781 * src/bison.s1 (__yy_memcpy):
21782 Really reorder the args, as was supposedly done on Feb 14 1995.
21783 (yyparse): Calls changed accordingly.
21784
21785 1996-05-11 Richard Stallman <rms@gnu.org>
21786
21787 * Makefile.in (dist): Don't use $(srcdir).
21788
21789 * bison.simple (__yy_memcpy):
21790 Really reorder the args, as was supposedly done on Feb 14 1995.
21791 (yyparse): Calls changed accordingly.
21792
21793 1996-01-27 Richard Stallman <rms@gnu.org>
21794
21795 * src/output.c (output_rule_data):
21796 Test YYERROR_VERBOSE in the conditional
21797 around the definition of ttyname.
21798
21799 1995-12-29 Richard Stallman <rms@gnu.org>
21800
21801 * src/bison.s1:
21802 Fix line numbers in #line commands.
21803
21804 1995-12-29 Richard Stallman <rms@gnu.org>
21805
21806 * bison.simple:
21807 Fix line numbers in #line commands.
21808
21809 1995-12-27 Richard Stallman <rms@gnu.org>
21810
21811 * src/bison.s1 (YYPARSE_PARAM_DECL):
21812 In C++, make it always null.
21813 (YYPARSE_PARAM_ARG): New macro.
21814 (yyparse): Use YYPARSE_PARAM_ARG.
21815
21816 1995-12-27 Richard Stallman <rms@gnu.org>
21817
21818 * bison.simple (YYPARSE_PARAM_DECL):
21819 In C++, make it always null.
21820 (YYPARSE_PARAM_ARG): New macro.
21821 (yyparse): Use YYPARSE_PARAM_ARG.
21822
21823 1995-11-29 Richard Stallman <rms@gnu.org>
21824
21825 * doc/bison.texinfo:
21826 Describe literal string tokens, %raw, %no_lines, %token_table.
21827
21828 1995-11-29 Daniel Hagerty <hag@gnu.org>
21829
21830 * doc/bison.texinfo: Fixed update date
21831
21832 1995-10-16 Richard Stallman <rms@gnu.org>
21833
21834 * src/version.c: Version 1.25.
21835
21836 1995-10-16 Richard Stallman <rms@gnu.org>
21837
21838 * NEWS: *** empty log message ***
21839
21840 1995-10-16 Richard Stallman <rms@gnu.org>
21841
21842 * doc/bison.1, doc/bison.rnh:
21843 Add new options.
21844
21845 1995-10-15 Richard Stallman <rms@gnu.org>
21846
21847 * src/vmsgetargs.c, src/getargs.c:
21848 Added -n, -k, and -raw switches.
21849 (noparserflag, toknumflag, rawtoknumflag): New variables.
21850
21851 * src/symtab.h (SALIAS):
21852 New #define for adding aliases to %token.
21853 (struct bucket): Added `alias' field.
21854
21855 * src/reduce.c (reduce_grammar):
21856 Revise error message.
21857 (print_notices): Remove final `.' from error message.
21858
21859 * src/reader.c (reader_output_yylsp):
21860 New function.
21861 (readgram): Use `#if 0' around code that accepted %command
21862 inside grammar rules: The documentation doesn't allow it,
21863 and it will fail since the %command processors scan for the next %.
21864 (parse_token_decl): Extended the %token
21865 declaration to allow a multi-character symbol as an alias.
21866 (parse_thong_decl): New function.
21867 (read_declarations): Added %thong declarations.
21868 (read_declarations): Handle NOOP to deal with allowing
21869 % declarations as another means to specify the flags.
21870 (readgram): Allow %prec prior to semantics embedded in a rule.
21871 (skip_to_char, read_declarations, copy_definition)
21872 (parse_token_decl, parse_start_decl, parse_type_decl)
21873 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
21874 (get_type_name, copy_guard, copy_action, readgram)
21875 (get_type, packsymbols): Revised most error messages.
21876 Changed `fatal' to `warnxxx' to avoid aborting for error.
21877 Revised and use multiple warnxxx functions to avoid using VARARGS1.
21878 (read_declarations): Improve the error message for
21879 an invalid character. Do not abort.
21880 (read_declarations, copy_guard, copy_action): Use
21881 printable_version to avoid unprintable characters in printed output.
21882 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
21883 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
21884 Allow the type of a non-terminal can be given
21885 more than once, as long as all specifications give the same type.
21886
21887 * src/output.c:
21888 (output_headers, output_trailers, output, output_gram)
21889 (output_rule_data): Implement noparserflag variable.
21890 Implement toknumflag variable.
21891 (output): Call reader_output_yylsp to output LTYPESTR.
21892
21893 * src/main.c (main):
21894 If reader sees an error, don't process the grammar.
21895 (fatals): Updated to not use VARARGS1.
21896 (printable_version, int_to_string, warn, warni, warns, warnss)
21897 (warnsss): New error reporting functions. Avoid abort for error.
21898
21899 * src/lex.h:
21900 Added THONG and NOOP for alias processing.
21901 Added SETOPT for the new code that allows setting options with %flags.
21902
21903 * src/lex.c:
21904 Include getopt.h. Add some extern decls.
21905 (safegetc): New function to deal with EOF gracefully.
21906 (literalchar); new function to deal with reading \ escapes.
21907 (lex): Use literalchar.
21908 (lex): Implemented "..." tokens.
21909 (literalchar, lex, parse_percent_token): Made tokenbuffer
21910 always contain the token. This includes growing the token
21911 buffer while reading an integer.
21912 (parse_percent_token): Replaced if-else statement with percent_table.
21913 (parse_percent_token): Added % declarations as another
21914 way to specify the flags -n, -l, and -r. Also added hooks for
21915 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
21916 major changes to files.c.
21917 (lex) Retain in the incoming stream a character following
21918 an incorrect '/'.
21919 (skip_white_space, lex): Revised most error messages
21920 and changed fatal to warn to avoid aborting.
21921 (percent_table): Added %thong declarations.
21922
21923 * src/gram.h: Comment changes.
21924
21925 * src/files.c (openfiles, open_extra_files, done):
21926 Add faction flag
21927 and actfile file. Handle noparserflag. Both for -n switch.
21928
21929 * src/conflicts.c (resolve_sr_conflict):
21930 Remove use of alloca.
21931
21932 1995-06-01 Jim Meyering <meyering@gnu.org>
21933
21934 * doc/bison.texinfo: *** empty log message ***
21935
21936 1995-05-06 Richard Stallman <rms@gnu.org>
21937
21938 * src/bison.s1: Comment change.
21939
21940 1995-05-06 Richard Stallman <rms@gnu.org>
21941
21942 * bison.simple: Comment change.
21943
21944 1995-05-03 Richard Stallman <rms@gnu.org>
21945
21946 * src/version.c: Version now 1.24.
21947
21948 * src/bison.s1: Change distribution terms.
21949
21950 * src/version.c: Version now 1.23.
21951
21952 1995-05-03 Richard Stallman <rms@gnu.org>
21953
21954 * doc/bison.texinfo:
21955 Rewrite "Conditions for Using Bison".
21956 Update version to 1.24.
21957
21958 1995-05-03 Richard Stallman <rms@gnu.org>
21959
21960 * bison.simple: Change distribution terms.
21961
21962 1995-02-23 Richard Stallman <rms@gnu.org>
21963
21964 * src/files.c: Test __VMS_POSIX as well as VMS.
21965
21966 1995-02-14 Jim Meyering <meyering@gnu.org>
21967
21968 * src/bison.s1 (__yy_memcpy):
21969 Renamed from __yy_bcopy to avoid
21970 confusion. Reverse FROM and TO arguments to be consistent with
21971 those of memcpy.
21972
21973 1995-02-14 Jim Meyering <meyering@gnu.org>
21974
21975 * bison.simple (__yy_memcpy):
21976 Renamed from __yy_bcopy to avoid
21977 confusion. Reverse FROM and TO arguments to be consistent with
21978 those of memcpy.
21979
21980 1994-11-10 David J. MacKenzie <djm@gnu.org>
21981
21982 * NEWS: reformat
21983
21984 * NEWS: New file.
21985
21986 * Makefile.in (DISTFILES): Include NEWS.
21987
21988 * Makefile.in (DISTFILES):
21989 Include install-sh, not install.sh.
21990
21991 * configure.in: Update to Autoconf v2 macro names.
21992
21993 1994-10-05 David J. MacKenzie <djm@gnu.org>
21994
21995 * Makefile.in: fix typo
21996
21997 * Makefile.in (prefix, exec_prefix):
21998 Let configure set them.
21999
22000 1994-09-28 David J. MacKenzie <djm@gnu.org>
22001
22002 * Makefile.in: Set datadir to $(prefix)/share.
22003
22004 1994-09-15 Richard Stallman <rms@gnu.org>
22005
22006 * src/bison.s1:
22007 Update copyright notice and GPL version.
22008
22009 1994-09-15 Richard Stallman <rms@gnu.org>
22010
22011 * bison.simple:
22012 Update copyright notice and GPL version.
22013
22014 1994-07-12 Richard Stallman <rms@gnu.org>
22015
22016 * src/reduce.c, src/reader.c:
22017 entered into RCS
22018
22019 1994-05-05 David J. MacKenzie <djm@gnu.org>
22020
22021 * Makefile.in: entered into RCS
22022
22023 1994-03-26 Richard Stallman <rms@gnu.org>
22024
22025 * src/bison.s1: entered into RCS
22026
22027 1994-03-26 Richard Stallman <rms@gnu.org>
22028
22029 * bison.simple: entered into RCS
22030
22031 1994-03-25 Richard Stallman <rms@gnu.org>
22032
22033 * src/main.c: entered into RCS
22034
22035 1994-03-24 Richard Stallman <rms@gnu.org>
22036
22037 * src/conflicts.c: entered into RCS
22038
22039 1994-01-02 Richard Stallman <rms@gnu.org>
22040
22041 * Makefile.in: *** empty log message ***
22042
22043 1993-11-21 Richard Stallman <rms@gnu.org>
22044
22045 * src/bison.s1: *** empty log message ***
22046
22047 1993-11-21 Richard Stallman <rms@gnu.org>
22048
22049 * doc/bison.texinfo: entered into RCS
22050
22051 * doc/bison.texinfo: *** empty log message ***
22052
22053 1993-11-21 Richard Stallman <rms@gnu.org>
22054
22055 * bison.simple: *** empty log message ***
22056
22057 1993-10-25 David J. MacKenzie <djm@gnu.org>
22058
22059 * doc/bison.texinfo: *** empty log message ***
22060
22061 1993-10-19 Richard Stallman <rms@gnu.org>
22062
22063 * src/bison.s1: *** empty log message ***
22064
22065 1993-10-19 Richard Stallman <rms@gnu.org>
22066
22067 * bison.simple: *** empty log message ***
22068
22069 1993-10-14 Richard Stallman <rms@gnu.org>
22070
22071 * src/bison.s1: *** empty log message ***
22072
22073 1993-10-14 Richard Stallman <rms@gnu.org>
22074
22075 * bison.simple: *** empty log message ***
22076
22077 1993-09-14 David J. MacKenzie <djm@gnu.org>
22078
22079 * doc/bison.texinfo: *** empty log message ***
22080
22081 1993-09-13 Noah Friedman <friedman@gnu.org>
22082
22083 * Makefile.in: *** empty log message ***
22084
22085 1993-09-10 Richard Stallman <rms@gnu.org>
22086
22087 * src/conflicts.c: *** empty log message ***
22088
22089 * src/system.h: entered into RCS
22090
22091 1993-09-10 Richard Stallman <rms@gnu.org>
22092
22093 * doc/bison.1: entered into RCS
22094
22095 1993-09-06 Noah Friedman <friedman@gnu.org>
22096
22097 * src/version.c: entered into RCS
22098
22099 1993-09-06 Noah Friedman <friedman@gnu.org>
22100
22101 * Makefile.in: *** empty log message ***
22102
22103 1993-07-30 David J. MacKenzie <djm@gnu.org>
22104
22105 * Makefile.in: *** empty log message ***
22106
22107 1993-07-24 Richard Stallman <rms@gnu.org>
22108
22109 * src/bison.s1: *** empty log message ***
22110
22111 1993-07-24 Richard Stallman <rms@gnu.org>
22112
22113 * bison.simple: *** empty log message ***
22114
22115 1993-07-08 David J. MacKenzie <djm@gnu.org>
22116
22117 * Makefile.in: *** empty log message ***
22118
22119 1993-07-04 Richard Stallman <rms@gnu.org>
22120
22121 * src/bison.s1: *** empty log message ***
22122
22123 1993-07-04 Richard Stallman <rms@gnu.org>
22124
22125 * bison.simple: *** empty log message ***
22126
22127 1993-06-26 David J. MacKenzie <djm@gnu.org>
22128
22129 * src/getargs.c: entered into RCS
22130
22131 1993-06-26 David J. MacKenzie <djm@gnu.org>
22132
22133 * doc/bison.texinfo: *** empty log message ***
22134
22135 * doc/bison.1: New file.
22136
22137 1993-06-25 Richard Stallman <rms@gnu.org>
22138
22139 * src/getargs.c: New file.
22140
22141 1993-06-16 Richard Stallman <rms@gnu.org>
22142
22143 * src/bison.s1: *** empty log message ***
22144
22145 1993-06-16 Richard Stallman <rms@gnu.org>
22146
22147 * bison.simple: *** empty log message ***
22148
22149 1993-06-03 Richard Stallman <rms@gnu.org>
22150
22151 * src/bison.s1: New file.
22152
22153 1993-06-03 Richard Stallman <rms@gnu.org>
22154
22155 * doc/bison.texinfo: *** empty log message ***
22156
22157 1993-06-03 Richard Stallman <rms@gnu.org>
22158
22159 * bison.simple: New file.
22160
22161 1993-05-19 Richard Stallman <rms@gnu.org>
22162
22163 * doc/bison.texinfo: New file.
22164
22165 1993-05-07 Noah Friedman <friedman@gnu.org>
22166
22167 * Makefile.in: *** empty log message ***
22168
22169 1993-04-28 Noah Friedman <friedman@gnu.org>
22170
22171 * src/reader.c: *** empty log message ***
22172
22173 1993-04-23 Noah Friedman <friedman@gnu.org>
22174
22175 * src/alloc.h: entered into RCS
22176
22177 1993-04-20 David J. MacKenzie <djm@gnu.org>
22178
22179 * src/version.c: *** empty log message ***
22180
22181 * src/files.c, src/allocate.c:
22182 entered into RCS
22183
22184 * src/reader.c: *** empty log message ***
22185
22186 * src/lex.c: entered into RCS
22187
22188 * src/conflicts.c: New file.
22189
22190 * src/symtab.c: entered into RCS
22191
22192 * src/alloc.h: New file.
22193
22194 * src/LR0.c: entered into RCS
22195
22196 1993-04-18 Noah Friedman <friedman@gnu.org>
22197
22198 * src/reader.c: New file.
22199
22200 * src/version.c: *** empty log message ***
22201
22202 1993-04-18 Noah Friedman <friedman@gnu.org>
22203
22204 * Makefile.in: *** empty log message ***
22205
22206 1993-04-17 Noah Friedman <friedman@gnu.org>
22207
22208 * Makefile.in: *** empty log message ***
22209
22210 1993-04-15 Richard Stallman <rms@gnu.org>
22211
22212 * src/main.c, src/files.c:
22213 New file.
22214
22215 1993-04-15 Noah Friedman <friedman@gnu.org>
22216
22217 * configure.in: entered into RCS
22218
22219 * configure.in: *** empty log message ***
22220
22221 * configure.in: New file.
22222
22223 1993-04-14 Richard Stallman <rms@gnu.org>
22224
22225 * Makefile.in: New file.
22226
22227 1993-04-13 Richard Stallman <rms@gnu.org>
22228
22229 * src/version.c: New file.
22230
22231 1993-03-25 Richard Stallman <rms@gnu.org>
22232
22233 * src/output.c: entered into RCS
22234
22235 1992-09-25 Richard Stallman <rms@gnu.org>
22236
22237 * configure.bat: entered into RCS
22238
22239 1992-06-22 Richard Stallman <rms@gnu.org>
22240
22241 * src/vmsgetargs.c: entered into RCS
22242
22243 1992-06-22 Richard Stallman <rms@gnu.org>
22244
22245 * doc/bison.rnh: entered into RCS
22246
22247 1992-04-20 David J. MacKenzie <djm@gnu.org>
22248
22249 * README: entered into RCS
22250
22251 1992-01-22 Richard Stallman <rms@gnu.org>
22252
22253 * src/machine.h: entered into RCS
22254
22255 1991-12-21 Richard Stallman <rms@gnu.org>
22256
22257 * src/lalr.c, src/closure.c:
22258 entered into RCS
22259
22260 1991-12-20 Richard Stallman <rms@gnu.org>
22261
22262 * src/state.h: entered into RCS
22263
22264 1991-12-18 Richard Stallman <rms@gnu.org>
22265
22266 * src/print.c, src/nullable.c, src/derives.c:
22267 entered into RCS
22268
22269 1991-11-03 David J. MacKenzie <djm@gnu.org>
22270
22271 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
22272 entered into RCS
22273
22274 1988-09-09 Richard Stallman <rms@gnu.org>
22275
22276 * src/bison.hairy: entered into RCS
22277
22278 1987-12-16 Richard Stallman <rms@gnu.org>
22279
22280 * REFERENCES: entered into RCS
22281
22282
22283 -----
22284
22285 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
22286 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
22287 2007, 2008, 2009 Free Software Foundation, Inc.
22288
22289 Copying and distribution of this file, with or without
22290 modification, are permitted provided the copyright notice and this
22291 notice are preserved.